diff --git a/.gitignore b/.gitignore index 56aa638d4..98560b704 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,266 @@ *.njsproj *.sln *.sw? +ошибки.txt +rustbook-ru/book/tomorrow-night.css +rustbook-ru/book/title-page.html +rustbook-ru/book/theme/2018-edition.css +rustbook-ru/book/searchindex.json +rustbook-ru/book/searchindex.js +rustbook-ru/book/searcher.js +rustbook-ru/book/print.html +rustbook-ru/book/mark.min.js +rustbook-ru/book/index.html +rustbook-ru/book/img/trpl20-01.png +rustbook-ru/book/img/trpl15-04.svg +rustbook-ru/book/img/trpl15-03.svg +rustbook-ru/book/img/trpl15-02.svg +rustbook-ru/book/img/trpl15-01.svg +rustbook-ru/book/img/trpl14-10.png +rustbook-ru/book/img/trpl14-07.png +rustbook-ru/book/img/trpl14-05.png +rustbook-ru/book/img/trpl14-04.png +rustbook-ru/book/img/trpl14-03.png +rustbook-ru/book/img/trpl14-02.png +rustbook-ru/book/img/trpl14-01.png +rustbook-ru/book/img/trpl04-06.svg +rustbook-ru/book/img/trpl04-05.svg +rustbook-ru/book/img/trpl04-04.svg +rustbook-ru/book/img/trpl04-03.svg +rustbook-ru/book/img/trpl04-02.svg +rustbook-ru/book/img/trpl04-01.svg +rustbook-ru/book/img/ferris/unsafe.svg +rustbook-ru/book/img/ferris/panics.svg +rustbook-ru/book/img/ferris/not_desired_behavior.svg +rustbook-ru/book/img/ferris/does_not_compile.svg +rustbook-ru/book/highlight.js +rustbook-ru/book/highlight.css +rustbook-ru/book/foreword.html +rustbook-ru/book/fonts/source-code-pro-v11-all-charsets-500.woff2 +rustbook-ru/book/fonts/SOURCE-CODE-PRO-LICENSE.txt +rustbook-ru/book/fonts/open-sans-v17-all-charsets-regular.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-italic.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-800italic.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-800.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-700italic.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-700.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-600italic.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-600.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-300italic.woff2 +rustbook-ru/book/fonts/open-sans-v17-all-charsets-300.woff2 +rustbook-ru/book/fonts/OPEN-SANS-LICENSE.txt +rustbook-ru/book/fonts/fonts.css +rustbook-ru/book/FontAwesome/fonts/FontAwesome.ttf +rustbook-ru/book/FontAwesome/fonts/fontawesome-webfont.woff2 +rustbook-ru/book/FontAwesome/fonts/fontawesome-webfont.woff +rustbook-ru/book/FontAwesome/fonts/fontawesome-webfont.ttf +rustbook-ru/book/FontAwesome/fonts/fontawesome-webfont.svg +rustbook-ru/book/FontAwesome/fonts/fontawesome-webfont.eot +rustbook-ru/book/FontAwesome/css/font-awesome.css +rustbook-ru/book/ferris.js +rustbook-ru/book/ferris.css +rustbook-ru/book/favicon.svg +rustbook-ru/book/favicon.png +rustbook-ru/book/elasticlunr.min.js +rustbook-ru/book/css/variables.css +rustbook-ru/book/css/print.css +rustbook-ru/book/css/general.css +rustbook-ru/book/css/chrome.css +rustbook-ru/book/clipboard.min.js +rustbook-ru/book/ch20-03-graceful-shutdown-and-cleanup.html +rustbook-ru/book/ch20-02-multithreaded.html +rustbook-ru/book/ch20-01-single-threaded.html +rustbook-ru/book/ch20-00-final-project-a-web-server.html +rustbook-ru/book/ch19-06-macros.html +rustbook-ru/book/ch19-05-advanced-functions-and-closures.html +rustbook-ru/book/ch19-04-advanced-types.html +rustbook-ru/book/ch19-03-advanced-traits.html +rustbook-ru/book/ch19-01-unsafe-rust.html +rustbook-ru/book/ch19-00-advanced-features.html +rustbook-ru/book/ch18-03-pattern-syntax.html +rustbook-ru/book/ch18-02-refutability.html +rustbook-ru/book/ch18-01-all-the-places-for-patterns.html +rustbook-ru/book/ch18-00-patterns.html +rustbook-ru/book/ch17-03-oo-design-patterns.html +rustbook-ru/book/ch17-02-trait-objects.html +rustbook-ru/book/ch17-01-what-is-oo.html +rustbook-ru/book/ch17-00-oop.html +rustbook-ru/book/ch16-04-extensible-concurrency-sync-and-send.html +rustbook-ru/book/ch16-03-shared-state.html +rustbook-ru/book/ch16-02-message-passing.html +rustbook-ru/book/ch16-01-threads.html +rustbook-ru/book/ch16-00-concurrency.html +rustbook-ru/book/ch15-06-reference-cycles.html +rustbook-ru/book/ch15-05-interior-mutability.html +rustbook-ru/book/ch15-04-rc.html +rustbook-ru/book/ch15-03-drop.html +rustbook-ru/book/ch15-02-deref.html +rustbook-ru/book/ch15-01-box.html +rustbook-ru/book/ch15-00-smart-pointers.html +rustbook-ru/book/ch14-05-extending-cargo.html +rustbook-ru/book/ch14-04-installing-binaries.html +rustbook-ru/book/ch14-03-cargo-workspaces.html +rustbook-ru/book/ch14-02-publishing-to-crates-io.html +rustbook-ru/book/ch14-01-release-profiles.html +rustbook-ru/book/ch14-00-more-about-cargo.html +rustbook-ru/book/ch13-04-performance.html +rustbook-ru/book/ch13-03-improving-our-io-project.html +rustbook-ru/book/ch13-02-iterators.html +rustbook-ru/book/ch13-01-closures.html +rustbook-ru/book/ch13-00-functional-features.html +rustbook-ru/book/ch12-06-writing-to-stderr-instead-of-stdout.html +rustbook-ru/book/ch12-05-working-with-environment-variables.html +rustbook-ru/book/ch12-04-testing-the-librarys-functionality.html +rustbook-ru/book/ch12-03-improving-error-handling-and-modularity.html +rustbook-ru/book/ch12-02-reading-a-file.html +rustbook-ru/book/ch12-01-accepting-command-line-arguments.html +rustbook-ru/book/ch12-00-an-io-project.html +rustbook-ru/book/ch11-03-test-organization.html +rustbook-ru/book/ch11-02-running-tests.html +rustbook-ru/book/ch11-01-writing-tests.html +rustbook-ru/book/ch11-00-testing.html +rustbook-ru/book/ch10-03-lifetime-syntax.html +rustbook-ru/book/ch10-02-traits.html +rustbook-ru/book/ch10-01-syntax.html +rustbook-ru/book/ch10-00-generics.html +rustbook-ru/book/ch09-03-to-panic-or-not-to-panic.html +rustbook-ru/book/ch09-02-recoverable-errors-with-result.html +rustbook-ru/book/ch09-01-unrecoverable-errors-with-panic.html +rustbook-ru/book/ch09-00-error-handling.html +rustbook-ru/book/ch08-03-hash-maps.html +rustbook-ru/book/ch08-02-strings.html +rustbook-ru/book/ch08-01-vectors.html +rustbook-ru/book/ch08-00-common-collections.html +rustbook-ru/book/ch07-05-separating-modules-into-different-files.html +rustbook-ru/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html +rustbook-ru/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html +rustbook-ru/book/ch07-02-defining-modules-to-control-scope-and-privacy.html +rustbook-ru/book/ch07-01-packages-and-crates.html +rustbook-ru/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html +rustbook-ru/book/ch06-03-if-let.html +rustbook-ru/book/ch06-02-match.html +rustbook-ru/book/ch06-01-defining-an-enum.html +rustbook-ru/book/ch06-00-enums.html +rustbook-ru/book/ch05-03-method-syntax.html +rustbook-ru/book/ch05-02-example-structs.html +rustbook-ru/book/ch05-01-defining-structs.html +rustbook-ru/book/ch05-00-structs.html +rustbook-ru/book/ch04-03-slices.html +rustbook-ru/book/ch04-02-references-and-borrowing.html +rustbook-ru/book/ch04-01-what-is-ownership.html +rustbook-ru/book/ch04-00-understanding-ownership.html +rustbook-ru/book/ch03-05-control-flow.html +rustbook-ru/book/ch03-04-comments.html +rustbook-ru/book/ch03-03-how-functions-work.html +rustbook-ru/book/ch03-02-data-types.html +rustbook-ru/book/ch03-01-variables-and-mutability.html +rustbook-ru/book/ch03-00-common-programming-concepts.html +rustbook-ru/book/ch02-00-guessing-game-tutorial.html +rustbook-ru/book/ch01-03-hello-cargo.html +rustbook-ru/book/ch01-02-hello-world.html +rustbook-ru/book/ch01-01-installation.html +rustbook-ru/book/ch01-00-getting-started.html +rustbook-ru/book/ch00-00-introduction.html +rustbook-ru/book/book.js +rustbook-ru/book/ayu-highlight.css +rustbook-ru/book/appendix-07-nightly-rust.html +rustbook-ru/book/appendix-06-translation.html +rustbook-ru/book/appendix-05-editions.html +rustbook-ru/book/appendix-04-useful-development-tools.html +rustbook-ru/book/appendix-03-derivable-traits.html +rustbook-ru/book/appendix-02-operators.html +rustbook-ru/book/appendix-01-keywords.html +rustbook-ru/book/appendix-00.html +rustbook-ru/book/404.html +rustbook-ru/book/.nojekyll +rustbook-ru/cycles_3_5/Cargo.lock +rustbook-ru/cycles_3_5/Cargo.toml +rustbook-ru/cycles_3_5/src/main.rs +rustbook-ru/cycles_3_5/target/.rustc_info.json +rustbook-ru/cycles_3_5/target/CACHEDIR.TAG +rustbook-ru/cycles_3_5/target/debug/.cargo-lock +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-c253783af073fa6e/bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-c253783af073fa6e/bin-cycles_3_5.json +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-c253783af073fa6e/dep-bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-c253783af073fa6e/invoked.timestamp +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-dc176b0a8aa1d384/dep-test-bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-dc176b0a8aa1d384/invoked.timestamp +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-dc176b0a8aa1d384/test-bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-dc176b0a8aa1d384/test-bin-cycles_3_5.json +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-f14a7c93068820f1/bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-f14a7c93068820f1/bin-cycles_3_5.json +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-f14a7c93068820f1/dep-bin-cycles_3_5 +rustbook-ru/cycles_3_5/target/debug/.fingerprint/cycles_3_5-f14a7c93068820f1/invoked.timestamp +rustbook-ru/cycles_3_5/target/debug/cycles_3_5.d +rustbook-ru/cycles_3_5/target/debug/cycles_3_5.exe +rustbook-ru/cycles_3_5/target/debug/cycles_3_5.pdb +rustbook-ru/cycles_3_5/target/debug/deps/cycles_3_5-c253783af073fa6e.d +rustbook-ru/cycles_3_5/target/debug/deps/cycles_3_5-dc176b0a8aa1d384.d +rustbook-ru/cycles_3_5/target/debug/deps/cycles_3_5.d +rustbook-ru/cycles_3_5/target/debug/deps/cycles_3_5.exe +rustbook-ru/cycles_3_5/target/debug/deps/cycles_3_5.pdb +rustbook-ru/cycles_3_5/target/debug/deps/libcycles_3_5-c253783af073fa6e.rmeta +rustbook-ru/cycles_3_5/target/debug/deps/libcycles_3_5-dc176b0a8aa1d384.rmeta +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfealghg-0vdxhwd-working/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfealghg-0vdxhwd-working/dep-graph.part.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfealghg-0vdxhwd-working/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfealghg-0vdxhwd-working/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfealghg-0vdxhwd.lock +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfefwvxa-1kkkcxr-7onebx9jtyo3h5yr6swno5654/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfefwvxa-1kkkcxr-7onebx9jtyo3h5yr6swno5654/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfefwvxa-1kkkcxr-7onebx9jtyo3h5yr6swno5654/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-0jbr1d9ga43gg/s-gzkfefwvxa-1kkkcxr.lock +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfealgg9-0pek6ib-working/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfealgg9-0pek6ib-working/dep-graph.part.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfealgg9-0pek6ib-working/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfealgg9-0pek6ib-working/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfealgg9-0pek6ib.lock +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfefwvxi-0u18x8k-3qkehu52mqzefz5drpzv4iy0w/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfefwvxi-0u18x8k-3qkehu52mqzefz5drpzv4iy0w/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfefwvxi-0u18x8k-3qkehu52mqzefz5drpzv4iy0w/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-1y6ujlyeevrve/s-gzkfefwvxi-0u18x8k.lock +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/0ro9b14ut7d6e8q9hcz6hdqxd.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/1mismad4ax139m8jpxm56u5ps.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/308zo3n0i8r6ea3rsbg2gj9m2.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/42ccgda5sgw8bfy30qpdmbbds.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/6y5sk2h6y545qxj0e81qcxsgc.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/8ou23t89gn4uk8bg5szlornpo.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/adjhbrkknkep5q8qzolf7f5su.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/b1rk05pjdh23ne0d9d3xr2kxs.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/cbu6httwlt0lyi8wfkxix1c7a.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/dep-graph.part.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/ecicg9dka1lknodd23z9hcacm.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/evpfw0bkf2ohhz2b5q7r2gw5p.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6-working/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfeandqa-01njnq6.lock +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/0ro9b14ut7d6e8q9hcz6hdqxd.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/1mismad4ax139m8jpxm56u5ps.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/308zo3n0i8r6ea3rsbg2gj9m2.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/42ccgda5sgw8bfy30qpdmbbds.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/6y5sk2h6y545qxj0e81qcxsgc.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/8ou23t89gn4uk8bg5szlornpo.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/adjhbrkknkep5q8qzolf7f5su.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/b1rk05pjdh23ne0d9d3xr2kxs.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/cbu6httwlt0lyi8wfkxix1c7a.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/dep-graph.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/ecicg9dka1lknodd23z9hcacm.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/evpfw0bkf2ohhz2b5q7r2gw5p.o +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/query-cache.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki-8rpdpsrxhpenexr4rk04iuozc/work-products.bin +rustbook-ru/cycles_3_5/target/debug/incremental/cycles_3_5-37m9q3i4pavv1/s-gzkfefy8bb-1rihqki.lock +rustbook-ru/src/ch00-00-introduction.md.bak +.vs/book/FileContentIndex/2ca08269-4e51-443c-a77b-85f12e843257.vsidx +.vs/book/FileContentIndex/2f454a4b-0c2f-4cfc-9095-155eb0b0ccf4.vsidx +.vs/book/FileContentIndex/b86b8781-ac9a-4547-ba2a-089f8a95030c.vsidx +.vs/book/FileContentIndex/d0b97c63-b172-441f-9ffa-a95133024ebc.vsidx +.vs/book/FileContentIndex/e552bc62-c316-441c-8c45-a5815ab8a22d.vsidx +.vs/book/FileContentIndex/ff24b99c-24f9-479c-9475-81b161c44b02.vsidx +.vs/book/v17/.wsuo +.vs/book/v17/DocumentLayout.backup.json +.vs/book/v17/workspaceFileList.bin +.vs/slnx.sqlite +.vs/slnx.sqlite +.vs/book/v17/workspaceFileList.bin +.vs/book/v17/.wsuo diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 000000000..f8b488856 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 000000000..6b6114114 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/book/v17/.wsuo b/.vs/book/v17/.wsuo new file mode 100644 index 000000000..98e3e110a Binary files /dev/null and b/.vs/book/v17/.wsuo differ diff --git a/.vs/book/v17/DocumentLayout.json b/.vs/book/v17/DocumentLayout.json new file mode 100644 index 000000000..5a0dcb99c --- /dev/null +++ b/.vs/book/v17/DocumentLayout.json @@ -0,0 +1,12 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\Rust\\\u043A\u043D\u0438\u0433\u0438\\book\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [] + } + ] +} \ No newline at end of file diff --git a/.vs/book/v17/workspaceFileList.bin b/.vs/book/v17/workspaceFileList.bin new file mode 100644 index 000000000..25221d704 Binary files /dev/null and b/.vs/book/v17/workspaceFileList.bin differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 000000000..c21f2eb07 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08f450d28..d8f8ff2bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,16 +4,16 @@ ## Как устроен процесс перевода -Перевод происходит исключительно в системе GitLocalize. Для регистрации в системе нужно авторизоваться через аккаунт на Github. Для каждого перевода создан отдельный проект. -Список проектов можно найти [тут][books-projects]. +Перевод происходит исключительно в системе GitLocalize. Для регистрации в системе нужно авторизоваться через аккаунт на Github. Для каждого перевода создан отдельный дело. +Список дел можно найти [тут][books-projects]. Процесс перевода происходит в следующих этапах: 1. Перевод файла 2. После полного перевода файла появляется кнопка "Create Review Request" для отправки на ревью -3. В течение недели корректор вычитывает перевод, правит ошибки, приводит книгу к одному стилю -4. После этого корректор отправляет Pull Request на Github -5. Модераторы перевода исправляют помарки, опечатки и технические ошибки, вызванные багами GitLocalize, и мержат перевод. После этого перевод синхронизируется с GitLocalize и появляется в системе +3. В течение недели изменитель вычитывает перевод, правит ошибки, приводит книгу к одному стилю +4. После этого изменитель отправляет Pull Request на Github +5. Писари перевода исправляют помарки, опечатки и технические ошибки, вызванные багами GitLocalize, и мержат перевод. После этого перевод синхронизируется с GitLocalize и появляется в системе ## Соглашения о процессе перевода @@ -26,7 +26,7 @@ - Перевод должен быть в единой стилистике, которая поддерживается редактором. В [чате переводов][translations-chat] можно задать вопросы по стилистике и принести предложения по ней. ## Ресурсы -- [Список проектов и переводов][books-projects] +- [Список дел и переводов][books-projects] - [Словарь терминов и переводов](https://github.com/rust-lang-ru/dictionary#readme) - [Словарь для проверки орфографии](https://github.com/rust-lang-ru/common-configs/blob/master/.yaspellerrc) - [Чат переводов][translations-chat] diff --git a/README.md b/README.md index f3736471c..e07c87555 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## GitLocalize -Проект на GitLocalize: https://gitlocalize.com/repo/4579 +Дело на GitLocalize: https://gitlocalize.com/repo/4579 ## Правила участия в переводе diff --git a/rustbook-en/.github/workflows/main.yml b/rustbook-en/.github/workflows/main.yml index 1737bce00..2b3ae3d5c 100644 --- a/rustbook-en/.github/workflows/main.yml +++ b/rustbook-en/.github/workflows/main.yml @@ -12,8 +12,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.79 -c rust-docs - rustup default 1.79 + rustup toolchain install 1.81 -c rust-docs + rustup default 1.81 - name: Install mdbook run: | mkdir bin @@ -36,8 +36,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.79 -c rust-docs - rustup default 1.79 + rustup toolchain install 1.81 -c rust-docs + rustup default 1.81 - name: Run `tools` package tests run: | cargo test diff --git a/rustbook-en/README.md b/rustbook-en/README.md index 8befc1b31..9648db0ae 100644 --- a/rustbook-en/README.md +++ b/rustbook-en/README.md @@ -33,6 +33,16 @@ rust-lang/rust uses in [this file][rust-mdbook]. To get it: $ cargo install mdbook --locked --version ``` +The book also uses two mdbook plugins which are part of this repository. If you +do not install them, you will see warnings when building and the output will not +look right, but you *will* still be able to build the book. To use the plugins, +you should run: + +```bash +$ cargo install --locked --path packages/mdbook-trpl-listing +$ cargo install --locked --path packages/mdbook-trpl-note +``` + ## Building To build the book, type: diff --git a/rustbook-en/ci/dictionary.txt b/rustbook-en/ci/dictionary.txt index 6329ed123..e2f5f670f 100644 --- a/rustbook-en/ci/dictionary.txt +++ b/rustbook-en/ci/dictionary.txt @@ -2,8 +2,6 @@ personal_ws-1.1 en 0 utf-8 abcabcabc abcd abcdefghijklmnopqrstuvwxyz -adaptor -adaptors AddAssign Addr adfb diff --git a/rustbook-en/dot/trpl04-05.dot b/rustbook-en/dot/trpl04-05.dot index ca1f7e06e..ccdad725a 100644 --- a/rustbook-en/dot/trpl04-05.dot +++ b/rustbook-en/dot/trpl04-05.dot @@ -1,32 +1,38 @@ digraph { - rankdir=LR; - overlap=false; - dpi=300.0; - node [shape="plaintext"]; - - table0[label=< - - - -
s
namevalue
ptr
>]; - table1[label=< - - - - - -
s1
namevalue
ptr
len5
capacity5
>]; - table2[label=< - - - - - - -
indexvalue
0h
1e
2l
3l
4o
>]; - - edge[tailclip="false"]; - table1:pointer:c -> table2:pointee; - table0:borrower:c -> table1:borrowee; -} - + rankdir = LR; + overlap = false; + dpi = 300.0; + node [shape = "plaintext";]; + + s [label = < + + + + + +
s
namevalue
ptr
len4
capacity4
>;]; + + subgraph cluster_heap { + peripheries = 0; + rank = "same"; + + hello [label = < + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>;]; + + ahoy [label = < + + + + + +
indexvalue
0a
1h
2o
3y
>;]; + } + + s -> ahoy [tailport = "pointer:c"; headport = "pointee"; tailclip = false;]; +} \ No newline at end of file diff --git a/rustbook-en/dot/trpl04-06.dot b/rustbook-en/dot/trpl04-06.dot index a23f179a7..ca1f7e06e 100644 --- a/rustbook-en/dot/trpl04-06.dot +++ b/rustbook-en/dot/trpl04-06.dot @@ -5,37 +5,28 @@ digraph { node [shape="plaintext"]; table0[label=< - + - - +
world
s
namevalue
ptr
len5
ptr
>]; - - table3[label=< - + table1[label=<
s
+ - - - + + +
s1
namevalue
ptr
len11
capacity11
ptr
len5
capacity5
>]; - table4[label=< + table2[label=<
- - - - - -
indexvalue
0h
1e
2l
3l
4o
5
6w
7o
8r
9l
10d
>]; - edge[tailclip="false"]; - table0:pointer2:c -> table4:pointee2; - table3:pointer:c -> table4:pointee; + table1:pointer:c -> table2:pointee; + table0:borrower:c -> table1:borrowee; } diff --git a/rustbook-en/dot/trpl04-07.dot b/rustbook-en/dot/trpl04-07.dot new file mode 100644 index 000000000..a23f179a7 --- /dev/null +++ b/rustbook-en/dot/trpl04-07.dot @@ -0,0 +1,41 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + +
world
namevalue
ptr
len5
>]; + + table3[label=< + + + + + +
s
namevalue
ptr
len11
capacity11
>]; + table4[label=< + + + + + + + + + + + + +
indexvalue
0h
1e
2l
3l
4o
5
6w
7o
8r
9l
10d
>]; + + + edge[tailclip="false"]; + table0:pointer2:c -> table4:pointee2; + table3:pointer:c -> table4:pointee; +} + diff --git a/rustbook-en/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt b/rustbook-en/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt index bb997866a..0f0bc2102 100644 --- a/rustbook-en/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt +++ b/rustbook-en/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -1,4 +1,10 @@ $ cargo build + Downloading crates ... + Downloaded rand_core v0.6.2 + Downloaded getrandom v0.2.2 + Downloaded rand_chacha v0.3.0 + Downloaded ppv-lite86 v0.2.10 + Downloaded libc v0.2.86 Compiling libc v0.2.86 Compiling getrandom v0.2.2 Compiling cfg-if v1.0.0 @@ -18,7 +24,7 @@ error[E0308]: mismatched types = note: expected reference `&String` found reference `&{integer}` note: method defined here - --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/cmp.rs:840:8 + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cmp.rs:839:8 For more information about this error, try `rustc --explain E0308`. error: could not compile `guessing_game` (bin "guessing_game") due to 1 previous error diff --git a/rustbook-en/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt b/rustbook-en/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt index 73ca9d62f..85efb431e 100644 --- a/rustbook-en/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt +++ b/rustbook-en/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt @@ -4,13 +4,15 @@ error[E0384]: cannot assign twice to immutable variable `x` --> src/main.rs:4:5 | 2 | let x = 5; - | - - | | - | first assignment to `x` - | help: consider making this binding mutable: `mut x` + | - first assignment to `x` 3 | println!("The value of x is: {x}"); 4 | x = 6; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +2 | let mut x = 5; + | +++ For more information about this error, try `rustc --explain E0384`. error: could not compile `variables` (bin "variables") due to 1 previous error diff --git a/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.lock b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/src/main.rs b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/src/main.rs new file mode 100644 index 000000000..b2d0846c1 --- /dev/null +++ b/rustbook-en/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + s = String::from("ahoy"); + + println!("{s}, world!"); + // ANCHOR_END: here +} diff --git a/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt b/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt index dde05f4b3..1eb76de43 100644 --- a/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt +++ b/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt @@ -8,10 +8,10 @@ error[E0277]: cannot add `Option` to `i8` | = help: the trait `Add>` is not implemented for `i8` = help: the following other types implement trait `Add`: - <&'a i8 as Add> - <&i8 as Add<&i8>> - > - + `&'a i8` implements `Add` + `&i8` implements `Add<&i8>` + `i8` implements `Add<&i8>` + `i8` implements `Add` For more information about this error, try `rustc --explain E0277`. error: could not compile `enums` (bin "enums") due to 1 previous error diff --git a/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt b/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt index 5232f9037..43acd14d6 100644 --- a/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt +++ b/rustbook-en/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt @@ -7,8 +7,8 @@ error[E0004]: non-exhaustive patterns: `None` not covered | ^ pattern `None` not covered | note: `Option` defined here - --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:571:1 - ::: /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:575:5 + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:574:1 + ::: /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:578:5 | = note: not covered = note: the matched value is of type `Option` diff --git a/rustbook-en/listings/ch09-error-handling/listing-09-10/output.txt b/rustbook-en/listings/ch09-error-handling/listing-09-10/output.txt index dbc9bb13d..f3c1641b2 100644 --- a/rustbook-en/listings/ch09-error-handling/listing-09-10/output.txt +++ b/rustbook-en/listings/ch09-error-handling/listing-09-10/output.txt @@ -9,6 +9,14 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu | ^ cannot use the `?` operator in a function that returns `()` | = help: the trait `FromResidual>` is not implemented for `()` +help: consider adding return type + | +3 ~ fn main() -> Result<(), Box> { +4 | let greeting_file = File::open("hello.txt")?; +5 + +6 + Ok(()) +7 + } + | For more information about this error, try `rustc --explain E0277`. error: could not compile `error-handling` (bin "error-handling") due to 1 previous error diff --git a/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt b/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt index 58f1ff4a5..b6fa60de5 100644 --- a/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt +++ b/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt @@ -22,8 +22,8 @@ failures: I got the value 8 thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: assertion `left == right` failed - left: 5 - right: 10 + left: 10 + right: 5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs b/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs index 462d22470..141d51ee6 100644 --- a/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs +++ b/rustbook-en/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs @@ -10,12 +10,12 @@ mod tests { #[test] fn this_test_will_pass() { let value = prints_and_returns_10(4); - assert_eq!(10, value); + assert_eq!(value, 10); } #[test] fn this_test_will_fail() { let value = prints_and_returns_10(8); - assert_eq!(5, value); + assert_eq!(value, 5); } } diff --git a/rustbook-en/listings/ch13-functional-features/listing-13-04/output.txt b/rustbook-en/listings/ch13-functional-features/listing-13-04/output.txt index b04a1a36c..fbc00b5df 100644 --- a/rustbook-en/listings/ch13-functional-features/listing-13-04/output.txt +++ b/rustbook-en/listings/ch13-functional-features/listing-13-04/output.txt @@ -1,6 +1,6 @@ $ cargo run Locking 1 package to latest compatible version - Adding closure-example v0.1.0 (/Users/carolnichols/rust/book/tmp/listings/ch13-functional-features/listing-13-04) + Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-04) Compiling closure-example v0.1.0 (file:///projects/closure-example) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s Running `target/debug/closure-example` diff --git a/rustbook-en/listings/ch13-functional-features/listing-13-05/output.txt b/rustbook-en/listings/ch13-functional-features/listing-13-05/output.txt index 1fddf5a98..695ee4bee 100644 --- a/rustbook-en/listings/ch13-functional-features/listing-13-05/output.txt +++ b/rustbook-en/listings/ch13-functional-features/listing-13-05/output.txt @@ -1,6 +1,6 @@ $ cargo run Locking 1 package to latest compatible version - Adding closure-example v0.1.0 (/Users/carolnichols/rust/book/tmp/listings/ch13-functional-features/listing-13-05) + Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-05) Compiling closure-example v0.1.0 (file:///projects/closure-example) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s Running `target/debug/closure-example` diff --git a/rustbook-en/listings/ch15-smart-pointers/listing-15-21/output.txt b/rustbook-en/listings/ch15-smart-pointers/listing-15-21/output.txt index 3509e8ec6..8501007f0 100644 --- a/rustbook-en/listings/ch15-smart-pointers/listing-15-21/output.txt +++ b/rustbook-en/listings/ch15-smart-pointers/listing-15-21/output.txt @@ -10,7 +10,7 @@ help: consider changing this to be a mutable reference in the `impl` method and | 2 ~ fn send(&mut self, msg: &str); 3 | } - ... +... 56 | impl Messenger for MockMessenger { 57 ~ fn send(&mut self, message: &str) { | diff --git a/rustbook-en/listings/ch16-fearless-concurrency/listing-16-14/output.txt b/rustbook-en/listings/ch16-fearless-concurrency/listing-16-14/output.txt index cb4167a5b..cc96baed1 100644 --- a/rustbook-en/listings/ch16-fearless-concurrency/listing-16-14/output.txt +++ b/rustbook-en/listings/ch16-fearless-concurrency/listing-16-14/output.txt @@ -22,7 +22,7 @@ note: required because it's used within this closure 11 | let handle = thread::spawn(move || { | ^^^^^^^ note: required by a bound in `spawn` - --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/mod.rs:691:1 + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:688:1 For more information about this error, try `rustc --explain E0277`. error: could not compile `shared-state` (bin "shared-state") due to 1 previous error diff --git a/rustbook-en/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt b/rustbook-en/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt index bc736bd68..3a2342639 100644 --- a/rustbook-en/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt +++ b/rustbook-en/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt @@ -6,11 +6,11 @@ error[E0746]: return type cannot have an unboxed trait object 1 | fn returns_closure() -> dyn Fn(i32) -> i32 { | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | -help: return an `impl Trait` instead of a `dyn Trait`, if all returned values are the same type +help: consider returning an `impl Trait` instead of a `dyn Trait` | 1 | fn returns_closure() -> impl Fn(i32) -> i32 { | ~~~~ -help: box the return type, and wrap all of the returned values in `Box::new` +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | 1 ~ fn returns_closure() -> Box i32> { 2 ~ Box::new(|x| x + 1) diff --git a/rustbook-en/listings/ch20-web-server/listing-20-02/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-02/src/main.rs index f139846c6..1eff2eef3 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-02/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-02/src/main.rs @@ -14,7 +14,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let http_request: Vec<_> = buf_reader .lines() .map(|result| result.unwrap()) diff --git a/rustbook-en/listings/ch20-web-server/listing-20-03/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-03/src/main.rs index c72d4a9c6..17c8401d4 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-03/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-03/src/main.rs @@ -15,7 +15,7 @@ fn main() { // ANCHOR: here fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let http_request: Vec<_> = buf_reader .lines() .map(|result| result.unwrap()) diff --git a/rustbook-en/listings/ch20-web-server/listing-20-05/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-05/src/main.rs index d4b78b640..437d9b626 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-05/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-05/src/main.rs @@ -19,7 +19,7 @@ fn main() { // ANCHOR: here fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let http_request: Vec<_> = buf_reader .lines() .map(|result| result.unwrap()) diff --git a/rustbook-en/listings/ch20-web-server/listing-20-06/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-06/src/main.rs index 5523a42d7..843d84676 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-06/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-06/src/main.rs @@ -17,7 +17,7 @@ fn main() { // --snip-- fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); if request_line == "GET / HTTP/1.1" { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-07/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-07/src/main.rs index a14b7d538..e19467b83 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-07/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-07/src/main.rs @@ -15,7 +15,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); if request_line == "GET / HTTP/1.1" { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-09/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-09/src/main.rs index ffc51e803..0f9356ab0 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-09/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-09/src/main.rs @@ -19,7 +19,7 @@ fn main() { fn handle_connection(mut stream: TcpStream) { // --snip-- // ANCHOR_END: here - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); // ANCHOR: here diff --git a/rustbook-en/listings/ch20-web-server/listing-20-10/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-10/src/main.rs index 5a18b45c0..0679ec600 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-10/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-10/src/main.rs @@ -24,7 +24,7 @@ fn handle_connection(mut stream: TcpStream) { // --snip-- // ANCHOR_END: here - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); // ANCHOR: here diff --git a/rustbook-en/listings/ch20-web-server/listing-20-11/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-11/src/main.rs index 1181357b0..075a0d9de 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-11/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-11/src/main.rs @@ -21,7 +21,7 @@ fn main() { // ANCHOR_END: here fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-12/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-12/src/main.rs index 21b9a80f1..bde3e29d1 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-12/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-12/src/main.rs @@ -22,7 +22,7 @@ fn main() { // ANCHOR_END: here fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-13/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-13/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-13/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-13/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-14/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-14/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-14/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-14/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-15/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-15/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-15/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-15/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-16/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-16/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-16/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-16/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-17/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-17/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-17/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-17/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-18/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-18/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-18/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-18/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-19/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-19/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-19/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-19/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-20/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-20/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-20/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-20/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-21/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-21/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-21/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-21/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-22/output.txt b/rustbook-en/listings/ch20-web-server/listing-20-22/output.txt index 84ebe928b..554bfd859 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-22/output.txt +++ b/rustbook-en/listings/ch20-web-server/listing-20-22/output.txt @@ -9,7 +9,7 @@ error[E0507]: cannot move out of `worker.thread` which is behind a mutable refer | move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait | note: `JoinHandle::::join` takes ownership of the receiver `self`, which moves `worker.thread` - --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/mod.rs:1718:17 + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:17 For more information about this error, try `rustc --explain E0507`. error: could not compile `hello` (lib) due to 1 previous error diff --git a/rustbook-en/listings/ch20-web-server/listing-20-22/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-22/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-22/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-22/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-23/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-23/src/main.rs index b6aa046d1..acd703f27 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-23/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-23/src/main.rs @@ -23,7 +23,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-24/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-24/src/main.rs index b6aa046d1..acd703f27 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-24/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-24/src/main.rs @@ -23,7 +23,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/listing-20-25/src/main.rs b/rustbook-en/listings/ch20-web-server/listing-20-25/src/main.rs index 86e8d9e78..ee0f1efe7 100644 --- a/rustbook-en/listings/ch20-web-server/listing-20-25/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/listing-20-25/src/main.rs @@ -25,7 +25,7 @@ fn main() { // ANCHOR_END: here fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs index f7b42167f..e68f72c70 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs @@ -23,7 +23,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt b/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt index 1ffe5206b..6867dcbca 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt +++ b/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt @@ -7,7 +7,7 @@ error[E0599]: no method named `join` found for enum `Option` in the current scop | ^^^^ method not found in `Option>` | note: the method `join` exists on the type `JoinHandle<()>` - --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/thread/mod.rs:1718:5 + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:5 help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None` | 52 | worker.thread.expect("REASON").join().unwrap(); diff --git a/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs index 79efb28a2..1f075fde5 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs @@ -21,7 +21,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs index b6aa046d1..acd703f27 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs @@ -23,7 +23,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/listings/ch20-web-server/no-listing-07-final-code/src/main.rs b/rustbook-en/listings/ch20-web-server/no-listing-07-final-code/src/main.rs index b6aa046d1..acd703f27 100644 --- a/rustbook-en/listings/ch20-web-server/no-listing-07-final-code/src/main.rs +++ b/rustbook-en/listings/ch20-web-server/no-listing-07-final-code/src/main.rs @@ -23,7 +23,7 @@ fn main() { } fn handle_connection(mut stream: TcpStream) { - let buf_reader = BufReader::new(&mut stream); + let buf_reader = BufReader::new(&stream); let request_line = buf_reader.lines().next().unwrap().unwrap(); let (status_line, filename) = match &request_line[..] { diff --git a/rustbook-en/packages/tools/src/bin/release_listings.rs b/rustbook-en/packages/tools/src/bin/release_listings.rs index c9a2f4597..09fb20976 100644 --- a/rustbook-en/packages/tools/src/bin/release_listings.rs +++ b/rustbook-en/packages/tools/src/bin/release_listings.rs @@ -28,26 +28,59 @@ fn main() -> Result<(), Box> { let chapter = chapter?; let chapter_path = chapter.path(); + if !chapter_path.is_dir() { + eprintln!( + "'{}' is not a directory, skipping", + chapter_path.display() + ); + continue; + } + let chapter_name = chapter_path .file_name() .expect("Chapter should've had a name"); // Create a corresponding chapter dir in `tmp/listings` let output_chapter_path = out_dir.join(chapter_name); - fs::create_dir(&output_chapter_path)?; + fs::create_dir(&output_chapter_path).map_err(|e| { + format!( + "could not create dir at '{}': {e}", + output_chapter_path.display() + ) + })?; // For each listing in the chapter directory, - for listing in fs::read_dir(chapter_path)? { - let listing = listing?; + for listing in fs::read_dir(&chapter_path).map_err(|e| { + format!("Could not read '{}': {e}", chapter_path.display()) + })? { + let listing = listing.map_err(|e| { + format!( + "bad dir entry listing in {}: {e}", + chapter_path.display() + ) + })?; let listing_path = listing.path(); + if !listing_path.is_dir() { + eprintln!( + "'{}' is not a directory, skipping", + chapter_path.display() + ); + continue; + } + let listing_name = listing_path .file_name() .expect("Listing should've had a name"); // Create a corresponding listing dir in the tmp chapter dir let output_listing_dir = output_chapter_path.join(listing_name); - fs::create_dir(&output_listing_dir)?; + fs::create_dir(&output_listing_dir).map_err(|e| { + format!( + "could not create dir '{}': {e}", + output_listing_dir.display() + ) + })?; // Copy all the cleaned files in the listing to the tmp directory copy_cleaned_listing_files(listing_path, output_listing_dir)?; @@ -79,8 +112,12 @@ fn copy_cleaned_listing_files( from: PathBuf, to: PathBuf, ) -> Result<(), Box> { - for item in fs::read_dir(from)? { - let item = item?; + for item in fs::read_dir(&from).map_err(|e| { + format!("Could not read_dir on '{}': {e}", from.display()) + })? { + let item = item.map_err(|e| { + format!("invalid dir entry in {}: {e}", from.display()) + })?; let item_path = item.path(); let item_name = @@ -90,7 +127,12 @@ fn copy_cleaned_listing_files( if item_path.is_dir() { // Don't copy `target` directories if item_name != "target" { - fs::create_dir(&output_item)?; + fs::create_dir(&output_item).map_err(|e| { + format!( + "Could not create output directory '{}': {e}", + output_item.display() + ) + })?; copy_cleaned_listing_files(item_path, output_item)?; } } else { @@ -105,7 +147,13 @@ fn copy_cleaned_listing_files( )?; } else { // Copy any non-Rust files without modification - fs::copy(item_path, output_item)?; + fs::copy(&item_path, &output_item).map_err(|e| { + format!( + "Could not copy from '{}' to '{}': {e}", + item_path.display(), + output_item.display() + ) + })?; } } } diff --git a/rustbook-en/rust-toolchain b/rustbook-en/rust-toolchain index 17420a571..ea3769f29 100644 --- a/rustbook-en/rust-toolchain +++ b/rustbook-en/rust-toolchain @@ -1 +1 @@ -1.79 +1.81 diff --git a/rustbook-en/src/appendix-06-translation.md b/rustbook-en/src/appendix-06-translation.md index 54d58376e..ef78fc254 100644 --- a/rustbook-en/src/appendix-06-translation.md +++ b/rustbook-en/src/appendix-06-translation.md @@ -9,9 +9,8 @@ For resources in languages other than English. Most are still in progress; see - [Português](https://github.com/nunojesus/rust-book-pt-pt) (PT) - [简体中文](https://github.com/KaiserY/trpl-zh-cn) - [正體中文](https://github.com/rust-tw/book-tw) -- [Українська](https://github.com/pavloslav/rust-book-uk-ua) +- [Українська](https://rust-lang-ua.github.io/rustbook_ukrainian) - [Español](https://github.com/thecodix/book), [alternate](https://github.com/ManRR/rust-book-es) -- [Italiano](https://github.com/EmanueleGurini/book_it) - [Русский](https://github.com/rust-lang-ru/book) - [한국어](https://github.com/rinthel/rust-lang-book-ko) - [日本語](https://github.com/rust-lang-ja/book-ja) diff --git a/rustbook-en/src/ch01-03-hello-cargo.md b/rustbook-en/src/ch01-03-hello-cargo.md index 5750e4f01..dea721d38 100644 --- a/rustbook-en/src/ch01-03-hello-cargo.md +++ b/rustbook-en/src/ch01-03-hello-cargo.md @@ -113,7 +113,8 @@ everything is in its place. If you started a project that doesn’t use Cargo, as we did with the “Hello, world!” project, you can convert it to a project that does use Cargo. Move the project code into the *src* directory and create an appropriate *Cargo.toml* -file. +file. One easy way to get that *Cargo.toml* file is to run `cargo init`, which +will create it for you automatically. ### Building and Running a Cargo Project diff --git a/rustbook-en/src/ch03-02-data-types.md b/rustbook-en/src/ch03-02-data-types.md index 2cfc156e8..84af90e3f 100644 --- a/rustbook-en/src/ch03-02-data-types.md +++ b/rustbook-en/src/ch03-02-data-types.md @@ -271,14 +271,14 @@ brackets: {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs}} ``` -Arrays are useful when you want your data allocated on the stack rather than -the heap (we will discuss the stack and the heap more in [Chapter -4][stack-and-heap]) or when you want to ensure you always have a -fixed number of elements. An array isn’t as flexible as the vector type, -though. A *vector* is a similar collection type provided by the standard -library that *is* allowed to grow or shrink in size. If you’re unsure whether -to use an array or a vector, chances are you should use a vector. [Chapter -8][vectors] discusses vectors in more detail. +Arrays are useful when you want your data allocated on the stack, the same as +the other types we have seen so far, rather than the heap (we will discuss the +stack and the heap more in [Chapter 4][stack-and-heap]) or when +you want to ensure you always have a fixed number of elements. An array isn’t as +flexible as the vector type, though. A *vector* is a similar collection type +provided by the standard library that *is* allowed to grow or shrink in size. If +you’re unsure whether to use an array or a vector, chances are you should use a +vector. [Chapter 8][vectors] discusses vectors in more detail. However, arrays are more useful when you know the number of elements will not need to change. For example, if you were using the names of the month in a diff --git a/rustbook-en/src/ch04-01-what-is-ownership.md b/rustbook-en/src/ch04-01-what-is-ownership.md index 5249c2dd7..5ef7b5f97 100644 --- a/rustbook-en/src/ch04-01-what-is-ownership.md +++ b/rustbook-en/src/ch04-01-what-is-ownership.md @@ -113,12 +113,13 @@ hardcoded into the text of our program. The variable is valid from the point at which it’s declared until the end of the current *scope*. Listing 4-1 shows a program with comments annotating where the variable `s` would be valid. ++ ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-01/src/main.rs:here}} ``` -Listing 4-1: A variable and the scope in which it is -valid + In other words, there are two important points in time here: @@ -239,12 +240,13 @@ we’ve allocated on the heap. Let’s explore some of those situations now. Multiple variables can interact with the same data in different ways in Rust. Let’s look at an example using an integer in Listing 4-2. ++ ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-02/src/main.rs:here}} ``` -Listing 4-2: Assigning the integer value of variable `x` -to `y` + We can probably guess what this is doing: “bind the value `5` to `x`; then make a copy of the value in `x` and bind it to `y`.” We now have two variables, `x` @@ -354,6 +356,37 @@ In addition, there’s a design choice that’s implied by this: Rust will never automatically create “deep” copies of your data. Therefore, any *automatic* copying can be assumed to be inexpensive in terms of runtime performance. +#### Scope and Assignment + +The inverse of this is true for the relationship between scoping, ownership, and +memory being freed via the `drop` function as well. When you assign a completely +new value to an existing variable, Rust will call `drop` and free the original +value’s memory immediately. Consider this code, for example: + +```rust +{{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/src/main.rs:here}} +``` + +We initially declare a variable `s` and bind it to a `String` with the value +`"hello"`. Then we immediately create a new `String` with the value `"ahoy"` and +assign it to `s`. At this point, nothing is referring to the original value on +the heap at all. + +One table s representing the string value on the stack, pointing to
+the second piece of string data (ahoy) on the heap, with the original string
+data (hello) grayed out because it cannot be accessed anymore. + +Figure 4-5: Representation in memory after the initial +value has been replaced in its entirety. + +The original string thus immediately goes out of scope. Rust will run the `drop` +function on it and its memory will be freed right away. When we print the value +at the end, it will be `"ahoy, world!"`. + @@ -429,14 +462,13 @@ assigning a value to a variable. Passing a variable to a function will move or copy, just as assignment does. Listing 4-3 has an example with some annotations showing where variables go into and out of scope. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-03/src/main.rs}} ``` -Listing 4-3: Functions with ownership and scope -annotated + If we tried to use `s` after the call to `takes_ownership`, Rust would throw a compile-time error. These static checks protect us from mistakes. Try adding @@ -449,14 +481,13 @@ Returning values can also transfer ownership. Listing 4-4 shows an example of a function that returns some value, with similar annotations as those in Listing 4-3. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-04/src/main.rs}} ``` -Listing 4-4: Transferring ownership of return -values + The ownership of a variable follows the same pattern every time: assigning a value to another variable moves it. When a variable that includes data on the @@ -471,13 +502,13 @@ from the body of the function that we might want to return as well. Rust does let us return multiple values using a tuple, as shown in Listing 4-5. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-05/src/main.rs}} ``` -Listing 4-5: Returning ownership of parameters + But this is too much ceremony and a lot of work for a concept that should be common. Luckily for us, Rust has a feature for using a value without diff --git a/rustbook-en/src/ch04-02-references-and-borrowing.md b/rustbook-en/src/ch04-02-references-and-borrowing.md index ea2d8d202..055001571 100644 --- a/rustbook-en/src/ch04-02-references-and-borrowing.md +++ b/rustbook-en/src/ch04-02-references-and-borrowing.md @@ -12,23 +12,25 @@ particular type for the life of that reference. Here is how you would define and use a `calculate_length` function that has a reference to an object as a parameter instead of taking ownership of the value: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs:all}} ``` + + First, notice that all the tuple code in the variable declaration and the function return value is gone. Second, note that we pass `&s1` into `calculate_length` and, in its definition, we take `&String` rather than `String`. These ampersands represent *references*, and they allow you to refer -to some value without taking ownership of it. Figure 4-5 depicts this concept. +to some value without taking ownership of it. Figure 4-6 depicts this concept. Three tables: the table for s contains only a pointer to the table
 for s1. The table for s1 contains the stack data for s1 and points to the
-string data on the heap. +string data on the heap." src="img/trpl04-06.svg" class="center" /> -Figure 4-5: A diagram of `&String s` pointing at `String +Figure 4-6: A diagram of `&String s` pointing at `String s1` > Note: The opposite of referencing by using `&` is *dereferencing*, which is @@ -67,13 +69,13 @@ to give it back. You don’t own it. So, what happens if we try to modify something we’re borrowing? Try the code in Listing 4-6. Spoiler alert: it doesn’t work! -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-06/src/main.rs}} ``` -Listing 4-6: Attempting to modify a borrowed value + Here’s the error: @@ -89,12 +91,14 @@ allowed to modify something we have a reference to. We can fix the code from Listing 4-6 to allow us to modify a borrowed value with just a few small tweaks that use, instead, a *mutable reference*: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs}} ``` + + First we change `s` to be `mut`. Then we create a mutable reference with `&mut s` where we call the `change` function, and update the function signature to accept a mutable reference with `some_string: &mut String`. This makes it very @@ -104,12 +108,14 @@ Mutable references have one big restriction: if you have a mutable reference to a value, you can have no other references to that value. This code that attempts to create two mutable references to `s` will fail: -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs:here}} ``` + + Here’s the error: ```console @@ -198,12 +204,14 @@ reference to the data does. Let’s try to create a dangling reference to see how Rust prevents them with a compile-time error: -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs}} ``` + + Here’s the error: ```console @@ -222,12 +230,14 @@ for it to be borrowed from Let’s take a closer look at exactly what’s happening at each stage of our `dangle` code: -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs:here}} ``` + + Because `s` is created inside `dangle`, when the code of `dangle` is finished, `s` will be deallocated. But we tried to return a reference to it. That means this reference would be pointing to an invalid `String`. That’s no good! Rust diff --git a/rustbook-en/src/ch04-03-slices.md b/rustbook-en/src/ch04-03-slices.md index 7f8c9b7af..d01d90502 100644 --- a/rustbook-en/src/ch04-03-slices.md +++ b/rustbook-en/src/ch04-03-slices.md @@ -21,14 +21,13 @@ ownership, so this is fine. But what should we return? We don’t really have a way to talk about *part* of a string. However, we could return the index of the end of the word, indicated by a space. Let’s try that, as shown in Listing 4-7. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-07/src/main.rs:here}} ``` -Listing 4-7: The `first_word` function that returns a -byte index value into the `String` parameter + Because we need to go through the `String` element by element and check whether a value is a space, we’ll convert our `String` to an array of bytes using the @@ -73,14 +72,13 @@ because it’s a separate value from the `String`, there’s no guarantee that i will still be valid in the future. Consider the program in Listing 4-8 that uses the `first_word` function from Listing 4-7. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-08/src/main.rs:here}} ``` -Listing 4-8: Storing the result from calling the -`first_word` function and then changing the `String` contents + This program compiles without any errors and would also do so if we used `word` after calling `s.clear()`. Because `word` isn’t connected to the state of `s` @@ -121,15 +119,15 @@ corresponds to `ending_index` minus `starting_index`. So, in the case of `let world = &s[6..11];`, `world` would be a slice that contains a pointer to the byte at index 6 of `s` with a length value of `5`. -Figure 4-6 shows this in a diagram. +Figure 4-7 shows this in a diagram. Three tables: a table representing the stack data of s, which points
 to the byte at index 0 in a table of the string data "hello world" on
 the heap. The third table rep-resents the stack data of the slice world, which
 has a length value of 5 and points to byte 6 of the heap data table. +src="img/trpl04-07.svg" class="center" style="width: 50%;" /> -Figure 4-6: String slice referring to part of a +Figure 4-7: String slice referring to part of a `String` With Rust’s `..` range syntax, if you want to start at index 0, you can drop @@ -176,12 +174,14 @@ let slice = &s[..]; With all this information in mind, let’s rewrite `first_word` to return a slice. The type that signifies “string slice” is written as `&str`: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs:here}} ``` + + We get the index for the end of the word the same way we did in Listing 4-7, by looking for the first occurrence of a space. When we find a space, we return a string slice using the start of the string and the index of the space as the @@ -207,12 +207,14 @@ string. Slices make this bug impossible and let us know we have a problem with our code much sooner. Using the slice version of `first_word` will throw a compile-time error: -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs:here}} ``` + + Here’s the compiler error: ```console @@ -257,12 +259,13 @@ A more experienced Rustacean would write the signature shown in Listing 4-9 instead because it allows us to use the same function on both `&String` values and `&str` values. ++ ```rust,ignore {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-09/src/main.rs:here}} ``` -Listing 4-9: Improving the `first_word` function by using -a string slice for the type of the `s` parameter + If we have a string slice, we can pass that directly. If we have a `String`, we can pass a slice of the `String` or a reference to the `String`. This @@ -273,12 +276,14 @@ Methods”][deref-coercions] section of Chapter 15. Defining a function to take a string slice instead of a reference to a `String` makes our API more general and useful without losing any functionality: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-09/src/main.rs:usage}} ``` + + ### Other Slices String slices, as you might imagine, are specific to strings. But there’s a diff --git a/rustbook-en/src/ch05-01-defining-structs.md b/rustbook-en/src/ch05-01-defining-structs.md index c5db4dc74..e1325c63e 100644 --- a/rustbook-en/src/ch05-01-defining-structs.md +++ b/rustbook-en/src/ch05-01-defining-structs.md @@ -13,13 +13,13 @@ grouped together. Then, inside curly brackets, we define the names and types of the pieces of data, which we call *fields*. For example, Listing 5-1 shows a struct that stores information about a user account. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs:here}} ``` -Listing 5-1: A `User` struct definition + To use a struct after we’ve defined it, we create an *instance* of that struct by specifying concrete values for each of the fields. We create an instance by @@ -31,14 +31,13 @@ struct definition is like a general template for the type, and instances fill in that template with particular data to create values of the type. For example, we can declare a particular user as shown in Listing 5-2. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs:here}} ``` -Listing 5-2: Creating an instance of the `User` -struct + To get a specific value from a struct, we use dot notation. For example, to access this user’s email address, we use `user1.email`. If the instance is @@ -46,14 +45,13 @@ mutable, we can change a value by using the dot notation and assigning into a particular field. Listing 5-3 shows how to change the value in the `email` field of a mutable `User` instance. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs:here}} ``` -Listing 5-3: Changing the value in the `email` field of a -`User` instance + Note that the entire instance must be mutable; Rust doesn’t allow us to mark only certain fields as mutable. As with any expression, we can construct a new @@ -64,14 +62,13 @@ Listing 5-4 shows a `build_user` function that returns a `User` instance with the given email and username. The `active` field gets the value of `true`, and the `sign_in_count` gets a value of `1`. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs:here}} ``` -Listing 5-4: A `build_user` function that takes an email -and username and returns a `User` instance + It makes sense to name the function parameters with the same name as the struct fields, but having to repeat the `email` and `username` field names and @@ -88,15 +85,13 @@ Listing 5-4, we can use the *field init shorthand* syntax to rewrite `build_user` so it behaves exactly the same but doesn’t have the repetition of `username` and `email`, as shown in Listing 5-5. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs:here}} ``` -Listing 5-5: A `build_user` function that uses field init -shorthand because the `username` and `email` parameters have the same name as -struct fields + Here, we’re creating a new instance of the `User` struct, which has a field named `email`. We want to set the `email` field’s value to the value in the @@ -114,28 +109,25 @@ First, in Listing 5-6 we show how to create a new `User` instance in `user2` regularly, without the update syntax. We set a new value for `email` but otherwise use the same values from `user1` that we created in Listing 5-2. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs:here}} ``` -Listing 5-6: Creating a new `User` instance using all but one of -the values from `user1` + Using struct update syntax, we can achieve the same effect with less code, as shown in Listing 5-7. The syntax `..` specifies that the remaining fields not explicitly set should have the same value as the fields in the given instance. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs:here}} ``` -Listing 5-7: Using struct update syntax to set a new -`email` value for a `User` instance but to use the rest of the values from -`user1` + The code in Listing 5-7 also creates an instance in `user2` that has a different value for `email` but has the same values for the `username`, @@ -154,7 +146,8 @@ Move”][move] section. In this example, we can no longer use `active` and `sign_in_count` values from `user1`, then `user1` would still be valid after creating `user2`. Both `active` and `sign_in_count` are types that implement the `Copy` trait, so the behavior we discussed in the [“Stack-Only -Data: Copy”][copy] section would apply. +Data: Copy”][copy] section would apply. We can still use +`user1.email` in this example, since its value was _not_ moved out. ### Using Tuple Structs Without Named Fields to Create Different Types @@ -169,12 +162,14 @@ To define a tuple struct, start with the `struct` keyword and the struct name followed by the types in the tuple. For example, here we define and use two tuple structs named `Color` and `Point`: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs}} ``` + + Note that the `black` and `origin` values are different types because they’re instances of different tuple structs. Each struct you define is its own type, even though the fields within the struct might have the same types. For @@ -182,7 +177,9 @@ example, a function that takes a parameter of type `Color` cannot take a `Point` as an argument, even though both types are made up of three `i32` values. Otherwise, tuple struct instances are similar to tuples in that you can destructure them into their individual pieces, and you can use a `.` followed -by the index to access an individual value. +by the index to access an individual value. Unlike tuples, tuple structs +require you to name the type of the struct when you destructure them. For +example, we would write `let Point(x, y, z) = point`. ### Unit-Like Structs Without Any Fields @@ -194,12 +191,14 @@ have any data that you want to store in the type itself. We’ll discuss traits in Chapter 10. Here’s an example of declaring and instantiating a unit struct named `AlwaysEqual`: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/src/main.rs}} ``` + + To define `AlwaysEqual`, we use the `struct` keyword, the name we want, and then a semicolon. No need for curly brackets or parentheses! Then we can get an instance of `AlwaysEqual` in the `subject` variable in a similar way: using the @@ -223,7 +222,7 @@ implement them on any type, including unit-like structs. > is valid for as long as the struct is. Let’s say you try to store a reference > in a struct without specifying lifetimes, like the following; this won’t work: > -> Filename: src/main.rs +> > > > @@ -245,6 +244,8 @@ implement them on any type, including unit-like structs. > } > ``` > +> +> > The compiler will complain that it needs lifetime specifiers: > > ```console diff --git a/rustbook-en/src/ch05-02-example-structs.md b/rustbook-en/src/ch05-02-example-structs.md index 1e7c9f7e9..392f1bd3b 100644 --- a/rustbook-en/src/ch05-02-example-structs.md +++ b/rustbook-en/src/ch05-02-example-structs.md @@ -9,14 +9,13 @@ the width and height of a rectangle specified in pixels and calculate the area of the rectangle. Listing 5-8 shows a short program with one way of doing exactly that in our project’s *src/main.rs*. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs:all}} ``` -Listing 5-8: Calculating the area of a rectangle -specified by separate width and height variables + Now, run this program using `cargo run`: @@ -45,14 +44,13 @@ of Chapter 3: by using tuples. Listing 5-9 shows another version of our program that uses tuples. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs}} ``` -Listing 5-9: Specifying the width and height of the -rectangle with a tuple + In one way, this program is better. Tuples let us add a bit of structure, and we’re now passing just one argument. But in another way, this version is less @@ -72,13 +70,13 @@ We use structs to add meaning by labeling the data. We can transform the tuple we’re using into a struct with a name for the whole as well as names for the parts, as shown in Listing 5-10. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs}} ``` -Listing 5-10: Defining a `Rectangle` struct + Here we’ve defined a struct and named it `Rectangle`. Inside the curly brackets, we defined the fields as `width` and `height`, both of which have @@ -108,14 +106,13 @@ debugging our program and see the values for all its fields. Listing 5-11 tries using the [`println!` macro][println] as we have used in previous chapters. This won’t work, however. -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs}} ``` -Listing 5-11: Attempting to print a `Rectangle` -instance + When we compile this code, we get an error with this core message: @@ -163,14 +160,13 @@ have to explicitly opt in to make that functionality available for our struct. To do that, we add the outer attribute `#[derive(Debug)]` just before the struct definition, as shown in Listing 5-12. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs}} ``` -Listing 5-12: Adding the attribute to derive the `Debug` -trait and printing the `Rectangle` instance using debug formatting + Now when we run the program, we won’t get any errors, and we’ll see the following output: diff --git a/rustbook-en/src/ch05-03-method-syntax.md b/rustbook-en/src/ch05-03-method-syntax.md index d25e55b18..91887210d 100644 --- a/rustbook-en/src/ch05-03-method-syntax.md +++ b/rustbook-en/src/ch05-03-method-syntax.md @@ -15,14 +15,13 @@ Let’s change the `area` function that has a `Rectangle` instance as a paramete and instead make an `area` method defined on the `Rectangle` struct, as shown in Listing 5-13. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs}} ``` -Listing 5-13: Defining an `area` method on the -`Rectangle` struct + To define the function within the context of `Rectangle`, we start an `impl` (implementation) block for `Rectangle`. Everything within this `impl` block @@ -65,12 +64,14 @@ Note that we can choose to give a method the same name as one of the struct’s fields. For example, we can define a method on `Rectangle` that is also named `width`: -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/src/main.rs:here}} ``` + + Here, we’re choosing to make the `width` method return `true` if the value in the instance’s `width` field is greater than `0` and `false` if the value is `0`: we can use a field within a method of the same name for any purpose. In @@ -141,14 +142,13 @@ within `self` (the first `Rectangle`); otherwise, it should return `false`. That is, once we’ve defined the `can_hold` method, we want to be able to write the program shown in Listing 5-14. -Filename: src/main.rs + ```rust,ignore {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs}} ``` -Listing 5-14: Using the as-yet-unwritten `can_hold` -method + The expected output would look like the following because both dimensions of `rect2` are smaller than the dimensions of `rect1`, but `rect3` is wider than @@ -173,14 +173,13 @@ Boolean, and the implementation will check whether the width and height of respectively. Let’s add the new `can_hold` method to the `impl` block from Listing 5-13, shown in Listing 5-15. -Filename: src/main.rs + ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs:here}} ``` -Listing 5-15: Implementing the `can_hold` method on -`Rectangle` that takes another `Rectangle` instance as a parameter + When we run this code with the `main` function in Listing 5-14, we’ll get our desired output. Methods can take multiple parameters that we add to the @@ -226,12 +225,13 @@ Each struct is allowed to have multiple `impl` blocks. For example, Listing 5-15 is equivalent to the code shown in Listing 5-16, which has each method in its own `impl` block. ++ ```rust {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs:here}} ``` -Listing 5-16: Rewriting Listing 5-15 using multiple `impl` -blocks + There’s no reason to separate these methods into multiple `impl` blocks here, but this is valid syntax. We’ll see a case in which multiple `impl` blocks are diff --git a/rustbook-en/src/ch13-02-iterators.md b/rustbook-en/src/ch13-02-iterators.md index c99fcd699..4ce9170de 100644 --- a/rustbook-en/src/ch13-02-iterators.md +++ b/rustbook-en/src/ch13-02-iterators.md @@ -111,7 +111,7 @@ trait. Some of these methods call the `next` method in their definition, which is why you’re required to implement the `next` method when implementing the `Iterator` trait. -Methods that call `next` are called *consuming adaptors*, because calling them +Methods that call `next` are called *consuming adapters*, because calling them uses up the iterator. One example is the `sum` method, which takes ownership of the iterator and iterates through the items by repeatedly calling `next`, thus consuming the iterator. As it iterates through, it adds each item to a running @@ -131,17 +131,17 @@ ownership of the iterator we call it on. ### Methods that Produce Other Iterators -*Iterator adaptors* are methods defined on the `Iterator` trait that don’t +*Iterator adapters* are methods defined on the `Iterator` trait that don’t consume the iterator. Instead, they produce different iterators by changing some aspect of the original iterator. -Listing 13-14 shows an example of calling the iterator adaptor method `map`, +Listing 13-14 shows an example of calling the iterator adapter method `map`, which takes a closure to call on each item as the items are iterated through. The `map` method returns a new iterator that produces the modified items. The closure here creates a new iterator in which each item from the vector will be incremented by 1: -+ ```rust,not_desired_behavior {{#rustdoc_include ../listings/ch13-functional-features/listing-13-14/src/main.rs:here}} @@ -156,7 +156,7 @@ However, this code produces a warning: ``` The code in Listing 13-14 doesn’t do anything; the closure we’ve specified -never gets called. The warning reminds us why: iterator adaptors are lazy, and +never gets called. The warning reminds us why: iterator adapters are lazy, and we need to consume the iterator here. To fix this warning and consume the iterator, we’ll use the `collect` method, @@ -181,9 +181,9 @@ on each item. This is a great example of how closures let you customize some behavior while reusing the iteration behavior that the `Iterator` trait provides. -You can chain multiple calls to iterator adaptors to perform complex actions in +You can chain multiple calls to iterator adapters to perform complex actions in a readable way. But because all iterators are lazy, you have to call one of the -consuming adaptor methods to get results from calls to iterator adaptors. +consuming adapter methods to get results from calls to iterator adapters. ### Using Closures that Capture Their Environment diff --git a/rustbook-en/src/ch13-03-improving-our-io-project.md b/rustbook-en/src/ch13-03-improving-our-io-project.md index 4c1a50845..c560bc112 100644 --- a/rustbook-en/src/ch13-03-improving-our-io-project.md +++ b/rustbook-en/src/ch13-03-improving-our-io-project.md @@ -116,7 +116,7 @@ value we want to put in the `query` field of `Config`. If `next` returns a not enough arguments were given and we return early with an `Err` value. We do the same thing for the `file_path` value. -### Making Code Clearer with Iterator Adaptors +### Making Code Clearer with Iterator Adapters We can also take advantage of iterators in the `search` function in our I/O project, which is reproduced here in Listing 13-21 as it was in Listing 12-19: @@ -129,14 +129,14 @@ project, which is reproduced here in Listing 13-21 as it was in Listing 12-19: -We can write this code in a more concise way using iterator adaptor methods. +We can write this code in a more concise way using iterator adapter methods. Doing so also lets us avoid having a mutable intermediate `results` vector. The functional programming style prefers to minimize the amount of mutable state to make code clearer. Removing the mutable state might enable a future enhancement to make searching happen in parallel, because we wouldn’t have to manage concurrent access to the `results` vector. Listing 13-22 shows this change: -+ ```rust,ignore {{#rustdoc_include ../listings/ch13-functional-features/listing-13-22/src/lib.rs:here}} @@ -146,7 +146,7 @@ concurrent access to the `results` vector. Listing 13-22 shows this change: Recall that the purpose of the `search` function is to return all lines in `contents` that contain the `query`. Similar to the `filter` example in Listing -13-16, this code uses the `filter` adaptor to keep only the lines that +13-16, this code uses the `filter` adapter to keep only the lines that `line.contains(query)` returns `true` for. We then collect the matching lines into another vector with `collect`. Much simpler! Feel free to make the same change to use iterator methods in the `search_case_insensitive` function as @@ -158,7 +158,7 @@ The next logical question is which style you should choose in your own code and why: the original implementation in Listing 13-21 or the version using iterators in Listing 13-22. Most Rust programmers prefer to use the iterator style. It’s a bit tougher to get the hang of at first, but once you get a feel -for the various iterator adaptors and what they do, iterators can be easier to +for the various iterator adapters and what they do, iterators can be easier to understand. Instead of fiddling with the various bits of looping and building new vectors, the code focuses on the high-level objective of the loop. This abstracts away some of the commonplace code so it’s easier to see the concepts diff --git a/rustbook-en/src/ch13-04-performance.md b/rustbook-en/src/ch13-04-performance.md index 5d09bf294..0dbc7420a 100644 --- a/rustbook-en/src/ch13-04-performance.md +++ b/rustbook-en/src/ch13-04-performance.md @@ -65,7 +65,7 @@ multiply the values together, sum all the results, and shift the bits in the sum `qlp_shift` bits to the right. Calculations in applications like audio decoders often prioritize performance -most highly. Here, we’re creating an iterator, using two adaptors, and then +most highly. Here, we’re creating an iterator, using two adapters, and then consuming the value. What assembly code would this Rust code compile to? Well, as of this writing, it compiles down to the same assembly you’d write by hand. There’s no loop at all corresponding to the iteration over the values in diff --git a/rustbook-en/src/ch20-01-single-threaded.md b/rustbook-en/src/ch20-01-single-threaded.md index 9e7fe865b..b474d926f 100644 --- a/rustbook-en/src/ch20-01-single-threaded.md +++ b/rustbook-en/src/ch20-01-single-threaded.md @@ -143,8 +143,8 @@ connection, we now call the new `handle_connection` function and pass the `stream` to it. In the `handle_connection` function, we create a new `BufReader` instance that -wraps a mutable reference to the `stream`. `BufReader` adds buffering by -managing calls to the `std::io::Read` trait methods for us. +wraps a reference to the `stream`. `BufReader` adds buffering by managing calls +to the `std::io::Read` trait methods for us. We create a variable named `http_request` to collect the lines of the request the browser sends to our server. We indicate that we want to collect these diff --git a/rustbook-en/src/img/trpl04-05.svg b/rustbook-en/src/img/trpl04-05.svg index b4bf2ebee..f3c6e8a82 100644 --- a/rustbook-en/src/img/trpl04-05.svg +++ b/rustbook-en/src/img/trpl04-05.svg @@ -1,87 +1,95 @@ - - + - -%3 - - - -table0 - -s - -name - -value - -ptr - - - - -table1 - -s1 - -name - -value - -ptr - - -len - -5 - -capacity - -5 + viewBox="0.00 0.00 1038.00 1342.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + + + +cluster_heap - - -table0:c->table1:borrowee - - + + +s + +s + +name + +value + +ptr + + +len + +4 + +capacity + +4 - + -table2 - -index - -value - -0 - -h - -1 - -e - -2 - -l - -3 - -l - -4 - -o +ahoy + +index + +value + +0 + +a + +1 + +h + +2 + +o + +3 + +y - + -table1:c->table2:pointee - - +s:c->ahoy:pointee + + + + + +hello + + +index + +value + +0 + +h + +1 + +e + +2 + +l + +3 + +l + +4 + +o diff --git a/rustbook-en/src/img/trpl04-06.svg b/rustbook-en/src/img/trpl04-06.svg index e64415fe4..b4bf2ebee 100644 --- a/rustbook-en/src/img/trpl04-06.svg +++ b/rustbook-en/src/img/trpl04-06.svg @@ -5,111 +5,83 @@ --> - + viewBox="0.00 0.00 1500.00 650.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + %3 - + table0 - -world - -name - -value - -ptr - - -len - -5 + +s + +name + +value + +ptr + - - -table4 - -index - -value - -0 - -h - -1 - -e - -2 - -l - -3 - -l - -4 - -o - -5 - - - -6 - -w - -7 - -o - -8 - -r - -9 - -l - -10 - -d - - - -table0:c->table4:pointee2 - - - - + -table3 - -s - -name - -value - -ptr - - -len - -11 - -capacity - -11 +table1 + +s1 + +name + +value + +ptr + + +len + +5 + +capacity + +5 - + -table3:c->table4:pointee - - +table0:c->table1:borrowee + + + + + +table2 + +index + +value + +0 + +h + +1 + +e + +2 + +l + +3 + +l + +4 + +o + + + +table1:c->table2:pointee + + diff --git a/rustbook-en/src/img/trpl04-07.svg b/rustbook-en/src/img/trpl04-07.svg new file mode 100644 index 000000000..e64415fe4 --- /dev/null +++ b/rustbook-en/src/img/trpl04-07.svg @@ -0,0 +1,115 @@ + + + + + + +%3 + + + +table0 + +world + +name + +value + +ptr + + +len + +5 + + + +table4 + +index + +value + +0 + +h + +1 + +e + +2 + +l + +3 + +l + +4 + +o + +5 + + + +6 + +w + +7 + +o + +8 + +r + +9 + +l + +10 + +d + + + +table0:c->table4:pointee2 + + + + + +table3 + +s + +name + +value + +ptr + + +len + +11 + +capacity + +11 + + + +table3:c->table4:pointee + + + + + diff --git a/rustbook-en/src/title-page.md b/rustbook-en/src/title-page.md index dee3c84cb..613de0ddd 100644 --- a/rustbook-en/src/title-page.md +++ b/rustbook-en/src/title-page.md @@ -2,7 +2,7 @@ *by Steve Klabnik and Carol Nichols, with contributions from the Rust Community* -This version of the text assumes you’re using Rust 1.79.0 (released 2024-06-13) +This version of the text assumes you’re using Rust 1.81.0 (released 2024-09-04) or later. See the [“Installation” section of Chapter 1][install] to install or update Rust. diff --git a/rustbook-ru/ADMIN_TASKS.md b/rustbook-ru/ADMIN_TASKS.md new file mode 100644 index 000000000..9caff3004 --- /dev/null +++ b/rustbook-ru/ADMIN_TASKS.md @@ -0,0 +1,145 @@ +# Administrative Tasks + +This documentation is for anyone managing the repo to remember how to do +occasional maintenance tasks. + +## Update the `rustc` version + +- Delete your `target` directory, you're about to recompile everything anyway +- Change the version number in `.github/workflows/main.yml` +- Change the version number in `rust-toolchain`, which should change the + version you're using locally with `rustup` +- Change the version number in `src/title-page.md` +- Run `./tools/update-rustc.sh` (see its commented code for details on what it + does) +- Inspect the changes (by looking at the files changed according to git) and + their effects (by looking at the files in `tmp/book-before` and + `tmp/book-after`) and commit them if they look good +- Grep for `manual-regeneration` and follow the instructions in those places to + update output that cannot be generated by a script + +## Update the `edition` in all listings + +To update the `edition = "[year]"` metadata in all the listings' `Cargo.toml`s, +run the `./tools/update-editions.sh` script and commit the changes. + +## Release a new version of the listings + +We now make `.tar` files of complete projects containing every listing +available [as GitHub Releases](https://github.com/rust-lang/book/releases). To +create a new release artifact, for example if there have been code changes due +to edits or due to updating Rust and `rustfmt`, do the following: + +- Create a git tag for the release and push it to GitHub, or create a new tag + by going to the GitHub UI, [drafting a new + release](https://github.com/rust-lang/book/releases/new), and entering a new + tag instead of selecting an existing tag +- Run `cargo run --bin release_listings`, which will generate + `tmp/listings.tar.gz` +- Upload `tmp/listings.tar.gz` in the GitHub UI for the draft release +- Publish the release + +## Add a new listing + +To facilitate the scripts that run `rustfmt` on all the listings, update the +output when the compiler is updated, and produce release artifacts containing +full projects for the listings, any listing beyond the most trivial should be +extracted into a file. To do that: + +- Find where the new listing should go in the `listings` directory. + - There is one subdirectory for each chapter + - Numbered listings should use `listing-[chapter num]-[listing num]` for + their directory names. + - Listings without a number should start with `no-listing-` followed by a + number that indicates its position in the chapter relative to the other + listings without numbers in the chapter, then a short description that + someone could read to find the code they're looking for. + - Listings used only for displaying the output of the code (for example, when + we say "if we had written x instead of y, we would get this compiler + error:" but we don't actually show code x) should be named with + `output-only-` followed by a number that indicates its position in the + chapter relative to the other listings used only for output, then a short + description that authors or contributors could read to find the code + they're looking for. + - **Remember to adjust surrounding listing numbers as appropriate!** +- Create a full Cargo project in that directory, either by using `cargo new` or + copying another listing as a starting point. +- Add the code and any surrounding code needed to create a full working example. +- If you only want to show part of the code in the file, use anchor comments + (`// ANCHOR: some_tag` and `// ANCHOR_END: some_tag`) to mark the parts of + the file you want to show. +- For Rust code, use the `{{#rustdoc_include [filename:some_tag]}}` directive + within the code blocks in the text. The `rustdoc_include` directive gives the + code that doesn't get displayed to `rustdoc` for `mdbook test` purposes. +- For anything else, use the `{{#include [filename:some_tag]}}` directive. +- If you want to display the output of a command in the text as well, create an + `output.txt` file in the listing's directory as follows: + - Run the command, like `cargo run` or `cargo test`, and copy all of the + output. + - Create a new `output.txt` file with the first line `$ [the command you + ran]`. + - Paste the output you just copied. + - Run `./tools/update-rustc.sh`, which should perform some normalization on + the compiler output. + - Include the output in the text with the `{{#include [filename]}}` directive. + - Add and commit output.txt. +- If you want to display output but for some reason it can't be generated by a + script (say, because of user input or external events like making a web + request), keep the output inline but make a comment that contains + `manual-regeneration` and instructions for manually updating the inline + output. +- If you don't want this example to even be attempted to be formatted by + `rustfmt` (for example because the example doesn't parse on purpose), add a + `rustfmt-ignore` file in the listing's directory and the reason it's not + being formatted as the contents of that file (in case it's a rustfmt bug that + might get fixed someday). + +## See the effect of some change on the rendered book + +To check, say, updating `mdbook` or changing the way files get included: + +- Generate a built book before the change you want to test by running `mdbook + build -d tmp/book-before` +- Apply the changes you want to test and run `mdbook build -d tmp/book-after` +- Run `./tools/megadiff.sh` +- Files remaining in `tmp/book-before` and `tmp/book-after` have differences + you can manually inspect with your favorite diff viewing mechanism + +## Produce new markdown files for No Starch + +- Run `./tools/nostarch.sh` +- Spot check the files that script created in the `nostarch` directory +- Check them into git if you're starting a round of edits + +## Produce markdown from docx for diffing + +- Save the docx file to `tmp/chapterXX.docx`. +- In Word, go to the review tab, choose "Accept all changes and stop tracking" +- Save the docx again and close Word +- Run `./tools/doc-to-md.sh` +- This should write `nostarch/chapterXX.md`. Adjust the XSL in + `tools/doc-to-md.xsl` and run `./tools/doc-to-md.sh` again if needed. + +## Generate Graphviz dot + +We're using [Graphviz](http://graphviz.org/) for some of the diagrams in the +book. The source for those files live in the `dot` directory. To turn a `dot` +file, for example, `dot/trpl04-01.dot` into an `svg`, run: + +```bash +$ dot dot/trpl04-01.dot -Tsvg > src/img/trpl04-01.svg +``` + +In the generated SVG, remove the width and the height attributes from the `svg` +element and set the `viewBox` attribute to `0.00 0.00 1000.00 1000.00` or other +values that don't cut off the image. + +## Publish a preview to GitHub Pages + +We sometimes publish to GitHub Pages for in-progress previews. The recommended +flow for publishing is: + +- Install the `ghp-import` tool by running `pip install ghp-import` (or `pipx install ghp-import`, using [pipx][pipx]). +- In the root, run `tools/generate-preview.sh` + +[pipx]: https://pipx.pypa.io/stable/#install-pipx diff --git a/rustbook-ru/CONTRIBUTING.md b/rustbook-ru/CONTRIBUTING.md new file mode 100644 index 000000000..a20cb5850 --- /dev/null +++ b/rustbook-ru/CONTRIBUTING.md @@ -0,0 +1,73 @@ +# Contributing + +We'd love your help! Thanks for caring about the book. + +## Where to Edit + +All edits should be made in the `src` directory. + +The `nostarch` directory contains snapshots for sending edits to the publishers +of the print version. The snapshot files reflect what has been sent or not, so +they only get updated when edits are sent to No Starch. **Do not submit pull +requests changing files in the `nostarch` directory, they will be closed.** + +## Checking for Fixes + +The book rides the Rust release trains. Therefore, if you see a problem on +https://doc.rust-lang.org/stable/book, it may already be fixed on the `main` +branch in this repo, but the fix hasn't gone through nightly -> beta -> stable +yet. Please check the `main` branch in this repo before reporting an issue. + +Looking at the history for a particular file can also give more information on +how or whether an issue has been fixed or not if you're trying to figure that +out. + +Please also search open and closed issues and open and closed PRs before +reporting a new issue or opening a new PR. + +## Licensing + +This repository is under the same license as Rust itself, MIT/Apache2. You +can find the full text of each license in the `LICENSE-*` files in this +repository. + +## Code of Conduct + +The Rust project has [a code of conduct](http://rust-lang.org/policies/code-of-conduct) +that governs all sub-projects, including this one. Please respect it! + +## Expectations + +Because the book is [printed][nostarch], and because we want +to keep the online version of the book close to the print version when +possible, it may take longer than you're used to for us to address your issue +or pull request. + +[nostarch]: https://nostarch.com/rust-programming-language-2nd-edition + +So far, we've been doing a larger revision to coincide with [Rust +Editions](https://doc.rust-lang.org/edition-guide/). Between those larger +revisions, we will only be correcting errors. If your issue or pull request +isn't strictly fixing an error, it might sit until the next time that we're +working on a large revision: expect on the order of months or years. Thank you +for your patience! + +## Help wanted + +If you're looking for ways to help that don't involve large amounts of +reading or writing, check out the [open issues with the E-help-wanted +label][help-wanted]. These might be small fixes to the text, Rust code, +frontend code, or shell scripts that would help us be more efficient or +enhance the book in some way! + +[help-wanted]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3AE-help-wanted + +## Translations + +We'd love help translating the book! See the [Translations] label to join in +efforts that are currently in progress. Open a new issue to start working on +a new language! We're waiting on [mdbook support] for multiple languages +before we merge any in, but feel free to start! + +[Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations +[mdbook support]: https://github.com/rust-lang/mdBook/issues/5 diff --git a/rustbook-ru/Cargo.lock b/rustbook-ru/Cargo.lock new file mode 100644 index 000000000..d54e8284e --- /dev/null +++ b/rustbook-ru/Cargo.lock @@ -0,0 +1,392 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "docopt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f3f119846c823f9eafcf953a8f6ffb6ed69bf6240883261a7f13b634579a51f" +dependencies = [ + "lazy_static", + "regex", + "serde", + "strsim", +] + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys", +] + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "proc-macro2" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rust-book-tools" +version = "0.0.1" +dependencies = [ + "docopt", + "flate2", + "lazy_static", + "regex", + "serde", + "tar", + "walkdir", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] diff --git a/rustbook-ru/Cargo.toml b/rustbook-ru/Cargo.toml new file mode 100644 index 000000000..2bddb66f9 --- /dev/null +++ b/rustbook-ru/Cargo.toml @@ -0,0 +1,25 @@ +[workspace] +members = ["packages/tools"] +default-members = ["packages/tools"] +resolver = "2" +exclude = [ + "linkchecker", # linkchecker is part of the CI workflow + "listings", # these are intentionally distinct from the workspace + "tmp", # listings are built here when updating output via tools/update-rustc.sh + + # These are used as path dependencies in `rust-lang/rust` (since we are not + # publishing them to crates.io), so they cannot be part of this workspace, + # because path dependencies do not get built as a crate within the hosting + # workspace. + "packages/mdbook-trpl-listing", + "packages/mdbook-trpl-note", +] + +[workspace.dependencies] +walkdir = "2.3.1" +docopt = "1.1.0" +serde = "1.0" +regex = "1.3.3" +lazy_static = "1.4.0" +flate2 = "1.0.13" +tar = "0.4.26" diff --git a/rustbook-ru/LICENSE-APACHE b/rustbook-ru/LICENSE-APACHE new file mode 100644 index 000000000..38634daab --- /dev/null +++ b/rustbook-ru/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2010 The Rust Project Developers + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/rustbook-ru/LICENSE-MIT b/rustbook-ru/LICENSE-MIT new file mode 100644 index 000000000..25597d583 --- /dev/null +++ b/rustbook-ru/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2010 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/rustbook-ru/README.md b/rustbook-ru/README.md index 211819262..889f00abd 100644 --- a/rustbook-ru/README.md +++ b/rustbook-ru/README.md @@ -1,37 +1,46 @@ -# Язык программирования Rust +# Язык программирования Ржавчина -Данный репозиторий содержит перевод второго издания “Язык программирования Rust”. +Данное хранилище содержит перевод второго издания “Язык программирования Ржавчина”. -Второе издание - это переработанная книга "The Rust Programming Language", которая будет напечатана издательством "No Starch Press" ориентировочно в мае 2018 года. Последнюю информацию о дате выхода книги и о способе ее заказа вы можете узнать на официальном сайте издательства [No Starch Press][nostarch]. +Второе издание - это переработанная книга "The Ржавчина язык программирования", которая будет напечатана издательством "No Starch Press" примерно в мае 2018 года. Последнюю сведения о дате выхода книги и о способе ее заказа вы можете узнать на сайте самого издательства [No Starch Press][nostarch]. [nostarch]: https://nostarch.com/rust -Книгу можно [читать онлайн](https://rustycrate.ru/book). +Книгу можно [Прочесть в сети](https://rustycrate.ru/book). -Оригинал книги вы можете прочесть [онлайн][html]; несколько последних глав еще не закончены, но готовая часть книги заметно улучшена по сравнению с первым изданием. Авторы оригинальной книги рекомендуют начать чтение со второго издания. +Подлинник книги вы можете прочесть [в сети][html]; несколько последних глав еще не закончены, но готовая часть книги заметно улучшена по сравнению с первым изданием. Составители изначальной книги советуют начать чтение со второго издания. [html]: http://rust-lang.github.io/book/ ## Требования -Для сборки книги требуется [mdBook] >= v0.0.13. Для установки выполните команду: +Сборка книги требует библиотеку [mdBook], лучше всего - когда это будет то же исполнение, которое +rust-lang/rust использует [этом файле][rust-mdbook]. Чтобы получить её: -[mdBook]: https://github.com/rust-lang-nursery/mdBook/ +[mdBook]: https://github.com/rust-lang/mdBook +[rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml ```bash -$ cargo install mdbook +$ cargo install mdbook --locked --version +``` + +Книга также использует два расширения mdbook, которые являются частью этого репозитория. Если вы их не установите, вы увидите предупреждения при сборке, и вывод будет выглядеть неправильно и искаженно, но вы *все равно* сможете собрать книгу. Чтобы использовать расширения,вы должны запустить: + +```bash +$ cargo install --locked --path packages/mdbook-trpl-listing +$ cargo install --locked --path packages/mdbook-trpl-note ``` ## Сборка -Для того, чтобы скомпилировать книгу, перейдите в нужный каталог с помощью команды cd - first-edition для первого, либо second-edition для второго издания. -Далее введите следующую команду: +Для того, чтобы собрать книгу, перейдите в нужную папку с помощью приказов cd - first-edition для первого, либо second-edition для второго издания. +Далее введите следующий приказ: ```bash $ mdbook build ``` -Результаты выполнения команды появятся в подкаталоге `book`. Для проверки откройте книгу в браузере. +Итогом сборки книги будет являться созданная подпапка `book`и все ее содержимое. Для проверки откройте книгу в любом обозревателе. _Firefox:_ ```bash @@ -49,7 +58,7 @@ $ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell) $ start chrome.exe .\book\index.html # Windows (Cmd) ``` -Для запуска тестов: +Для запуска проверок: ```bash $ mdbook test @@ -67,20 +76,20 @@ $ mdbook test [![ruRust/rust_book_ru](http://issuestats.com/github/ruRust/rust_book_ru/badge/issue?style=flat)](http://issuestats.com/github/ruRust/rust_book_ru) -# Соавторам +# Сосоставителям ## С чего начать -При желании помочь с переводом пишите в группу, указанную выше. Вам ответят на любые вопросы по теме. -Нам особенно интересна помощь именно со вторым изданием! +При желании помочь с переводом - для этого пишите в объединение, указанное выше. Вам ответят на любые вопросы по теме. +Нам особенно важна помощь именно со вторым изданием! Не бойтесь code review, у нас не принято наезжать на новичков. :smile: ## Для опытных [Правила перевода](https://github.com/ruRust/rust_book_ru/wiki/Правила). -## Ресурсы -* первое издание rustbook расположено [здесь][original] +## Источники +* первое издание пособия по Ржавчине расположено [здесь][original] * перевод первого издания расположен [здесь][rustbook] [rustbook]: http://ruRust.github.io/rust_book_ru diff --git a/rustbook-ru/TODO.md b/rustbook-ru/TODO.md new file mode 100644 index 000000000..b61f85314 --- /dev/null +++ b/rustbook-ru/TODO.md @@ -0,0 +1,17 @@ +# In each chapter + +- [ ] Manual regeneration +- [ ] Check for upstream changes from last snapshot +- [ ] Propagate updated output to docx +- [ ] Extract docx and check diff +- [ ] Answer all comments +- [ ] Check cross references +- [ ] Check indentation of --snip-- +- [ ] Numbered lines, Gray out unchanged lines +- [ ] Check line wrapping +- [ ] Check for unneeded command/compiling/running output +- [ ] Check println style and error messages +- [ ] Add alt text to images +- [ ] Index tags + - [ ] search for "convention" conventions:naming:of blah + - [ ] check for double spaces, spaces at the end of paragraphs diff --git a/rustbook-ru/book.toml b/rustbook-ru/book.toml index 2fd9c8267..66bff6d23 100644 --- a/rustbook-ru/book.toml +++ b/rustbook-ru/book.toml @@ -1,8 +1,20 @@ +# Sync any changes to this *other than where explicitly specified* with the copy +# in `nostarch/book.toml`! + [book] -title = "Язык программирования Rust" -author = "Стив Клабник, Кэрол Николс и другие участники сообщества Rust" -language = "ru-RU" +title = "Язык программирования Ржавчина" +authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"] [output.html] -additional-css = ["ferris.css", "theme/2018-edition.css"] +additional-css = ["ferris.css", "theme/2018-edition.css", "theme/semantic-notes.css", "theme/listing.css"] additional-js = ["ferris.js"] +git-repository-url = "https://github.com/rust-lang/book" + +# Do not sync this preprocessor; it is for the HTML renderer only. +[preprocessor.trpl-note] + +[preprocessor.trpl-listing] +output-mode = "default" + +[rust] +edition = "2021" diff --git a/rustbook-ru/ci/dictionary.txt b/rustbook-ru/ci/dictionary.txt new file mode 100644 index 000000000..6329ed123 --- /dev/null +++ b/rustbook-ru/ci/dictionary.txt @@ -0,0 +1,590 @@ +personal_ws-1.1 en 0 utf-8 +abcabcabc +abcd +abcdefghijklmnopqrstuvwxyz +adaptor +adaptors +AddAssign +Addr +adfb +afdc +aggregator +AGraph +aliasability +alignof +alloc +allocator +AlwaysEqual +Amir +anotherusername +APIs +app's +aren +args +ArgumentV +associativity +async +atomics +attr +autocompletion +AveragedCollection +backend +backported +backtrace +backtraces +BACKTRACE +Backtraces +Baz's +beefeb +benchmarking +bioinformatics +bitand +BitAnd +BitAndAssign +bitor +BitOr +BitOrAssign +bitwise +Bitwise +bitxor +BitXor +BitXorAssign +Bjarne +Boehm +bool +boolean +Boolean +Booleans +Bors +BorrowMutError +BoxMeUp +BTreeSet +BufRead +BufReader +BuildHasher +Cacher +cacher +Cagain +callsite +CamelCase +cargodoc +centric +chacha +ChangeColor +ChangeColorMessage +charset +choo +chXX +chYY +clippy +clippy's +cmdlet +coercions +combinator +ConcreteType +config +Config +confignew +const +consts +constant's +copyeditor +couldn +CPUs +cratesio +CRLF +cryptocurrencies +cryptographic +cryptographically +CStr +CString +ctrl +Ctrl +customizable +CustomSmartPointer +CustomSmartPointers +data's +DataStruct +deallocate +deallocated +deallocating +deallocation +debuginfo +decl +decrementing +deduplicate +deduplicating +deps +deref +Deref +dereference +Dereference +dereferenced +dereferences +dereferencing +DerefMut +DeriveInput +Dest +destructor +destructure +destructured +destructures +destructuring +Destructuring +deterministically +DevOps +devtools +didn +Dobrý +doccargo +doccratesio +DOCTYPE +doesn +disambiguating +DisplayBacktrace +DivAssign +DraftPost +DSTs +ebook +ebooks +Edsger +egular +else's +emoji +encodings +enum +Enum +enums +enum's +Enums +eprintln +Erlang +ErrorKind +eval +executables +ExitCode +expr +extern +favicon +ferris +FFFD +FFFF +figcaption +fieldname +filename +Filename +filesystem +Filesystem +filesystem's +filesystems +filmmaking +Firefox +FnMut +FnOnce +formatter +formatters +FrenchToast +FromIterator +FromResidual +frontend +getrandom +getter +getters +GGraph +GitHub +gitignore +grapheme +Grapheme +growable +gzip +hardcode +hardcoded +hardcoding +hasher +hashers +HashMap +HashSet +Haskell +hasn +HeadB +HeadC +HelloMacro +helloworld +HelloWorld +HelloWorldName +Hmmm +Hoare +Hola +homogenous +html +http +https +hyperoptimize +hypotheticals +Iceburgh +ident +IDE +IDEs +IDE's +IEEE +impl +implementor +implementors +ImportantExcerpt +incrementing +IndexMut +indices +init +initializer +initializers +inline +instantiation +internet +interoperate +IntoIterator +InvalidDigit +invariants +ioerror +iokind +ioresult +IoResult +iostdin +IpAddr +IpAddrKind +irst +isize +iter +iterator's +JavaScript +JoinHandle +Kay's +kinded +Klabnik +lang +LastWriteTime +latin +liballoc +libc +libcollections +libcore +libpanic +librarys +libreoffice +libstd +libunwind +lifecycle +LimitTracker +linter +LLVM +lobally +locators +LockResult +login +lookup +loopback +lossy +Lukas +lval +macOS +Matsakis +mathematic +memoization +metadata +Metadata +metaprogramming +mibbit +Mibbit +millis +minigrep +mixup +mkdir +MockMessenger +modifiability +modularity +monomorphization +Monomorphization +monomorphized +MoveMessage +Mozilla +mpsc +msvc +MulAssign +multibyte +multithreaded +mutex +mutex's +Mutex +mutexes +Mutexes +MutexGuard +mutext +MyBox +myprogram +namespace +namespaced +namespaces +namespacing +natively +newfound +NewJob +NewsArticle +NewThread +newtype +newtypes +nitty +nocapture +nomicon +nonadministrators +nondeterministic +nonequality +nongeneric +noplayground +NotFound +nsprust +null's +OCaml +offsetof +online +OpenGL +optimizations +OptionalFloatingPointNumber +OptionalNumber +OsStr +OsString +other's +otherinstall +OtherError +OurError +OutlinePrint +overloadable +overread +PanicPayload +param +parameterize +ParseIntError +PartialEq +PartialOrd +pbcopy +PendingReview +PendingReviewPost +PlaceholderType +polymorphism +PoolCreationError +portia +powershell +PowerShell +powi +preallocate +preallocates +preprocessing +Preprocessing +preprocessor +PrimaryColor +println +priv +proc +proto +pseudocode +pthreads +pushups +QuitMessage +quux +RAII +randcrate +RangeFrom +RangeTo +RangeFull +README +READMEs +rect +recurse +recv +redeclaring +Refactoring +refactor +refactoring +refcell +RefCell +refcellt +RefMut +reformats +refutability +reimplement +RemAssign +repr +representable +request's +resizes +resizing +ReturnedError +retweet +rewordings +rint +ripgrep +runnable +runtime +runtimes +Rustacean +Rustaceans +rUsT +rustc +rustdoc +RUSTFLAGS +Rustonomicon +rustfix +rustfmt +rustup +sampleproject +screenshot +searchstring +SecondaryColor +SelectBox +semver +SemVer +serde +ShirtColor +ShlAssign +ShrAssign +shouldn +Simula +siphash +SipHash +situps +sizeof +SliceIndex +Smalltalk +snuck +someproject +someusername +SPDX +spdx +SpreadsheetCell +sqrt +stackoverflow +startup +StaticRef +stderr +stdin +Stdin +stdlib +stdout +steveklabnik's +stringify +Stroustrup +Stroustrup's +struct +Struct +structs +struct's +Structs +StrWrap +SubAssign +subclasses +subcommand +subcommands +subdirectories +subdirectory +submodule +submodules +Submodules +submodule’s +suboptimal +subpath +subslices +substring +subteams +subtree +subtyping +summarizable +supertrait +supertraits +TcpListener +TcpStream +templating +test's +TextField +That'd +there'd +ThreadPool +threadpool +timestamp +Tiếng +timeline +tlborm +tlsv +TODO +TokenStream +toml +TOML +toolchain +toolchains +ToString +tradeoff +tradeoffs +TrafficLight +transcoding +trpl +tuesday +tuple +tuples +turbofish +Turon +typeof +TypeName +UFCS +unary +Unary +uncomment +Uncomment +uncommenting +unevaluated +Uninstalling +uninstall +unittests +unix +unpopulated +unoptimized +UnsafeCell +unsafety +unsized +unsynchronized +Unyank +UpperCamelCase +URIs +UsefulType +username +USERPROFILE +usize +UsState +utils +vals +variable's +variant's +vers +versa +vert +Versioning +visualstudio +Vlissides +vscode +vtable +waitlist +wasn +weakt +WeatherForecast +WebSocket +whitespace +wildcard +wildcards +Wirth +workflow +workspace +workspaces +Workspaces +wouldn +writeln +WriteMessage +xcode +xpression +yyyy +ZipImpl diff --git a/rustbook-ru/ci/spellcheck.sh b/rustbook-ru/ci/spellcheck.sh new file mode 100644 index 000000000..3d61e76a5 --- /dev/null +++ b/rustbook-ru/ci/spellcheck.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +set -eu + +aspell --version + +# Checks project Markdown files for spelling mistakes. + +# Notes: + +# This script needs dictionary file ($dict_filename) with project-specific +# valid words. If this file is missing, first invocation of a script generates +# a file of words considered typos at the moment. User should remove real typos +# from this file and leave only valid words. When script generates false +# positive after source modification, new valid word should be added +# to dictionary file. + +# Default mode of this script is interactive. Each source file is scanned for +# typos. aspell opens window, suggesting fixes for each found typo. Original +# files with errors will be backed up to files with format "filename.md.bak". + +# When running in CI, this script should be run in "list" mode (pass "list" +# as first argument). In this mode script scans all files and reports found +# errors. Exit code in this case depends on scan result: +# 1 if any errors found, +# 0 if all is clear. + +# Script skips words with length less than or equal to 3. This helps to avoid +# some false positives. + +# We can consider skipping source code in markdown files (```code```) to reduce +# rate of false positives, but then we lose ability to detect typos in code +# comments/strings etc. + +shopt -s nullglob + +dict_filename=./ci/dictionary.txt +markdown_sources=(./src/*.md) +mode="check" + +# aspell repeatedly modifies the personal dictionary for some reason, +# so we should use a copy of our dictionary. +dict_path="/tmp/dictionary.txt" + +if [[ "$1" == "list" ]]; then + mode="list" +fi + +# Error if running in list (CI) mode and there isn't a dictionary file; +# creating one in CI won't do any good :( +if [[ "$mode" == "list" && ! -f "$dict_filename" ]]; then + echo "No dictionary file found! A dictionary file is required in CI!" + exit 1 +fi + +if [[ ! -f "$dict_filename" ]]; then + # Pre-check mode: generates dictionary of words aspell consider typos. + # After user validates that this file contains only valid words, we can + # look for typos using this dictionary and some default aspell dictionary. + echo "Scanning files to generate dictionary file '$dict_filename'." + echo "Please check that it doesn't contain any misspellings." + + echo "personal_ws-1.1 en 0 utf-8" > "$dict_filename" + cat "${markdown_sources[@]}" | aspell --ignore 3 list | sort -u >> "$dict_filename" +elif [[ "$mode" == "list" ]]; then + # List (default) mode: scan all files, report errors. + declare -i retval=0 + + cp "$dict_filename" "$dict_path" + + if [ ! -f $dict_path ]; then + retval=1 + exit "$retval" + fi + + for fname in "${markdown_sources[@]}"; do + command=$(aspell --ignore 3 --personal="$dict_path" "$mode" < "$fname") + if [[ -n "$command" ]]; then + for error in $command; do + # FIXME: find more correct way to get line number + # (ideally from aspell). Now it can make some false positives, + # because it is just a grep. + grep --with-filename --line-number --color=always "$error" "$fname" + done + retval=1 + fi + done + exit "$retval" +elif [[ "$mode" == "check" ]]; then + # Interactive mode: fix typos. + cp "$dict_filename" "$dict_path" + + if [ ! -f $dict_path ]; then + retval=1 + exit "$retval" + fi + + for fname in "${markdown_sources[@]}"; do + aspell --ignore 3 --dont-backup --personal="$dict_path" "$mode" "$fname" + done +fi diff --git a/rustbook-ru/ci/validate.sh b/rustbook-ru/ci/validate.sh new file mode 100644 index 000000000..9d65bc161 --- /dev/null +++ b/rustbook-ru/ci/validate.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -eu + +for file in src/*.md ; do + echo Checking references in "$file" + cargo run --quiet --bin link2print < "$file" > /dev/null +done \ No newline at end of file diff --git a/rustbook-ru/dot/trpl04-01.dot b/rustbook-ru/dot/trpl04-01.dot new file mode 100644 index 000000000..331d59133 --- /dev/null +++ b/rustbook-ru/dot/trpl04-01.dot @@ -0,0 +1,26 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + + +
s1
namevalue
ptr
len5
capacity5
>]; + table1[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + edge[tailclip="false"]; + table0:pointer:c -> table1:pointee; +} + diff --git a/rustbook-ru/dot/trpl04-02.dot b/rustbook-ru/dot/trpl04-02.dot new file mode 100644 index 000000000..e46d2ed4a --- /dev/null +++ b/rustbook-ru/dot/trpl04-02.dot @@ -0,0 +1,35 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + + +
s1
namevalue
ptr
len5
capacity5
>]; + table3[label=< + + + + + +
s2
namevalue
ptr
len5
capacity5
>]; + + table1[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + edge[tailclip="false"]; + table0:pointer:c -> table1:pointee; + table3:pointer:c -> table1:pointee; +} + diff --git a/rustbook-ru/dot/trpl04-03.dot b/rustbook-ru/dot/trpl04-03.dot new file mode 100644 index 000000000..16c0b2860 --- /dev/null +++ b/rustbook-ru/dot/trpl04-03.dot @@ -0,0 +1,44 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + + +
s2
namevalue
ptr
len5
capacity5
>]; + table1[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + table3[label=< + + + + + +
s1
namevalue
ptr
len5
capacity5
>]; + table4[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + + edge[tailclip="false"]; + table0:pointer:c -> table1:pointee; + table3:pointer:c -> table4:pointee; +} + diff --git a/rustbook-ru/dot/trpl04-04.dot b/rustbook-ru/dot/trpl04-04.dot new file mode 100644 index 000000000..1c95c231c --- /dev/null +++ b/rustbook-ru/dot/trpl04-04.dot @@ -0,0 +1,35 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + + +
s1
namevalue
ptr
len5
capacity5
>]; + table3[label=< + + + + + +
s2
namevalue
ptr
len5
capacity5
>]; + + table1[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + edge[tailclip="false"]; + table0:pointer:c -> table1:pointee; + table3:pointer:c -> table1:pointee; +} + diff --git a/rustbook-ru/dot/trpl04-05.dot b/rustbook-ru/dot/trpl04-05.dot new file mode 100644 index 000000000..ca1f7e06e --- /dev/null +++ b/rustbook-ru/dot/trpl04-05.dot @@ -0,0 +1,32 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + +
s
namevalue
ptr
>]; + table1[label=< + + + + + +
s1
namevalue
ptr
len5
capacity5
>]; + table2[label=< + + + + + + +
indexvalue
0h
1e
2l
3l
4o
>]; + + edge[tailclip="false"]; + table1:pointer:c -> table2:pointee; + table0:borrower:c -> table1:borrowee; +} + diff --git a/rustbook-ru/dot/trpl04-06.dot b/rustbook-ru/dot/trpl04-06.dot new file mode 100644 index 000000000..a23f179a7 --- /dev/null +++ b/rustbook-ru/dot/trpl04-06.dot @@ -0,0 +1,41 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + + +
world
namevalue
ptr
len5
>]; + + table3[label=< + + + + + +
s
namevalue
ptr
len11
capacity11
>]; + table4[label=< + + + + + + + + + + + + +
indexvalue
0h
1e
2l
3l
4o
5
6w
7o
8r
9l
10d
>]; + + + edge[tailclip="false"]; + table0:pointer2:c -> table4:pointee2; + table3:pointer:c -> table4:pointee; +} + diff --git a/rustbook-ru/dot/trpl15-01.dot b/rustbook-ru/dot/trpl15-01.dot new file mode 100644 index 000000000..e8b95f9a3 --- /dev/null +++ b/rustbook-ru/dot/trpl15-01.dot @@ -0,0 +1,24 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + +
Cons
i32 + + +
Cons
i32 + + +
Cons
i32 + + +
Cons
i32 + + +
Cons
i32
>]; +} + diff --git a/rustbook-ru/dot/trpl15-02.dot b/rustbook-ru/dot/trpl15-02.dot new file mode 100644 index 000000000..f7dfd22c9 --- /dev/null +++ b/rustbook-ru/dot/trpl15-02.dot @@ -0,0 +1,18 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table0[label=< + + + +
Cons
i32 + + + +
Box
usize
+
>]; +} + diff --git a/rustbook-ru/dot/trpl15-03.dot b/rustbook-ru/dot/trpl15-03.dot new file mode 100644 index 000000000..16f026814 --- /dev/null +++ b/rustbook-ru/dot/trpl15-03.dot @@ -0,0 +1,51 @@ +digraph { + rankdir=LR; + overlap=false; + dpi=300.0; + node [shape="plaintext"]; + + table4[label=< + +
b
>]; + + table5[label=< + +
3
>]; + + + table0[label=< + +
a
>]; + + table1[label=< + +
5
>]; + + table2[label=< + +
10
>]; + + table3[label=< + +
Nil
>]; + + + table6[label=< + +
c
>]; + + table7[label=< + +
4
>]; + + + edge[tailclip="false"]; + table0:ptr0:c -> table1:pte0; + table1:ptr1:c -> table2:pte1; + table2:ptr2:c -> table3:pte2; + table4:ptr4:c -> table5:pte4; + table5:ptr5:c -> table1:pte0; + table6:ptr6:c -> table7:pte6; + table7:ptr7:c -> table1:pte0; +} + diff --git a/rustbook-ru/dot/trpl15-04.dot b/rustbook-ru/dot/trpl15-04.dot new file mode 100644 index 000000000..562543cb6 --- /dev/null +++ b/rustbook-ru/dot/trpl15-04.dot @@ -0,0 +1,16 @@ +digraph { + node[shape=record]; + rankdir=LR; + + l1[label="{ 5| }"]; + l2[label="{ 10| }"]; + + {node[shape=point height=0] invisible_start invisible_end} + + a -> l1:n; + b -> l2:n; + invisible_start:n -> l1[arrowtail=none]; + invisible_start:s -> invisible_end:s[dir=none]; + l1:next:c -> l2:data; + l2:next:c -> invisible_end:n[arrowhead=none]; +} diff --git a/rustbook-ru/ferris.css b/rustbook-ru/ferris.css index 371207924..fb4a553ff 100644 --- a/rustbook-ru/ferris.css +++ b/rustbook-ru/ferris.css @@ -19,13 +19,25 @@ body.ayu .not_desired_behavior { background: #501f21; } -.ferris { +.ferris-container { position: absolute; z-index: 99; right: 5px; top: 30px; - width: 10%; - height: auto; +} + +.ferris { + vertical-align: top; + margin-left: 0.2em; + height: auto; +} + +.ferris-large { + width: 4.5em; +} + +.ferris-small { + width: 2.3em; } .ferris-explain { diff --git a/rustbook-ru/ferris.js b/rustbook-ru/ferris.js index 5e79b3c71..51e5b12a9 100644 --- a/rustbook-ru/ferris.js +++ b/rustbook-ru/ferris.js @@ -1,4 +1,11 @@ -var ferrisTypes = [ +// @ts-check + +/** + * @typedef {{ attr: string, title: string }} FerrisType + */ + +/** @type {Array} */ +const FERRIS_TYPES = [ { attr: 'does_not_compile', title: 'This code does not compile!' @@ -7,10 +14,6 @@ var ferrisTypes = [ attr: 'panics', title: 'This code panics!' }, - { - attr: 'unsafe', - title: 'This code block contains unsafe code.' - }, { attr: 'not_desired_behavior', title: 'This code does not produce the desired behavior.' @@ -18,34 +21,80 @@ var ferrisTypes = [ ] document.addEventListener('DOMContentLoaded', () => { - for (var ferrisType of ferrisTypes) { + for (let ferrisType of FERRIS_TYPES) { attachFerrises(ferrisType) } }) -function attachFerrises (type) { - var elements = document.getElementsByClassName(type.attr) +/** + * @param {FerrisType} type + */ +function attachFerrises(type) { + let elements = document.getElementsByClassName(type.attr) - for (var codeBlock of elements) { - var lines = codeBlock.textContent.split(/\r|\r\n|\n/).length - 1; + for (let codeBlock of elements) { + // Skip SVG etc.: in principle, these should never be attached to those, but + // this means if someone happens to have a browser extension which *is* + // attaching them, it will not break the code. + if (!(codeBlock instanceof HTMLElement)) { + continue + } + + let lines = codeBlock.innerText.replace(/\n$/, '').split(/\n/).length - if (lines >= 4) { - attachFerris(codeBlock, type) + /** @type {'small' | 'large'} */ + let size = lines < 4 ? 'small' : 'large' + + let container = prepareFerrisContainer(codeBlock, size == 'small') + if (!container) { + continue } + + container.appendChild(createFerris(type, size)) } } -function attachFerris (element, type) { - var a = document.createElement('a') +/** + * @param {HTMLElement} element - Code block element to attach a Ferris to. + * @param {boolean} useButtons - Whether to attach to existing buttons. + * @returns {Element | null} - The container element to use. + */ +function prepareFerrisContainer(element, useButtons) { + let foundButtons = element.parentElement?.querySelector('.buttons') + if (useButtons && foundButtons) { + return foundButtons + } + + let div = document.createElement('div') + div.classList.add('ferris-container') + + if (!element.parentElement) { + console.error(`Could not install Ferris on ${element}, which is missing a parent`); + return null; + } + + element.parentElement.insertBefore(div, element) + + return div +} + +/** + * @param {FerrisType} type + * @param {'small' | 'large'} size + * @returns {HTMLAnchorElement} - The generated anchor element. + */ +function createFerris(type, size) { + let a = document.createElement('a') a.setAttribute('href', 'ch00-00-introduction.html#ferris') a.setAttribute('target', '_blank') - var img = document.createElement('img') + let img = document.createElement('img') img.setAttribute('src', 'img/ferris/' + type.attr + '.svg') img.setAttribute('title', type.title) - img.className = 'ferris' + img.classList.add('ferris') + img.classList.add('ferris-' + size) a.appendChild(img) - element.parentElement.insertBefore(a, element) + return a } diff --git a/rustbook-ru/index.md b/rustbook-ru/index.md index 634f78c75..8a4506b64 100644 --- a/rustbook-ru/index.md +++ b/rustbook-ru/index.md @@ -1,11 +1,11 @@ -% The Rust Programming Language +% The Ржавчина язык программирования -There are two editions of "The Rust Programming Language": +There are two editions of "The Ржавчина Programming Language": * [First edition](first-edition/index.html) * [Second edition](second-edition/index.html) The second edition is a complete re-write. It is still under construction, -though it is far enough along to learn most of Rust. We suggest reading the +though it is far enough along to learn most of Ржавчина. We suggest reading the second edition and then checking out the first edition later to pick up some of the more esoteric parts of the language. diff --git a/rustbook-ru/listings b/rustbook-ru/listings deleted file mode 120000 index 35d488990..000000000 --- a/rustbook-ru/listings +++ /dev/null @@ -1 +0,0 @@ -../rustbook-en/listings \ No newline at end of file diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml new file mode 100644 index 000000000..78c94fef9 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs new file mode 100644 index 000000000..b822b89ff --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs @@ -0,0 +1,31 @@ +// ANCHOR: all +// ANCHOR: io +use std::io; +// ANCHOR_END: io + +// ANCHOR: main +fn main() { + // ANCHOR_END: main + // ANCHOR: print + println!("Guess the number!"); + + println!("Please input your guess."); + // ANCHOR_END: print + + // ANCHOR: string + let mut guess = String::new(); + // ANCHOR_END: string + + // ANCHOR: read + io::stdin() + .read_line(&mut guess) + // ANCHOR_END: read + // ANCHOR: expect + .expect("Failed to read line"); + // ANCHOR_END: expect + + // ANCHOR: print_guess + println!("You guessed: {}", guess); + // ANCHOR_END: print_guess +} +// ANCHOR: all diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock new file mode 100644 index 000000000..0fb52b33c --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs new file mode 100644 index 000000000..b35ed0f2f --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs @@ -0,0 +1,15 @@ +use std::io; + +fn main() { + println!("Guess the number!"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {guess}"); +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs new file mode 100644 index 000000000..1ba2d4d41 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs @@ -0,0 +1,28 @@ +// ANCHOR: all +use std::io; +// ANCHOR: ch07-04 +use rand::Rng; + +fn main() { + // ANCHOR_END: ch07-04 + println!("Guess the number!"); + + // ANCHOR: ch07-04 + let secret_number = rand::thread_rng().gen_range(1..=100); + // ANCHOR_END: ch07-04 + + println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {guess}"); + // ANCHOR: ch07-04 +} +// ANCHOR_END: ch07-04 +// ANCHOR_END: all diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt new file mode 100644 index 000000000..0f0bc2102 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -0,0 +1,30 @@ +$ cargo build + Downloading crates ... + Downloaded rand_core v0.6.2 + Downloaded getrandom v0.2.2 + Downloaded rand_chacha v0.3.0 + Downloaded ppv-lite86 v0.2.10 + Downloaded libc v0.2.86 + Compiling libc v0.2.86 + Compiling getrandom v0.2.2 + Compiling cfg-if v1.0.0 + Compiling ppv-lite86 v0.2.10 + Compiling rand_core v0.6.2 + Compiling rand_chacha v0.3.0 + Compiling rand v0.8.5 + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) +error[E0308]: mismatched types + --> src/main.rs:22:21 + | +22 | match guess.cmp(&secret_number) { + | --- ^^^^^^^^^^^^^^ expected `&String`, found `&{integer}` + | | + | arguments to this method are incorrect + | + = note: expected reference `&String` + found reference `&{integer}` +note: method defined here + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cmp.rs:839:8 + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `guessing_game` (bin "guessing_game") due to 1 previous error diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs new file mode 100644 index 000000000..6e58a7645 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs @@ -0,0 +1,32 @@ +// ANCHOR: here +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + // --snip-- + // ANCHOR_END: here + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + // ANCHOR: here + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs new file mode 100644 index 000000000..12f497e18 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs @@ -0,0 +1,45 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + loop { + println!("Please input your guess."); + + let mut guess = String::new(); + + // ANCHOR: here + // --snip-- + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + // ANCHOR: ch19 + let guess: u32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + // ANCHOR_END: ch19 + + println!("You guessed: {guess}"); + + // --snip-- + // ANCHOR_END: here + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + } +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs new file mode 100644 index 000000000..7fcbb99fb --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs @@ -0,0 +1,35 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + loop { + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + } +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock new file mode 100644 index 000000000..ee5d79095 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "guessing_game" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml new file mode 100644 index 000000000..78c94fef9 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt new file mode 100644 index 000000000..33409e38c --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.50s + Running `target/debug/guessing_game` +Hello, world! diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml new file mode 100644 index 000000000..78c94fef9 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt new file mode 100644 index 000000000..417d4e3cb --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt @@ -0,0 +1,17 @@ +$ cargo build + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) +warning: unused `Result` that must be used + --> src/main.rs:10:5 + | +10 | io::stdin().read_line(&mut guess); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this `Result` may be an `Err` variant, which should be handled + = note: `#[warn(unused_must_use)]` on by default +help: use `let _ = ...` to ignore the resulting value + | +10 | let _ = io::stdin().read_line(&mut guess); + | +++++++ + +warning: `guessing_game` (bin "guessing_game") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.59s diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs new file mode 100644 index 000000000..51046016f --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs @@ -0,0 +1,13 @@ +use std::io; + +fn main() { + println!("Guess the number!"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin().read_line(&mut guess); + + println!("You guessed: {guess}"); +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs new file mode 100644 index 000000000..7f076c592 --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs @@ -0,0 +1,33 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + // ANCHOR: here + // --snip-- + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = guess.trim().parse().expect("Please type a number!"); + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs new file mode 100644 index 000000000..f97d1c58c --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs @@ -0,0 +1,40 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + // ANCHOR: here + // --snip-- + + println!("The secret number is: {secret_number}"); + + loop { + println!("Please input your guess."); + + // --snip-- + + // ANCHOR_END: here + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = guess.trim().parse().expect("Please type a number!"); + + println!("You guessed: {guess}"); + + // ANCHOR: here + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs new file mode 100644 index 000000000..def0a0e7e --- /dev/null +++ b/rustbook-ru/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs @@ -0,0 +1,38 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + loop { + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = guess.trim().parse().expect("Please type a number!"); + + println!("You guessed: {guess}"); + + // ANCHOR: here + // --snip-- + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs new file mode 100644 index 000000000..b492d384f --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let y = 6; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/output.txt new file mode 100644 index 000000000..3b0deaec6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/branches` +The value of number is: 5 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs new file mode 100644 index 000000000..e021e41e8 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + let condition = true; + let number = if condition { 5 } else { 6 }; + + println!("The value of number is: {number}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs new file mode 100644 index 000000000..ca070c759 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + let mut number = 3; + + while number != 0 { + println!("{number}!"); + + number -= 1; + } + + println!("LIFTOFF!!!"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/output.txt new file mode 100644 index 000000000..82408ac82 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/output.txt @@ -0,0 +1,9 @@ +$ cargo run + Compiling loops v0.1.0 (file:///projects/loops) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s + Running `target/debug/loops` +the value is: 10 +the value is: 20 +the value is: 30 +the value is: 40 +the value is: 50 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs new file mode 100644 index 000000000..38fd301e6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + let a = [10, 20, 30, 40, 50]; + let mut index = 0; + + while index < 5 { + println!("the value is: {}", a[index]); + + index += 1; + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs new file mode 100644 index 000000000..b44e6b7aa --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let a = [10, 20, 30, 40, 50]; + + for element in a { + println!("the value is: {element}"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock new file mode 100644 index 000000000..2d62cbe7a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "variables" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml new file mode 100644 index 000000000..4da3b8150 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt new file mode 100644 index 000000000..85efb431e --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) +error[E0384]: cannot assign twice to immutable variable `x` + --> src/main.rs:4:5 + | +2 | let x = 5; + | - first assignment to `x` +3 | println!("The value of x is: {x}"); +4 | x = 6; + | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +2 | let mut x = 5; + | +++ + +For more information about this error, try `rustc --explain E0384`. +error: could not compile `variables` (bin "variables") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs new file mode 100644 index 000000000..d64f46de4 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + let x = 5; + println!("The value of x is: {x}"); + x = 6; + println!("The value of x is: {x}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock new file mode 100644 index 000000000..2d62cbe7a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "variables" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml new file mode 100644 index 000000000..4da3b8150 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt new file mode 100644 index 000000000..ed0c0c342 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt @@ -0,0 +1,6 @@ +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/variables` +The value of x is: 5 +The value of x is: 6 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs new file mode 100644 index 000000000..a57709ccf --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + let mut x = 5; + println!("The value of x is: {x}"); + x = 6; + println!("The value of x is: {x}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock new file mode 100644 index 000000000..2d62cbe7a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "variables" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml new file mode 100644 index 000000000..4da3b8150 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt new file mode 100644 index 000000000..6ff531b55 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt @@ -0,0 +1,6 @@ +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/variables` +The value of x in the inner scope is: 12 +The value of x is: 6 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs new file mode 100644 index 000000000..03924fe1c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + let x = 5; + + let x = x + 1; + + { + let x = x * 2; + println!("The value of x in the inner scope is: {x}"); + } + + println!("The value of x is: {x}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock new file mode 100644 index 000000000..2d62cbe7a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "variables" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml new file mode 100644 index 000000000..4da3b8150 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs new file mode 100644 index 000000000..42589f548 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let spaces = " "; + let spaces = spaces.len(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock new file mode 100644 index 000000000..2d62cbe7a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "variables" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml new file mode 100644 index 000000000..4da3b8150 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt new file mode 100644 index 000000000..578a1f4aa --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt @@ -0,0 +1,12 @@ +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) +error[E0308]: mismatched types + --> src/main.rs:3:14 + | +2 | let mut spaces = " "; + | ----- expected due to this value +3 | spaces = spaces.len(); + | ^^^^^^^^^^^^ expected `&str`, found `usize` + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `variables` (bin "variables") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs new file mode 100644 index 000000000..f52635d0b --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let mut spaces = " "; + spaces = spaces.len(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock new file mode 100644 index 000000000..3b40559a7 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "floating-point" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml new file mode 100644 index 000000000..83610e756 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "floating-point" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs new file mode 100644 index 000000000..6f4f0fe87 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let x = 2.0; // f64 + + let y: f32 = 3.0; // f32 +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock new file mode 100644 index 000000000..94a12b255 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "numeric-operations" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml new file mode 100644 index 000000000..b4bea55e3 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "numeric-operations" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs new file mode 100644 index 000000000..77c716c14 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + // addition + let sum = 5 + 10; + + // subtraction + let difference = 95.5 - 4.3; + + // multiplication + let product = 4 * 30; + + // division + let quotient = 56.7 / 32.2; + let truncated = -5 / 3; // Results in -1 + + // remainder + let remainder = 43 % 5; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock new file mode 100644 index 000000000..5d5728ebd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "boolean" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml new file mode 100644 index 000000000..47e42cef8 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "boolean" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs new file mode 100644 index 000000000..2c56e62f9 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let t = true; + + let f: bool = false; // with explicit type annotation +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock new file mode 100644 index 000000000..bb58446cc --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "char" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml new file mode 100644 index 000000000..a1ef3b537 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "char" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs new file mode 100644 index 000000000..4921cc998 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let c = 'z'; + let z: char = 'ℤ'; // with explicit type annotation + let heart_eyed_cat = '😻'; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock new file mode 100644 index 000000000..f57f0767c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tuples" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml new file mode 100644 index 000000000..9b0879c2c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tuples" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs new file mode 100644 index 000000000..b7b51fb2f --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let tup: (i32, f64, u8) = (500, 6.4, 1); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock new file mode 100644 index 000000000..f57f0767c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tuples" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml new file mode 100644 index 000000000..9b0879c2c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tuples" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs new file mode 100644 index 000000000..3002bdde4 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let tup = (500, 6.4, 1); + + let (x, y, z) = tup; + + println!("The value of y is: {y}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock new file mode 100644 index 000000000..f57f0767c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tuples" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml new file mode 100644 index 000000000..9b0879c2c --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tuples" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs new file mode 100644 index 000000000..1b1e646fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let x: (i32, f64, u8) = (500, 6.4, 1); + + let five_hundred = x.0; + + let six_point_four = x.1; + + let one = x.2; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock new file mode 100644 index 000000000..68e3c5967 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arrays" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml new file mode 100644 index 000000000..96be3e2b1 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "arrays" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs new file mode 100644 index 000000000..d475901ce --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let a = [1, 2, 3, 4, 5]; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock new file mode 100644 index 000000000..68e3c5967 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arrays" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml new file mode 100644 index 000000000..96be3e2b1 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "arrays" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs new file mode 100644 index 000000000..d33e3174f --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + let a = [1, 2, 3, 4, 5]; + + let first = a[0]; + let second = a[1]; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock new file mode 100644 index 000000000..68e3c5967 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arrays" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml new file mode 100644 index 000000000..96be3e2b1 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "arrays" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs new file mode 100644 index 000000000..b634c9378 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs @@ -0,0 +1,22 @@ +use std::io; + +fn main() { + let a = [1, 2, 3, 4, 5]; + + println!("Please enter an array index."); + + let mut index = String::new(); + + io::stdin() + .read_line(&mut index) + .expect("Failed to read line"); + + let index: usize = index + .trim() + .parse() + .expect("Index entered was not a number"); + + let element = a[index]; + + println!("The value of the element at index {index} is: {element}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt new file mode 100644 index 000000000..898cf5fb6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt @@ -0,0 +1,6 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.28s + Running `target/debug/functions` +Hello, world! +Another function. diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs new file mode 100644 index 000000000..38be8565b --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + println!("Hello, world!"); + + another_function(); +} + +fn another_function() { + println!("Another function."); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt new file mode 100644 index 000000000..377f72886 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.21s + Running `target/debug/functions` +The value of x is: 5 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs new file mode 100644 index 000000000..108da4f81 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + another_function(5); +} + +fn another_function(x: i32) { + println!("The value of x is: {x}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt new file mode 100644 index 000000000..91e71c174 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/functions` +The measurement is: 5h diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs new file mode 100644 index 000000000..b070ccb23 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + print_labeled_measurement(5, 'h'); +} + +fn print_labeled_measurement(value: i32, unit_label: char) { + println!("The measurement is: {value}{unit_label}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock new file mode 100644 index 000000000..89a654d69 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt new file mode 100644 index 000000000..504fdd6ec --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt @@ -0,0 +1,25 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) +error: expected expression, found `let` statement + --> src/main.rs:2:14 + | +2 | let x = (let y = 6); + | ^^^ + | + = note: only supported directly in conditions of `if` and `while` expressions + +warning: unnecessary parentheses around assigned value + --> src/main.rs:2:13 + | +2 | let x = (let y = 6); + | ^ ^ + | + = note: `#[warn(unused_parens)]` on by default +help: remove these parentheses + | +2 - let x = (let y = 6); +2 + let x = let y = 6; + | + +warning: `functions` (bin "functions") generated 1 warning +error: could not compile `functions` (bin "functions") due to 1 previous error; 1 warning emitted diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore new file mode 100644 index 000000000..06a976dd4 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore @@ -0,0 +1 @@ +This listing deliberately doesn't parse so rustfmt fails. diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs new file mode 100644 index 000000000..988f9653e --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let x = (let y = 6); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs new file mode 100644 index 000000000..64b873297 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + let y = { + let x = 3; + x + 1 + }; + + println!("The value of y is: {y}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt new file mode 100644 index 000000000..e66e4b980 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/functions` +The value of x is: 5 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs new file mode 100644 index 000000000..a11af7ec7 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs @@ -0,0 +1,9 @@ +fn five() -> i32 { + 5 +} + +fn main() { + let x = five(); + + println!("The value of x is: {x}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs new file mode 100644 index 000000000..da9d0ddb3 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let x = plus_one(5); + + println!("The value of x is: {x}"); +} + +fn plus_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock new file mode 100644 index 000000000..88287d136 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml new file mode 100644 index 000000000..478b346fd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt new file mode 100644 index 000000000..18fdfd1b4 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt @@ -0,0 +1,14 @@ +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) +error[E0308]: mismatched types + --> src/main.rs:7:24 + | +7 | fn plus_one(x: i32) -> i32 { + | -------- ^^^ expected `i32`, found `()` + | | + | implicitly returns `()` as its body has no tail or `return` expression +8 | x + 1; + | - help: remove this semicolon to return this value + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `functions` (bin "functions") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs new file mode 100644 index 000000000..1cec800b6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let x = plus_one(5); + + println!("The value of x is: {x}"); +} + +fn plus_one(x: i32) -> i32 { + x + 1; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock new file mode 100644 index 000000000..a289136a6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "comments" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml new file mode 100644 index 000000000..e0576b5dc --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "comments" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs new file mode 100644 index 000000000..535f4b993 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let lucky_number = 7; // I’m feeling lucky today +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock new file mode 100644 index 000000000..a289136a6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "comments" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml new file mode 100644 index 000000000..e0576b5dc --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "comments" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs new file mode 100644 index 000000000..81cd93559 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + // I’m feeling lucky today + let lucky_number = 7; +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt new file mode 100644 index 000000000..d39b3b5fc --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +condition was true diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs new file mode 100644 index 000000000..e64a42adf --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let number = 3; + + if number < 5 { + println!("condition was true"); + } else { + println!("condition was false"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt new file mode 100644 index 000000000..3aa1e1c05 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +condition was false diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs new file mode 100644 index 000000000..f7d76cf55 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let number = 7; + // ANCHOR_END: here + + if number < 5 { + println!("condition was true"); + } else { + println!("condition was false"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt new file mode 100644 index 000000000..c9c0b0c46 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt @@ -0,0 +1,10 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) +error[E0308]: mismatched types + --> src/main.rs:4:8 + | +4 | if number { + | ^^^^^^ expected `bool`, found integer + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `branches` (bin "branches") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs new file mode 100644 index 000000000..bc4af767b --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let number = 3; + + if number { + println!("number was three"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs new file mode 100644 index 000000000..704650f46 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let number = 3; + + if number != 0 { + println!("number was something other than zero"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt new file mode 100644 index 000000000..d5195248a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +number is divisible by 3 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs new file mode 100644 index 000000000..d0ef9b2c1 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + let number = 6; + + if number % 4 == 0 { + println!("number is divisible by 4"); + } else if number % 3 == 0 { + println!("number is divisible by 3"); + } else if number % 2 == 0 { + println!("number is divisible by 2"); + } else { + println!("number is not divisible by 4, 3, or 2"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock new file mode 100644 index 000000000..4ca0c2dbd --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "branches" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml new file mode 100644 index 000000000..659645556 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "branches" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt new file mode 100644 index 000000000..7fb857f03 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt @@ -0,0 +1,12 @@ +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) +error[E0308]: `if` and `else` have incompatible types + --> src/main.rs:4:44 + | +4 | let number = if condition { 5 } else { "six" }; + | - ^^^^^ expected integer, found `&str` + | | + | expected because of this + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `branches` (bin "branches") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs new file mode 100644 index 000000000..df7068bcf --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let condition = true; + + let number = if condition { 5 } else { "six" }; + + println!("The value of number is: {number}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.lock new file mode 100644 index 000000000..f73867315 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt new file mode 100644 index 000000000..4977b2b34 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt @@ -0,0 +1,13 @@ +$ cargo run + Compiling loops v0.1.0 (file:///projects/loops) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.58s + Running `target/debug/loops` +count = 0 +remaining = 10 +remaining = 9 +count = 1 +remaining = 10 +remaining = 9 +count = 2 +remaining = 10 +End count = 2 diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/src/main.rs new file mode 100644 index 000000000..dd8856403 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/src/main.rs @@ -0,0 +1,21 @@ +fn main() { + let mut count = 0; + 'counting_up: loop { + println!("count = {count}"); + let mut remaining = 10; + + loop { + println!("remaining = {remaining}"); + if remaining == 9 { + break; + } + if count == 2 { + break 'counting_up; + } + remaining -= 1; + } + + count += 1; + } + println!("End count = {count}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs new file mode 100644 index 000000000..f1692e462 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + loop { + println!("again!"); + } +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs new file mode 100644 index 000000000..683d18bc1 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + let mut counter = 0; + + let result = loop { + counter += 1; + + if counter == 10 { + break counter * 2; + } + }; + + println!("The result is {result}"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock new file mode 100644 index 000000000..9942b362a --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "loops" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml new file mode 100644 index 000000000..810e8bbc0 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loops" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs new file mode 100644 index 000000000..df5b305bc --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + for number in (1..4).rev() { + println!("{number}!"); + } + println!("LIFTOFF!!!"); +} diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock new file mode 100644 index 000000000..b5664bc33 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "no_type_annotations" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml new file mode 100644 index 000000000..8ad4d5aa6 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "no_type_annotations" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt new file mode 100644 index 000000000..ee6a97943 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt @@ -0,0 +1,16 @@ +$ cargo build + Compiling no_type_annotations v0.1.0 (file:///projects/no_type_annotations) +error[E0284]: type annotations needed + --> src/main.rs:2:9 + | +2 | let guess = "42".parse().expect("Not a number!"); + | ^^^^^ ----- type must be known at this point + | + = note: cannot satisfy `<_ as FromStr>::Err == _` +help: consider giving `guess` an explicit type + | +2 | let guess: /* Type */ = "42".parse().expect("Not a number!"); + | ++++++++++++ + +For more information about this error, try `rustc --explain E0284`. +error: could not compile `no_type_annotations` (bin "no_type_annotations") due to 1 previous error diff --git a/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs new file mode 100644 index 000000000..f41c55805 --- /dev/null +++ b/rustbook-ru/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + let guess = "42".parse().expect("Not a number!"); +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/src/main.rs new file mode 100644 index 000000000..ebcd3691b --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-01/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + { // s is not valid here, it’s not yet declared + let s = "hello"; // s is valid from this point forward + + // do stuff with s + } // this scope is now over, and s is no longer valid + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/src/main.rs new file mode 100644 index 000000000..de0f1b325 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-02/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let x = 5; + let y = x; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/src/main.rs new file mode 100644 index 000000000..edf51a947 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-03/src/main.rs @@ -0,0 +1,23 @@ +fn main() { + let s = String::from("hello"); // s comes into scope + + takes_ownership(s); // s's value moves into the function... + // ... and so is no longer valid here + + let x = 5; // x comes into scope + + makes_copy(x); // x would move into the function, + // but i32 is Copy, so it's okay to still + // use x afterward + +} // Here, x goes out of scope, then s. But because s's value was moved, nothing + // special happens. + +fn takes_ownership(some_string: String) { // some_string comes into scope + println!("{some_string}"); +} // Here, some_string goes out of scope and `drop` is called. The backing + // memory is freed. + +fn makes_copy(some_integer: i32) { // some_integer comes into scope + println!("{some_integer}"); +} // Here, some_integer goes out of scope. Nothing special happens. diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/src/main.rs new file mode 100644 index 000000000..e206bec7a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-04/src/main.rs @@ -0,0 +1,29 @@ +fn main() { + let s1 = gives_ownership(); // gives_ownership moves its return + // value into s1 + + let s2 = String::from("hello"); // s2 comes into scope + + let s3 = takes_and_gives_back(s2); // s2 is moved into + // takes_and_gives_back, which also + // moves its return value into s3 +} // Here, s3 goes out of scope and is dropped. s2 was moved, so nothing + // happens. s1 goes out of scope and is dropped. + +fn gives_ownership() -> String { // gives_ownership will move its + // return value into the function + // that calls it + + let some_string = String::from("yours"); // some_string comes into scope + + some_string // some_string is returned and + // moves out to the calling + // function +} + +// This function takes a String and returns one +fn takes_and_gives_back(a_string: String) -> String { // a_string comes into + // scope + + a_string // a_string is returned and moves out to the calling function +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/src/main.rs new file mode 100644 index 000000000..2782483a7 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-05/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + let s1 = String::from("hello"); + + let (s2, len) = calculate_length(s1); + + println!("The length of '{s2}' is {len}."); +} + +fn calculate_length(s: String) -> (String, usize) { + let length = s.len(); // len() returns the length of a String + + (s, length) +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/output.txt new file mode 100644 index 000000000..c78cd5d3d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/output.txt @@ -0,0 +1,15 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` reference + --> src/main.rs:8:5 + | +8 | some_string.push_str(", world"); + | ^^^^^^^^^^^ `some_string` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | +help: consider changing this to be a mutable reference + | +7 | fn change(some_string: &mut String) { + | +++ + +For more information about this error, try `rustc --explain E0596`. +error: could not compile `ownership` (bin "ownership") due to 1 previous error diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/src/main.rs new file mode 100644 index 000000000..330ffa68a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-06/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let s = String::from("hello"); + + change(&s); +} + +fn change(some_string: &String) { + some_string.push_str(", world"); +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/src/main.rs new file mode 100644 index 000000000..3bb3c8580 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-07/src/main.rs @@ -0,0 +1,21 @@ +// ANCHOR: here +fn first_word(s: &String) -> usize { + // ANCHOR: as_bytes + let bytes = s.as_bytes(); + // ANCHOR_END: as_bytes + + // ANCHOR: iter + for (i, &item) in bytes.iter().enumerate() { + // ANCHOR_END: iter + // ANCHOR: inside_for + if item == b' ' { + return i; + } + } + + s.len() + // ANCHOR_END: inside_for +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/src/main.rs new file mode 100644 index 000000000..b6182fe2b --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-08/src/main.rs @@ -0,0 +1,24 @@ +fn first_word(s: &String) -> usize { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return i; + } + } + + s.len() +} + +// ANCHOR: here +fn main() { + let mut s = String::from("hello world"); + + let word = first_word(&s); // word will get the value 5 + + s.clear(); // this empties the String, making it equal to "" + + // word still has the value 5 here, but there's no more string that + // we could meaningfully use the value 5 with. word is now totally invalid! +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/src/main.rs new file mode 100644 index 000000000..5a6ceaa1e --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/listing-04-09/src/main.rs @@ -0,0 +1,36 @@ +// ANCHOR: here +fn first_word(s: &str) -> &str { + // ANCHOR_END: here + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} + +// ANCHOR: usage +fn main() { + let my_string = String::from("hello world"); + + // `first_word` works on slices of `String`s, whether partial or whole + let word = first_word(&my_string[0..6]); + let word = first_word(&my_string[..]); + // `first_word` also works on references to `String`s, which are equivalent + // to whole slices of `String`s + let word = first_word(&my_string); + + let my_string_literal = "hello world"; + + // `first_word` works on slices of string literals, whether partial or whole + let word = first_word(&my_string_literal[0..6]); + let word = first_word(&my_string_literal[..]); + + // Because string literals *are* string slices already, + // this works too, without the slice syntax! + let word = first_word(my_string_literal); +} +// ANCHOR_END: usage diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs new file mode 100644 index 000000000..15bc9d922 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + + s.push_str(", world!"); // push_str() appends a literal to a String + + println!("{s}"); // This will print `hello, world!` + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs new file mode 100644 index 000000000..7e6d46f83 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + { + let s = String::from("hello"); // s is valid from this point forward + + // do stuff with s + } // this scope is now over, and s is no + // longer valid + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs new file mode 100644 index 000000000..a5817e714 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("hello"); + let s2 = s1; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt new file mode 100644 index 000000000..73e6115d6 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt @@ -0,0 +1,21 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0382]: borrow of moved value: `s1` + --> src/main.rs:5:15 + | +2 | let s1 = String::from("hello"); + | -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait +3 | let s2 = s1; + | -- value moved here +4 | +5 | println!("{s1}, world!"); + | ^^^^ value borrowed here after move + | + = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider cloning the value if the performance cost is acceptable + | +3 | let s2 = s1.clone(); + | ++++++++ + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `ownership` (bin "ownership") due to 1 previous error diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs new file mode 100644 index 000000000..e35f6d803 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("hello"); + let s2 = s1; + + println!("{s1}, world!"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs new file mode 100644 index 000000000..0b65e5f61 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("hello"); + let s2 = s1.clone(); + + println!("s1 = {s1}, s2 = {s2}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs new file mode 100644 index 000000000..b6fd2445d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let x = 5; + let y = x; + + println!("x = {x}, y = {y}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs new file mode 100644 index 000000000..6f6d5fb23 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs @@ -0,0 +1,15 @@ +// ANCHOR: all +fn main() { + // ANCHOR: here + let s1 = String::from("hello"); + + let len = calculate_length(&s1); + // ANCHOR_END: here + + println!("The length of '{s1}' is {len}."); +} + +fn calculate_length(s: &String) -> usize { + s.len() +} +// ANCHOR_END: all diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs new file mode 100644 index 000000000..964fd233f --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + let s1 = String::from("hello"); + + let len = calculate_length(&s1); + + println!("The length of '{s1}' is {len}."); +} + +// ANCHOR: here +fn calculate_length(s: &String) -> usize { // s is a reference to a String + s.len() +} // Here, s goes out of scope. But because it does not have ownership of what + // it refers to, it is not dropped. +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs new file mode 100644 index 000000000..fdf7f0a6f --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let mut s = String::from("hello"); + + change(&mut s); +} + +fn change(some_string: &mut String) { + some_string.push_str(", world"); +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt new file mode 100644 index 000000000..97be4a258 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt @@ -0,0 +1,15 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0499]: cannot borrow `s` as mutable more than once at a time + --> src/main.rs:5:14 + | +4 | let r1 = &mut s; + | ------ first mutable borrow occurs here +5 | let r2 = &mut s; + | ^^^^^^ second mutable borrow occurs here +6 | +7 | println!("{}, {}", r1, r2); + | -- first borrow later used here + +For more information about this error, try `rustc --explain E0499`. +error: could not compile `ownership` (bin "ownership") due to 1 previous error diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs new file mode 100644 index 000000000..ddbf8120f --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + + let r1 = &mut s; + let r2 = &mut s; + + println!("{}, {}", r1, r2); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs new file mode 100644 index 000000000..4b1a5a383 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + + { + let r1 = &mut s; + } // r1 goes out of scope here, so we can make a new reference with no problems. + + let r2 = &mut s; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt new file mode 100644 index 000000000..454882323 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable + --> src/main.rs:6:14 + | +4 | let r1 = &s; // no problem + | -- immutable borrow occurs here +5 | let r2 = &s; // no problem +6 | let r3 = &mut s; // BIG PROBLEM + | ^^^^^^ mutable borrow occurs here +7 | +8 | println!("{}, {}, and {}", r1, r2, r3); + | -- immutable borrow later used here + +For more information about this error, try `rustc --explain E0502`. +error: could not compile `ownership` (bin "ownership") due to 1 previous error diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs new file mode 100644 index 000000000..0da04c010 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + + let r1 = &s; // no problem + let r2 = &s; // no problem + let r3 = &mut s; // BIG PROBLEM + + println!("{}, {}, and {}", r1, r2, r3); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs new file mode 100644 index 000000000..c005414d8 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("hello"); + + let r1 = &s; // no problem + let r2 = &s; // no problem + println!("{r1} and {r2}"); + // variables r1 and r2 will not be used after this point + + let r3 = &mut s; // no problem + println!("{r3}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt new file mode 100644 index 000000000..0339433f2 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt @@ -0,0 +1,28 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0106]: missing lifetime specifier + --> src/main.rs:5:16 + | +5 | fn dangle() -> &String { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` + | +5 | fn dangle() -> &'static String { + | +++++++ +help: instead, you are more likely to want to return an owned value + | +5 - fn dangle() -> &String { +5 + fn dangle() -> String { + | + +error[E0515]: cannot return reference to local variable `s` + --> src/main.rs:8:5 + | +8 | &s + | ^^ returns a reference to data owned by the current function + +Some errors have detailed explanations: E0106, E0515. +For more information about an error, try `rustc --explain E0106`. +error: could not compile `ownership` (bin "ownership") due to 2 previous errors diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs new file mode 100644 index 000000000..b10269781 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let reference_to_nothing = dangle(); +} + +fn dangle() -> &String { + let s = String::from("hello"); + + &s +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock new file mode 100644 index 000000000..9e4e62ddf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs new file mode 100644 index 000000000..9fbb372a0 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + let reference_to_nothing = dangle(); +} + +// ANCHOR: here +fn dangle() -> &String { // dangle returns a reference to a String + + let s = String::from("hello"); // s is a new String + + &s // we return a reference to the String, s +} // Here, s goes out of scope, and is dropped. Its memory goes away. + // Danger! +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs new file mode 100644 index 000000000..9c20a3b2d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + let string = no_dangle(); +} + +// ANCHOR: here +fn no_dangle() -> String { + let s = String::from("hello"); + + s +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs new file mode 100644 index 000000000..44163af99 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let s = String::from("hello world"); + + let hello = &s[0..5]; + let world = &s[6..11]; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs new file mode 100644 index 000000000..f44a970da --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs @@ -0,0 +1,15 @@ +// ANCHOR: here +fn first_word(s: &String) -> &str { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt new file mode 100644 index 000000000..c29ddf5bf --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling ownership v0.1.0 (file:///projects/ownership) +error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable + --> src/main.rs:18:5 + | +16 | let word = first_word(&s); + | -- immutable borrow occurs here +17 | +18 | s.clear(); // error! + | ^^^^^^^^^ mutable borrow occurs here +19 | +20 | println!("the first word is: {word}"); + | ------ immutable borrow later used here + +For more information about this error, try `rustc --explain E0502`. +error: could not compile `ownership` (bin "ownership") due to 1 previous error diff --git a/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs new file mode 100644 index 000000000..b23e45f43 --- /dev/null +++ b/rustbook-ru/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs @@ -0,0 +1,23 @@ +fn first_word(s: &String) -> &str { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} + +// ANCHOR: here +fn main() { + let mut s = String::from("hello world"); + + let word = first_word(&s); + + s.clear(); // error! + + println!("the first word is: {word}"); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs new file mode 100644 index 000000000..16dd15b29 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs @@ -0,0 +1,10 @@ +// ANCHOR: here +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs new file mode 100644 index 000000000..122d25164 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs @@ -0,0 +1,17 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn main() { + let user1 = User { + active: true, + username: String::from("someusername123"), + email: String::from("someone@example.com"), + sign_in_count: 1, + }; +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs new file mode 100644 index 000000000..35eea8a9a --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs @@ -0,0 +1,19 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn main() { + let mut user1 = User { + active: true, + username: String::from("someusername123"), + email: String::from("someone@example.com"), + sign_in_count: 1, + }; + + user1.email = String::from("anotheremail@example.com"); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs new file mode 100644 index 000000000..8614561c1 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs @@ -0,0 +1,24 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn build_user(email: String, username: String) -> User { + User { + active: true, + username: username, + email: email, + sign_in_count: 1, + } +} +// ANCHOR_END: here + +fn main() { + let user1 = build_user( + String::from("someone@example.com"), + String::from("someusername123"), + ); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs new file mode 100644 index 000000000..c893c86a9 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs @@ -0,0 +1,24 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn build_user(email: String, username: String) -> User { + User { + active: true, + username, + email, + sign_in_count: 1, + } +} +// ANCHOR_END: here + +fn main() { + let user1 = build_user( + String::from("someone@example.com"), + String::from("someusername123"), + ); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs new file mode 100644 index 000000000..15e7690e1 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs @@ -0,0 +1,28 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn main() { + // --snip-- + // ANCHOR_END: here + + let user1 = User { + email: String::from("someone@example.com"), + username: String::from("someusername123"), + active: true, + sign_in_count: 1, + }; + // ANCHOR: here + + let user2 = User { + active: user1.active, + username: user1.username, + email: String::from("another@example.com"), + sign_in_count: user1.sign_in_count, + }; +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs new file mode 100644 index 000000000..008ad18f6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs @@ -0,0 +1,26 @@ +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} + +// ANCHOR: here +fn main() { + // --snip-- + // ANCHOR_END: here + + let user1 = User { + email: String::from("someone@example.com"), + username: String::from("someusername123"), + active: true, + sign_in_count: 1, + }; + // ANCHOR: here + + let user2 = User { + email: String::from("another@example.com"), + ..user1 + }; +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt new file mode 100644 index 000000000..79b830777 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.42s + Running `target/debug/rectangles` +The area of the rectangle is 1500 square pixels. diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs new file mode 100644 index 000000000..f324529fd --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs @@ -0,0 +1,17 @@ +// ANCHOR: all +fn main() { + let width1 = 30; + let height1 = 50; + + println!( + "The area of the rectangle is {} square pixels.", + area(width1, height1) + ); +} + +// ANCHOR: here +fn area(width: u32, height: u32) -> u32 { + // ANCHOR_END: here + width * height +} +// ANCHOR_END: all diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs new file mode 100644 index 000000000..d4b77ba7a --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + let rect1 = (30, 50); + + println!( + "The area of the rectangle is {} square pixels.", + area(rect1) + ); +} + +fn area(dimensions: (u32, u32)) -> u32 { + dimensions.0 * dimensions.1 +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs new file mode 100644 index 000000000..62ef9acd8 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs @@ -0,0 +1,20 @@ +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!( + "The area of the rectangle is {} square pixels.", + area(&rect1) + ); +} + +fn area(rectangle: &Rectangle) -> u32 { + rectangle.width * rectangle.height +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt new file mode 100644 index 000000000..ee169726d --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt @@ -0,0 +1,14 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) +error[E0277]: `Rectangle` doesn't implement `std::fmt::Display` + --> src/main.rs:12:29 + | +12 | println!("rect1 is {}", rect1); + | ^^^^^ `Rectangle` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `Rectangle` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead + = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `rectangles` (bin "rectangles") due to 1 previous error diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs new file mode 100644 index 000000000..0ff8dcc8c --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs @@ -0,0 +1,13 @@ +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {}", rect1); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt new file mode 100644 index 000000000..0c810b1f4 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s + Running `target/debug/rectangles` +rect1 is Rectangle { width: 30, height: 50 } diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs new file mode 100644 index 000000000..67e0b92a4 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs @@ -0,0 +1,14 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {rect1:?}"); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs new file mode 100644 index 000000000..e4f45e868 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs @@ -0,0 +1,23 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +impl Rectangle { + fn area(&self) -> u32 { + self.width * self.height + } +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!( + "The area of the rectangle is {} square pixels.", + rect1.area() + ); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs new file mode 100644 index 000000000..843dab481 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + let rect2 = Rectangle { + width: 10, + height: 40, + }; + let rect3 = Rectangle { + width: 60, + height: 45, + }; + + println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2)); + println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3)); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs new file mode 100644 index 000000000..e6a32723f --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs @@ -0,0 +1,35 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +// ANCHOR: here +impl Rectangle { + fn area(&self) -> u32 { + self.width * self.height + } + + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} +// ANCHOR_END: here + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + let rect2 = Rectangle { + width: 10, + height: 40, + }; + let rect3 = Rectangle { + width: 60, + height: 45, + }; + + println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2)); + println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3)); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs new file mode 100644 index 000000000..a5d3f772a --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs @@ -0,0 +1,37 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +// ANCHOR: here +impl Rectangle { + fn area(&self) -> u32 { + self.width * self.height + } +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} +// ANCHOR_END: here + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + let rect2 = Rectangle { + width: 10, + height: 40, + }; + let rect3 = Rectangle { + width: 60, + height: 45, + }; + + println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2)); + println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3)); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs new file mode 100644 index 000000000..0d993162b --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs @@ -0,0 +1,7 @@ +struct Color(i32, i32, i32); +struct Point(i32, i32, i32); + +fn main() { + let black = Color(0, 0, 0); + let origin = Point(0, 0, 0); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock new file mode 100644 index 000000000..bede081a0 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "structs" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml new file mode 100644 index 000000000..d36dbc1d3 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt new file mode 100644 index 000000000..5f9344c51 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt @@ -0,0 +1,31 @@ +$ cargo run + Compiling structs v0.1.0 (file:///projects/structs) +error[E0106]: missing lifetime specifier + --> src/main.rs:3:15 + | +3 | username: &str, + | ^ expected named lifetime parameter + | +help: consider introducing a named lifetime parameter + | +1 ~ struct User<'a> { +2 | active: bool, +3 ~ username: &'a str, + | + +error[E0106]: missing lifetime specifier + --> src/main.rs:4:12 + | +4 | email: &str, + | ^ expected named lifetime parameter + | +help: consider introducing a named lifetime parameter + | +1 ~ struct User<'a> { +2 | active: bool, +3 | username: &str, +4 ~ email: &'a str, + | + +For more information about this error, try `rustc --explain E0106`. +error: could not compile `structs` (bin "structs") due to 2 previous errors diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs new file mode 100644 index 000000000..96092d042 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs @@ -0,0 +1,15 @@ +struct User { + active: bool, + username: &str, + email: &str, + sign_in_count: u64, +} + +fn main() { + let user1 = User { + email: "someone@example.com", + username: "someusername123", + active: true, + sign_in_count: 1, + }; +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs new file mode 100644 index 000000000..47fedc552 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs @@ -0,0 +1,20 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +// ANCHOR: here +impl Rectangle { + fn square(size: u32) -> Self { + Self { + width: size, + height: size, + } + } +} +// ANCHOR_END: here + +fn main() { + let sq = Rectangle::square(3); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.lock new file mode 100644 index 000000000..fb30ed9c8 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "structs" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml new file mode 100644 index 000000000..3232b6065 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "structs" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/src/main.rs new file mode 100644 index 000000000..d48c94e99 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/src/main.rs @@ -0,0 +1,5 @@ +struct AlwaysEqual; + +fn main() { + let subject = AlwaysEqual; +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/output.txt new file mode 100644 index 000000000..1c1f07dfb --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/output.txt @@ -0,0 +1,9 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.61s + Running `target/debug/rectangles` +[src/main.rs:10:16] 30 * scale = 60 +[src/main.rs:14:5] &rect1 = Rectangle { + width: 60, + height: 50, +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/src/main.rs new file mode 100644 index 000000000..dd0342959 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/src/main.rs @@ -0,0 +1,15 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let scale = 2; + let rect1 = Rectangle { + width: dbg!(30 * scale), + height: 50, + }; + + dbg!(&rect1); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/src/main.rs new file mode 100644 index 000000000..00e1de83b --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/src/main.rs @@ -0,0 +1,24 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +// ANCHOR: here +impl Rectangle { + fn width(&self) -> bool { + self.width > 0 + } +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + if rect1.width() { + println!("The rectangle has a nonzero width; it is {}", rect1.width); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt new file mode 100644 index 000000000..71de1f7bd --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt @@ -0,0 +1,19 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) +error[E0277]: `Rectangle` doesn't implement `Debug` + --> src/main.rs:12:31 + | +12 | println!("rect1 is {:?}", rect1); + | ^^^^^ `Rectangle` cannot be formatted using `{:?}` + | + = help: the trait `Debug` is not implemented for `Rectangle` + = note: add `#[derive(Debug)]` to `Rectangle` or manually `impl Debug for Rectangle` + = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider annotating `Rectangle` with `#[derive(Debug)]` + | +1 + #[derive(Debug)] +2 | struct Rectangle { + | + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `rectangles` (bin "rectangles") due to 1 previous error diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs new file mode 100644 index 000000000..019a357ab --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs @@ -0,0 +1,13 @@ +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {:?}", rect1); +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock new file mode 100644 index 000000000..4aabe7da6 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangles" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt new file mode 100644 index 000000000..4a6c5a9a1 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt @@ -0,0 +1,8 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s + Running `target/debug/rectangles` +rect1 is Rectangle { + width: 30, + height: 50, +} diff --git a/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs new file mode 100644 index 000000000..f763b50d3 --- /dev/null +++ b/rustbook-ru/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs @@ -0,0 +1,14 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {rect1:#?}"); +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs new file mode 100644 index 000000000..5b688e0f2 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs @@ -0,0 +1,23 @@ +fn main() { + // ANCHOR: here + enum IpAddrKind { + V4, + V6, + } + + struct IpAddr { + kind: IpAddrKind, + address: String, + } + + let home = IpAddr { + kind: IpAddrKind::V4, + address: String::from("127.0.0.1"), + }; + + let loopback = IpAddr { + kind: IpAddrKind::V6, + address: String::from("::1"), + }; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs new file mode 100644 index 000000000..3ba749788 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs @@ -0,0 +1,10 @@ +// ANCHOR: here +enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(i32, i32, i32), +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs new file mode 100644 index 000000000..93dce48cb --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs @@ -0,0 +1,19 @@ +// ANCHOR: here +enum Coin { + Penny, + Nickel, + Dime, + Quarter, +} + +fn value_in_cents(coin: Coin) -> u8 { + match coin { + Coin::Penny => 1, + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter => 25, + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs new file mode 100644 index 000000000..3ba384fba --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs @@ -0,0 +1,17 @@ +// ANCHOR: here +#[derive(Debug)] // so we can inspect the state in a minute +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs new file mode 100644 index 000000000..c86190aa7 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs @@ -0,0 +1,18 @@ +fn main() { + // ANCHOR: here + fn plus_one(x: Option) -> Option { + match x { + // ANCHOR: first_arm + None => None, + // ANCHOR_END: first_arm + // ANCHOR: second_arm + Some(i) => Some(i + 1), + // ANCHOR_END: second_arm + } + } + + let five = Some(5); + let six = plus_one(five); + let none = plus_one(None); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs new file mode 100644 index 000000000..0a037517a --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let config_max = Some(3u8); + match config_max { + Some(max) => println!("The maximum is configured to be {max}"), + _ => (), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs new file mode 100644 index 000000000..c631e56ba --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs @@ -0,0 +1,22 @@ +// ANCHOR: def +enum IpAddrKind { + V4, + V6, +} +// ANCHOR_END: def + +fn main() { + // ANCHOR: instance + let four = IpAddrKind::V4; + let six = IpAddrKind::V6; + // ANCHOR_END: instance + + // ANCHOR: fn_call + route(IpAddrKind::V4); + route(IpAddrKind::V6); + // ANCHOR_END: fn_call +} + +// ANCHOR: fn +fn route(ip_kind: IpAddrKind) {} +// ANCHOR_END: fn diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs new file mode 100644 index 000000000..7d59b811f --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: here + enum IpAddr { + V4(String), + V6(String), + } + + let home = IpAddr::V4(String::from("127.0.0.1")); + + let loopback = IpAddr::V6(String::from("::1")); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs new file mode 100644 index 000000000..844a14041 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: here + enum IpAddr { + V4(u8, u8, u8, u8), + V6(String), + } + + let home = IpAddr::V4(127, 0, 0, 1); + + let loopback = IpAddr::V6(String::from("::1")); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs new file mode 100644 index 000000000..df451be8b --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs @@ -0,0 +1,11 @@ +// ANCHOR: here +struct QuitMessage; // unit struct +struct MoveMessage { + x: i32, + y: i32, +} +struct WriteMessage(String); // tuple struct +struct ChangeColorMessage(i32, i32, i32); // tuple struct + // ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs new file mode 100644 index 000000000..66e0b6da1 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(i32, i32, i32), + } + + // ANCHOR: here + impl Message { + fn call(&self) { + // method body would be defined here + } + } + + let m = Message::Write(String::from("hello")); + m.call(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs new file mode 100644 index 000000000..be552bfa5 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let some_number = Some(5); + let some_char = Some('e'); + + let absent_number: Option = None; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt new file mode 100644 index 000000000..1eb76de43 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt @@ -0,0 +1,17 @@ +$ cargo run + Compiling enums v0.1.0 (file:///projects/enums) +error[E0277]: cannot add `Option` to `i8` + --> src/main.rs:5:17 + | +5 | let sum = x + y; + | ^ no implementation for `i8 + Option` + | + = help: the trait `Add>` is not implemented for `i8` + = help: the following other types implement trait `Add`: + `&'a i8` implements `Add` + `&i8` implements `Add<&i8>` + `i8` implements `Add<&i8>` + `i8` implements `Add` + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `enums` (bin "enums") due to 1 previous error diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/src/main.rs new file mode 100644 index 000000000..ec65565d4 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let x: i8 = 5; + let y: Option = Some(5); + + let sum = x + y; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/src/main.rs new file mode 100644 index 000000000..3f909dcaf --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/src/main.rs @@ -0,0 +1,22 @@ +enum Coin { + Penny, + Nickel, + Dime, + Quarter, +} + +// ANCHOR: here +fn value_in_cents(coin: Coin) -> u8 { + match coin { + Coin::Penny => { + println!("Lucky penny!"); + 1 + } + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter => 25, + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/src/main.rs new file mode 100644 index 000000000..298215d40 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/src/main.rs @@ -0,0 +1,31 @@ +#[derive(Debug)] +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +// ANCHOR: here +fn value_in_cents(coin: Coin) -> u8 { + match coin { + Coin::Penny => 1, + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter(state) => { + println!("State quarter from {state:?}!"); + 25 + } + } +} +// ANCHOR_END: here + +fn main() { + value_in_cents(Coin::Quarter(UsState::Alaska)); +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt new file mode 100644 index 000000000..43acd14d6 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt @@ -0,0 +1,22 @@ +$ cargo run + Compiling enums v0.1.0 (file:///projects/enums) +error[E0004]: non-exhaustive patterns: `None` not covered + --> src/main.rs:3:15 + | +3 | match x { + | ^ pattern `None` not covered + | +note: `Option` defined here + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:574:1 + ::: /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:578:5 + | + = note: not covered + = note: the matched value is of type `Option` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +4 ~ Some(i) => Some(i + 1), +5 ~ None => todo!(), + | + +For more information about this error, try `rustc --explain E0004`. +error: could not compile `enums` (bin "enums") due to 1 previous error diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/src/main.rs new file mode 100644 index 000000000..f1963d0c9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + fn plus_one(x: Option) -> Option { + match x { + Some(i) => Some(i + 1), + } + } + // ANCHOR_END: here + + let five = Some(5); + let six = plus_one(five); + let none = plus_one(None); +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/src/main.rs new file mode 100644 index 000000000..7d7254ea0 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let config_max = Some(3u8); + if let Some(max) = config_max { + println!("The maximum is configured to be {max}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/src/main.rs new file mode 100644 index 000000000..d0d7d8027 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/src/main.rs @@ -0,0 +1,24 @@ +#[derive(Debug)] +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +fn main() { + let coin = Coin::Penny; + // ANCHOR: here + let mut count = 0; + match coin { + Coin::Quarter(state) => println!("State quarter from {state:?}!"), + _ => count += 1, + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/src/main.rs new file mode 100644 index 000000000..3bb363035 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/src/main.rs @@ -0,0 +1,25 @@ +#[derive(Debug)] +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +fn main() { + let coin = Coin::Penny; + // ANCHOR: here + let mut count = 0; + if let Coin::Quarter(state) = coin { + println!("State quarter from {state:?}!"); + } else { + count += 1; + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/src/main.rs new file mode 100644 index 000000000..6ce0b5998 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + // ANCHOR: here + let dice_roll = 9; + match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + other => move_player(other), + } + + fn add_fancy_hat() {} + fn remove_fancy_hat() {} + fn move_player(num_spaces: u8) {} + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/src/main.rs new file mode 100644 index 000000000..586e23751 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + // ANCHOR: here + let dice_roll = 9; + match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + _ => reroll(), + } + + fn add_fancy_hat() {} + fn remove_fancy_hat() {} + fn reroll() {} + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.lock b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.lock new file mode 100644 index 000000000..f62e8ac45 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enums" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml new file mode 100644 index 000000000..e959295f9 --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/src/main.rs b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/src/main.rs new file mode 100644 index 000000000..e791742ee --- /dev/null +++ b/rustbook-ru/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + let dice_roll = 9; + match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + _ => (), + } + + fn add_fancy_hat() {} + fn remove_fancy_hat() {} + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/src/lib.rs new file mode 100644 index 000000000..591e24557 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-01/src/lib.rs @@ -0,0 +1,15 @@ +mod front_of_house { + mod hosting { + fn add_to_waitlist() {} + + fn seat_at_table() {} + } + + mod serving { + fn take_order() {} + + fn serve_order() {} + + fn take_payment() {} + } +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/output.txt b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/output.txt new file mode 100644 index 000000000..2d06c7fd1 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/output.txt @@ -0,0 +1,32 @@ +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0603]: module `hosting` is private + --> src/lib.rs:9:28 + | +9 | crate::front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^ --------------- function `add_to_waitlist` is not publicly re-exported + | | + | private module + | +note: the module `hosting` is defined here + --> src/lib.rs:2:5 + | +2 | mod hosting { + | ^^^^^^^^^^^ + +error[E0603]: module `hosting` is private + --> src/lib.rs:12:21 + | +12 | front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^ --------------- function `add_to_waitlist` is not publicly re-exported + | | + | private module + | +note: the module `hosting` is defined here + --> src/lib.rs:2:5 + | +2 | mod hosting { + | ^^^^^^^^^^^ + +For more information about this error, try `rustc --explain E0603`. +error: could not compile `restaurant` (lib) due to 2 previous errors diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs new file mode 100644 index 000000000..0b8a43c6b --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs @@ -0,0 +1,13 @@ +mod front_of_house { + mod hosting { + fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/output.txt b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/output.txt new file mode 100644 index 000000000..98d8d6e2a --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/output.txt @@ -0,0 +1,28 @@ +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0603]: function `add_to_waitlist` is private + --> src/lib.rs:9:37 + | +9 | crate::front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^^^^^^^^^ private function + | +note: the function `add_to_waitlist` is defined here + --> src/lib.rs:3:9 + | +3 | fn add_to_waitlist() {} + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: function `add_to_waitlist` is private + --> src/lib.rs:12:30 + | +12 | front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^^^^^^^^^ private function + | +note: the function `add_to_waitlist` is defined here + --> src/lib.rs:3:9 + | +3 | fn add_to_waitlist() {} + | ^^^^^^^^^^^^^^^^^^^^ + +For more information about this error, try `rustc --explain E0603`. +error: could not compile `restaurant` (lib) due to 2 previous errors diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs new file mode 100644 index 000000000..05372dbe5 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs @@ -0,0 +1,13 @@ +mod front_of_house { + pub mod hosting { + fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs new file mode 100644 index 000000000..7b89ee7cd --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs @@ -0,0 +1,13 @@ +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/src/lib.rs new file mode 100644 index 000000000..b3ddb4f0f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-08/src/lib.rs @@ -0,0 +1,10 @@ +fn deliver_order() {} + +mod back_of_house { + fn fix_incorrect_order() { + cook_order(); + super::deliver_order(); + } + + fn cook_order() {} +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/src/lib.rs new file mode 100644 index 000000000..92c4695d5 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-09/src/lib.rs @@ -0,0 +1,27 @@ +mod back_of_house { + pub struct Breakfast { + pub toast: String, + seasonal_fruit: String, + } + + impl Breakfast { + pub fn summer(toast: &str) -> Breakfast { + Breakfast { + toast: String::from(toast), + seasonal_fruit: String::from("peaches"), + } + } + } +} + +pub fn eat_at_restaurant() { + // Order a breakfast in the summer with Rye toast + let mut meal = back_of_house::Breakfast::summer("Rye"); + // Change our mind about what bread we'd like + meal.toast = String::from("Wheat"); + println!("I'd like {} toast please", meal.toast); + + // The next line won't compile if we uncomment it; we're not allowed + // to see or modify the seasonal fruit that comes with the meal + // meal.seasonal_fruit = String::from("blueberries"); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/src/lib.rs new file mode 100644 index 000000000..908f1dfb7 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-10/src/lib.rs @@ -0,0 +1,11 @@ +mod back_of_house { + pub enum Appetizer { + Soup, + Salad, + } +} + +pub fn eat_at_restaurant() { + let order1 = back_of_house::Appetizer::Soup; + let order2 = back_of_house::Appetizer::Salad; +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/src/lib.rs new file mode 100644 index 000000000..cf31a9c97 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-11/src/lib.rs @@ -0,0 +1,11 @@ +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/output.txt b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/output.txt new file mode 100644 index 000000000..0eda25312 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/output.txt @@ -0,0 +1,24 @@ +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0433]: failed to resolve: use of undeclared crate or module `hosting` + --> src/lib.rs:11:9 + | +11 | hosting::add_to_waitlist(); + | ^^^^^^^ use of undeclared crate or module `hosting` + | +help: consider importing this module through its public re-export + | +10 + use crate::hosting; + | + +warning: unused import: `crate::front_of_house::hosting` + --> src/lib.rs:7:5 + | +7 | use crate::front_of_house::hosting; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +For more information about this error, try `rustc --explain E0433`. +warning: `restaurant` (lib) generated 1 warning +error: could not compile `restaurant` (lib) due to 1 previous error; 1 warning emitted diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/src/lib.rs new file mode 100644 index 000000000..afc759423 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-12/src/lib.rs @@ -0,0 +1,13 @@ +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting; + +mod customer { + pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); + } +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/src/lib.rs new file mode 100644 index 000000000..c72994efe --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-13/src/lib.rs @@ -0,0 +1,11 @@ +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting::add_to_waitlist; + +pub fn eat_at_restaurant() { + add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/src/main.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/src/main.rs new file mode 100644 index 000000000..4379e7c79 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-14/src/main.rs @@ -0,0 +1,6 @@ +use std::collections::HashMap; + +fn main() { + let mut map = HashMap::new(); + map.insert(1, 2); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/src/lib.rs new file mode 100644 index 000000000..bfac3a07a --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-15/src/lib.rs @@ -0,0 +1,18 @@ +// ANCHOR: here +use std::fmt; +use std::io; + +fn function1() -> fmt::Result { + // --snip-- + // ANCHOR_END: here + Ok(()) + // ANCHOR: here +} + +fn function2() -> io::Result<()> { + // --snip-- + // ANCHOR_END: here + Ok(()) + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/src/lib.rs new file mode 100644 index 000000000..843490b4d --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-16/src/lib.rs @@ -0,0 +1,18 @@ +// ANCHOR: here +use std::fmt::Result; +use std::io::Result as IoResult; + +fn function1() -> Result { + // --snip-- + // ANCHOR_END: here + Ok(()) + // ANCHOR: here +} + +fn function2() -> IoResult<()> { + // --snip-- + // ANCHOR_END: here + Ok(()) + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/src/lib.rs new file mode 100644 index 000000000..45cf1bac9 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-17/src/lib.rs @@ -0,0 +1,11 @@ +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +pub use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml new file mode 100644 index 000000000..d508e9578 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/src/main.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/src/main.rs new file mode 100644 index 000000000..2f69412a4 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-18/src/main.rs @@ -0,0 +1,32 @@ +use rand::Rng; +// ANCHOR: here +// --snip-- +use std::{cmp::Ordering, io}; +// --snip-- +// ANCHOR_END: here + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = guess.trim().parse().expect("Please type a number!"); + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/src/lib.rs new file mode 100644 index 000000000..3fee46c44 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-19/src/lib.rs @@ -0,0 +1,2 @@ +use std::io; +use std::io::Write; diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/src/lib.rs new file mode 100644 index 000000000..341f40a47 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-20/src/lib.rs @@ -0,0 +1 @@ +use std::io::{self, Write}; diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/front_of_house.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/front_of_house.rs new file mode 100644 index 000000000..6875dfdb6 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/front_of_house.rs @@ -0,0 +1,3 @@ +pub mod hosting { + pub fn add_to_waitlist() {} +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/lib.rs new file mode 100644 index 000000000..d6769556a --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/listing-07-21-and-22/src/lib.rs @@ -0,0 +1,7 @@ +mod front_of_house; + +pub use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml new file mode 100644 index 000000000..7eda67aea --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/src/main.rs b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/src/main.rs new file mode 100644 index 000000000..3a02c9963 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/src/main.rs @@ -0,0 +1,31 @@ +use rand::Rng; +// ANCHOR: here +// --snip-- +use std::cmp::Ordering; +use std::io; +// --snip-- +// ANCHOR_END: here + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.lock new file mode 100644 index 000000000..f25ab358f --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "restaurant" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml new file mode 100644 index 000000000..60cec7cb0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "restaurant" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house.rs b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house.rs new file mode 100644 index 000000000..d0a8154ea --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house.rs @@ -0,0 +1 @@ +pub mod hosting; diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house/hosting.rs b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house/hosting.rs new file mode 100644 index 000000000..d65f3afd1 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house/hosting.rs @@ -0,0 +1 @@ +pub fn add_to_waitlist() {} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/lib.rs b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/lib.rs new file mode 100644 index 000000000..d6769556a --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/lib.rs @@ -0,0 +1,7 @@ +mod front_of_house; + +pub use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.lock b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.lock new file mode 100644 index 000000000..4773c201d --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "backyard" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml new file mode 100644 index 000000000..6e904abbe --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "backyard" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/output.txt b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/output.txt new file mode 100644 index 000000000..04ac6f6c0 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling backyard v0.1.0 (file:///projects/backyard) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s + Running `target/debug/backyard` +I'm growing Asparagus! diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden.rs b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden.rs new file mode 100644 index 000000000..6c7f9b1cb --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden.rs @@ -0,0 +1 @@ +pub mod vegetables; diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden/vegetables.rs b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden/vegetables.rs new file mode 100644 index 000000000..b00f785ef --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/garden/vegetables.rs @@ -0,0 +1,2 @@ +#[derive(Debug)] +pub struct Asparagus {} diff --git a/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/main.rs b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/main.rs new file mode 100644 index 000000000..0d9a0ca92 --- /dev/null +++ b/rustbook-ru/listings/ch07-managing-growing-projects/quick-reference-example/src/main.rs @@ -0,0 +1,8 @@ +use crate::garden::vegetables::Asparagus; + +pub mod garden; + +fn main() { + let plant = Asparagus {}; + println!("I'm growing {plant:?}!"); +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-01/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-01/src/main.rs new file mode 100644 index 000000000..45e45581e --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-01/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let v: Vec = Vec::new(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-02/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-02/src/main.rs new file mode 100644 index 000000000..3b10a53e8 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-02/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let v = vec![1, 2, 3]; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-03/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-03/src/main.rs new file mode 100644 index 000000000..147223f9a --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-03/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + let mut v = Vec::new(); + + v.push(5); + v.push(6); + v.push(7); + v.push(8); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-04/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-04/src/main.rs new file mode 100644 index 000000000..fca332de6 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-04/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + // ANCHOR: here + let v = vec![1, 2, 3, 4, 5]; + + let third: &i32 = &v[2]; + println!("The third element is {third}"); + + let third: Option<&i32> = v.get(2); + match third { + Some(third) => println!("The third element is {third}"), + None => println!("There is no third element."), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-05/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-05/src/main.rs new file mode 100644 index 000000000..783d9b110 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-05/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let v = vec![1, 2, 3, 4, 5]; + + let does_not_exist = &v[100]; + let does_not_exist = v.get(100); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-06/output.txt b/rustbook-ru/listings/ch08-common-collections/listing-08-06/output.txt new file mode 100644 index 000000000..f98ab1cde --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-06/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) +error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable + --> src/main.rs:6:5 + | +4 | let first = &v[0]; + | - immutable borrow occurs here +5 | +6 | v.push(6); + | ^^^^^^^^^ mutable borrow occurs here +7 | +8 | println!("The first element is: {first}"); + | ------- immutable borrow later used here + +For more information about this error, try `rustc --explain E0502`. +error: could not compile `collections` (bin "collections") due to 1 previous error diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-06/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-06/src/main.rs new file mode 100644 index 000000000..653ac27b0 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-06/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let mut v = vec![1, 2, 3, 4, 5]; + + let first = &v[0]; + + v.push(6); + + println!("The first element is: {first}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-07/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-07/src/main.rs new file mode 100644 index 000000000..aebf855a9 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-07/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let v = vec![100, 32, 57]; + for i in &v { + println!("{i}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-08/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-08/src/main.rs new file mode 100644 index 000000000..c62ba21b4 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-08/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let mut v = vec![100, 32, 57]; + for i in &mut v { + *i += 50; + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-09/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-09/src/main.rs new file mode 100644 index 000000000..c2198883b --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-09/src/main.rs @@ -0,0 +1,15 @@ +fn main() { + // ANCHOR: here + enum SpreadsheetCell { + Int(i32), + Float(f64), + Text(String), + } + + let row = vec![ + SpreadsheetCell::Int(3), + SpreadsheetCell::Text(String::from("blue")), + SpreadsheetCell::Float(10.12), + ]; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-10/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-10/src/main.rs new file mode 100644 index 000000000..abda2db66 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-10/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + { + let v = vec![1, 2, 3, 4]; + + // do stuff with v + } // <- v goes out of scope and is freed here + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-11/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-11/src/main.rs new file mode 100644 index 000000000..4cf4c81c2 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-11/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let mut s = String::new(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-12/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-12/src/main.rs new file mode 100644 index 000000000..d9e5e768a --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-12/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + let data = "initial contents"; + + let s = data.to_string(); + + // the method also works on a literal directly: + let s = "initial contents".to_string(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-13/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-13/src/main.rs new file mode 100644 index 000000000..b81e37453 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-13/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let s = String::from("initial contents"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-14/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-14/src/main.rs new file mode 100644 index 000000000..bf737ab44 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-14/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + // ANCHOR: here + let hello = String::from("السلام عليكم"); + let hello = String::from("Dobrý den"); + let hello = String::from("Hello"); + let hello = String::from("שלום"); + let hello = String::from("नमस्ते"); + let hello = String::from("こんにちは"); + let hello = String::from("안녕하세요"); + let hello = String::from("你好"); + let hello = String::from("Olá"); + // ANCHOR: russian + let hello = String::from("Здравствуйте"); + // ANCHOR_END: russian + // ANCHOR: spanish + let hello = String::from("Hola"); + // ANCHOR_END: spanish + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-15/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-15/src/main.rs new file mode 100644 index 000000000..7dec657d9 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-15/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("foo"); + s.push_str("bar"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-16/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-16/src/main.rs new file mode 100644 index 000000000..db57cddba --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-16/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let mut s1 = String::from("foo"); + let s2 = "bar"; + s1.push_str(s2); + println!("s2 is {s2}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-17/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-17/src/main.rs new file mode 100644 index 000000000..0a9e8cc0a --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-17/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let mut s = String::from("lo"); + s.push('l'); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-18/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-18/src/main.rs new file mode 100644 index 000000000..93939a69f --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-18/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("Hello, "); + let s2 = String::from("world!"); + let s3 = s1 + &s2; // note s1 has been moved here and can no longer be used + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-19/output.txt b/rustbook-ru/listings/ch08-common-collections/listing-08-19/output.txt new file mode 100644 index 000000000..75d9a56f5 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-19/output.txt @@ -0,0 +1,17 @@ +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) +error[E0277]: the type `str` cannot be indexed by `{integer}` + --> src/main.rs:3:16 + | +3 | let h = s1[0]; + | ^ string indices are ranges of `usize` + | + = help: the trait `SliceIndex` is not implemented for `{integer}`, which is required by `String: Index<_>` + = note: you can use `.chars().nth()` or `.bytes().nth()` + for more information, see chapter 8 in The Book: + = help: the trait `SliceIndex<[_]>` is implemented for `usize` + = help: for that trait implementation, expected `[_]`, found `str` + = note: required for `String` to implement `Index<{integer}>` + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `collections` (bin "collections") due to 1 previous error diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-19/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-19/src/main.rs new file mode 100644 index 000000000..fc08e9cea --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-19/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("hello"); + let h = s1[0]; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-20/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-20/src/main.rs new file mode 100644 index 000000000..54c201091 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-20/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-21/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-21/src/main.rs new file mode 100644 index 000000000..07551549d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-21/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); + + let team_name = String::from("Blue"); + let score = scores.get(&team_name).copied().unwrap_or(0); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-22/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-22/src/main.rs new file mode 100644 index 000000000..2b2a73f94 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-22/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let field_name = String::from("Favorite color"); + let field_value = String::from("Blue"); + + let mut map = HashMap::new(); + map.insert(field_name, field_value); + // field_name and field_value are invalid at this point, try using them and + // see what compiler error you get! + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-23/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-23/src/main.rs new file mode 100644 index 000000000..29025b417 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-23/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Blue"), 25); + + println!("{scores:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-24/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-24/src/main.rs new file mode 100644 index 000000000..013895632 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-24/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let mut scores = HashMap::new(); + scores.insert(String::from("Blue"), 10); + + scores.entry(String::from("Yellow")).or_insert(50); + scores.entry(String::from("Blue")).or_insert(50); + + println!("{scores:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/listing-08-25/src/main.rs b/rustbook-ru/listings/ch08-common-collections/listing-08-25/src/main.rs new file mode 100644 index 000000000..84dd1cd4b --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/listing-08-25/src/main.rs @@ -0,0 +1,16 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let text = "hello world wonderful world"; + + let mut map = HashMap::new(); + + for word in text.split_whitespace() { + let count = map.entry(word).or_insert(0); + *count += 1; + } + + println!("{map:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/src/main.rs b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/src/main.rs new file mode 100644 index 000000000..4995650d1 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("tic"); + let s2 = String::from("tac"); + let s3 = String::from("toe"); + + let s = s1 + "-" + &s2 + "-" + &s3; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/src/main.rs b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/src/main.rs new file mode 100644 index 000000000..db408e2b7 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-02-format/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let s1 = String::from("tic"); + let s2 = String::from("tac"); + let s3 = String::from("toe"); + + let s = format!("{s1}-{s2}-{s3}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs new file mode 100644 index 000000000..bb13c86f1 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + // ANCHOR: here + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); + + for (key, value) in &scores { + println!("{key}: {value}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.lock b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.lock new file mode 100644 index 000000000..d3daeff7d --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "collections" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml new file mode 100644 index 000000000..fe4959823 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "collections" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt new file mode 100644 index 000000000..de65b05c0 --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s + Running `target/debug/collections` +thread 'main' panicked at src/main.rs:4:19: +byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/src/main.rs b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/src/main.rs new file mode 100644 index 000000000..9283ff5bd --- /dev/null +++ b/rustbook-ru/listings/ch08-common-collections/output-only-01-not-char-boundary/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let hello = "Здравствуйте"; + + let s = &hello[0..1]; +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.lock new file mode 100644 index 000000000..4fe030fab --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "panic" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.toml new file mode 100644 index 000000000..660e2c819 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "panic" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-01/output.txt b/rustbook-ru/listings/ch09-error-handling/listing-09-01/output.txt new file mode 100644 index 000000000..5f4def009 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-01/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling panic v0.1.0 (file:///projects/panic) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s + Running `target/debug/panic` +thread 'main' panicked at src/main.rs:4:6: +index out of bounds: the len is 3 but the index is 99 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-01/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-01/src/main.rs new file mode 100644 index 000000000..70194abd7 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-01/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + let v = vec![1, 2, 3]; + + v[99]; +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-03/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-03/src/main.rs new file mode 100644 index 000000000..2342904ed --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-03/src/main.rs @@ -0,0 +1,5 @@ +use std::fs::File; + +fn main() { + let greeting_file_result = File::open("hello.txt"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-04/output.txt b/rustbook-ru/listings/ch09-error-handling/listing-09-04/output.txt new file mode 100644 index 000000000..b36bdc05f --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-04/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling error-handling v0.1.0 (file:///projects/error-handling) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s + Running `target/debug/error-handling` +thread 'main' panicked at src/main.rs:8:23: +Problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" } +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-04/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-04/src/main.rs new file mode 100644 index 000000000..832f57f0e --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-04/src/main.rs @@ -0,0 +1,10 @@ +use std::fs::File; + +fn main() { + let greeting_file_result = File::open("hello.txt"); + + let greeting_file = match greeting_file_result { + Ok(file) => file, + Err(error) => panic!("Problem opening the file: {error:?}"), + }; +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-05/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-05/src/main.rs new file mode 100644 index 000000000..e0bc55c3f --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-05/src/main.rs @@ -0,0 +1,19 @@ +use std::fs::File; +use std::io::ErrorKind; + +fn main() { + let greeting_file_result = File::open("hello.txt"); + + let greeting_file = match greeting_file_result { + Ok(file) => file, + Err(error) => match error.kind() { + ErrorKind::NotFound => match File::create("hello.txt") { + Ok(fc) => fc, + Err(e) => panic!("Problem creating the file: {e:?}"), + }, + other_error => { + panic!("Problem opening the file: {other_error:?}"); + } + }, + }; +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-06/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-06/src/main.rs new file mode 100644 index 000000000..a70734cb5 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-06/src/main.rs @@ -0,0 +1,24 @@ +// ANCHOR: here +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let username_file_result = File::open("hello.txt"); + + let mut username_file = match username_file_result { + Ok(file) => file, + Err(e) => return Err(e), + }; + + let mut username = String::new(); + + match username_file.read_to_string(&mut username) { + Ok(_) => Ok(username), + Err(e) => Err(e), + } +} +// ANCHOR_END: here + +fn main() { + let username = read_username_from_file().expect("Unable to get username"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-07/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-07/src/main.rs new file mode 100644 index 000000000..0295949d2 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-07/src/main.rs @@ -0,0 +1,15 @@ +// ANCHOR: here +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let mut username_file = File::open("hello.txt")?; + let mut username = String::new(); + username_file.read_to_string(&mut username)?; + Ok(username) +} +// ANCHOR_END: here + +fn main() { + let username = read_username_from_file().expect("Unable to get username"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-08/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-08/src/main.rs new file mode 100644 index 000000000..ca672caad --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-08/src/main.rs @@ -0,0 +1,16 @@ +// ANCHOR: here +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let mut username = String::new(); + + File::open("hello.txt")?.read_to_string(&mut username)?; + + Ok(username) +} +// ANCHOR_END: here + +fn main() { + let username = read_username_from_file().expect("Unable to get username"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-09/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-09/src/main.rs new file mode 100644 index 000000000..4597dc2ee --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-09/src/main.rs @@ -0,0 +1,12 @@ +// ANCHOR: here +use std::fs; +use std::io; + +fn read_username_from_file() -> Result { + fs::read_to_string("hello.txt") +} +// ANCHOR_END: here + +fn main() { + let username = read_username_from_file().expect("Unable to get username"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-10/output.txt b/rustbook-ru/listings/ch09-error-handling/listing-09-10/output.txt new file mode 100644 index 000000000..f3c1641b2 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-10/output.txt @@ -0,0 +1,22 @@ +$ cargo run + Compiling error-handling v0.1.0 (file:///projects/error-handling) +error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) + --> src/main.rs:4:48 + | +3 | fn main() { + | --------- this function should return `Result` or `Option` to accept `?` +4 | let greeting_file = File::open("hello.txt")?; + | ^ cannot use the `?` operator in a function that returns `()` + | + = help: the trait `FromResidual>` is not implemented for `()` +help: consider adding return type + | +3 ~ fn main() -> Result<(), Box> { +4 | let greeting_file = File::open("hello.txt")?; +5 + +6 + Ok(()) +7 + } + | + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `error-handling` (bin "error-handling") due to 1 previous error diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-10/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-10/src/main.rs new file mode 100644 index 000000000..38b005480 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-10/src/main.rs @@ -0,0 +1,5 @@ +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt")?; +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.lock new file mode 100644 index 000000000..7320ae639 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "error-handling" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-11/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-11/src/main.rs new file mode 100644 index 000000000..bd5322786 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-11/src/main.rs @@ -0,0 +1,15 @@ +// ANCHOR: here +fn last_char_of_first_line(text: &str) -> Option { + text.lines().next()?.chars().last() +} +// ANCHOR_END: here + +fn main() { + assert_eq!( + last_char_of_first_line("Hello, world\nHow are you today?"), + Some('d') + ); + + assert_eq!(last_char_of_first_line(""), None); + assert_eq!(last_char_of_first_line("\nhi"), None); +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-12/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-12/src/main.rs new file mode 100644 index 000000000..b0f7445f4 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-12/src/main.rs @@ -0,0 +1,8 @@ +use std::error::Error; +use std::fs::File; + +fn main() -> Result<(), Box> { + let greeting_file = File::open("hello.txt")?; + + Ok(()) +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.toml new file mode 100644 index 000000000..d508e9578 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-13/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/lib.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/lib.rs new file mode 100644 index 000000000..d09383110 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/lib.rs @@ -0,0 +1,17 @@ +pub struct Guess { + value: i32, +} + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 || value > 100 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } + + pub fn value(&self) -> i32 { + self.value + } +} diff --git a/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/main.rs b/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/main.rs new file mode 100644 index 000000000..cda389303 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/listing-09-13/src/main.rs @@ -0,0 +1,36 @@ +use guessing_game::Guess; +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + loop { + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: i32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + + let guess = Guess::new(guess); + + match guess.value().cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + } +} diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.lock new file mode 100644 index 000000000..4fe030fab --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "panic" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml new file mode 100644 index 000000000..660e2c819 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "panic" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/output.txt b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/output.txt new file mode 100644 index 000000000..ced4ee719 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling panic v0.1.0 (file:///projects/panic) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.25s + Running `target/debug/panic` +thread 'main' panicked at src/main.rs:2:5: +crash and burn +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/src/main.rs b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/src/main.rs new file mode 100644 index 000000000..32a4c243d --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-01-panic/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + panic!("crash and burn"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/src/main.rs b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/src/main.rs new file mode 100644 index 000000000..92e9452f1 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-04-unwrap/src/main.rs @@ -0,0 +1,5 @@ +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt").unwrap(); +} diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/src/main.rs b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/src/main.rs new file mode 100644 index 000000000..3d36fa5b1 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-05-expect/src/main.rs @@ -0,0 +1,6 @@ +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt") + .expect("hello.txt should be included in this project"); +} diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.lock new file mode 100644 index 000000000..1fa96b797 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "error-handling" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml new file mode 100644 index 000000000..c496db783 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "error-handling" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/src/main.rs b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/src/main.rs new file mode 100644 index 000000000..3e1835266 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + use std::net::IpAddr; + + let home: IpAddr = "127.0.0.1" + .parse() + .expect("Hardcoded IP address should be valid"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock new file mode 100644 index 000000000..2ae9e459e --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock @@ -0,0 +1,75 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guessing_game" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml new file mode 100644 index 000000000..d508e9578 --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/src/main.rs b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/src/main.rs new file mode 100644 index 000000000..fc22cbc5e --- /dev/null +++ b/rustbook-ru/listings/ch09-error-handling/no-listing-09-guess-out-of-range/src/main.rs @@ -0,0 +1,47 @@ +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + // ANCHOR: here + loop { + // --snip-- + + // ANCHOR_END: here + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + // ANCHOR: here + let guess: i32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + + if guess < 1 || guess > 100 { + println!("The secret number will be between 1 and 100."); + continue; + } + + match guess.cmp(&secret_number) { + // --snip-- + // ANCHOR_END: here + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + // ANCHOR: here + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/src/main.rs new file mode 100644 index 000000000..c9e9bbbd2 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/src/main.rs @@ -0,0 +1,18 @@ +// ANCHOR: here +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); + // ANCHOR_END: here + assert_eq!(*largest, 100); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/src/main.rs new file mode 100644 index 000000000..fd43154a9 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/src/main.rs @@ -0,0 +1,25 @@ +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); + + let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/src/main.rs new file mode 100644 index 000000000..1878f5aac --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/src/main.rs @@ -0,0 +1,31 @@ +// ANCHOR: here +fn largest(list: &[i32]) -> &i32 { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest(&number_list); + println!("The largest number is {result}"); + // ANCHOR_END: here + assert_eq!(*result, 100); + // ANCHOR: here + + let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8]; + + let result = largest(&number_list); + println!("The largest number is {result}"); + // ANCHOR_END: here + assert_eq!(*result, 6000); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/src/main.rs new file mode 100644 index 000000000..ac3b1f7c1 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/src/main.rs @@ -0,0 +1,43 @@ +// ANCHOR: here +fn largest_i32(list: &[i32]) -> &i32 { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn largest_char(list: &[char]) -> &char { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest_i32(&number_list); + println!("The largest number is {result}"); + // ANCHOR_END: here + assert_eq!(*result, 100); + // ANCHOR: here + + let char_list = vec!['y', 'm', 'a', 'q']; + + let result = largest_char(&char_list); + println!("The largest char is {result}"); + // ANCHOR_END: here + assert_eq!(*result, 'y'); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt new file mode 100644 index 000000000..05b96ca17 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt @@ -0,0 +1,17 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0369]: binary operation `>` cannot be applied to type `&T` + --> src/main.rs:5:17 + | +5 | if item > largest { + | ---- ^ ------- &T + | | + | &T + | +help: consider restricting type parameter `T` + | +1 | fn largest(list: &[T]) -> &T { + | ++++++++++++++++++++++ + +For more information about this error, try `rustc --explain E0369`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/src/main.rs new file mode 100644 index 000000000..094eb416a --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/src/main.rs @@ -0,0 +1,23 @@ +fn largest(list: &[T]) -> &T { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest(&number_list); + println!("The largest number is {result}"); + + let char_list = vec!['y', 'm', 'a', 'q']; + + let result = largest(&char_list); + println!("The largest char is {result}"); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/src/main.rs new file mode 100644 index 000000000..4252593df --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/src/main.rs @@ -0,0 +1,9 @@ +struct Point { + x: T, + y: T, +} + +fn main() { + let integer = Point { x: 5, y: 10 }; + let float = Point { x: 1.0, y: 4.0 }; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt new file mode 100644 index 000000000..5f6c3f465 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt @@ -0,0 +1,10 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0308]: mismatched types + --> src/main.rs:7:38 + | +7 | let wont_work = Point { x: 5, y: 4.0 }; + | ^^^ expected integer, found floating-point number + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/src/main.rs new file mode 100644 index 000000000..7883db1a6 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/src/main.rs @@ -0,0 +1,8 @@ +struct Point { + x: T, + y: T, +} + +fn main() { + let wont_work = Point { x: 5, y: 4.0 }; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/src/main.rs new file mode 100644 index 000000000..615b78cfd --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/src/main.rs @@ -0,0 +1,10 @@ +struct Point { + x: T, + y: U, +} + +fn main() { + let both_integer = Point { x: 5, y: 10 }; + let both_float = Point { x: 1.0, y: 4.0 }; + let integer_and_float = Point { x: 5, y: 4.0 }; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/src/main.rs new file mode 100644 index 000000000..288b64eac --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/src/main.rs @@ -0,0 +1,16 @@ +struct Point { + x: T, + y: T, +} + +impl Point { + fn x(&self) -> &T { + &self.x + } +} + +fn main() { + let p = Point { x: 5, y: 10 }; + + println!("p.x = {}", p.x()); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/src/main.rs new file mode 100644 index 000000000..4c5b01bdc --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/src/main.rs @@ -0,0 +1,24 @@ +struct Point { + x: T, + y: T, +} + +impl Point { + fn x(&self) -> &T { + &self.x + } +} + +// ANCHOR: here +impl Point { + fn distance_from_origin(&self) -> f32 { + (self.x.powi(2) + self.y.powi(2)).sqrt() + } +} +// ANCHOR_END: here + +fn main() { + let p = Point { x: 5, y: 10 }; + + println!("p.x = {}", p.x()); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/src/main.rs new file mode 100644 index 000000000..86b028108 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/src/main.rs @@ -0,0 +1,22 @@ +struct Point { + x: X1, + y: Y1, +} + +impl Point { + fn mixup(self, other: Point) -> Point { + Point { + x: self.x, + y: other.y, + } + } +} + +fn main() { + let p1 = Point { x: 5, y: 10.4 }; + let p2 = Point { x: "Hello", y: 'c' }; + + let p3 = p1.mixup(p2); + + println!("p3.x = {}, p3.y = {}", p3.x, p3.y); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/src/lib.rs new file mode 100644 index 000000000..cfaedb02f --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/src/lib.rs @@ -0,0 +1,3 @@ +pub trait Summary { + fn summarize(&self) -> String; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs new file mode 100644 index 000000000..c4c83329e --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs @@ -0,0 +1,31 @@ +pub trait Summary { + fn summarize(&self) -> String; +} + +// ANCHOR: here +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs new file mode 100644 index 000000000..fb59b84fb --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs @@ -0,0 +1,29 @@ +// ANCHOR: here +pub trait Summary { + fn summarize(&self) -> String { + String::from("(Read more...)") + } +} +// ANCHOR_END: here + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle {} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/src/lib.rs new file mode 100644 index 000000000..669cc5fdc --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/src/lib.rs @@ -0,0 +1,22 @@ +use std::fmt::Display; + +struct Pair { + x: T, + y: T, +} + +impl Pair { + fn new(x: T, y: T) -> Self { + Self { x, y } + } +} + +impl Pair { + fn cmp_display(&self) { + if self.x >= self.y { + println!("The largest member is x = {}", self.x); + } else { + println!("The largest member is y = {}", self.y); + } + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/output.txt new file mode 100644 index 000000000..5c4414226 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/output.txt @@ -0,0 +1,17 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0597]: `x` does not live long enough + --> src/main.rs:6:13 + | +5 | let x = 5; + | - binding `x` declared here +6 | r = &x; + | ^^ borrowed value does not live long enough +7 | } + | - `x` dropped here while still borrowed +8 | +9 | println!("r: {r}"); + | --- borrow later used here + +For more information about this error, try `rustc --explain E0597`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/src/main.rs new file mode 100644 index 000000000..773340eab --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + let r; + + { + let x = 5; + r = &x; + } + + println!("r: {r}"); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.lock new file mode 100644 index 000000000..6388bb2b5 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/rustfmt-ignore b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/src/main.rs new file mode 100644 index 000000000..6679bcf31 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + let r; // ---------+-- 'a + // | + { // | + let x = 5; // -+-- 'b | + r = &x; // | | + } // -+ | + // | + println!("r: {r}"); // | +} // ---------+ diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.lock new file mode 100644 index 000000000..6388bb2b5 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/rustfmt-ignore b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/rustfmt-ignore new file mode 100644 index 000000000..9a53c718a --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/rustfmt-ignore @@ -0,0 +1,3 @@ +We have some weird comments pointing out borrowing scopes that we don't want to change; +unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to +manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028 diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/src/main.rs new file mode 100644 index 000000000..634ff9391 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + let x = 5; // ----------+-- 'b + // | + let r = &x; // --+-- 'a | + // | | + println!("r: {r}"); // | | + // --+ | +} // ----------+ diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/src/main.rs new file mode 100644 index 000000000..8b64cd000 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt new file mode 100644 index 000000000..a6783b2cc --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0106]: missing lifetime specifier + --> src/main.rs:9:33 + | +9 | fn longest(x: &str, y: &str) -> &str { + | ---- ---- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y` +help: consider introducing a named lifetime parameter + | +9 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + | ++++ ++ ++ ++ + +For more information about this error, try `rustc --explain E0106`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs new file mode 100644 index 000000000..bf41acd1f --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} + +// ANCHOR: here +fn longest(x: &str, y: &str) -> &str { + if x.len() > y.len() { + x + } else { + y + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs new file mode 100644 index 000000000..7668de134 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} + +// ANCHOR: here +fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + if x.len() > y.len() { + x + } else { + y + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs new file mode 100644 index 000000000..fc9ff296c --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs @@ -0,0 +1,19 @@ +// ANCHOR: here +fn main() { + let string1 = String::from("long string is long"); + + { + let string2 = String::from("xyz"); + let result = longest(string1.as_str(), string2.as_str()); + println!("The longest string is {result}"); + } +} +// ANCHOR_END: here + +fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + if x.len() > y.len() { + x + } else { + y + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/output.txt new file mode 100644 index 000000000..cb209ab8a --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0597]: `string2` does not live long enough + --> src/main.rs:6:44 + | +5 | let string2 = String::from("xyz"); + | ------- binding `string2` declared here +6 | result = longest(string1.as_str(), string2.as_str()); + | ^^^^^^^ borrowed value does not live long enough +7 | } + | - `string2` dropped here while still borrowed +8 | println!("The longest string is {result}"); + | -------- borrow later used here + +For more information about this error, try `rustc --explain E0597`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs new file mode 100644 index 000000000..f2e633862 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs @@ -0,0 +1,19 @@ +// ANCHOR: here +fn main() { + let string1 = String::from("long string is long"); + let result; + { + let string2 = String::from("xyz"); + result = longest(string1.as_str(), string2.as_str()); + } + println!("The longest string is {result}"); +} +// ANCHOR_END: here + +fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + if x.len() > y.len() { + x + } else { + y + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/src/main.rs new file mode 100644 index 000000000..ca3cf86d2 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/src/main.rs @@ -0,0 +1,11 @@ +struct ImportantExcerpt<'a> { + part: &'a str, +} + +fn main() { + let novel = String::from("Call me Ishmael. Some years ago..."); + let first_sentence = novel.split('.').next().unwrap(); + let i = ImportantExcerpt { + part: first_sentence, + }; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.lock new file mode 100644 index 000000000..2aa4918e5 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ownership" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml new file mode 100644 index 000000000..e8847526d --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "ownership" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/src/main.rs new file mode 100644 index 000000000..431a261d2 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/src/main.rs @@ -0,0 +1,29 @@ +// ANCHOR: here +fn first_word(s: &str) -> &str { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} +// ANCHOR_END: here + +fn main() { + let my_string = String::from("hello world"); + + // first_word works on slices of `String`s + let word = first_word(&my_string[..]); + + let my_string_literal = "hello world"; + + // first_word works on slices of string literals + let word = first_word(&my_string_literal[..]); + + // Because string literals *are* string slices already, + // this works too, without the slice syntax! + let word = first_word(my_string_literal); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs new file mode 100644 index 000000000..fa644ca4f --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs @@ -0,0 +1,29 @@ +pub trait Summary { + fn summarize(&self) -> String; +} + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs new file mode 100644 index 000000000..0b51121d9 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs @@ -0,0 +1,14 @@ +use aggregator::{Summary, Tweet}; + +fn main() { + let tweet = Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + }; + + println!("1 new tweet: {}", tweet.summarize()); +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs new file mode 100644 index 000000000..b6f93a68f --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs @@ -0,0 +1,27 @@ +pub trait Summary { + fn summarize(&self) -> String { + String::from("(Read more...)") + } +} + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle {} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/main.rs new file mode 100644 index 000000000..cc9b98e31 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/main.rs @@ -0,0 +1,17 @@ +use aggregator::{self, NewsArticle, Summary}; + +fn main() { + // ANCHOR: here + let article = NewsArticle { + headline: String::from("Penguins win the Stanley Cup Championship!"), + location: String::from("Pittsburgh, PA, USA"), + author: String::from("Iceburgh"), + content: String::from( + "The Pittsburgh Penguins once again are the best \ + hockey team in the NHL.", + ), + }; + + println!("New article available! {}", article.summarize()); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs new file mode 100644 index 000000000..643906f69 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs @@ -0,0 +1,24 @@ +// ANCHOR: here +pub trait Summary { + fn summarize_author(&self) -> String; + + fn summarize(&self) -> String { + format!("(Read more from {}...)", self.summarize_author()) + } +} +// ANCHOR_END: here + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +// ANCHOR: impl +impl Summary for Tweet { + fn summarize_author(&self) -> String { + format!("@{}", self.username) + } +} +// ANCHOR_END: impl diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs new file mode 100644 index 000000000..e05e8e1c6 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs @@ -0,0 +1,16 @@ +use aggregator::{self, Summary, Tweet}; + +fn main() { + // ANCHOR: here + let tweet = Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + }; + + println!("1 new tweet: {}", tweet.summarize()); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs new file mode 100644 index 000000000..261994351 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs @@ -0,0 +1,35 @@ +pub trait Summary { + fn summarize(&self) -> String; +} + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} + +// ANCHOR: here +pub fn notify(item: &impl Summary) { + println!("Breaking news! {}", item.summarize()); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs new file mode 100644 index 000000000..a611fce38 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs @@ -0,0 +1,42 @@ +pub trait Summary { + fn summarize(&self) -> String; +} + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} + +// ANCHOR: here +fn returns_summarizable() -> impl Summary { + Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.lock new file mode 100644 index 000000000..2835471f0 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aggregator" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml new file mode 100644 index 000000000..46f46a7f4 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "aggregator" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs new file mode 100644 index 000000000..7cd81d4c3 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs @@ -0,0 +1,56 @@ +pub trait Summary { + fn summarize(&self) -> String; +} + +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} + +// ANCHOR: here +fn returns_summarizable(switch: bool) -> impl Summary { + if switch { + NewsArticle { + headline: String::from( + "Penguins win the Stanley Cup Championship!", + ), + location: String::from("Pittsburgh, PA, USA"), + author: String::from("Iceburgh"), + content: String::from( + "The Pittsburgh Penguins once again are the best \ + hockey team in the NHL.", + ), + } + } else { + Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml new file mode 100644 index 000000000..4dbde9090 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/src/lib.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/src/lib.rs new file mode 100644 index 000000000..05b07c31a --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/src/lib.rs @@ -0,0 +1,9 @@ +// ANCHOR: here +fn some_function(t: &T, u: &U) -> i32 +where + T: Display + Clone, + U: Clone + Debug, +{ + // ANCHOR_END: here + unimplemented!() +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/src/main.rs new file mode 100644 index 000000000..4c35d90e3 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "efghijklmnopqrstuvwxyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} + +// ANCHOR: here +fn longest<'a>(x: &'a str, y: &str) -> &'a str { + x +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt new file mode 100644 index 000000000..9b9ef2338 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt @@ -0,0 +1,13 @@ +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0515]: cannot return value referencing local variable `result` + --> src/main.rs:11:5 + | +11 | result.as_str() + | ------^^^^^^^^^ + | | + | returns a value referencing data owned by the current function + | `result` is borrowed here + +For more information about this error, try `rustc --explain E0515`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/src/main.rs new file mode 100644 index 000000000..4d596ec43 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} + +// ANCHOR: here +fn longest<'a>(x: &str, y: &str) -> &'a str { + let result = String::from("really long string"); + result.as_str() +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/src/main.rs new file mode 100644 index 000000000..c04ec3823 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/src/main.rs @@ -0,0 +1,28 @@ +struct ImportantExcerpt<'a> { + part: &'a str, +} + +// ANCHOR: 1st +impl<'a> ImportantExcerpt<'a> { + fn level(&self) -> i32 { + 3 + } +} +// ANCHOR_END: 1st + +// ANCHOR: 3rd +impl<'a> ImportantExcerpt<'a> { + fn announce_and_return_part(&self, announcement: &str) -> &str { + println!("Attention please: {announcement}"); + self.part + } +} +// ANCHOR_END: 3rd + +fn main() { + let novel = String::from("Call me Ishmael. Some years ago..."); + let first_sentence = novel.split('.').next().unwrap(); + let i = ImportantExcerpt { + part: first_sentence, + }; +} diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.lock b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.lock new file mode 100644 index 000000000..e8007a19b --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "chapter10" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml new file mode 100644 index 000000000..489f80967 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "chapter10" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs new file mode 100644 index 000000000..4b0201fb1 --- /dev/null +++ b/rustbook-ru/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs @@ -0,0 +1,31 @@ +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest_with_an_announcement( + string1.as_str(), + string2, + "Today is someone's birthday!", + ); + println!("The longest string is {result}"); +} + +// ANCHOR: here +use std::fmt::Display; + +fn longest_with_an_announcement<'a, T>( + x: &'a str, + y: &'a str, + ann: T, +) -> &'a str +where + T: Display, +{ + println!("Announcement! {ann}"); + if x.len() > y.len() { + x + } else { + y + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock new file mode 100644 index 000000000..8b8c69d33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adder" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml new file mode 100644 index 000000000..b7d36d44c --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/output.txt new file mode 100644 index 000000000..128309c12 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/output.txt @@ -0,0 +1,16 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.57s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs new file mode 100644 index 000000000..7d12d9af8 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/output.txt new file mode 100644 index 000000000..cf2c206aa --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/output.txt @@ -0,0 +1,23 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.72s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::another ... FAILED +test tests::exploration ... ok + +failures: + +---- tests::another stdout ---- +thread 'tests::another' panicked at src/lib.rs:17:9: +Make this test fail +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::another + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs new file mode 100644 index 000000000..866f0238b --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs @@ -0,0 +1,19 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn exploration() { + let result = add(2, 2); + assert_eq!(result, 4); + } + + #[test] + fn another() { + panic!("Make this test fail"); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.lock new file mode 100644 index 000000000..9dcd5439d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangle" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml new file mode 100644 index 000000000..2447c67f5 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangle" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/src/lib.rs new file mode 100644 index 000000000..0a03a2b44 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-05/src/lib.rs @@ -0,0 +1,11 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.lock new file mode 100644 index 000000000..9dcd5439d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangle" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml new file mode 100644 index 000000000..2447c67f5 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangle" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/output.txt new file mode 100644 index 000000000..e03add229 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/output.txt @@ -0,0 +1,16 @@ +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 1 test +test tests::larger_can_hold_smaller ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests rectangle + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/src/lib.rs new file mode 100644 index 000000000..6ad1512ed --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-06/src/lib.rs @@ -0,0 +1,32 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn larger_can_hold_smaller() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(larger.can_hold(&smaller)); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/output.txt new file mode 100644 index 000000000..908ed572c --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/output.txt @@ -0,0 +1,16 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/src/lib.rs new file mode 100644 index 000000000..682e8ae17 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-07/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add_two(a: usize) -> usize { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml new file mode 100644 index 000000000..4e348c8d2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/output.txt new file mode 100644 index 000000000..a5a764377 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/output.txt @@ -0,0 +1,16 @@ +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests guessing_game + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/src/lib.rs new file mode 100644 index 000000000..54e447bb9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-08/src/lib.rs @@ -0,0 +1,24 @@ +pub struct Guess { + value: i32, +} + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 || value > 100 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic] + fn greater_than_100() { + Guess::new(200); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml new file mode 100644 index 000000000..4e348c8d2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/src/lib.rs new file mode 100644 index 000000000..1bb464137 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-09/src/lib.rs @@ -0,0 +1,34 @@ +pub struct Guess { + value: i32, +} + +// ANCHOR: here +// --snip-- + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 { + panic!( + "Guess value must be greater than or equal to 1, got {value}." + ); + } else if value > 100 { + panic!( + "Guess value must be less than or equal to 100, got {value}." + ); + } + + Guess { value } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic(expected = "less than or equal to 100")] + fn greater_than_100() { + Guess::new(200); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.lock new file mode 100644 index 000000000..a6d35e395 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "silly-function" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml new file mode 100644 index 000000000..f751864de --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "silly-function" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/output.txt new file mode 100644 index 000000000..c67b607d8 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/output.txt @@ -0,0 +1,26 @@ +$ cargo test + Compiling silly-function v0.1.0 (file:///projects/silly-function) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/silly_function-160869f38cff9166) + +running 2 tests +test tests::this_test_will_fail ... FAILED +test tests::this_test_will_pass ... ok + +failures: + +---- tests::this_test_will_fail stdout ---- +I got the value 8 +thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: +assertion `left == right` failed + left: 10 + right: 5 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::this_test_will_fail + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/src/lib.rs new file mode 100644 index 000000000..3fbde2a1e --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-10/src/lib.rs @@ -0,0 +1,21 @@ +fn prints_and_returns_10(a: i32) -> i32 { + println!("I got the value {a}"); + 10 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn this_test_will_pass() { + let value = prints_and_returns_10(4); + assert_eq!(value, 10); + } + + #[test] + fn this_test_will_fail() { + let value = prints_and_returns_10(8); + assert_eq!(value, 5); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/output.txt new file mode 100644 index 000000000..a0fe55df1 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/output.txt @@ -0,0 +1,18 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.62s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 3 tests +test tests::add_three_and_two ... ok +test tests::add_two_and_two ... ok +test tests::one_hundred ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/src/lib.rs new file mode 100644 index 000000000..ccf1eb2a2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-11/src/lib.rs @@ -0,0 +1,26 @@ +pub fn add_two(a: usize) -> usize { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn add_two_and_two() { + let result = add_two(2); + assert_eq!(result, 4); + } + + #[test] + fn add_three_and_two() { + let result = add_two(3); + assert_eq!(result, 5); + } + + #[test] + fn one_hundred() { + let result = add_two(100); + assert_eq!(result, 102); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/src/lib.rs new file mode 100644 index 000000000..9ba15d8b2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-12/src/lib.rs @@ -0,0 +1,18 @@ +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/output.txt new file mode 100644 index 000000000..84344add7 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/output.txt @@ -0,0 +1,23 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.31s + Running unittests src/lib.rs (target/debug/deps/adder-1082c4b063a8fbe6) + +running 1 test +test tests::internal ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/integration_test.rs (target/debug/deps/integration_test-1082c4b063a8fbe6) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/src/lib.rs new file mode 100644 index 000000000..9ba15d8b2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/src/lib.rs @@ -0,0 +1,18 @@ +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs new file mode 100644 index 000000000..d6b88a750 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs @@ -0,0 +1,7 @@ +use adder::add_two; + +#[test] +fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/output.txt new file mode 100644 index 000000000..79d3ae25c --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/output.txt @@ -0,0 +1,16 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.59s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::exploration ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs new file mode 100644 index 000000000..5be58b93f --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn exploration() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.lock new file mode 100644 index 000000000..9dcd5439d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangle" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml new file mode 100644 index 000000000..2447c67f5 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangle" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/output.txt new file mode 100644 index 000000000..63044036d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/output.txt @@ -0,0 +1,17 @@ +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 2 tests +test tests::larger_can_hold_smaller ... ok +test tests::smaller_cannot_hold_larger ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests rectangle + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/src/lib.rs new file mode 100644 index 000000000..ee4fc45b9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/src/lib.rs @@ -0,0 +1,49 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn larger_can_hold_smaller() { + // --snip-- + // ANCHOR_END: here + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(larger.can_hold(&smaller)); + // ANCHOR: here + } + + #[test] + fn smaller_cannot_hold_larger() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(!smaller.can_hold(&larger)); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.lock new file mode 100644 index 000000000..9dcd5439d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "rectangle" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml new file mode 100644 index 000000000..2447c67f5 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangle" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt new file mode 100644 index 000000000..6d616db37 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt @@ -0,0 +1,23 @@ +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 2 tests +test tests::larger_can_hold_smaller ... FAILED +test tests::smaller_cannot_hold_larger ... ok + +failures: + +---- tests::larger_can_hold_smaller stdout ---- +thread 'tests::larger_can_hold_smaller' panicked at src/lib.rs:28:9: +assertion failed: larger.can_hold(&smaller) +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::larger_can_hold_smaller + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/src/lib.rs new file mode 100644 index 000000000..f5968fcaf --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/src/lib.rs @@ -0,0 +1,47 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +// ANCHOR: here +// --snip-- +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width < other.width && self.height > other.height + } +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn larger_can_hold_smaller() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(larger.can_hold(&smaller)); + } + + #[test] + fn smaller_cannot_hold_larger() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(!smaller.can_hold(&larger)); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt new file mode 100644 index 000000000..927f89144 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt @@ -0,0 +1,24 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_adds_two ... FAILED + +failures: + +---- tests::it_adds_two stdout ---- +thread 'tests::it_adds_two' panicked at src/lib.rs:12:9: +assertion `left == right` failed + left: 5 + right: 4 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::it_adds_two + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs new file mode 100644 index 000000000..aed772b0e --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs @@ -0,0 +1,16 @@ +// ANCHOR: here +pub fn add_two(a: usize) -> usize { + a + 3 +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.lock new file mode 100644 index 000000000..9a7ecdd9f --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "greeter" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml new file mode 100644 index 000000000..90a826cf4 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "greeter" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/src/lib.rs new file mode 100644 index 000000000..433cf148e --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-05-greeter/src/lib.rs @@ -0,0 +1,14 @@ +pub fn greeting(name: &str) -> String { + format!("Hello {name}!") +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn greeting_contains_name() { + let result = greeting("Carol"); + assert!(result.contains("Carol")); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.lock new file mode 100644 index 000000000..9a7ecdd9f --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "greeter" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml new file mode 100644 index 000000000..90a826cf4 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "greeter" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt new file mode 100644 index 000000000..0a7d44dce --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt @@ -0,0 +1,22 @@ +$ cargo test + Compiling greeter v0.1.0 (file:///projects/greeter) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.91s + Running unittests src/lib.rs (target/debug/deps/greeter-170b942eb5bf5e3a) + +running 1 test +test tests::greeting_contains_name ... FAILED + +failures: + +---- tests::greeting_contains_name stdout ---- +thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: +assertion failed: result.contains("Carol") +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::greeting_contains_name + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/src/lib.rs new file mode 100644 index 000000000..6f28fc52a --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/src/lib.rs @@ -0,0 +1,16 @@ +// ANCHOR: here +pub fn greeting(name: &str) -> String { + String::from("Hello!") +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn greeting_contains_name() { + let result = greeting("Carol"); + assert!(result.contains("Carol")); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.lock new file mode 100644 index 000000000..9a7ecdd9f --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "greeter" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml new file mode 100644 index 000000000..90a826cf4 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "greeter" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt new file mode 100644 index 000000000..d2015d56b --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt @@ -0,0 +1,22 @@ +$ cargo test + Compiling greeter v0.1.0 (file:///projects/greeter) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.93s + Running unittests src/lib.rs (target/debug/deps/greeter-170b942eb5bf5e3a) + +running 1 test +test tests::greeting_contains_name ... FAILED + +failures: + +---- tests::greeting_contains_name stdout ---- +thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: +Greeting did not contain name, value was `Hello!` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::greeting_contains_name + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/src/lib.rs new file mode 100644 index 000000000..8bbaca53f --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/src/lib.rs @@ -0,0 +1,19 @@ +pub fn greeting(name: &str) -> String { + String::from("Hello!") +} + +#[cfg(test)] +mod tests { + use super::*; + + // ANCHOR: here + #[test] + fn greeting_contains_name() { + let result = greeting("Carol"); + assert!( + result.contains("Carol"), + "Greeting did not contain name, value was `{result}`" + ); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml new file mode 100644 index 000000000..4e348c8d2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt new file mode 100644 index 000000000..9b7ec43f7 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt @@ -0,0 +1,19 @@ +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.62s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... FAILED + +failures: + +---- tests::greater_than_100 stdout ---- +note: test did not panic as expected + +failures: + tests::greater_than_100 + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/src/lib.rs new file mode 100644 index 000000000..0f962fcd7 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/src/lib.rs @@ -0,0 +1,27 @@ +pub struct Guess { + value: i32, +} + +// ANCHOR: here +// --snip-- +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic] + fn greater_than_100() { + Guess::new(200); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.lock new file mode 100644 index 000000000..5802b7dc9 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "guessing_game" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml new file mode 100644 index 000000000..4e348c8d2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt new file mode 100644 index 000000000..f30b55ab1 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt @@ -0,0 +1,24 @@ +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... FAILED + +failures: + +---- tests::greater_than_100 stdout ---- +thread 'tests::greater_than_100' panicked at src/lib.rs:12:13: +Guess value must be greater than or equal to 1, got 200. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +note: panic did not contain expected string + panic message: `"Guess value must be greater than or equal to 1, got 200."`, + expected substring: `"less than or equal to 100"` + +failures: + tests::greater_than_100 + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/src/lib.rs new file mode 100644 index 000000000..fb5fc0e77 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/src/lib.rs @@ -0,0 +1,32 @@ +pub struct Guess { + value: i32, +} + +impl Guess { + pub fn new(value: i32) -> Guess { + // ANCHOR: here + if value < 1 { + panic!( + "Guess value must be less than or equal to 100, got {value}." + ); + } else if value > 100 { + panic!( + "Guess value must be greater than or equal to 1, got {value}." + ); + } + // ANCHOR_END: here + + Guess { value } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic(expected = "less than or equal to 100")] + fn greater_than_100() { + Guess::new(200); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs new file mode 100644 index 000000000..c31cdcae4 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs @@ -0,0 +1,21 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + // ANCHOR: here + #[test] + fn it_works() -> Result<(), String> { + let result = add(2, 2); + + if result == 4 { + Ok(()) + } else { + Err(String::from("two plus two does not equal four")) + } + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/output.txt new file mode 100644 index 000000000..bc40c96eb --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/output.txt @@ -0,0 +1,17 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.60s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::expensive_test ... ignored +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs new file mode 100644 index 000000000..0c8b38def --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs @@ -0,0 +1,22 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } + + #[test] + #[ignore] + fn expensive_test() { + // code that takes an hour to run + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/output.txt new file mode 100644 index 000000000..e25839459 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/output.txt @@ -0,0 +1,29 @@ +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.89s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::internal ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/common.rs (target/debug/deps/common-92948b65e88960b4) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/integration_test.rs (target/debug/deps/integration_test-92948b65e88960b4) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/src/lib.rs new file mode 100644 index 000000000..9ba15d8b2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/src/lib.rs @@ -0,0 +1,18 @@ +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs new file mode 100644 index 000000000..5fb7a390a --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs @@ -0,0 +1,3 @@ +pub fn setup() { + // setup code specific to your library's tests would go here +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/integration_test.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/integration_test.rs new file mode 100644 index 000000000..d6b88a750 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/integration_test.rs @@ -0,0 +1,7 @@ +use adder::add_two; + +#[test] +fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/src/lib.rs new file mode 100644 index 000000000..9ba15d8b2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/src/lib.rs @@ -0,0 +1,18 @@ +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/common/mod.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/common/mod.rs new file mode 100644 index 000000000..5fb7a390a --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/common/mod.rs @@ -0,0 +1,3 @@ +pub fn setup() { + // setup code specific to your library's tests would go here +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/integration_test.rs b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/integration_test.rs new file mode 100644 index 000000000..d18b5b689 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/integration_test.rs @@ -0,0 +1,11 @@ +use adder::add_two; + +mod common; + +#[test] +fn it_adds_two() { + common::setup(); + + let result = add_two(2); + assert_eq!(result, 4); +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.lock new file mode 100644 index 000000000..a6d35e395 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "silly-function" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml new file mode 100644 index 000000000..f751864de --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "silly-function" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt new file mode 100644 index 000000000..58f1ff4a5 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt @@ -0,0 +1,35 @@ +$ cargo test -- --show-output + Compiling silly-function v0.1.0 (file:///projects/silly-function) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.60s + Running unittests src/lib.rs (target/debug/deps/silly_function-160869f38cff9166) + +running 2 tests +test tests::this_test_will_fail ... FAILED +test tests::this_test_will_pass ... ok + +successes: + +---- tests::this_test_will_pass stdout ---- +I got the value 4 + + +successes: + tests::this_test_will_pass + +failures: + +---- tests::this_test_will_fail stdout ---- +I got the value 8 +thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: +assertion `left == right` failed + left: 5 + right: 10 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::this_test_will_fail + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs new file mode 100644 index 000000000..462d22470 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-01-show-output/src/lib.rs @@ -0,0 +1,21 @@ +pub fn prints_and_returns_10(a: i32) -> i32 { + println!("I got the value {a}"); + 10 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn this_test_will_pass() { + let value = prints_and_returns_10(4); + assert_eq!(10, value); + } + + #[test] + fn this_test_will_fail() { + let value = prints_and_returns_10(8); + assert_eq!(5, value); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/output.txt new file mode 100644 index 000000000..47e2a478e --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/output.txt @@ -0,0 +1,10 @@ +$ cargo test one_hundred + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.69s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::one_hundred ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/src/lib.rs new file mode 100644 index 000000000..f56715263 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-02-single-test/src/lib.rs @@ -0,0 +1,23 @@ +pub fn add_two(a: i32) -> i32 { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn add_two_and_two() { + assert_eq!(4, add_two(2)); + } + + #[test] + fn add_three_and_two() { + assert_eq!(5, add_two(3)); + } + + #[test] + fn one_hundred() { + assert_eq!(102, add_two(100)); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/output.txt new file mode 100644 index 000000000..d08940aee --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/output.txt @@ -0,0 +1,11 @@ +$ cargo test add + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::add_three_and_two ... ok +test tests::add_two_and_two ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/src/lib.rs new file mode 100644 index 000000000..f56715263 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/src/lib.rs @@ -0,0 +1,23 @@ +pub fn add_two(a: i32) -> i32 { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn add_two_and_two() { + assert_eq!(4, add_two(2)); + } + + #[test] + fn add_three_and_two() { + assert_eq!(5, add_two(3)); + } + + #[test] + fn one_hundred() { + assert_eq!(102, add_two(100)); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/output.txt new file mode 100644 index 000000000..4c7782d07 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/output.txt @@ -0,0 +1,16 @@ +$ cargo test -- --ignored + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test expensive_test ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/src/lib.rs new file mode 100644 index 000000000..2290c699d --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-04-running-ignored/src/lib.rs @@ -0,0 +1,12 @@ +// ANCHOR: here +#[test] +fn it_works() { + assert_eq!(2 + 2, 4); +} + +#[test] +#[ignore] +fn expensive_test() { + // code that takes an hour to run +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.lock b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/output.txt b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/output.txt new file mode 100644 index 000000000..2745d0f81 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/output.txt @@ -0,0 +1,10 @@ +$ cargo test --test integration_test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.64s + Running tests/integration_test.rs (target/debug/deps/integration_test-82e7799c1bc62298) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/src/lib.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/src/lib.rs new file mode 100644 index 000000000..9ba15d8b2 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/src/lib.rs @@ -0,0 +1,18 @@ +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/tests/integration_test.rs b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/tests/integration_test.rs new file mode 100644 index 000000000..d6b88a750 --- /dev/null +++ b/rustbook-ru/listings/ch11-writing-automated-tests/output-only-05-single-integration/tests/integration_test.rs @@ -0,0 +1,7 @@ +use adder::add_two; + +#[test] +fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-01/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/output.txt new file mode 100644 index 000000000..d2abb056b --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.61s + Running `target/debug/minigrep` +[src/main.rs:5:5] args = [ + "target/debug/minigrep", +] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-01/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/src/main.rs new file mode 100644 index 000000000..ae7def53d --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-01/src/main.rs @@ -0,0 +1,6 @@ +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + dbg!(args); +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-02/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/output.txt new file mode 100644 index 000000000..ad87dcf06 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/output.txt @@ -0,0 +1,6 @@ +$ cargo run -- test sample.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep test sample.txt` +Searching for test +In file sample.txt diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-02/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/src/main.rs new file mode 100644 index 000000000..afc3c3c9f --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-02/src/main.rs @@ -0,0 +1,11 @@ +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + + let query = &args[1]; + let file_path = &args[2]; + + println!("Searching for {query}"); + println!("In file {file_path}"); +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-03/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-03/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/src/main.rs new file mode 100644 index 000000000..afc3c3c9f --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-03/src/main.rs @@ -0,0 +1,11 @@ +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + + let query = &args[1]; + let file_path = &args[2]; + + println!("Searching for {query}"); + println!("In file {file_path}"); +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-04/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/output.txt new file mode 100644 index 000000000..d8cfe392d --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/output.txt @@ -0,0 +1,17 @@ +$ cargo run -- the poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep the poem.txt` +Searching for the +In file poem.txt +With text: +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-04/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-04/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/src/main.rs new file mode 100644 index 000000000..f34324979 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-04/src/main.rs @@ -0,0 +1,22 @@ +// ANCHOR: here +use std::env; +use std::fs; + +fn main() { + // --snip-- + // ANCHOR_END: here + let args: Vec = env::args().collect(); + + let query = &args[1]; + let file_path = &args[2]; + + println!("Searching for {query}"); + // ANCHOR: here + println!("In file {file_path}"); + + let contents = fs::read_to_string(file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-05/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-05/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/src/main.rs new file mode 100644 index 000000000..838cacf39 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-05/src/main.rs @@ -0,0 +1,29 @@ +use std::env; +use std::fs; + +// ANCHOR: here +fn main() { + let args: Vec = env::args().collect(); + + let (query, file_path) = parse_config(&args); + + // --snip-- + // ANCHOR_END: here + + println!("Searching for {query}"); + println!("In file {file_path}"); + + let contents = fs::read_to_string(file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); + // ANCHOR: here +} + +fn parse_config(args: &[String]) -> (&str, &str) { + let query = &args[1]; + let file_path = &args[2]; + + (query, file_path) +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-06/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-06/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/src/main.rs new file mode 100644 index 000000000..c77e848d8 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-06/src/main.rs @@ -0,0 +1,34 @@ +use std::env; +use std::fs; + +// ANCHOR: here +fn main() { + let args: Vec = env::args().collect(); + + let config = parse_config(&args); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + // --snip-- + // ANCHOR_END: here + + println!("With text:\n{contents}"); + // ANCHOR: here +} + +struct Config { + query: String, + file_path: String, +} + +fn parse_config(args: &[String]) -> Config { + let query = args[1].clone(); + let file_path = args[2].clone(); + + Config { query, file_path } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-07/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/output.txt new file mode 100644 index 000000000..e14b954de --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep` +thread 'main' panicked at src/main.rs:27:21: +index out of bounds: the len is 1 but the index is 1 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-07/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-07/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/src/main.rs new file mode 100644 index 000000000..ff6c29420 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-07/src/main.rs @@ -0,0 +1,40 @@ +use std::env; +use std::fs; + +// ANCHOR: here +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::new(&args); + // ANCHOR_END: here + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); + // ANCHOR: here + + // --snip-- +} + +// --snip-- + +// ANCHOR_END: here +struct Config { + query: String, + file_path: String, +} + +// ANCHOR: here +impl Config { + fn new(args: &[String]) -> Config { + let query = args[1].clone(); + let file_path = args[2].clone(); + + Config { query, file_path } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-08/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/output.txt new file mode 100644 index 000000000..c1aa1a93f --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep` +thread 'main' panicked at src/main.rs:26:13: +not enough arguments +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-08/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-08/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/src/main.rs new file mode 100644 index 000000000..cecd15abf --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-08/src/main.rs @@ -0,0 +1,38 @@ +use std::env; +use std::fs; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::new(&args); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} + +struct Config { + query: String, + file_path: String, +} + +impl Config { + // ANCHOR: here + // --snip-- + fn new(args: &[String]) -> Config { + if args.len() < 3 { + panic!("not enough arguments"); + } + // --snip-- + // ANCHOR_END: here + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Config { query, file_path } + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-09/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-09/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/src/main.rs new file mode 100644 index 000000000..3418e718c --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-09/src/main.rs @@ -0,0 +1,36 @@ +use std::env; +use std::fs; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::new(&args); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} + +struct Config { + query: String, + file_path: String, +} + +// ANCHOR: here +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-10/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/output.txt new file mode 100644 index 000000000..c5e085b45 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s + Running `target/debug/minigrep` +Problem parsing arguments: not enough arguments diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-10/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-10/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/src/main.rs new file mode 100644 index 000000000..ab6d3e548 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-10/src/main.rs @@ -0,0 +1,42 @@ +use std::env; +use std::fs; +// ANCHOR: here +use std::process; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // --snip-- + // ANCHOR_END: here + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} + +struct Config { + query: String, + file_path: String, +} + +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-11/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-11/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/src/main.rs new file mode 100644 index 000000000..3f476b975 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-11/src/main.rs @@ -0,0 +1,50 @@ +use std::env; +use std::fs; +use std::process; + +// ANCHOR: here +fn main() { + // --snip-- + + // ANCHOR_END: here + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // ANCHOR: here + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + run(config); +} + +fn run(config: Config) { + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} + +// --snip-- +// ANCHOR_END: here + +struct Config { + query: String, + file_path: String, +} + +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-12/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/output.txt new file mode 100644 index 000000000..6c5e67ba4 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/output.txt @@ -0,0 +1,31 @@ +$ cargo run -- the poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) +warning: unused `Result` that must be used + --> src/main.rs:19:5 + | +19 | run(config); + | ^^^^^^^^^^^ + | + = note: this `Result` may be an `Err` variant, which should be handled + = note: `#[warn(unused_must_use)]` on by default +help: use `let _ = ...` to ignore the resulting value + | +19 | let _ = run(config); + | +++++++ + +warning: `minigrep` (bin "minigrep") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71s + Running `target/debug/minigrep the poem.txt` +Searching for the +In file poem.txt +With text: +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-12/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-12/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/src/main.rs new file mode 100644 index 000000000..ab5fdb894 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-12/src/main.rs @@ -0,0 +1,51 @@ +use std::env; +use std::fs; +use std::process; +// ANCHOR: here +use std::error::Error; + +// --snip-- + +// ANCHOR_END: here + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + run(config); +} + +// ANCHOR: here +fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + println!("With text:\n{contents}"); + + Ok(()) +} +// ANCHOR_END: here + +struct Config { + query: String, + file_path: String, +} + +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-13/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/lib.rs new file mode 100644 index 000000000..1a3c48089 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/lib.rs @@ -0,0 +1,36 @@ +// ANCHOR: here +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + // --snip-- + // ANCHOR_END: here + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + // ANCHOR: here + } +} + +pub fn run(config: Config) -> Result<(), Box> { + // --snip-- + // ANCHOR_END: here + let contents = fs::read_to_string(config.file_path)?; + + println!("With text:\n{contents}"); + + Ok(()) + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/main.rs new file mode 100644 index 000000000..09756ca3f --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-13/src/main.rs @@ -0,0 +1,19 @@ +use std::env; +use std::process; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + if let Err(e) = run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-14/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/lib.rs new file mode 100644 index 000000000..4f3a4e865 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/lib.rs @@ -0,0 +1,28 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + println!("With text:\n{contents}"); + + Ok(()) +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/main.rs new file mode 100644 index 000000000..3b76009b5 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-14/src/main.rs @@ -0,0 +1,29 @@ +// ANCHOR: here +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + // --snip-- + // ANCHOR_END: here + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + // ANCHOR: here + if let Err(e) = minigrep::run(config) { + // --snip-- + // ANCHOR_END: here + println!("Application error: {e}"); + process::exit(1); + // ANCHOR: here + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-15/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/lib.rs new file mode 100644 index 000000000..20c4a782b --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/lib.rs @@ -0,0 +1,44 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-15/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/output.txt new file mode 100644 index 000000000..9f4c64d29 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/output.txt @@ -0,0 +1,24 @@ +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.97s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 1 test +test tests::one_result ... FAILED + +failures: + +---- tests::one_result stdout ---- +thread 'tests::one_result' panicked at src/lib.rs:44:9: +assertion `left == right` failed + left: ["safe, fast, productive."] + right: [] +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::one_result + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/lib.rs new file mode 100644 index 000000000..f5e593484 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/lib.rs @@ -0,0 +1,48 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + vec![] +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-16/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-17/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/lib.rs new file mode 100644 index 000000000..cb9fab401 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/lib.rs @@ -0,0 +1,50 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + for line in contents.lines() { + // do something with line + } +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-17/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-18/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/lib.rs new file mode 100644 index 000000000..a05d046d7 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/lib.rs @@ -0,0 +1,52 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + for line in contents.lines() { + if line.contains(query) { + // do something with line + } + } +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-18/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/output.txt new file mode 100644 index 000000000..ed87e4f58 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/output.txt @@ -0,0 +1,22 @@ +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.22s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 1 test +test tests::one_result ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests minigrep + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/lib.rs new file mode 100644 index 000000000..f5d3ffa9f --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/lib.rs @@ -0,0 +1,58 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +// ANCHOR: ch13 +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} +// ANCHOR_END: ch13 +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-19/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-20/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/lib.rs new file mode 100644 index 000000000..a757f7f55 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/lib.rs @@ -0,0 +1,76 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-20/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/output.txt new file mode 100644 index 000000000..945df3fd5 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/output.txt @@ -0,0 +1,23 @@ +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.33s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 2 tests +test tests::case_insensitive ... ok +test tests::case_sensitive ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests minigrep + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/lib.rs new file mode 100644 index 000000000..3aaa04082 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/lib.rs @@ -0,0 +1,92 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +// ANCHOR: here +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-21/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-22/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/lib.rs new file mode 100644 index 000000000..c3f4723f1 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/lib.rs @@ -0,0 +1,101 @@ +use std::error::Error; +use std::fs; + +// ANCHOR: here +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} +// ANCHOR_END: here + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +// ANCHOR: there +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} +// ANCHOR_END: there + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-22/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/output.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/output.txt new file mode 100644 index 000000000..5c6fc0c53 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/output.txt @@ -0,0 +1,6 @@ +$ cargo run -- to poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep to poem.txt` +Are you nobody, too? +How dreary to be somebody! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/lib.rs new file mode 100644 index 000000000..20eda2197 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/lib.rs @@ -0,0 +1,110 @@ +// ANCHOR: here +use std::env; +// --snip-- + +// ANCHOR_END: here +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +// ANCHOR: here +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +// ANCHOR_END: here + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-23/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-24/poem.txt b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/lib.rs new file mode 100644 index 000000000..292b09789 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/lib.rs @@ -0,0 +1,104 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/main.rs new file mode 100644 index 000000000..1278a6c17 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/listing-12-24/src/main.rs @@ -0,0 +1,20 @@ +use std::env; +use std::process; + +use minigrep::Config; + +// ANCHOR: here +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/poem.txt b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/src/main.rs new file mode 100644 index 000000000..e51319efe --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/src/main.rs @@ -0,0 +1,53 @@ +use std::env; +use std::error::Error; +use std::fs; +use std::process; + +// ANCHOR: here +fn main() { + // --snip-- + + // ANCHOR_END: here + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // ANCHOR: here + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + if let Err(e) = run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} +// ANCHOR_END: here + +fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + println!("With text:\n{contents}"); + + Ok(()) +} + +struct Config { + query: String, + file_path: String, +} + +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/output.txt b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/output.txt new file mode 100644 index 000000000..44b203620 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/output.txt @@ -0,0 +1,5 @@ +$ cargo run -- frog poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s + Running `target/debug/minigrep frog poem.txt` +How public, like a frog diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/poem.txt b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/lib.rs new file mode 100644 index 000000000..e06eae4cd --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/lib.rs @@ -0,0 +1,60 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +// ANCHOR: here +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} +// ANCHOR_END: here + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/output.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/output.txt new file mode 100644 index 000000000..5f733a7dd --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/output.txt @@ -0,0 +1,9 @@ +$ cargo run -- needle haystack + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.57s + Running `target/debug/minigrep needle haystack` +[src/main.rs:5:5] args = [ + "target/debug/minigrep", + "needle", + "haystack", +] diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/src/main.rs new file mode 100644 index 000000000..ae7def53d --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-01-with-args/src/main.rs @@ -0,0 +1,6 @@ +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + dbg!(args); +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt new file mode 100644 index 000000000..7e46576b4 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt @@ -0,0 +1,16 @@ +$ cargo build + Compiling minigrep v0.1.0 (file:///projects/minigrep) +error[E0106]: missing lifetime specifier + --> src/lib.rs:28:51 + | +28 | pub fn search(query: &str, contents: &str) -> Vec<&str> { + | ---- ---- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `query` or `contents` +help: consider introducing a named lifetime parameter + | +28 | pub fn search<'a>(query: &'a str, contents: &'a str) -> Vec<&'a str> { + | ++++ ++ ++ ++ + +For more information about this error, try `rustc --explain E0106`. +error: could not compile `minigrep` (lib) due to 1 previous error diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/poem.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/lib.rs new file mode 100644 index 000000000..df623bdea --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/lib.rs @@ -0,0 +1,48 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + Ok(()) +} + +// ANCHOR: here +pub fn search(query: &str, contents: &str) -> Vec<&str> { + vec![] +} +// ANCHOR_END: here + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-02-missing-lifetimes/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/output.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/output.txt new file mode 100644 index 000000000..704df2590 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/output.txt @@ -0,0 +1,7 @@ +$ cargo run -- body poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep body poem.txt` +I'm nobody! Who are you? +Are you nobody, too? +How dreary to be somebody! diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/poem.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/lib.rs new file mode 100644 index 000000000..e06eae4cd --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/lib.rs @@ -0,0 +1,60 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +// ANCHOR: here +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} +// ANCHOR_END: here + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-03-multiple-matches/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.lock b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/output.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/output.txt new file mode 100644 index 000000000..57f3a617c --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/output.txt @@ -0,0 +1,4 @@ +$ cargo run -- monomorphization poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep monomorphization poem.txt` diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/poem.txt b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/lib.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/lib.rs new file mode 100644 index 000000000..e06eae4cd --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/lib.rs @@ -0,0 +1,60 @@ +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} + +// ANCHOR: here +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} +// ANCHOR_END: here + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} diff --git a/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/main.rs b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch12-an-io-project/output-only-04-no-matches/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/lib.rs new file mode 100644 index 000000000..e54343d24 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/lib.rs @@ -0,0 +1,106 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +// ANCHOR: ch13 +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +// ANCHOR_END: ch13 + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/main.rs new file mode 100644 index 000000000..a4f8a7411 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-23-reproduced/src/main.rs @@ -0,0 +1,18 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/lib.rs new file mode 100644 index 000000000..292b09789 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/lib.rs @@ -0,0 +1,104 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/main.rs new file mode 100644 index 000000000..f9d179c8c --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-12-24-reproduced/src/main.rs @@ -0,0 +1,24 @@ +use std::env; +use std::process; + +use minigrep::Config; + +// ANCHOR: ch13 +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // --snip-- + // ANCHOR_END: ch13 + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } + // ANCHOR: ch13 +} +// ANCHOR_END: ch13 diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.lock new file mode 100644 index 000000000..6f974d1ba --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "shirt-company" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.toml new file mode 100644 index 000000000..1eb392dfa --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shirt-company" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-01/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-01/output.txt new file mode 100644 index 000000000..28c829f4e --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-01/output.txt @@ -0,0 +1,6 @@ +$ cargo run + Compiling shirt-company v0.1.0 (file:///projects/shirt-company) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s + Running `target/debug/shirt-company` +The user with preference Some(Red) gets Red +The user with preference None gets Blue diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-01/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-01/src/main.rs new file mode 100644 index 000000000..2c87d6965 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-01/src/main.rs @@ -0,0 +1,52 @@ +#[derive(Debug, PartialEq, Copy, Clone)] +enum ShirtColor { + Red, + Blue, +} + +struct Inventory { + shirts: Vec, +} + +impl Inventory { + fn giveaway(&self, user_preference: Option) -> ShirtColor { + user_preference.unwrap_or_else(|| self.most_stocked()) + } + + fn most_stocked(&self) -> ShirtColor { + let mut num_red = 0; + let mut num_blue = 0; + + for color in &self.shirts { + match color { + ShirtColor::Red => num_red += 1, + ShirtColor::Blue => num_blue += 1, + } + } + if num_red > num_blue { + ShirtColor::Red + } else { + ShirtColor::Blue + } + } +} + +fn main() { + let store = Inventory { + shirts: vec![ShirtColor::Blue, ShirtColor::Red, ShirtColor::Blue], + }; + + let user_pref1 = Some(ShirtColor::Red); + let giveaway1 = store.giveaway(user_pref1); + println!( + "The user with preference {:?} gets {:?}", + user_pref1, giveaway1 + ); + + let user_pref2 = None; + let giveaway2 = store.giveaway(user_pref2); + println!( + "The user with preference {:?} gets {:?}", + user_pref2, giveaway2 + ); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.lock new file mode 100644 index 000000000..75ff09e51 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "workout-app" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.toml new file mode 100644 index 000000000..f09a737d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "workout-app" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-02/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-02/src/main.rs new file mode 100644 index 000000000..b3f4cc2c2 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-02/src/main.rs @@ -0,0 +1,33 @@ +use std::thread; +use std::time::Duration; + +fn generate_workout(intensity: u32, random_number: u32) { + // ANCHOR: here + let expensive_closure = |num: u32| -> u32 { + println!("calculating slowly..."); + thread::sleep(Duration::from_secs(2)); + num + }; + // ANCHOR_END: here + + if intensity < 25 { + println!("Today, do {} pushups!", expensive_closure(intensity)); + println!("Next, do {} situps!", expensive_closure(intensity)); + } else { + if random_number == 3 { + println!("Take a break today! Remember to stay hydrated!"); + } else { + println!( + "Today, run for {} minutes!", + expensive_closure(intensity) + ); + } + } +} + +fn main() { + let simulated_user_specified_value = 10; + let simulated_random_number = 7; + + generate_workout(simulated_user_specified_value, simulated_random_number); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.lock new file mode 100644 index 000000000..c190d3a41 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "closure-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.toml new file mode 100644 index 000000000..914c4cfaa --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "closure-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-03/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-03/output.txt new file mode 100644 index 000000000..16716c3ac --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-03/output.txt @@ -0,0 +1,26 @@ +$ cargo run + Compiling closure-example v0.1.0 (file:///projects/closure-example) +error[E0308]: mismatched types + --> src/main.rs:5:29 + | +5 | let n = example_closure(5); + | --------------- ^- help: try using a conversion method: `.to_string()` + | | | + | | expected `String`, found integer + | arguments to this function are incorrect + | +note: expected because the closure was earlier called with an argument of type `String` + --> src/main.rs:4:29 + | +4 | let s = example_closure(String::from("hello")); + | --------------- ^^^^^^^^^^^^^^^^^^^^^ expected because this argument is of type `String` + | | + | in this closure call +note: closure parameter defined here + --> src/main.rs:2:28 + | +2 | let example_closure = |x| x; + | ^ + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `closure-example` (bin "closure-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-03/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-03/src/main.rs new file mode 100644 index 000000000..ebb2489bf --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-03/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let example_closure = |x| x; + + let s = example_closure(String::from("hello")); + let n = example_closure(5); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.lock new file mode 100644 index 000000000..75ff09e51 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "workout-app" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.toml new file mode 100644 index 000000000..914c4cfaa --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "closure-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-04/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-04/output.txt new file mode 100644 index 000000000..fbc00b5df --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-04/output.txt @@ -0,0 +1,10 @@ +$ cargo run + Locking 1 package to latest compatible version + Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-04) + Compiling closure-example v0.1.0 (file:///projects/closure-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s + Running `target/debug/closure-example` +Before defining closure: [1, 2, 3] +Before calling closure: [1, 2, 3] +From closure: [1, 2, 3] +After calling closure: [1, 2, 3] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-04/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-04/src/main.rs new file mode 100644 index 000000000..19f51a6f7 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-04/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + let list = vec![1, 2, 3]; + println!("Before defining closure: {list:?}"); + + let only_borrows = || println!("From closure: {list:?}"); + + println!("Before calling closure: {list:?}"); + only_borrows(); + println!("After calling closure: {list:?}"); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.lock new file mode 100644 index 000000000..75ff09e51 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "workout-app" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.toml new file mode 100644 index 000000000..914c4cfaa --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "closure-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-05/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-05/output.txt new file mode 100644 index 000000000..695ee4bee --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-05/output.txt @@ -0,0 +1,8 @@ +$ cargo run + Locking 1 package to latest compatible version + Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-05) + Compiling closure-example v0.1.0 (file:///projects/closure-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s + Running `target/debug/closure-example` +Before defining closure: [1, 2, 3] +After calling closure: [1, 2, 3, 7] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-05/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-05/src/main.rs new file mode 100644 index 000000000..f6c2a53de --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-05/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let mut list = vec![1, 2, 3]; + println!("Before defining closure: {list:?}"); + + let mut borrows_mutably = || list.push(7); + + borrows_mutably(); + println!("After calling closure: {list:?}"); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-06/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-06/Cargo.toml new file mode 100644 index 000000000..8085ade0f --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-06/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "closure-example" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-06/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-06/src/main.rs new file mode 100644 index 000000000..ee9ca0457 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-06/src/main.rs @@ -0,0 +1,10 @@ +use std::thread; + +fn main() { + let list = vec![1, 2, 3]; + println!("Before defining closure: {list:?}"); + + thread::spawn(move || println!("From thread: {list:?}")) + .join() + .unwrap(); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-07/.rustfmt.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-07/.rustfmt.toml new file mode 100644 index 000000000..ee10c634b --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-07/.rustfmt.toml @@ -0,0 +1,2 @@ +struct_lit_width = 50 + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-07/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-07/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-07/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-07/output.txt new file mode 100644 index 000000000..8c11d84dc --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-07/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.41s + Running `target/debug/rectangles` +[ + Rectangle { + width: 3, + height: 5, + }, + Rectangle { + width: 7, + height: 12, + }, + Rectangle { + width: 10, + height: 1, + }, +] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-07/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-07/src/main.rs new file mode 100644 index 000000000..e7ab8d340 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-07/src/main.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let mut list = [ + Rectangle { width: 10, height: 1 }, + Rectangle { width: 3, height: 5 }, + Rectangle { width: 7, height: 12 }, + ]; + + list.sort_by_key(|r| r.width); + println!("{list:#?}"); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-08/.rustfmt.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-08/.rustfmt.toml new file mode 100644 index 000000000..ee10c634b --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-08/.rustfmt.toml @@ -0,0 +1,2 @@ +struct_lit_width = 50 + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-08/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-08/Cargo.toml new file mode 100644 index 000000000..703c9d977 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-08/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-08/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-08/output.txt new file mode 100644 index 000000000..979868dc3 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-08/output.txt @@ -0,0 +1,20 @@ +$ cargo run + Compiling rectangles v0.1.0 (file:///projects/rectangles) +error[E0507]: cannot move out of `value`, a captured variable in an `FnMut` closure + --> src/main.rs:18:30 + | +15 | let value = String::from("closure called"); + | ----- captured outer variable +16 | +17 | list.sort_by_key(|r| { + | --- captured by this `FnMut` closure +18 | sort_operations.push(value); + | ^^^^^ move occurs because `value` has type `String`, which does not implement the `Copy` trait + | +help: consider cloning the value if the performance cost is acceptable + | +18 | sort_operations.push(value.clone()); + | ++++++++ + +For more information about this error, try `rustc --explain E0507`. +error: could not compile `rectangles` (bin "rectangles") due to 1 previous error diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-08/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-08/src/main.rs new file mode 100644 index 000000000..e00fec70f --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-08/src/main.rs @@ -0,0 +1,22 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let mut list = [ + Rectangle { width: 10, height: 1 }, + Rectangle { width: 3, height: 5 }, + Rectangle { width: 7, height: 12 }, + ]; + + let mut sort_operations = vec![]; + let value = String::from("closure called"); + + list.sort_by_key(|r| { + sort_operations.push(value); + r.width + }); + println!("{list:#?}"); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-09/.rustfmt.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-09/.rustfmt.toml new file mode 100644 index 000000000..ee10c634b --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-09/.rustfmt.toml @@ -0,0 +1,2 @@ +struct_lit_width = 50 + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.lock new file mode 100644 index 000000000..e090432bc --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cacher" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.toml new file mode 100644 index 000000000..4a279a450 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rectangles" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-09/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-09/src/main.rs new file mode 100644 index 000000000..f007e3c04 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-09/src/main.rs @@ -0,0 +1,20 @@ +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let mut list = [ + Rectangle { width: 10, height: 1 }, + Rectangle { width: 3, height: 5 }, + Rectangle { width: 7, height: 12 }, + ]; + + let mut num_sort_operations = 0; + list.sort_by_key(|r| { + num_sort_operations += 1; + r.width + }); + println!("{list:#?}, sorted in {num_sort_operations} operations"); +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-10/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-10/src/main.rs new file mode 100644 index 000000000..55a0dd37e --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-10/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + let v1 = vec![1, 2, 3]; + + let v1_iter = v1.iter(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-11/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-11/src/main.rs new file mode 100644 index 000000000..b4e85169a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-11/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let v1 = vec![1, 2, 3]; + + let v1_iter = v1.iter(); + + for val in v1_iter { + println!("Got: {val}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-12/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-12/src/lib.rs new file mode 100644 index 000000000..758284044 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-12/src/lib.rs @@ -0,0 +1,16 @@ +#[cfg(test)] +mod tests { + // ANCHOR: here + #[test] + fn iterator_demonstration() { + let v1 = vec![1, 2, 3]; + + let mut v1_iter = v1.iter(); + + assert_eq!(v1_iter.next(), Some(&1)); + assert_eq!(v1_iter.next(), Some(&2)); + assert_eq!(v1_iter.next(), Some(&3)); + assert_eq!(v1_iter.next(), None); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-13/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-13/src/lib.rs new file mode 100644 index 000000000..d1cb54d0a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-13/src/lib.rs @@ -0,0 +1,15 @@ +#[cfg(test)] +mod tests { + // ANCHOR: here + #[test] + fn iterator_sum() { + let v1 = vec![1, 2, 3]; + + let v1_iter = v1.iter(); + + let total: i32 = v1_iter.sum(); + + assert_eq!(total, 6); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-14/output.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-14/output.txt new file mode 100644 index 000000000..d46dd5c42 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-14/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling iterators v0.1.0 (file:///projects/iterators) +warning: unused `Map` that must be used + --> src/main.rs:4:5 + | +4 | v1.iter().map(|x| x + 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: iterators are lazy and do nothing unless consumed + = note: `#[warn(unused_must_use)]` on by default +help: use `let _ = ...` to ignore the resulting value + | +4 | let _ = v1.iter().map(|x| x + 1); + | +++++++ + +warning: `iterators` (bin "iterators") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.47s + Running `target/debug/iterators` diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-14/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-14/src/main.rs new file mode 100644 index 000000000..62a68be9b --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-14/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + let v1: Vec = vec![1, 2, 3]; + + v1.iter().map(|x| x + 1); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.lock new file mode 100644 index 000000000..e91eaa8d4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "iterators" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.toml new file mode 100644 index 000000000..2652a8a1a --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "iterators" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-15/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-15/src/main.rs new file mode 100644 index 000000000..db9025d6f --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-15/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let v1: Vec = vec![1, 2, 3]; + + let v2: Vec<_> = v1.iter().map(|x| x + 1).collect(); + + assert_eq!(v2, vec![2, 3, 4]); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.lock new file mode 100644 index 000000000..0b15e2157 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shoe_size" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.toml new file mode 100644 index 000000000..cc803776b --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shoe_size" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-16/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-16/src/lib.rs new file mode 100644 index 000000000..281c3c9e4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-16/src/lib.rs @@ -0,0 +1,48 @@ +#[derive(PartialEq, Debug)] +struct Shoe { + size: u32, + style: String, +} + +fn shoes_in_size(shoes: Vec, shoe_size: u32) -> Vec { + shoes.into_iter().filter(|s| s.size == shoe_size).collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn filters_by_size() { + let shoes = vec![ + Shoe { + size: 10, + style: String::from("sneaker"), + }, + Shoe { + size: 13, + style: String::from("sandal"), + }, + Shoe { + size: 10, + style: String::from("boot"), + }, + ]; + + let in_my_size = shoes_in_size(shoes, 10); + + assert_eq!( + in_my_size, + vec![ + Shoe { + size: 10, + style: String::from("sneaker") + }, + Shoe { + size: 10, + style: String::from("boot") + }, + ] + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-18/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-18/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-18/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/lib.rs new file mode 100644 index 000000000..292b09789 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/lib.rs @@ -0,0 +1,104 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/main.rs new file mode 100644 index 000000000..40109ef63 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-18/src/main.rs @@ -0,0 +1,22 @@ +use std::env; +use std::process; + +use minigrep::Config; + +// ANCHOR: here +fn main() { + let config = Config::build(env::args()).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // --snip-- + // ANCHOR_END: here + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-19/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-19/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-19/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/lib.rs new file mode 100644 index 000000000..79ae2b8f6 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/lib.rs @@ -0,0 +1,109 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +// ANCHOR: here +impl Config { + pub fn build( + mut args: impl Iterator, + ) -> Result { + // --snip-- + // ANCHOR_END: here + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/main.rs new file mode 100644 index 000000000..9ac022545 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-19/src/main.rs @@ -0,0 +1,16 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let config = Config::build(env::args()).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-20/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-20/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-20/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/lib.rs new file mode 100644 index 000000000..4410964a7 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/lib.rs @@ -0,0 +1,113 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +// ANCHOR: here +impl Config { + pub fn build( + mut args: impl Iterator, + ) -> Result { + args.next(); + + let query = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a query string"), + }; + + let file_path = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a file path"), + }; + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +// ANCHOR_END: here + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/main.rs new file mode 100644 index 000000000..9ac022545 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-20/src/main.rs @@ -0,0 +1,16 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let config = Config::build(env::args()).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.lock b/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.lock new file mode 100644 index 000000000..88bf82d16 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "minigrep" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.toml b/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.toml new file mode 100644 index 000000000..64c2a3f52 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "minigrep" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-22/poem.txt b/rustbook-ru/listings/ch13-functional-features/listing-13-22/poem.txt new file mode 100644 index 000000000..870752731 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-22/poem.txt @@ -0,0 +1,9 @@ +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/lib.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/lib.rs new file mode 100644 index 000000000..d694669b4 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/lib.rs @@ -0,0 +1,108 @@ +use std::env; +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} + +impl Config { + pub fn build( + mut args: impl Iterator, + ) -> Result { + args.next(); + + let query = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a query string"), + }; + + let file_path = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a file path"), + }; + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} + +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} + +// ANCHOR: here +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + contents + .lines() + .filter(|line| line.contains(query)) + .collect() +} +// ANCHOR_END: here + +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} diff --git a/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/main.rs b/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/main.rs new file mode 100644 index 000000000..9ac022545 --- /dev/null +++ b/rustbook-ru/listings/ch13-functional-features/listing-13-22/src/main.rs @@ -0,0 +1,16 @@ +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + let config = Config::build(env::args()).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.lock new file mode 100644 index 000000000..b304dd7c7 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "my_crate" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml new file mode 100644 index 000000000..c52da0412 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "my_crate" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/src/lib.rs new file mode 100644 index 000000000..ed7abb727 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-01/src/lib.rs @@ -0,0 +1,13 @@ +/// Adds one to the number given. +/// +/// # Examples +/// +/// ``` +/// let arg = 5; +/// let answer = my_crate::add_one(arg); +/// +/// assert_eq!(6, answer); +/// ``` +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.lock new file mode 100644 index 000000000..b304dd7c7 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "my_crate" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml new file mode 100644 index 000000000..c52da0412 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "my_crate" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/src/lib.rs new file mode 100644 index 000000000..64c9c439c --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-02/src/lib.rs @@ -0,0 +1,21 @@ +// ANCHOR: here +//! # My Crate +//! +//! `my_crate` is a collection of utilities to make performing certain +//! calculations more convenient. + +/// Adds one to the number given. +// --snip-- +// ANCHOR_END: here +/// +/// # Examples +/// +/// ``` +/// let arg = 5; +/// let answer = my_crate::add_one(arg); +/// +/// assert_eq!(6, answer); +/// ``` +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.lock new file mode 100644 index 000000000..df19c247b --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "art" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml new file mode 100644 index 000000000..66ef4b532 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "art" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/src/lib.rs new file mode 100644 index 000000000..bffbe058d --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-03/src/lib.rs @@ -0,0 +1,34 @@ +// ANCHOR: here +//! # Art +//! +//! A library for modeling artistic concepts. + +pub mod kinds { + /// The primary colors according to the RYB color model. + pub enum PrimaryColor { + Red, + Yellow, + Blue, + } + + /// The secondary colors according to the RYB color model. + pub enum SecondaryColor { + Orange, + Green, + Purple, + } +} + +pub mod utils { + use crate::kinds::*; + + /// Combines two primary colors in equal amounts to create + /// a secondary color. + pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor { + // --snip-- + // ANCHOR_END: here + unimplemented!(); + // ANCHOR: here + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.lock new file mode 100644 index 000000000..df19c247b --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "art" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml new file mode 100644 index 000000000..66ef4b532 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "art" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/lib.rs new file mode 100644 index 000000000..b077a9a71 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/lib.rs @@ -0,0 +1,29 @@ +//! # Art +//! +//! A library for modeling artistic concepts. + +pub mod kinds { + /// The primary colors according to the RYB color model. + pub enum PrimaryColor { + Red, + Yellow, + Blue, + } + + /// The secondary colors according to the RYB color model. + pub enum SecondaryColor { + Orange, + Green, + Purple, + } +} + +pub mod utils { + use crate::kinds::*; + + /// Combines two primary colors in equal amounts to create + /// a secondary color. + pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor { + SecondaryColor::Orange + } +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/main.rs new file mode 100644 index 000000000..b1a4bf792 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-04/src/main.rs @@ -0,0 +1,8 @@ +use art::kinds::PrimaryColor; +use art::utils::mix; + +fn main() { + let red = PrimaryColor::Red; + let yellow = PrimaryColor::Yellow; + mix(red, yellow); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.lock new file mode 100644 index 000000000..df19c247b --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "art" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml new file mode 100644 index 000000000..66ef4b532 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "art" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/src/lib.rs new file mode 100644 index 000000000..c5aa9e7b0 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-05/src/lib.rs @@ -0,0 +1,41 @@ +// ANCHOR: here +//! # Art +//! +//! A library for modeling artistic concepts. + +pub use self::kinds::PrimaryColor; +pub use self::kinds::SecondaryColor; +pub use self::utils::mix; + +pub mod kinds { + // --snip-- + // ANCHOR_END: here + /// The primary colors according to the RYB color model. + pub enum PrimaryColor { + Red, + Yellow, + Blue, + } + + /// The secondary colors according to the RYB color model. + pub enum SecondaryColor { + Orange, + Green, + Purple, + } + // ANCHOR: here +} + +pub mod utils { + // --snip-- + // ANCHOR_END: here + use crate::kinds::*; + + /// Combines two primary colors in equal amounts to create + /// a secondary color. + pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor { + SecondaryColor::Orange + } + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.lock new file mode 100644 index 000000000..df19c247b --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "art" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml new file mode 100644 index 000000000..66ef4b532 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "art" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/lib.rs new file mode 100644 index 000000000..daabd006d --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/lib.rs @@ -0,0 +1,33 @@ +//! # Art +//! +//! A library for modeling artistic concepts. + +pub use self::kinds::PrimaryColor; +pub use self::kinds::SecondaryColor; +pub use self::utils::mix; + +pub mod kinds { + /// The primary colors according to the RYB color model. + pub enum PrimaryColor { + Red, + Yellow, + Blue, + } + + /// The secondary colors according to the RYB color model. + pub enum SecondaryColor { + Orange, + Green, + Purple, + } +} + +pub mod utils { + use crate::kinds::*; + + /// Combines two primary colors in equal amounts to create + /// a secondary color. + pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor { + SecondaryColor::Orange + } +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/main.rs new file mode 100644 index 000000000..51f3b761d --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-06/src/main.rs @@ -0,0 +1,13 @@ +// ANCHOR: here +use art::mix; +use art::PrimaryColor; + +fn main() { + // --snip-- + // ANCHOR_END: here + let red = PrimaryColor::Red; + let yellow = PrimaryColor::Yellow; + mix(red, yellow); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.lock new file mode 100644 index 000000000..a456055c9 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.lock @@ -0,0 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "add_one" +version = "0.1.0" + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one 0.1.0", +] + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml new file mode 100644 index 000000000..8af4ab816 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/src/lib.rs new file mode 100644 index 000000000..b0bb86943 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/add_one/src/lib.rs @@ -0,0 +1,3 @@ +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml new file mode 100644 index 000000000..feb3d956e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] + +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs new file mode 100644 index 000000000..131629490 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs @@ -0,0 +1,6 @@ +use add_one; + +fn main() { + let num = 10; + println!("Hello, world! {num} plus one is {}!", add_one::add_one(num)); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock new file mode 100644 index 000000000..d37189b33 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml new file mode 100644 index 000000000..c5ea8e510 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +members = [ + "adder", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml new file mode 100644 index 000000000..e61cb12e3 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.lock new file mode 100644 index 000000000..a456055c9 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.lock @@ -0,0 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "add_one" +version = "0.1.0" + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one 0.1.0", +] + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml new file mode 100644 index 000000000..8af4ab816 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/src/lib.rs new file mode 100644 index 000000000..b0bb86943 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/src/lib.rs @@ -0,0 +1,3 @@ +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml new file mode 100644 index 000000000..55c02036c --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.lock new file mode 100644 index 000000000..bf6974b58 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.lock @@ -0,0 +1,82 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "add_one" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml new file mode 100644 index 000000000..bc758bd88 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/src/lib.rs new file mode 100644 index 000000000..7b61b40a4 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/src/lib.rs @@ -0,0 +1,5 @@ +use rand; + +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml new file mode 100644 index 000000000..feb3d956e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] + +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/src/main.rs new file mode 100644 index 000000000..7deb7962f --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/src/main.rs @@ -0,0 +1,10 @@ +use add_one; + +fn main() { + let num = 10; + println!( + "Hello, world! {} plus one is {}!", + num, + add_one::add_one(num) + ); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.lock new file mode 100644 index 000000000..a456055c9 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.lock @@ -0,0 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "add_one" +version = "0.1.0" + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one 0.1.0", +] + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml new file mode 100644 index 000000000..8af4ab816 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/src/lib.rs new file mode 100644 index 000000000..40ceb1285 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/src/lib.rs @@ -0,0 +1,13 @@ +pub fn add_one(x: i32) -> i32 { + x + 1 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + assert_eq!(3, add_one(2)); + } +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml new file mode 100644 index 000000000..feb3d956e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] + +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/src/main.rs new file mode 100644 index 000000000..7deb7962f --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/src/main.rs @@ -0,0 +1,10 @@ +use add_one; + +fn main() { + let num = 10; + println!( + "Hello, world! {} plus one is {}!", + num, + add_one::add_one(num) + ); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/.gitignore b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/.gitignore new file mode 100644 index 000000000..b46d5c464 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/.gitignore @@ -0,0 +1 @@ +adder diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.lock new file mode 100644 index 000000000..d98623d6e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adder" +version = "0.1.0" diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml new file mode 100644 index 000000000..c5ea8e510 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +members = [ + "adder", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/rustfmt-ignore b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/rustfmt-ignore new file mode 100644 index 000000000..958e56837 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/rustfmt-ignore @@ -0,0 +1,2 @@ +This listing is used for demonstrating how to set up a workspace, but the workspace isn't +completely set up yet, so rustfmt complains the crate mentioned in Cargo.toml doesn't exist yet. diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock new file mode 100644 index 000000000..a456055c9 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.lock @@ -0,0 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "add_one" +version = "0.1.0" + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one 0.1.0", +] + diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml new file mode 100644 index 000000000..900018470 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs new file mode 100644 index 000000000..7d12d9af8 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml new file mode 100644 index 000000000..feb3d956e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] + +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.lock b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.lock new file mode 100644 index 000000000..bf6974b58 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.lock @@ -0,0 +1,82 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "add_one" +version = "0.1.0" +dependencies = [ + "rand", +] + +[[package]] +name = "adder" +version = "0.1.0" +dependencies = [ + "add_one", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml new file mode 100644 index 000000000..1448801d5 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] + +members = [ + "adder", + "add_one", +] diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml new file mode 100644 index 000000000..bc758bd88 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "add_one" +version = "0.1.0" +edition = "2021" + +[dependencies] +rand = "0.8.5" diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/src/lib.rs b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/src/lib.rs new file mode 100644 index 000000000..7b61b40a4 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/src/lib.rs @@ -0,0 +1,5 @@ +use rand; + +pub fn add_one(x: i32) -> i32 { + x + 1 +} diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml new file mode 100644 index 000000000..feb3d956e --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "adder" +version = "0.1.0" +edition = "2021" + +[dependencies] + +add_one = { path = "../add_one" } diff --git a/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/src/main.rs b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/src/main.rs new file mode 100644 index 000000000..eb4050dc3 --- /dev/null +++ b/rustbook-ru/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/src/main.rs @@ -0,0 +1,11 @@ +use add_one; +use rand; + +fn main() { + let num = 10; + println!( + "Hello, world! {} plus one is {}!", + num, + add_one::add_one(num) + ); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.lock new file mode 100644 index 000000000..8c125fc84 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "box-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.toml new file mode 100644 index 000000000..690385c7a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "box-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/src/main.rs new file mode 100644 index 000000000..97f04f385 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-01/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let b = Box::new(5); + println!("b = {b}"); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/src/main.rs new file mode 100644 index 000000000..84640b9b9 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-02/src/main.rs @@ -0,0 +1,8 @@ +// ANCHOR: here +enum List { + Cons(i32, List), + Nil, +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/output.txt new file mode 100644 index 000000000..2563fb647 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/output.txt @@ -0,0 +1,28 @@ +$ cargo run + Compiling cons-list v0.1.0 (file:///projects/cons-list) +error[E0072]: recursive type `List` has infinite size + --> src/main.rs:1:1 + | +1 | enum List { + | ^^^^^^^^^ +2 | Cons(i32, List), + | ---- recursive without indirection + | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle + | +2 | Cons(i32, Box), + | ++++ + + +error[E0391]: cycle detected when computing when `List` needs drop + --> src/main.rs:1:1 + | +1 | enum List { + | ^^^^^^^^^ + | + = note: ...which immediately requires computing when `List` needs drop again + = note: cycle used when computing whether `List` needs drop + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +Some errors have detailed explanations: E0072, E0391. +For more information about an error, try `rustc --explain E0072`. +error: could not compile `cons-list` (bin "cons-list") due to 2 previous errors diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/src/main.rs new file mode 100644 index 000000000..a96f3d7b1 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-03/src/main.rs @@ -0,0 +1,12 @@ +enum List { + Cons(i32, List), + Nil, +} + +// ANCHOR: here +use crate::List::{Cons, Nil}; + +fn main() { + let list = Cons(1, Cons(2, Cons(3, Nil))); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/src/main.rs new file mode 100644 index 000000000..22f7d8338 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-05/src/main.rs @@ -0,0 +1,10 @@ +enum List { + Cons(i32, Box), + Nil, +} + +use crate::List::{Cons, Nil}; + +fn main() { + let list = Cons(1, Box::new(Cons(2, Box::new(Cons(3, Box::new(Nil)))))); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/src/main.rs new file mode 100644 index 000000000..174b620cf --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-06/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let x = 5; + let y = &x; + + assert_eq!(5, x); + assert_eq!(5, *y); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/src/main.rs new file mode 100644 index 000000000..4933a416b --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-07/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let x = 5; + let y = Box::new(x); + + assert_eq!(5, x); + assert_eq!(5, *y); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/src/main.rs new file mode 100644 index 000000000..f48594673 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-08/src/main.rs @@ -0,0 +1,11 @@ +// ANCHOR: here +struct MyBox(T); + +impl MyBox { + fn new(x: T) -> MyBox { + MyBox(x) + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/output.txt new file mode 100644 index 000000000..a295d2628 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/output.txt @@ -0,0 +1,10 @@ +$ cargo run + Compiling deref-example v0.1.0 (file:///projects/deref-example) +error[E0614]: type `MyBox<{integer}>` cannot be dereferenced + --> src/main.rs:14:19 + | +14 | assert_eq!(5, *y); + | ^^ + +For more information about this error, try `rustc --explain E0614`. +error: could not compile `deref-example` (bin "deref-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/src/main.rs new file mode 100644 index 000000000..d07f2d78a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-09/src/main.rs @@ -0,0 +1,17 @@ +struct MyBox(T); + +impl MyBox { + fn new(x: T) -> MyBox { + MyBox(x) + } +} + +// ANCHOR: here +fn main() { + let x = 5; + let y = MyBox::new(x); + + assert_eq!(5, x); + assert_eq!(5, *y); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/src/main.rs new file mode 100644 index 000000000..cce754d08 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-10/src/main.rs @@ -0,0 +1,27 @@ +// ANCHOR: here +use std::ops::Deref; + +impl Deref for MyBox { + type Target = T; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +// ANCHOR_END: here + +struct MyBox(T); + +impl MyBox { + fn new(x: T) -> MyBox { + MyBox(x) + } +} + +fn main() { + let x = 5; + let y = MyBox::new(x); + + assert_eq!(5, x); + assert_eq!(5, *y); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/src/main.rs new file mode 100644 index 000000000..77a88c91f --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-11/src/main.rs @@ -0,0 +1,7 @@ +// ANCHOR: here +fn hello(name: &str) { + println!("Hello, {name}!"); +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/src/main.rs new file mode 100644 index 000000000..8cd3893cb --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-12/src/main.rs @@ -0,0 +1,28 @@ +use std::ops::Deref; + +impl Deref for MyBox { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } +} + +struct MyBox(T); + +impl MyBox { + fn new(x: T) -> MyBox { + MyBox(x) + } +} + +fn hello(name: &str) { + println!("Hello, {name}!"); +} + +// ANCHOR: here +fn main() { + let m = MyBox::new(String::from("Rust")); + hello(&m); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/src/main.rs new file mode 100644 index 000000000..9debe2a31 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-13/src/main.rs @@ -0,0 +1,28 @@ +use std::ops::Deref; + +impl Deref for MyBox { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } +} + +struct MyBox(T); + +impl MyBox { + fn new(x: T) -> MyBox { + MyBox(x) + } +} + +fn hello(name: &str) { + println!("Hello, {name}!"); +} + +// ANCHOR: here +fn main() { + let m = MyBox::new(String::from("Rust")); + hello(&(*m)[..]); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.lock new file mode 100644 index 000000000..eb8a2817a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "drop-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.toml new file mode 100644 index 000000000..1e4c99481 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "drop-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/output.txt new file mode 100644 index 000000000..1393d44b3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling drop-example v0.1.0 (file:///projects/drop-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.60s + Running `target/debug/drop-example` +CustomSmartPointers created. +Dropping CustomSmartPointer with data `other stuff`! +Dropping CustomSmartPointer with data `my stuff`! diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/src/main.rs new file mode 100644 index 000000000..231612ae6 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-14/src/main.rs @@ -0,0 +1,19 @@ +struct CustomSmartPointer { + data: String, +} + +impl Drop for CustomSmartPointer { + fn drop(&mut self) { + println!("Dropping CustomSmartPointer with data `{}`!", self.data); + } +} + +fn main() { + let c = CustomSmartPointer { + data: String::from("my stuff"), + }; + let d = CustomSmartPointer { + data: String::from("other stuff"), + }; + println!("CustomSmartPointers created."); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.lock new file mode 100644 index 000000000..eb8a2817a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "drop-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.toml new file mode 100644 index 000000000..1e4c99481 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "drop-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/output.txt new file mode 100644 index 000000000..8a53b2852 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/output.txt @@ -0,0 +1,15 @@ +$ cargo run + Compiling drop-example v0.1.0 (file:///projects/drop-example) +error[E0040]: explicit use of destructor method + --> src/main.rs:16:7 + | +16 | c.drop(); + | ^^^^ explicit destructor calls not allowed + | +help: consider using `drop` function + | +16 | drop(c); + | +++++ ~ + +For more information about this error, try `rustc --explain E0040`. +error: could not compile `drop-example` (bin "drop-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/src/main.rs new file mode 100644 index 000000000..ff3b391a9 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-15/src/main.rs @@ -0,0 +1,20 @@ +struct CustomSmartPointer { + data: String, +} + +impl Drop for CustomSmartPointer { + fn drop(&mut self) { + println!("Dropping CustomSmartPointer with data `{}`!", self.data); + } +} + +// ANCHOR: here +fn main() { + let c = CustomSmartPointer { + data: String::from("some data"), + }; + println!("CustomSmartPointer created."); + c.drop(); + println!("CustomSmartPointer dropped before the end of main."); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.lock new file mode 100644 index 000000000..eb8a2817a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "drop-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.toml new file mode 100644 index 000000000..1e4c99481 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "drop-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/output.txt new file mode 100644 index 000000000..f032d84b6 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling drop-example v0.1.0 (file:///projects/drop-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s + Running `target/debug/drop-example` +CustomSmartPointer created. +Dropping CustomSmartPointer with data `some data`! +CustomSmartPointer dropped before the end of main. diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/src/main.rs new file mode 100644 index 000000000..f11715c45 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-16/src/main.rs @@ -0,0 +1,20 @@ +struct CustomSmartPointer { + data: String, +} + +impl Drop for CustomSmartPointer { + fn drop(&mut self) { + println!("Dropping CustomSmartPointer with data `{}`!", self.data); + } +} + +// ANCHOR: here +fn main() { + let c = CustomSmartPointer { + data: String::from("some data"), + }; + println!("CustomSmartPointer created."); + drop(c); + println!("CustomSmartPointer dropped before the end of main."); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/output.txt new file mode 100644 index 000000000..757a65fb5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/output.txt @@ -0,0 +1,14 @@ +$ cargo run + Compiling cons-list v0.1.0 (file:///projects/cons-list) +error[E0382]: use of moved value: `a` + --> src/main.rs:11:30 + | +9 | let a = Cons(5, Box::new(Cons(10, Box::new(Nil)))); + | - move occurs because `a` has type `List`, which does not implement the `Copy` trait +10 | let b = Cons(3, Box::new(a)); + | - value moved here +11 | let c = Cons(4, Box::new(a)); + | ^ value used here after move + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `cons-list` (bin "cons-list") due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/src/main.rs new file mode 100644 index 000000000..47c33e4c4 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-17/src/main.rs @@ -0,0 +1,12 @@ +enum List { + Cons(i32, Box), + Nil, +} + +use crate::List::{Cons, Nil}; + +fn main() { + let a = Cons(5, Box::new(Cons(10, Box::new(Nil)))); + let b = Cons(3, Box::new(a)); + let c = Cons(4, Box::new(a)); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/src/main.rs new file mode 100644 index 000000000..602f7de40 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-18/src/main.rs @@ -0,0 +1,13 @@ +enum List { + Cons(i32, Rc), + Nil, +} + +use crate::List::{Cons, Nil}; +use std::rc::Rc; + +fn main() { + let a = Rc::new(Cons(5, Rc::new(Cons(10, Rc::new(Nil))))); + let b = Cons(3, Rc::clone(&a)); + let c = Cons(4, Rc::clone(&a)); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/output.txt new file mode 100644 index 000000000..252ccae89 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/output.txt @@ -0,0 +1,8 @@ +$ cargo run + Compiling cons-list v0.1.0 (file:///projects/cons-list) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.45s + Running `target/debug/cons-list` +count after creating a = 1 +count after creating b = 2 +count after creating c = 3 +count after c goes out of scope = 2 diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/src/main.rs new file mode 100644 index 000000000..1bd7bc533 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-19/src/main.rs @@ -0,0 +1,21 @@ +enum List { + Cons(i32, Rc), + Nil, +} + +use crate::List::{Cons, Nil}; +use std::rc::Rc; + +// ANCHOR: here +fn main() { + let a = Rc::new(Cons(5, Rc::new(Cons(10, Rc::new(Nil))))); + println!("count after creating a = {}", Rc::strong_count(&a)); + let b = Cons(3, Rc::clone(&a)); + println!("count after creating b = {}", Rc::strong_count(&a)); + { + let c = Cons(4, Rc::clone(&a)); + println!("count after creating c = {}", Rc::strong_count(&a)); + } + println!("count after c goes out of scope = {}", Rc::strong_count(&a)); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.lock new file mode 100644 index 000000000..4dc2226a5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "limit-tracker" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.toml new file mode 100644 index 000000000..98c3f537c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "limit-tracker" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/src/lib.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/src/lib.rs new file mode 100644 index 000000000..a5181834c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-20/src/lib.rs @@ -0,0 +1,38 @@ +pub trait Messenger { + fn send(&self, msg: &str); +} + +pub struct LimitTracker<'a, T: Messenger> { + messenger: &'a T, + value: usize, + max: usize, +} + +impl<'a, T> LimitTracker<'a, T> +where + T: Messenger, +{ + pub fn new(messenger: &'a T, max: usize) -> LimitTracker<'a, T> { + LimitTracker { + messenger, + value: 0, + max, + } + } + + pub fn set_value(&mut self, value: usize) { + self.value = value; + + let percentage_of_max = self.value as f64 / self.max as f64; + + if percentage_of_max >= 1.0 { + self.messenger.send("Error: You are over your quota!"); + } else if percentage_of_max >= 0.9 { + self.messenger + .send("Urgent warning: You've used up over 90% of your quota!"); + } else if percentage_of_max >= 0.75 { + self.messenger + .send("Warning: You've used up over 75% of your quota!"); + } + } +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.lock new file mode 100644 index 000000000..4dc2226a5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "limit-tracker" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.toml new file mode 100644 index 000000000..98c3f537c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "limit-tracker" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/output.txt new file mode 100644 index 000000000..8501007f0 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/output.txt @@ -0,0 +1,19 @@ +$ cargo test + Compiling limit-tracker v0.1.0 (file:///projects/limit-tracker) +error[E0596]: cannot borrow `self.sent_messages` as mutable, as it is behind a `&` reference + --> src/lib.rs:58:13 + | +58 | self.sent_messages.push(String::from(message)); + | ^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | +help: consider changing this to be a mutable reference in the `impl` method and the `trait` definition + | +2 ~ fn send(&mut self, msg: &str); +3 | } +... +56 | impl Messenger for MockMessenger { +57 ~ fn send(&mut self, message: &str) { + | + +For more information about this error, try `rustc --explain E0596`. +error: could not compile `limit-tracker` (lib test) due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/src/lib.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/src/lib.rs new file mode 100644 index 000000000..4572d4313 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-21/src/lib.rs @@ -0,0 +1,73 @@ +pub trait Messenger { + fn send(&self, msg: &str); +} + +pub struct LimitTracker<'a, T: Messenger> { + messenger: &'a T, + value: usize, + max: usize, +} + +impl<'a, T> LimitTracker<'a, T> +where + T: Messenger, +{ + pub fn new(messenger: &'a T, max: usize) -> LimitTracker<'a, T> { + LimitTracker { + messenger, + value: 0, + max, + } + } + + pub fn set_value(&mut self, value: usize) { + self.value = value; + + let percentage_of_max = self.value as f64 / self.max as f64; + + if percentage_of_max >= 1.0 { + self.messenger.send("Error: You are over your quota!"); + } else if percentage_of_max >= 0.9 { + self.messenger + .send("Urgent warning: You've used up over 90% of your quota!"); + } else if percentage_of_max >= 0.75 { + self.messenger + .send("Warning: You've used up over 75% of your quota!"); + } + } +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + + struct MockMessenger { + sent_messages: Vec, + } + + impl MockMessenger { + fn new() -> MockMessenger { + MockMessenger { + sent_messages: vec![], + } + } + } + + impl Messenger for MockMessenger { + fn send(&self, message: &str) { + self.sent_messages.push(String::from(message)); + } + } + + #[test] + fn it_sends_an_over_75_percent_warning_message() { + let mock_messenger = MockMessenger::new(); + let mut limit_tracker = LimitTracker::new(&mock_messenger, 100); + + limit_tracker.set_value(80); + + assert_eq!(mock_messenger.sent_messages.len(), 1); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.lock new file mode 100644 index 000000000..4dc2226a5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "limit-tracker" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.toml new file mode 100644 index 000000000..98c3f537c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "limit-tracker" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/src/lib.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/src/lib.rs new file mode 100644 index 000000000..a77ffa41c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-22/src/lib.rs @@ -0,0 +1,78 @@ +pub trait Messenger { + fn send(&self, msg: &str); +} + +pub struct LimitTracker<'a, T: Messenger> { + messenger: &'a T, + value: usize, + max: usize, +} + +impl<'a, T> LimitTracker<'a, T> +where + T: Messenger, +{ + pub fn new(messenger: &'a T, max: usize) -> LimitTracker<'a, T> { + LimitTracker { + messenger, + value: 0, + max, + } + } + + pub fn set_value(&mut self, value: usize) { + self.value = value; + + let percentage_of_max = self.value as f64 / self.max as f64; + + if percentage_of_max >= 1.0 { + self.messenger.send("Error: You are over your quota!"); + } else if percentage_of_max >= 0.9 { + self.messenger + .send("Urgent warning: You've used up over 90% of your quota!"); + } else if percentage_of_max >= 0.75 { + self.messenger + .send("Warning: You've used up over 75% of your quota!"); + } + } +} + +// ANCHOR: here +#[cfg(test)] +mod tests { + use super::*; + use std::cell::RefCell; + + struct MockMessenger { + sent_messages: RefCell>, + } + + impl MockMessenger { + fn new() -> MockMessenger { + MockMessenger { + sent_messages: RefCell::new(vec![]), + } + } + } + + impl Messenger for MockMessenger { + fn send(&self, message: &str) { + self.sent_messages.borrow_mut().push(String::from(message)); + } + } + + #[test] + fn it_sends_an_over_75_percent_warning_message() { + // --snip-- + // ANCHOR_END: here + let mock_messenger = MockMessenger::new(); + let mut limit_tracker = LimitTracker::new(&mock_messenger, 100); + + limit_tracker.set_value(80); + // ANCHOR: here + + // ANCHOR: here + assert_eq!(mock_messenger.sent_messages.borrow().len(), 1); + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.lock new file mode 100644 index 000000000..4dc2226a5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "limit-tracker" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.toml new file mode 100644 index 000000000..98c3f537c --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "limit-tracker" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/output.txt new file mode 100644 index 000000000..d3e560297 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/output.txt @@ -0,0 +1,22 @@ +$ cargo test + Compiling limit-tracker v0.1.0 (file:///projects/limit-tracker) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.91s + Running unittests src/lib.rs (target/debug/deps/limit_tracker-e599811fa246dbde) + +running 1 test +test tests::it_sends_an_over_75_percent_warning_message ... FAILED + +failures: + +---- tests::it_sends_an_over_75_percent_warning_message stdout ---- +thread 'tests::it_sends_an_over_75_percent_warning_message' panicked at src/lib.rs:60:53: +already borrowed: BorrowMutError +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::it_sends_an_over_75_percent_warning_message + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/src/lib.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/src/lib.rs new file mode 100644 index 000000000..7d288e680 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-23/src/lib.rs @@ -0,0 +1,78 @@ +pub trait Messenger { + fn send(&self, msg: &str); +} + +pub struct LimitTracker<'a, T: Messenger> { + messenger: &'a T, + value: usize, + max: usize, +} + +impl<'a, T> LimitTracker<'a, T> +where + T: Messenger, +{ + pub fn new(messenger: &'a T, max: usize) -> LimitTracker<'a, T> { + LimitTracker { + messenger, + value: 0, + max, + } + } + + pub fn set_value(&mut self, value: usize) { + self.value = value; + + let percentage_of_max = self.value as f64 / self.max as f64; + + if percentage_of_max >= 1.0 { + self.messenger.send("Error: You are over your quota!"); + } else if percentage_of_max >= 0.9 { + self.messenger + .send("Urgent warning: You've used up over 90% of your quota!"); + } else if percentage_of_max >= 0.75 { + self.messenger + .send("Warning: You've used up over 75% of your quota!"); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::cell::RefCell; + + struct MockMessenger { + sent_messages: RefCell>, + } + + impl MockMessenger { + fn new() -> MockMessenger { + MockMessenger { + sent_messages: RefCell::new(vec![]), + } + } + } + + // ANCHOR: here + impl Messenger for MockMessenger { + fn send(&self, message: &str) { + let mut one_borrow = self.sent_messages.borrow_mut(); + let mut two_borrow = self.sent_messages.borrow_mut(); + + one_borrow.push(String::from(message)); + two_borrow.push(String::from(message)); + } + } + // ANCHOR_END: here + + #[test] + fn it_sends_an_over_75_percent_warning_message() { + let mock_messenger = MockMessenger::new(); + let mut limit_tracker = LimitTracker::new(&mock_messenger, 100); + + limit_tracker.set_value(80); + + assert_eq!(mock_messenger.sent_messages.borrow().len(), 1); + } +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/output.txt new file mode 100644 index 000000000..bbdc588c6 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling cons-list v0.1.0 (file:///projects/cons-list) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.63s + Running `target/debug/cons-list` +a after = Cons(RefCell { value: 15 }, Nil) +b after = Cons(RefCell { value: 3 }, Cons(RefCell { value: 15 }, Nil)) +c after = Cons(RefCell { value: 4 }, Cons(RefCell { value: 15 }, Nil)) diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/src/main.rs new file mode 100644 index 000000000..e3dda1a19 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-24/src/main.rs @@ -0,0 +1,24 @@ +#[derive(Debug)] +enum List { + Cons(Rc>, Rc), + Nil, +} + +use crate::List::{Cons, Nil}; +use std::cell::RefCell; +use std::rc::Rc; + +fn main() { + let value = Rc::new(RefCell::new(5)); + + let a = Rc::new(Cons(Rc::clone(&value), Rc::new(Nil))); + + let b = Cons(Rc::new(RefCell::new(3)), Rc::clone(&a)); + let c = Cons(Rc::new(RefCell::new(4)), Rc::clone(&a)); + + *value.borrow_mut() += 10; + + println!("a after = {a:?}"); + println!("b after = {b:?}"); + println!("c after = {c:?}"); +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/src/main.rs new file mode 100644 index 000000000..f36c7fd06 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-25/src/main.rs @@ -0,0 +1,20 @@ +use crate::List::{Cons, Nil}; +use std::cell::RefCell; +use std::rc::Rc; + +#[derive(Debug)] +enum List { + Cons(i32, RefCell>), + Nil, +} + +impl List { + fn tail(&self) -> Option<&RefCell>> { + match self { + Cons(_, item) => Some(item), + Nil => None, + } + } +} + +fn main() {} diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.lock new file mode 100644 index 000000000..a792c49aa --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cons-list" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.toml new file mode 100644 index 000000000..dce1515c3 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cons-list" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/output.txt b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/output.txt new file mode 100644 index 000000000..b8e70e47d --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/output.txt @@ -0,0 +1,11 @@ +$ cargo run + Compiling cons-list v0.1.0 (file:///projects/cons-list) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.53s + Running `target/debug/cons-list` +a initial rc count = 1 +a next item = Some(RefCell { value: Nil }) +a rc count after b creation = 2 +b initial rc count = 1 +b next item = Some(RefCell { value: Cons(5, RefCell { value: Nil }) }) +b rc count after changing a = 2 +a rc count after changing a = 2 diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/src/main.rs new file mode 100644 index 000000000..08963aaa5 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-26/src/main.rs @@ -0,0 +1,44 @@ +use crate::List::{Cons, Nil}; +use std::cell::RefCell; +use std::rc::Rc; + +#[derive(Debug)] +enum List { + Cons(i32, RefCell>), + Nil, +} + +impl List { + fn tail(&self) -> Option<&RefCell>> { + match self { + Cons(_, item) => Some(item), + Nil => None, + } + } +} + +// ANCHOR: here +fn main() { + let a = Rc::new(Cons(5, RefCell::new(Rc::new(Nil)))); + + println!("a initial rc count = {}", Rc::strong_count(&a)); + println!("a next item = {:?}", a.tail()); + + let b = Rc::new(Cons(10, RefCell::new(Rc::clone(&a)))); + + println!("a rc count after b creation = {}", Rc::strong_count(&a)); + println!("b initial rc count = {}", Rc::strong_count(&b)); + println!("b next item = {:?}", b.tail()); + + if let Some(link) = a.tail() { + *link.borrow_mut() = Rc::clone(&b); + } + + println!("b rc count after changing a = {}", Rc::strong_count(&b)); + println!("a rc count after changing a = {}", Rc::strong_count(&a)); + + // Uncomment the next line to see that we have a cycle; + // it will overflow the stack + // println!("a next item = {:?}", a.tail()); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.lock new file mode 100644 index 000000000..dd1f00a87 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tree" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.toml new file mode 100644 index 000000000..0bbf897d0 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tree" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/src/main.rs new file mode 100644 index 000000000..335d154dd --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-27/src/main.rs @@ -0,0 +1,24 @@ +// ANCHOR: here +use std::cell::RefCell; +use std::rc::Rc; + +#[derive(Debug)] +struct Node { + value: i32, + children: RefCell>>, +} +// ANCHOR_END: here + +// ANCHOR: there +fn main() { + let leaf = Rc::new(Node { + value: 3, + children: RefCell::new(vec![]), + }); + + let branch = Rc::new(Node { + value: 5, + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); +} +// ANCHOR_END: there diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.lock new file mode 100644 index 000000000..dd1f00a87 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tree" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.toml new file mode 100644 index 000000000..0bbf897d0 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tree" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/src/main.rs new file mode 100644 index 000000000..fabd1cbce --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-28/src/main.rs @@ -0,0 +1,33 @@ +// ANCHOR: here +use std::cell::RefCell; +use std::rc::{Rc, Weak}; + +#[derive(Debug)] +struct Node { + value: i32, + parent: RefCell>, + children: RefCell>>, +} +// ANCHOR_END: here + +// ANCHOR: there +fn main() { + let leaf = Rc::new(Node { + value: 3, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![]), + }); + + println!("leaf parent = {:?}", leaf.parent.borrow().upgrade()); + + let branch = Rc::new(Node { + value: 5, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); + + *leaf.parent.borrow_mut() = Rc::downgrade(&branch); + + println!("leaf parent = {:?}", leaf.parent.borrow().upgrade()); +} +// ANCHOR_END: there diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.lock new file mode 100644 index 000000000..dd1f00a87 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "tree" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.toml new file mode 100644 index 000000000..0bbf897d0 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "tree" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/src/main.rs new file mode 100644 index 000000000..ea13df0eb --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/listing-15-29/src/main.rs @@ -0,0 +1,54 @@ +use std::cell::RefCell; +use std::rc::{Rc, Weak}; + +#[derive(Debug)] +struct Node { + value: i32, + parent: RefCell>, + children: RefCell>>, +} + +// ANCHOR: here +fn main() { + let leaf = Rc::new(Node { + value: 3, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![]), + }); + + println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); + + { + let branch = Rc::new(Node { + value: 5, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); + + *leaf.parent.borrow_mut() = Rc::downgrade(&branch); + + println!( + "branch strong = {}, weak = {}", + Rc::strong_count(&branch), + Rc::weak_count(&branch), + ); + + println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); + } + + println!("leaf parent = {:?}", leaf.parent.borrow().upgrade()); + println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.lock new file mode 100644 index 000000000..340f6604a --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "borrowing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml new file mode 100644 index 000000000..16f92447f --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "borrowing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt new file mode 100644 index 000000000..95b9b68a8 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt @@ -0,0 +1,15 @@ +$ cargo run + Compiling borrowing v0.1.0 (file:///projects/borrowing) +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> src/main.rs:3:13 + | +3 | let y = &mut x; + | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +2 | let mut x = 5; + | +++ + +For more information about this error, try `rustc --explain E0596`. +error: could not compile `borrowing` (bin "borrowing") due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/src/main.rs new file mode 100644 index 000000000..8f48d41c1 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let x = 5; + let y = &mut x; +} diff --git a/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.lock b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.lock new file mode 100644 index 000000000..4297c6733 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "deref-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml new file mode 100644 index 000000000..67ec198f7 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deref-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt new file mode 100644 index 000000000..d1eccd2b2 --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt @@ -0,0 +1,13 @@ +$ cargo run + Compiling deref-example v0.1.0 (file:///projects/deref-example) +error[E0277]: can't compare `{integer}` with `&{integer}` + --> src/main.rs:6:5 + | +6 | assert_eq!(5, y); + | ^^^^^^^^^^^^^^^^ no implementation for `{integer} == &{integer}` + | + = help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}` + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `deref-example` (bin "deref-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/src/main.rs b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/src/main.rs new file mode 100644 index 000000000..4e20cae0b --- /dev/null +++ b/rustbook-ru/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let x = 5; + let y = &x; + + assert_eq!(5, x); + assert_eq!(5, y); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/src/main.rs new file mode 100644 index 000000000..ea10ba282 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-01/src/main.rs @@ -0,0 +1,16 @@ +use std::thread; +use std::time::Duration; + +fn main() { + thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/src/main.rs new file mode 100644 index 000000000..33bf53f40 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-02/src/main.rs @@ -0,0 +1,18 @@ +use std::thread; +use std::time::Duration; + +fn main() { + let handle = thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } + + handle.join().unwrap(); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/output.txt b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/output.txt new file mode 100644 index 000000000..3de4d4d3f --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/output.txt @@ -0,0 +1,25 @@ +$ cargo run + Compiling threads v0.1.0 (file:///projects/threads) +error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function + --> src/main.rs:6:32 + | +6 | let handle = thread::spawn(|| { + | ^^ may outlive borrowed value `v` +7 | println!("Here's a vector: {v:?}"); + | - `v` is borrowed here + | +note: function requires argument type to outlive `'static` + --> src/main.rs:6:18 + | +6 | let handle = thread::spawn(|| { + | __________________^ +7 | | println!("Here's a vector: {v:?}"); +8 | | }); + | |______^ +help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword + | +6 | let handle = thread::spawn(move || { + | ++++ + +For more information about this error, try `rustc --explain E0373`. +error: could not compile `threads` (bin "threads") due to 1 previous error diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/src/main.rs new file mode 100644 index 000000000..b2231c5b8 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-03/src/main.rs @@ -0,0 +1,11 @@ +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(|| { + println!("Here's a vector: {v:?}"); + }); + + handle.join().unwrap(); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs new file mode 100644 index 000000000..f0a9058a1 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs @@ -0,0 +1,13 @@ +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(|| { + println!("Here's a vector: {v:?}"); + }); + + drop(v); // oh no! + + handle.join().unwrap(); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs new file mode 100644 index 000000000..76783e614 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs @@ -0,0 +1,11 @@ +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(move || { + println!("Here's a vector: {v:?}"); + }); + + handle.join().unwrap(); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/src/main.rs new file mode 100644 index 000000000..d80dac4a0 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-06/src/main.rs @@ -0,0 +1,5 @@ +use std::sync::mpsc; + +fn main() { + let (tx, rx) = mpsc::channel(); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/src/main.rs new file mode 100644 index 000000000..7859b64da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-07/src/main.rs @@ -0,0 +1,11 @@ +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + }); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/src/main.rs new file mode 100644 index 000000000..e7ac452dc --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-08/src/main.rs @@ -0,0 +1,14 @@ +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + }); + + let received = rx.recv().unwrap(); + println!("Got: {received}"); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/output.txt b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/output.txt new file mode 100644 index 000000000..2e95105fe --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling message-passing v0.1.0 (file:///projects/message-passing) +error[E0382]: borrow of moved value: `val` + --> src/main.rs:10:26 + | +8 | let val = String::from("hi"); + | --- move occurs because `val` has type `String`, which does not implement the `Copy` trait +9 | tx.send(val).unwrap(); + | --- value moved here +10 | println!("val is {val}"); + | ^^^^^ value borrowed here after move + | + = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `message-passing` (bin "message-passing") due to 1 previous error diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/src/main.rs new file mode 100644 index 000000000..fe20d3474 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-09/src/main.rs @@ -0,0 +1,15 @@ +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + println!("val is {val}"); + }); + + let received = rx.recv().unwrap(); + println!("Got: {received}"); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/src/main.rs new file mode 100644 index 000000000..c9702bd85 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-10/src/main.rs @@ -0,0 +1,25 @@ +use std::sync::mpsc; +use std::thread; +use std::time::Duration; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let vals = vec![ + String::from("hi"), + String::from("from"), + String::from("the"), + String::from("thread"), + ]; + + for val in vals { + tx.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } + }); + + for received in rx { + println!("Got: {received}"); + } +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.lock new file mode 100644 index 000000000..55d2252da --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "message-passing" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml new file mode 100644 index 000000000..24bd2ee7b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "message-passing" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/src/main.rs new file mode 100644 index 000000000..174a5d14b --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-11/src/main.rs @@ -0,0 +1,46 @@ +use std::sync::mpsc; +use std::thread; +use std::time::Duration; + +fn main() { + // ANCHOR: here + // --snip-- + + let (tx, rx) = mpsc::channel(); + + let tx1 = tx.clone(); + thread::spawn(move || { + let vals = vec![ + String::from("hi"), + String::from("from"), + String::from("the"), + String::from("thread"), + ]; + + for val in vals { + tx1.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } + }); + + thread::spawn(move || { + let vals = vec![ + String::from("more"), + String::from("messages"), + String::from("for"), + String::from("you"), + ]; + + for val in vals { + tx.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } + }); + + for received in rx { + println!("Got: {received}"); + } + + // --snip-- + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.lock new file mode 100644 index 000000000..8e7ba9cf5 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shared-state" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml new file mode 100644 index 000000000..da297eaba --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shared-state" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/src/main.rs new file mode 100644 index 000000000..99ba5b489 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-12/src/main.rs @@ -0,0 +1,12 @@ +use std::sync::Mutex; + +fn main() { + let m = Mutex::new(5); + + { + let mut num = m.lock().unwrap(); + *num = 6; + } + + println!("m = {m:?}"); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.lock new file mode 100644 index 000000000..8e7ba9cf5 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shared-state" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml new file mode 100644 index 000000000..da297eaba --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shared-state" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/output.txt b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/output.txt new file mode 100644 index 000000000..a4db0dcc3 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/output.txt @@ -0,0 +1,26 @@ +$ cargo run + Compiling shared-state v0.1.0 (file:///projects/shared-state) +error[E0382]: borrow of moved value: `counter` + --> src/main.rs:21:29 + | +5 | let counter = Mutex::new(0); + | ------- move occurs because `counter` has type `Mutex`, which does not implement the `Copy` trait +... +8 | for _ in 0..10 { + | -------------- inside of this loop +9 | let handle = thread::spawn(move || { + | ------- value moved into closure here, in previous iteration of loop +... +21 | println!("Result: {}", *counter.lock().unwrap()); + | ^^^^^^^ value borrowed here after move + | +help: consider moving the expression out of the loop so it is only moved once + | +8 ~ let mut value = counter.lock(); +9 ~ for _ in 0..10 { +10 | let handle = thread::spawn(move || { +11 ~ let mut num = value.unwrap(); + | + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `shared-state` (bin "shared-state") due to 1 previous error diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/src/main.rs new file mode 100644 index 000000000..4e380a59a --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-13/src/main.rs @@ -0,0 +1,22 @@ +use std::sync::Mutex; +use std::thread; + +fn main() { + let counter = Mutex::new(0); + let mut handles = vec![]; + + for _ in 0..10 { + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + } + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.lock new file mode 100644 index 000000000..8e7ba9cf5 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shared-state" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml new file mode 100644 index 000000000..da297eaba --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shared-state" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/output.txt b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/output.txt new file mode 100644 index 000000000..cc96baed1 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/output.txt @@ -0,0 +1,28 @@ +$ cargo run + Compiling shared-state v0.1.0 (file:///projects/shared-state) +error[E0277]: `Rc>` cannot be sent between threads safely + --> src/main.rs:11:36 + | +11 | let handle = thread::spawn(move || { + | ------------- ^------ + | | | + | ______________________|_____________within this `{closure@src/main.rs:11:36: 11:43}` + | | | + | | required by a bound introduced by this call +12 | | let mut num = counter.lock().unwrap(); +13 | | +14 | | *num += 1; +15 | | }); + | |_________^ `Rc>` cannot be sent between threads safely + | + = help: within `{closure@src/main.rs:11:36: 11:43}`, the trait `Send` is not implemented for `Rc>`, which is required by `{closure@src/main.rs:11:36: 11:43}: Send` +note: required because it's used within this closure + --> src/main.rs:11:36 + | +11 | let handle = thread::spawn(move || { + | ^^^^^^^ +note: required by a bound in `spawn` + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:688:1 + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `shared-state` (bin "shared-state") due to 1 previous error diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/src/main.rs new file mode 100644 index 000000000..d940b1a34 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-14/src/main.rs @@ -0,0 +1,24 @@ +use std::rc::Rc; +use std::sync::Mutex; +use std::thread; + +fn main() { + let counter = Rc::new(Mutex::new(0)); + let mut handles = vec![]; + + for _ in 0..10 { + let counter = Rc::clone(&counter); + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + } + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.lock new file mode 100644 index 000000000..8e7ba9cf5 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shared-state" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml new file mode 100644 index 000000000..da297eaba --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shared-state" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/src/main.rs new file mode 100644 index 000000000..30247dd52 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/listing-16-15/src/main.rs @@ -0,0 +1,23 @@ +use std::sync::{Arc, Mutex}; +use std::thread; + +fn main() { + let counter = Arc::new(Mutex::new(0)); + let mut handles = vec![]; + + for _ in 0..10 { + let counter = Arc::clone(&counter); + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + } + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/src/main.rs new file mode 100644 index 000000000..7023a90f6 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/src/main.rs @@ -0,0 +1,18 @@ +use std::thread; +use std::time::Duration; + +fn main() { + let handle = thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + handle.join().unwrap(); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.lock new file mode 100644 index 000000000..8e7ba9cf5 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "shared-state" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml new file mode 100644 index 000000000..da297eaba --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "shared-state" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/src/main.rs new file mode 100644 index 000000000..dbb139771 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/src/main.rs @@ -0,0 +1,27 @@ +use std::sync::Mutex; +use std::thread; + +fn main() { + let counter = Mutex::new(0); + let mut handles = vec![]; + + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + + let handle2 = thread::spawn(move || { + let mut num2 = counter.lock().unwrap(); + + *num2 += 1; + }); + handles.push(handle2); + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.lock b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.lock new file mode 100644 index 000000000..8ecc3ae17 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "threads" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml new file mode 100644 index 000000000..bd4edf762 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "threads" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt new file mode 100644 index 000000000..929354c13 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling threads v0.1.0 (file:///projects/threads) +error[E0382]: use of moved value: `v` + --> src/main.rs:10:10 + | +4 | let v = vec![1, 2, 3]; + | - move occurs because `v` has type `Vec`, which does not implement the `Copy` trait +5 | +6 | let handle = thread::spawn(move || { + | ------- value moved into closure here +7 | println!("Here's a vector: {v:?}"); + | - variable moved due to use in closure +... +10 | drop(v); // oh no! + | ^ value used here after move + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `threads` (bin "threads") due to 1 previous error diff --git a/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/src/main.rs b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/src/main.rs new file mode 100644 index 000000000..cc71cbab0 --- /dev/null +++ b/rustbook-ru/listings/ch16-fearless-concurrency/output-only-01-move-drop/src/main.rs @@ -0,0 +1,13 @@ +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(move || { + println!("Here's a vector: {v:?}"); + }); + + drop(v); // oh no! + + handle.join().unwrap(); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.lock new file mode 100644 index 000000000..471d8dfc3 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "averaged-collection" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.toml new file mode 100644 index 000000000..aed614e93 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "averaged-collection" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-01/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-01/src/lib.rs new file mode 100644 index 000000000..b5ce2ab64 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-01/src/lib.rs @@ -0,0 +1,4 @@ +pub struct AveragedCollection { + list: Vec, + average: f64, +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.lock new file mode 100644 index 000000000..471d8dfc3 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "averaged-collection" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.toml new file mode 100644 index 000000000..aed614e93 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "averaged-collection" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-02/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-02/src/lib.rs new file mode 100644 index 000000000..bb407ec5f --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-02/src/lib.rs @@ -0,0 +1,33 @@ +pub struct AveragedCollection { + list: Vec, + average: f64, +} + +// ANCHOR: here +impl AveragedCollection { + pub fn add(&mut self, value: i32) { + self.list.push(value); + self.update_average(); + } + + pub fn remove(&mut self) -> Option { + let result = self.list.pop(); + match result { + Some(value) => { + self.update_average(); + Some(value) + } + None => None, + } + } + + pub fn average(&self) -> f64 { + self.average + } + + fn update_average(&mut self) { + let total: i32 = self.list.iter().sum(); + self.average = total as f64 / self.list.len() as f64; + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-03/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-03/src/lib.rs new file mode 100644 index 000000000..3a5cb779c --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-03/src/lib.rs @@ -0,0 +1,3 @@ +pub trait Draw { + fn draw(&self); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-04/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-04/src/lib.rs new file mode 100644 index 000000000..0c45e2a62 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-04/src/lib.rs @@ -0,0 +1,9 @@ +pub trait Draw { + fn draw(&self); +} + +// ANCHOR: here +pub struct Screen { + pub components: Vec>, +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-05/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-05/src/lib.rs new file mode 100644 index 000000000..57ebb5782 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-05/src/lib.rs @@ -0,0 +1,17 @@ +pub trait Draw { + fn draw(&self); +} + +pub struct Screen { + pub components: Vec>, +} + +// ANCHOR: here +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-06/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-06/src/lib.rs new file mode 100644 index 000000000..63a8907d3 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-06/src/lib.rs @@ -0,0 +1,20 @@ +pub trait Draw { + fn draw(&self); +} + +// ANCHOR: here +pub struct Screen { + pub components: Vec, +} + +impl Screen +where + T: Draw, +{ + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-07/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-07/src/lib.rs new file mode 100644 index 000000000..b16cd0155 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-07/src/lib.rs @@ -0,0 +1,29 @@ +pub trait Draw { + fn draw(&self); +} + +pub struct Screen { + pub components: Vec>, +} + +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} + +// ANCHOR: here +pub struct Button { + pub width: u32, + pub height: u32, + pub label: String, +} + +impl Draw for Button { + fn draw(&self) { + // code to actually draw a button + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-08/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-08/src/lib.rs new file mode 100644 index 000000000..960fee23d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-08/src/lib.rs @@ -0,0 +1,27 @@ +pub trait Draw { + fn draw(&self); +} + +pub struct Screen { + pub components: Vec>, +} + +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} + +pub struct Button { + pub width: u32, + pub height: u32, + pub label: String, +} + +impl Draw for Button { + fn draw(&self) { + // code to actually draw a button + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-08/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-08/src/main.rs new file mode 100644 index 000000000..9575d407e --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-08/src/main.rs @@ -0,0 +1,17 @@ +// ANCHOR: here +use gui::Draw; + +struct SelectBox { + width: u32, + height: u32, + options: Vec, +} + +impl Draw for SelectBox { + fn draw(&self) { + // code to actually draw a select box + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-09/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-09/src/lib.rs new file mode 100644 index 000000000..960fee23d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-09/src/lib.rs @@ -0,0 +1,27 @@ +pub trait Draw { + fn draw(&self); +} + +pub struct Screen { + pub components: Vec>, +} + +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} + +pub struct Button { + pub width: u32, + pub height: u32, + pub label: String, +} + +impl Draw for Button { + fn draw(&self) { + // code to actually draw a button + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-09/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-09/src/main.rs new file mode 100644 index 000000000..4eb13f6b7 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-09/src/main.rs @@ -0,0 +1,40 @@ +use gui::Draw; + +struct SelectBox { + width: u32, + height: u32, + options: Vec, +} + +impl Draw for SelectBox { + fn draw(&self) { + // code to actually draw a select box + } +} + +// ANCHOR: here +use gui::{Button, Screen}; + +fn main() { + let screen = Screen { + components: vec![ + Box::new(SelectBox { + width: 75, + height: 10, + options: vec![ + String::from("Yes"), + String::from("Maybe"), + String::from("No"), + ], + }), + Box::new(Button { + width: 50, + height: 10, + label: String::from("OK"), + }), + ], + }; + + screen.run(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.lock new file mode 100644 index 000000000..00d7b2182 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "gui" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.toml new file mode 100644 index 000000000..9b816e766 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "gui" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-10/output.txt b/rustbook-ru/listings/ch17-oop/listing-17-10/output.txt new file mode 100644 index 000000000..78d7c39a3 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-10/output.txt @@ -0,0 +1,13 @@ +$ cargo run + Compiling gui v0.1.0 (file:///projects/gui) +error[E0277]: the trait bound `String: Draw` is not satisfied + --> src/main.rs:5:26 + | +5 | components: vec![Box::new(String::from("Hi"))], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Draw` is not implemented for `String` + | + = help: the trait `Draw` is implemented for `Button` + = note: required for the cast from `Box` to `Box` + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `gui` (bin "gui") due to 1 previous error diff --git a/rustbook-ru/listings/ch17-oop/listing-17-10/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-10/src/lib.rs new file mode 100644 index 000000000..960fee23d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-10/src/lib.rs @@ -0,0 +1,27 @@ +pub trait Draw { + fn draw(&self); +} + +pub struct Screen { + pub components: Vec>, +} + +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} + +pub struct Button { + pub width: u32, + pub height: u32, + pub label: String, +} + +impl Draw for Button { + fn draw(&self) { + // code to actually draw a button + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-10/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-10/src/main.rs new file mode 100644 index 000000000..2ede87ab7 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-10/src/main.rs @@ -0,0 +1,9 @@ +use gui::Screen; + +fn main() { + let screen = Screen { + components: vec![Box::new(String::from("Hi"))], + }; + + screen.run(); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-11/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-11/src/main.rs new file mode 100644 index 000000000..d99170a97 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-11/src/main.rs @@ -0,0 +1,20 @@ +// ANCHOR: all +use blog::Post; + +// ANCHOR: here +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + // ANCHOR_END: here + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); + // ANCHOR: here +} +// ANCHOR_END: here +// ANCHOR_END: all diff --git a/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-12/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-12/src/lib.rs new file mode 100644 index 000000000..b8156c39d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-12/src/lib.rs @@ -0,0 +1,19 @@ +pub struct Post { + state: Option>, + content: String, +} + +impl Post { + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } +} + +trait State {} + +struct Draft {} + +impl State for Draft {} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-12/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-12/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-12/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-13/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-13/src/lib.rs new file mode 100644 index 000000000..bd68557a0 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-13/src/lib.rs @@ -0,0 +1,28 @@ +pub struct Post { + state: Option>, + content: String, +} + +// ANCHOR: here +impl Post { + // --snip-- + // ANCHOR_END: here + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + // ANCHOR: here + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } +} +// ANCHOR_END: here + +trait State {} + +struct Draft {} + +impl State for Draft {} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-13/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-13/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-13/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-14/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-14/src/lib.rs new file mode 100644 index 000000000..09cf0c466 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-14/src/lib.rs @@ -0,0 +1,32 @@ +pub struct Post { + state: Option>, + content: String, +} + +// ANCHOR: here +impl Post { + // --snip-- + // ANCHOR_END: here + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + // ANCHOR: here + pub fn content(&self) -> &str { + "" + } +} +// ANCHOR_END: here + +trait State {} + +struct Draft {} + +impl State for Draft {} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-14/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-14/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-14/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-15/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-15/src/lib.rs new file mode 100644 index 000000000..909dd5274 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-15/src/lib.rs @@ -0,0 +1,52 @@ +pub struct Post { + state: Option>, + content: String, +} + +// ANCHOR: here +impl Post { + // --snip-- + // ANCHOR_END: here + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + pub fn content(&self) -> &str { + "" + } + + // ANCHOR: here + pub fn request_review(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.request_review()) + } + } +} + +trait State { + fn request_review(self: Box) -> Box; +} + +struct Draft {} + +impl State for Draft { + fn request_review(self: Box) -> Box { + Box::new(PendingReview {}) + } +} + +struct PendingReview {} + +impl State for PendingReview { + fn request_review(self: Box) -> Box { + self + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-15/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-15/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-15/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-16/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-16/src/lib.rs new file mode 100644 index 000000000..92cb29813 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-16/src/lib.rs @@ -0,0 +1,85 @@ +pub struct Post { + state: Option>, + content: String, +} + +// ANCHOR: here +impl Post { + // --snip-- + // ANCHOR_END: here + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + pub fn content(&self) -> &str { + "" + } + + pub fn request_review(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.request_review()) + } + } + + // ANCHOR: here + pub fn approve(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.approve()) + } + } +} + +trait State { + fn request_review(self: Box) -> Box; + fn approve(self: Box) -> Box; +} + +struct Draft {} + +impl State for Draft { + // --snip-- + // ANCHOR_END: here + fn request_review(self: Box) -> Box { + Box::new(PendingReview {}) + } + + // ANCHOR: here + fn approve(self: Box) -> Box { + self + } +} + +struct PendingReview {} + +impl State for PendingReview { + // --snip-- + // ANCHOR_END: here + fn request_review(self: Box) -> Box { + self + } + + // ANCHOR: here + fn approve(self: Box) -> Box { + Box::new(Published {}) + } +} + +struct Published {} + +impl State for Published { + fn request_review(self: Box) -> Box { + self + } + + fn approve(self: Box) -> Box { + self + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-16/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-16/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-16/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-17/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-17/src/lib.rs new file mode 100644 index 000000000..0beee7b8d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-17/src/lib.rs @@ -0,0 +1,82 @@ +pub struct Post { + state: Option>, + content: String, +} + +// ANCHOR: here +impl Post { + // --snip-- + // ANCHOR_END: here + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + // ANCHOR: here + pub fn content(&self) -> &str { + self.state.as_ref().unwrap().content(self) + } + // --snip-- + // ANCHOR_END: here + + pub fn request_review(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.request_review()) + } + } + + pub fn approve(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.approve()) + } + } + // ANCHOR: here +} +// ANCHOR_END: here + +trait State { + fn request_review(self: Box) -> Box; + fn approve(self: Box) -> Box; +} + +struct Draft {} + +impl State for Draft { + fn request_review(self: Box) -> Box { + Box::new(PendingReview {}) + } + + fn approve(self: Box) -> Box { + self + } +} + +struct PendingReview {} + +impl State for PendingReview { + fn request_review(self: Box) -> Box { + self + } + + fn approve(self: Box) -> Box { + Box::new(Published {}) + } +} + +struct Published {} + +impl State for Published { + fn request_review(self: Box) -> Box { + self + } + + fn approve(self: Box) -> Box { + self + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-17/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-17/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-17/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-18/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-18/src/lib.rs new file mode 100644 index 000000000..1bac8a87a --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-18/src/lib.rs @@ -0,0 +1,94 @@ +pub struct Post { + state: Option>, + content: String, +} + +impl Post { + pub fn new() -> Post { + Post { + state: Some(Box::new(Draft {})), + content: String::new(), + } + } + + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + pub fn content(&self) -> &str { + self.state.as_ref().unwrap().content(self) + } + + pub fn request_review(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.request_review()) + } + } + + pub fn approve(&mut self) { + if let Some(s) = self.state.take() { + self.state = Some(s.approve()) + } + } +} + +// ANCHOR: here +trait State { + // --snip-- + // ANCHOR_END: here + fn request_review(self: Box) -> Box; + fn approve(self: Box) -> Box; + + // ANCHOR: here + fn content<'a>(&self, post: &'a Post) -> &'a str { + "" + } +} + +// --snip-- +// ANCHOR_END: here + +struct Draft {} + +impl State for Draft { + fn request_review(self: Box) -> Box { + Box::new(PendingReview {}) + } + + fn approve(self: Box) -> Box { + self + } +} + +struct PendingReview {} + +impl State for PendingReview { + fn request_review(self: Box) -> Box { + self + } + + fn approve(self: Box) -> Box { + Box::new(Published {}) + } +} + +// ANCHOR: here +struct Published {} + +impl State for Published { + // --snip-- + // ANCHOR_END: here + fn request_review(self: Box) -> Box { + self + } + + fn approve(self: Box) -> Box { + self + } + + // ANCHOR: here + fn content<'a>(&self, post: &'a Post) -> &'a str { + &post.content + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-18/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-18/src/main.rs new file mode 100644 index 000000000..14b4c0824 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-18/src/main.rs @@ -0,0 +1,14 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-19/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-19/src/lib.rs new file mode 100644 index 000000000..bfe034eaf --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-19/src/lib.rs @@ -0,0 +1,25 @@ +pub struct Post { + content: String, +} + +pub struct DraftPost { + content: String, +} + +impl Post { + pub fn new() -> DraftPost { + DraftPost { + content: String::new(), + } + } + + pub fn content(&self) -> &str { + &self.content + } +} + +impl DraftPost { + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-20/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-20/src/lib.rs new file mode 100644 index 000000000..3b82ec05d --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-20/src/lib.rs @@ -0,0 +1,48 @@ +pub struct Post { + content: String, +} + +pub struct DraftPost { + content: String, +} + +impl Post { + pub fn new() -> DraftPost { + DraftPost { + content: String::new(), + } + } + + pub fn content(&self) -> &str { + &self.content + } +} + +// ANCHOR: here +impl DraftPost { + // --snip-- + // ANCHOR_END: here + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + // ANCHOR: here + pub fn request_review(self) -> PendingReviewPost { + PendingReviewPost { + content: self.content, + } + } +} + +pub struct PendingReviewPost { + content: String, +} + +impl PendingReviewPost { + pub fn approve(self) -> Post { + Post { + content: self.content, + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.lock b/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.lock new file mode 100644 index 000000000..b6f4232c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "blog" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.toml b/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.toml new file mode 100644 index 000000000..1619af5c6 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "blog" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch17-oop/listing-17-21/src/lib.rs b/rustbook-ru/listings/ch17-oop/listing-17-21/src/lib.rs new file mode 100644 index 000000000..38500a651 --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-21/src/lib.rs @@ -0,0 +1,43 @@ +pub struct Post { + content: String, +} + +pub struct DraftPost { + content: String, +} + +impl Post { + pub fn new() -> DraftPost { + DraftPost { + content: String::new(), + } + } + + pub fn content(&self) -> &str { + &self.content + } +} + +impl DraftPost { + pub fn add_text(&mut self, text: &str) { + self.content.push_str(text); + } + + pub fn request_review(self) -> PendingReviewPost { + PendingReviewPost { + content: self.content, + } + } +} + +pub struct PendingReviewPost { + content: String, +} + +impl PendingReviewPost { + pub fn approve(self) -> Post { + Post { + content: self.content, + } + } +} diff --git a/rustbook-ru/listings/ch17-oop/listing-17-21/src/main.rs b/rustbook-ru/listings/ch17-oop/listing-17-21/src/main.rs new file mode 100644 index 000000000..720c55e6a --- /dev/null +++ b/rustbook-ru/listings/ch17-oop/listing-17-21/src/main.rs @@ -0,0 +1,13 @@ +use blog::Post; + +fn main() { + let mut post = Post::new(); + + post.add_text("I ate a salad for lunch today"); + + let post = post.request_review(); + + let post = post.approve(); + + assert_eq!("I ate a salad for lunch today", post.content()); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/src/main.rs new file mode 100644 index 000000000..fc87768fb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-01/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + let favorite_color: Option<&str> = None; + let is_tuesday = false; + let age: Result = "34".parse(); + + if let Some(color) = favorite_color { + println!("Using your favorite color, {color}, as the background"); + } else if is_tuesday { + println!("Tuesday is green day!"); + } else if let Ok(age) = age { + if age > 30 { + println!("Using purple as the background color"); + } else { + println!("Using orange as the background color"); + } + } else { + println!("Using blue as the background color"); + } +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/src/main.rs new file mode 100644 index 000000000..2479d845d --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-02/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + let mut stack = Vec::new(); + + stack.push(1); + stack.push(2); + stack.push(3); + + while let Some(top) = stack.pop() { + println!("{top}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/output.txt b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/output.txt new file mode 100644 index 000000000..9add287fa --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling patterns v0.1.0 (file:///projects/patterns) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.52s + Running `target/debug/patterns` +a is at index 0 +b is at index 1 +c is at index 2 diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/src/main.rs new file mode 100644 index 000000000..218c18063 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-03/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + let v = vec!['a', 'b', 'c']; + + for (index, value) in v.iter().enumerate() { + println!("{value} is at index {index}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/src/main.rs new file mode 100644 index 000000000..27b0c3fbd --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-04/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let (x, y, z) = (1, 2, 3); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/output.txt b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/output.txt new file mode 100644 index 000000000..8002272a7 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/output.txt @@ -0,0 +1,15 @@ +$ cargo run + Compiling patterns v0.1.0 (file:///projects/patterns) +error[E0308]: mismatched types + --> src/main.rs:2:9 + | +2 | let (x, y) = (1, 2, 3); + | ^^^^^^ --------- this expression has type `({integer}, {integer}, {integer})` + | | + | expected a tuple with 3 elements, found one with 2 elements + | + = note: expected tuple `({integer}, {integer}, {integer})` + found tuple `(_, _)` + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `patterns` (bin "patterns") due to 1 previous error diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/src/main.rs new file mode 100644 index 000000000..39f768e29 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-05/src/main.rs @@ -0,0 +1,5 @@ +fn main() { + // ANCHOR: here + let (x, y) = (1, 2, 3); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs new file mode 100644 index 000000000..c5d71e6c1 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs @@ -0,0 +1,7 @@ +// ANCHOR: here +fn foo(x: i32) { + // code goes here +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/src/main.rs new file mode 100644 index 000000000..70069424c --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-07/src/main.rs @@ -0,0 +1,8 @@ +fn print_coordinates(&(x, y): &(i32, i32)) { + println!("Current location: ({x}, {y})"); +} + +fn main() { + let point = (3, 5); + print_coordinates(&point); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/output.txt b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/output.txt new file mode 100644 index 000000000..6ce3dfc58 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling patterns v0.1.0 (file:///projects/patterns) +error[E0005]: refutable pattern in local binding + --> src/main.rs:3:9 + | +3 | let Some(x) = some_option_value; + | ^^^^^^^ pattern `None` not covered + | + = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant + = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: the matched value is of type `Option` +help: you might want to use `let else` to handle the variant that isn't matched + | +3 | let Some(x) = some_option_value else { todo!() }; + | ++++++++++++++++ + +For more information about this error, try `rustc --explain E0005`. +error: could not compile `patterns` (bin "patterns") due to 1 previous error diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/src/main.rs new file mode 100644 index 000000000..7baa02a49 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-08/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + let some_option_value: Option = None; + // ANCHOR: here + let Some(x) = some_option_value; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/src/main.rs new file mode 100644 index 000000000..e378c3703 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-09/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + let some_option_value: Option = None; + // ANCHOR: here + if let Some(x) = some_option_value { + println!("{x}"); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/output.txt b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/output.txt new file mode 100644 index 000000000..97bc014ec --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/output.txt @@ -0,0 +1,16 @@ +$ cargo run + Compiling patterns v0.1.0 (file:///projects/patterns) +warning: irrefutable `if let` pattern + --> src/main.rs:2:8 + | +2 | if let x = 5 { + | ^^^^^^^^^ + | + = note: this pattern will always match, so the `if let` is useless + = help: consider replacing the `if let` with a `let` + = note: `#[warn(irrefutable_let_patterns)]` on by default + +warning: `patterns` (bin "patterns") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s + Running `target/debug/patterns` +5 diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/src/main.rs new file mode 100644 index 000000000..2073948e7 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-10/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + if let x = 5 { + println!("{x}"); + }; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/src/main.rs new file mode 100644 index 000000000..055212803 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-11/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + // ANCHOR: here + let x = Some(5); + let y = 10; + + match x { + Some(50) => println!("Got 50"), + Some(y) => println!("Matched, y = {y}"), + _ => println!("Default case, x = {x:?}"), + } + + println!("at the end: x = {x:?}, y = {y}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/src/main.rs new file mode 100644 index 000000000..62f4ccbf1 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-12/src/main.rs @@ -0,0 +1,12 @@ +struct Point { + x: i32, + y: i32, +} + +fn main() { + let p = Point { x: 0, y: 7 }; + + let Point { x: a, y: b } = p; + assert_eq!(0, a); + assert_eq!(7, b); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/src/main.rs new file mode 100644 index 000000000..5badc1594 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-13/src/main.rs @@ -0,0 +1,12 @@ +struct Point { + x: i32, + y: i32, +} + +fn main() { + let p = Point { x: 0, y: 7 }; + + let Point { x, y } = p; + assert_eq!(0, x); + assert_eq!(7, y); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/src/main.rs new file mode 100644 index 000000000..b71da9a37 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-14/src/main.rs @@ -0,0 +1,18 @@ +struct Point { + x: i32, + y: i32, +} + +// ANCHOR: here +fn main() { + let p = Point { x: 0, y: 7 }; + + match p { + Point { x, y: 0 } => println!("On the x axis at {x}"), + Point { x: 0, y } => println!("On the y axis at {y}"), + Point { x, y } => { + println!("On neither axis: ({x}, {y})"); + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/src/main.rs new file mode 100644 index 000000000..9407cc16a --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-15/src/main.rs @@ -0,0 +1,25 @@ +enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(i32, i32, i32), +} + +fn main() { + let msg = Message::ChangeColor(0, 160, 255); + + match msg { + Message::Quit => { + println!("The Quit variant has no data to destructure."); + } + Message::Move { x, y } => { + println!("Move in the x direction {x} and in the y direction {y}"); + } + Message::Write(text) => { + println!("Text message: {text}"); + } + Message::ChangeColor(r, g, b) => { + println!("Change the color to red {r}, green {g}, and blue {b}") + } + } +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/src/main.rs new file mode 100644 index 000000000..1e7ad5f19 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-16/src/main.rs @@ -0,0 +1,25 @@ +enum Color { + Rgb(i32, i32, i32), + Hsv(i32, i32, i32), +} + +enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(Color), +} + +fn main() { + let msg = Message::ChangeColor(Color::Hsv(0, 160, 255)); + + match msg { + Message::ChangeColor(Color::Rgb(r, g, b)) => { + println!("Change color to red {r}, green {g}, and blue {b}"); + } + Message::ChangeColor(Color::Hsv(h, s, v)) => { + println!("Change color to hue {h}, saturation {s}, value {v}") + } + _ => (), + } +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/src/main.rs new file mode 100644 index 000000000..705386034 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-17/src/main.rs @@ -0,0 +1,7 @@ +fn foo(_: i32, y: i32) { + println!("This code only uses the y parameter: {y}"); +} + +fn main() { + foo(3, 4); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/src/main.rs new file mode 100644 index 000000000..2b8877620 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-18/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + // ANCHOR: here + let mut setting_value = Some(5); + let new_setting_value = Some(10); + + match (setting_value, new_setting_value) { + (Some(_), Some(_)) => { + println!("Can't overwrite an existing customized value"); + } + _ => { + setting_value = new_setting_value; + } + } + + println!("setting is {setting_value:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/src/main.rs new file mode 100644 index 000000000..e28dab111 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-19/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let numbers = (2, 4, 8, 16, 32); + + match numbers { + (first, _, third, _, fifth) => { + println!("Some numbers: {first}, {third}, {fifth}") + } + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/src/main.rs new file mode 100644 index 000000000..1ffc46bad --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-20/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + let _x = 5; + let y = 10; +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/src/main.rs new file mode 100644 index 000000000..320db62f5 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-21/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let s = Some(String::from("Hello!")); + + if let Some(_s) = s { + println!("found a string"); + } + + println!("{s:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/src/main.rs new file mode 100644 index 000000000..9df1492b2 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-22/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let s = Some(String::from("Hello!")); + + if let Some(_) = s { + println!("found a string"); + } + + println!("{s:?}"); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/src/main.rs new file mode 100644 index 000000000..491d6c53f --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-23/src/main.rs @@ -0,0 +1,15 @@ +fn main() { + // ANCHOR: here + struct Point { + x: i32, + y: i32, + z: i32, + } + + let origin = Point { x: 0, y: 0, z: 0 }; + + match origin { + Point { x, .. } => println!("x is {x}"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/src/main.rs new file mode 100644 index 000000000..3f9aaafc2 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-24/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let numbers = (2, 4, 8, 16, 32); + + match numbers { + (first, .., last) => { + println!("Some numbers: {first}, {last}"); + } + } +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.lock new file mode 100644 index 000000000..a233623e5 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/output.txt b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/output.txt new file mode 100644 index 000000000..bd5e0f9d7 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/output.txt @@ -0,0 +1,11 @@ +$ cargo run + Compiling patterns v0.1.0 (file:///projects/patterns) +error: `..` can only be used once per tuple pattern + --> src/main.rs:5:22 + | +5 | (.., second, ..) => { + | -- ^^ can only be used once per tuple pattern + | | + | previously used here + +error: could not compile `patterns` (bin "patterns") due to 1 previous error diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/rustfmt-ignore b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/rustfmt-ignore new file mode 100644 index 000000000..06a976dd4 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/rustfmt-ignore @@ -0,0 +1 @@ +This listing deliberately doesn't parse so rustfmt fails. diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/src/main.rs new file mode 100644 index 000000000..6c3b24b7d --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-25/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let numbers = (2, 4, 8, 16, 32); + + match numbers { + (.., second, ..) => { + println!("Some numbers: {second}") + }, + } +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/src/main.rs new file mode 100644 index 000000000..2566169a7 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-26/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let num = Some(4); + + match num { + Some(x) if x % 2 == 0 => println!("The number {x} is even"), + Some(x) => println!("The number {x} is odd"), + None => (), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/src/main.rs new file mode 100644 index 000000000..06fd94996 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-27/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + let x = Some(5); + let y = 10; + + match x { + Some(50) => println!("Got 50"), + Some(n) if n == y => println!("Matched, n = {n}"), + _ => println!("Default case, x = {x:?}"), + } + + println!("at the end: x = {x:?}, y = {y}"); +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/src/main.rs new file mode 100644 index 000000000..15804553f --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-28/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let x = 4; + let y = false; + + match x { + 4 | 5 | 6 if y => println!("yes"), + _ => println!("no"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/src/main.rs new file mode 100644 index 000000000..e36fda878 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/listing-18-29/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + // ANCHOR: here + enum Message { + Hello { id: i32 }, + } + + let msg = Message::Hello { id: 5 }; + + match msg { + Message::Hello { + id: id_variable @ 3..=7, + } => println!("Found an id in range: {id_variable}"), + Message::Hello { id: 10..=12 } => { + println!("Found an id in another range") + } + Message::Hello { id } => println!("Found some other id: {id}"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/src/main.rs new file mode 100644 index 000000000..7978e1ade --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-01-literals/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: here + let x = 1; + + match x { + 1 => println!("one"), + 2 => println!("two"), + 3 => println!("three"), + _ => println!("anything"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/src/main.rs new file mode 100644 index 000000000..e52d815d8 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-02-multiple-patterns/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let x = 1; + + match x { + 1 | 2 => println!("one or two"), + 3 => println!("three"), + _ => println!("anything"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/src/main.rs new file mode 100644 index 000000000..a3ebe7af0 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-03-ranges/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + let x = 5; + + match x { + 1..=5 => println!("one through five"), + _ => println!("something else"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/src/main.rs new file mode 100644 index 000000000..8cebfef5e --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-04-ranges-of-char/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + // ANCHOR: here + let x = 'c'; + + match x { + 'a'..='j' => println!("early ASCII letter"), + 'k'..='z' => println!("late ASCII letter"), + _ => println!("something else"), + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.lock b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.lock new file mode 100644 index 000000000..2b4fa2903 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "patterns" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml new file mode 100644 index 000000000..82fe057bb --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "patterns" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/src/main.rs b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/src/main.rs new file mode 100644 index 000000000..962d09349 --- /dev/null +++ b/rustbook-ru/listings/ch18-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + struct Point { + x: i32, + y: i32, + } + + // ANCHOR: here + let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-01/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/src/main.rs new file mode 100644 index 000000000..893f57890 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-01/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // ANCHOR: here + let mut num = 5; + + let r1 = &num as *const i32; + let r2 = &mut num as *mut i32; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-02/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/src/main.rs new file mode 100644 index 000000000..849629a7c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-02/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let address = 0x012345usize; + let r = address as *const i32; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-03/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/src/main.rs new file mode 100644 index 000000000..02a0be6b0 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-03/src/main.rs @@ -0,0 +1,13 @@ +fn main() { + // ANCHOR: here + let mut num = 5; + + let r1 = &num as *const i32; + let r2 = &mut num as *mut i32; + + unsafe { + println!("r1 is: {}", *r1); + println!("r2 is: {}", *r2); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-04/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/src/main.rs new file mode 100644 index 000000000..6ac58442d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-04/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: here + let mut v = vec![1, 2, 3, 4, 5, 6]; + + let r = &mut v[..]; + + let (a, b) = r.split_at_mut(3); + + assert_eq!(a, &mut [1, 2, 3]); + assert_eq!(b, &mut [4, 5, 6]); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-05/output.txt b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/output.txt new file mode 100644 index 000000000..514e25331 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/output.txt @@ -0,0 +1,19 @@ +$ cargo run + Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example) +error[E0499]: cannot borrow `*values` as mutable more than once at a time + --> src/main.rs:6:31 + | +1 | fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { + | - let's call the lifetime of this reference `'1` +... +6 | (&mut values[..mid], &mut values[mid..]) + | --------------------------^^^^^^-------- + | | | | + | | | second mutable borrow occurs here + | | first mutable borrow occurs here + | returning this value requires that `*values` is borrowed for `'1` + | + = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices + +For more information about this error, try `rustc --explain E0499`. +error: could not compile `unsafe-example` (bin "unsafe-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-05/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/src/main.rs new file mode 100644 index 000000000..dabf63de1 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-05/src/main.rs @@ -0,0 +1,14 @@ +// ANCHOR: here +fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { + let len = values.len(); + + assert!(mid <= len); + + (&mut values[..mid], &mut values[mid..]) +} +// ANCHOR_END: here + +fn main() { + let mut vector = vec![1, 2, 3, 4, 5, 6]; + let (left, right) = split_at_mut(&mut vector, 3); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-06/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/src/main.rs new file mode 100644 index 000000000..3af21f761 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-06/src/main.rs @@ -0,0 +1,22 @@ +// ANCHOR: here +use std::slice; + +fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) { + let len = values.len(); + let ptr = values.as_mut_ptr(); + + assert!(mid <= len); + + unsafe { + ( + slice::from_raw_parts_mut(ptr, mid), + slice::from_raw_parts_mut(ptr.add(mid), len - mid), + ) + } +} +// ANCHOR_END: here + +fn main() { + let mut vector = vec![1, 2, 3, 4, 5, 6]; + let (left, right) = split_at_mut(&mut vector, 3); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-07/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/src/main.rs new file mode 100644 index 000000000..b4d6cdb7c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-07/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + use std::slice; + + let address = 0x01234usize; + let r = address as *mut i32; + + let values: &[i32] = unsafe { slice::from_raw_parts_mut(r, 10000) }; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-08/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/src/main.rs new file mode 100644 index 000000000..8b56630c9 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-08/src/main.rs @@ -0,0 +1,9 @@ +extern "C" { + fn abs(input: i32) -> i32; +} + +fn main() { + unsafe { + println!("Absolute value of -3 according to C: {}", abs(-3)); + } +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-09/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/src/main.rs new file mode 100644 index 000000000..fda5179af --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-09/src/main.rs @@ -0,0 +1,5 @@ +static HELLO_WORLD: &str = "Hello, world!"; + +fn main() { + println!("name is: {HELLO_WORLD}"); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-10/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/src/main.rs new file mode 100644 index 000000000..b5559fd3a --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-10/src/main.rs @@ -0,0 +1,15 @@ +static mut COUNTER: u32 = 0; + +fn add_to_count(inc: u32) { + unsafe { + COUNTER += inc; + } +} + +fn main() { + add_to_count(3); + + unsafe { + println!("COUNTER: {COUNTER}"); + } +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-11/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/src/main.rs new file mode 100644 index 000000000..885c1aa1d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-11/src/main.rs @@ -0,0 +1,9 @@ +unsafe trait Foo { + // methods go here +} + +unsafe impl Foo for i32 { + // method implementations go here +} + +fn main() {} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-12/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/src/lib.rs new file mode 100644 index 000000000..dbe04620e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-12/src/lib.rs @@ -0,0 +1,5 @@ +pub trait Iterator { + type Item; + + fn next(&mut self) -> Option; +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-13/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/src/lib.rs new file mode 100644 index 000000000..7c9479c5b --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-13/src/lib.rs @@ -0,0 +1,3 @@ +pub trait Iterator { + fn next(&mut self) -> Option; +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-14/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/src/main.rs new file mode 100644 index 000000000..9111fbc55 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-14/src/main.rs @@ -0,0 +1,25 @@ +use std::ops::Add; + +#[derive(Debug, Copy, Clone, PartialEq)] +struct Point { + x: i32, + y: i32, +} + +impl Add for Point { + type Output = Point; + + fn add(self, other: Point) -> Point { + Point { + x: self.x + other.x, + y: self.y + other.y, + } + } +} + +fn main() { + assert_eq!( + Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, + Point { x: 3, y: 3 } + ); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-15/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/src/lib.rs new file mode 100644 index 000000000..f38bf475c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-15/src/lib.rs @@ -0,0 +1,12 @@ +use std::ops::Add; + +struct Millimeters(u32); +struct Meters(u32); + +impl Add for Millimeters { + type Output = Millimeters; + + fn add(self, other: Meters) -> Millimeters { + Millimeters(self.0 + (other.0 * 1000)) + } +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-16/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/src/main.rs new file mode 100644 index 000000000..d854e287d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-16/src/main.rs @@ -0,0 +1,31 @@ +// ANCHOR: here +trait Pilot { + fn fly(&self); +} + +trait Wizard { + fn fly(&self); +} + +struct Human; + +impl Pilot for Human { + fn fly(&self) { + println!("This is your captain speaking."); + } +} + +impl Wizard for Human { + fn fly(&self) { + println!("Up!"); + } +} + +impl Human { + fn fly(&self) { + println!("*waving arms furiously*"); + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-17/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/src/main.rs new file mode 100644 index 000000000..3df65a7ce --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-17/src/main.rs @@ -0,0 +1,34 @@ +trait Pilot { + fn fly(&self); +} + +trait Wizard { + fn fly(&self); +} + +struct Human; + +impl Pilot for Human { + fn fly(&self) { + println!("This is your captain speaking."); + } +} + +impl Wizard for Human { + fn fly(&self) { + println!("Up!"); + } +} + +impl Human { + fn fly(&self) { + println!("*waving arms furiously*"); + } +} + +// ANCHOR: here +fn main() { + let person = Human; + person.fly(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-18/output.txt b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/output.txt new file mode 100644 index 000000000..d7e315bfa --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/output.txt @@ -0,0 +1,7 @@ +$ cargo run + Compiling traits-example v0.1.0 (file:///projects/traits-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s + Running `target/debug/traits-example` +This is your captain speaking. +Up! +*waving arms furiously* diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-18/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/src/main.rs new file mode 100644 index 000000000..fa01c09cc --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-18/src/main.rs @@ -0,0 +1,36 @@ +trait Pilot { + fn fly(&self); +} + +trait Wizard { + fn fly(&self); +} + +struct Human; + +impl Pilot for Human { + fn fly(&self) { + println!("This is your captain speaking."); + } +} + +impl Wizard for Human { + fn fly(&self) { + println!("Up!"); + } +} + +impl Human { + fn fly(&self) { + println!("*waving arms furiously*"); + } +} + +// ANCHOR: here +fn main() { + let person = Human; + Pilot::fly(&person); + Wizard::fly(&person); + person.fly(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-19/output.txt b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/output.txt new file mode 100644 index 000000000..b6e283f20 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling traits-example v0.1.0 (file:///projects/traits-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.54s + Running `target/debug/traits-example` +A baby dog is called a Spot diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-19/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/src/main.rs new file mode 100644 index 000000000..44affe0ee --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-19/src/main.rs @@ -0,0 +1,21 @@ +trait Animal { + fn baby_name() -> String; +} + +struct Dog; + +impl Dog { + fn baby_name() -> String { + String::from("Spot") + } +} + +impl Animal for Dog { + fn baby_name() -> String { + String::from("puppy") + } +} + +fn main() { + println!("A baby dog is called a {}", Dog::baby_name()); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-20/output.txt b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/output.txt new file mode 100644 index 000000000..0e78ae2d9 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/output.txt @@ -0,0 +1,18 @@ +$ cargo run + Compiling traits-example v0.1.0 (file:///projects/traits-example) +error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type + --> src/main.rs:20:43 + | +2 | fn baby_name() -> String; + | ------------------------- `Animal::baby_name` defined here +... +20 | println!("A baby dog is called a {}", Animal::baby_name()); + | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait + | +help: use the fully-qualified path to the only available implementation + | +20 | println!("A baby dog is called a {}", ::baby_name()); + | +++++++ + + +For more information about this error, try `rustc --explain E0790`. +error: could not compile `traits-example` (bin "traits-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-20/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/src/main.rs new file mode 100644 index 000000000..8e295c9b6 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-20/src/main.rs @@ -0,0 +1,23 @@ +trait Animal { + fn baby_name() -> String; +} + +struct Dog; + +impl Dog { + fn baby_name() -> String { + String::from("Spot") + } +} + +impl Animal for Dog { + fn baby_name() -> String { + String::from("puppy") + } +} + +// ANCHOR: here +fn main() { + println!("A baby dog is called a {}", Animal::baby_name()); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-21/output.txt b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/output.txt new file mode 100644 index 000000000..f59d0bc27 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/output.txt @@ -0,0 +1,5 @@ +$ cargo run + Compiling traits-example v0.1.0 (file:///projects/traits-example) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s + Running `target/debug/traits-example` +A baby dog is called a puppy diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-21/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/src/main.rs new file mode 100644 index 000000000..b1df72895 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-21/src/main.rs @@ -0,0 +1,23 @@ +trait Animal { + fn baby_name() -> String; +} + +struct Dog; + +impl Dog { + fn baby_name() -> String { + String::from("Spot") + } +} + +impl Animal for Dog { + fn baby_name() -> String { + String::from("puppy") + } +} + +// ANCHOR: here +fn main() { + println!("A baby dog is called a {}", ::baby_name()); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-22/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/src/main.rs new file mode 100644 index 000000000..7069fef17 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-22/src/main.rs @@ -0,0 +1,17 @@ +// ANCHOR: here +use std::fmt; + +trait OutlinePrint: fmt::Display { + fn outline_print(&self) { + let output = self.to_string(); + let len = output.len(); + println!("{}", "*".repeat(len + 4)); + println!("*{}*", " ".repeat(len + 2)); + println!("* {output} *"); + println!("*{}*", " ".repeat(len + 2)); + println!("{}", "*".repeat(len + 4)); + } +} +// ANCHOR_END: here + +fn main() {} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-23/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/src/main.rs new file mode 100644 index 000000000..f8c8366b4 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-23/src/main.rs @@ -0,0 +1,14 @@ +use std::fmt; + +struct Wrapper(Vec); + +impl fmt::Display for Wrapper { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "[{}]", self.0.join(", ")) + } +} + +fn main() { + let w = Wrapper(vec![String::from("hello"), String::from("world")]); + println!("w = {w}"); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-24/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/src/main.rs new file mode 100644 index 000000000..d604ae8d6 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-24/src/main.rs @@ -0,0 +1,16 @@ +fn main() { + // ANCHOR: here + let f: Box = Box::new(|| println!("hi")); + + fn takes_long_type(f: Box) { + // --snip-- + } + + fn returns_long_type() -> Box { + // --snip-- + // ANCHOR_END: here + Box::new(|| ()) + // ANCHOR: here + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-25/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/src/main.rs new file mode 100644 index 000000000..af35bed2c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-25/src/main.rs @@ -0,0 +1,18 @@ +fn main() { + // ANCHOR: here + type Thunk = Box; + + let f: Thunk = Box::new(|| println!("hi")); + + fn takes_long_type(f: Thunk) { + // --snip-- + } + + fn returns_long_type() -> Thunk { + // --snip-- + // ANCHOR_END: here + Box::new(|| ()) + // ANCHOR: here + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-27/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/src/main.rs new file mode 100644 index 000000000..312df2412 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-27/src/main.rs @@ -0,0 +1,13 @@ +fn add_one(x: i32) -> i32 { + x + 1 +} + +fn do_twice(f: fn(i32) -> i32, arg: i32) -> i32 { + f(arg) + f(arg) +} + +fn main() { + let answer = do_twice(add_one, 5); + + println!("The answer is: {answer}"); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.lock new file mode 100644 index 000000000..b2d925754 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "macros-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.toml new file mode 100644 index 000000000..9218091c8 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "macros-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-28/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/src/lib.rs new file mode 100644 index 000000000..7c7c4756c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-28/src/lib.rs @@ -0,0 +1,12 @@ +#[macro_export] +macro_rules! vec { + ( $( $x:expr ),* ) => { + { + let mut temp_vec = Vec::new(); + $( + temp_vec.push($x); + )* + temp_vec + } + }; +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.lock new file mode 100644 index 000000000..39afcf282 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.toml new file mode 100644 index 000000000..c6fb92087 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-30/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/src/main.rs new file mode 100644 index 000000000..468c30aa4 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-30/src/main.rs @@ -0,0 +1,9 @@ +use hello_macro::HelloMacro; +use hello_macro_derive::HelloMacro; + +#[derive(HelloMacro)] +struct Pancakes; + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.lock new file mode 100644 index 000000000..39afcf282 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.toml new file mode 100644 index 000000000..c6fb92087 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.lock new file mode 100644 index 000000000..6be987b21 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.lock @@ -0,0 +1,46 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_macro_derive" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.toml new file mode 100644 index 000000000..ed9e917ad --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "hello_macro_derive" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +syn = "2.0" +quote = "1.0" diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs new file mode 100644 index 000000000..839ec8359 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs @@ -0,0 +1,12 @@ +use proc_macro::TokenStream; +use quote::quote; + +#[proc_macro_derive(HelloMacro)] +pub fn hello_macro_derive(input: TokenStream) -> TokenStream { + // Construct a representation of Rust code as a syntax tree + // that we can manipulate + let ast = syn::parse(input).unwrap(); + + // Build the trait implementation + impl_hello_macro(&ast) +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/lib.rs new file mode 100644 index 000000000..e74793184 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/lib.rs @@ -0,0 +1,3 @@ +pub trait HelloMacro { + fn hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/main.rs new file mode 100644 index 000000000..10b028b2d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-31/hello_macro/src/main.rs @@ -0,0 +1,13 @@ +use hello_macro::HelloMacro; + +struct Pancakes; + +impl HelloMacro for Pancakes { + fn hello_macro() { + println!("Hello, Macro! My name is Pancakes!"); + } +} + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.lock new file mode 100644 index 000000000..39afcf282 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.toml new file mode 100644 index 000000000..c6fb92087 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.lock new file mode 100644 index 000000000..6be987b21 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.lock @@ -0,0 +1,46 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_macro_derive" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.toml new file mode 100644 index 000000000..ed9e917ad --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "hello_macro_derive" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +syn = "2.0" +quote = "1.0" diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/src/lib.rs new file mode 100644 index 000000000..ba1215f51 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/hello_macro_derive/src/lib.rs @@ -0,0 +1,26 @@ +use proc_macro::TokenStream; +use quote::quote; + +#[proc_macro_derive(HelloMacro)] +pub fn hello_macro_derive(input: TokenStream) -> TokenStream { + // Construct a representation of Rust code as a syntax tree + // that we can manipulate + let ast = syn::parse(input).unwrap(); + + // Build the trait implementation + impl_hello_macro(&ast) +} + +// ANCHOR: here +fn impl_hello_macro(ast: &syn::DeriveInput) -> TokenStream { + let name = &ast.ident; + let gen = quote! { + impl HelloMacro for #name { + fn hello_macro() { + println!("Hello, Macro! My name is {}!", stringify!(#name)); + } + } + }; + gen.into() +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/lib.rs new file mode 100644 index 000000000..e74793184 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/lib.rs @@ -0,0 +1,3 @@ +pub trait HelloMacro { + fn hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/main.rs new file mode 100644 index 000000000..10b028b2d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/listing-19-33/hello_macro/src/main.rs @@ -0,0 +1,13 @@ +use hello_macro::HelloMacro; + +struct Pancakes; + +impl HelloMacro for Pancakes { + fn hello_macro() { + println!("Hello, Macro! My name is Pancakes!"); + } +} + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/src/main.rs new file mode 100644 index 000000000..21ecdbe5a --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-01-unsafe-fn/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + unsafe fn dangerous() {} + + unsafe { + dangerous(); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/output.txt b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/output.txt new file mode 100644 index 000000000..41af68689 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/output.txt @@ -0,0 +1,34 @@ +$ cargo run + Compiling traits-example v0.1.0 (file:///projects/traits-example) +error[E0277]: `Point` doesn't implement `std::fmt::Display` + --> src/main.rs:20:23 + | +20 | impl OutlinePrint for Point {} + | ^^^^^ `Point` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `Point` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `OutlinePrint` + --> src/main.rs:3:21 + | +3 | trait OutlinePrint: fmt::Display { + | ^^^^^^^^^^^^ required by this bound in `OutlinePrint` + +error[E0277]: `Point` doesn't implement `std::fmt::Display` + --> src/main.rs:24:7 + | +24 | p.outline_print(); + | ^^^^^^^^^^^^^ `Point` cannot be formatted with the default formatter + | + = help: the trait `std::fmt::Display` is not implemented for `Point` + = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +note: required by a bound in `OutlinePrint::outline_print` + --> src/main.rs:3:21 + | +3 | trait OutlinePrint: fmt::Display { + | ^^^^^^^^^^^^ required by this bound in `OutlinePrint::outline_print` +4 | fn outline_print(&self) { + | ------------- required by a bound in this associated function + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `traits-example` (bin "traits-example") due to 2 previous errors diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/src/main.rs new file mode 100644 index 000000000..0e45f3c28 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/src/main.rs @@ -0,0 +1,27 @@ +use std::fmt; + +trait OutlinePrint: fmt::Display { + fn outline_print(&self) { + let output = self.to_string(); + let len = output.len(); + println!("{}", "*".repeat(len + 4)); + println!("*{}*", " ".repeat(len + 2)); + println!("* {output} *"); + println!("*{}*", " ".repeat(len + 2)); + println!("{}", "*".repeat(len + 4)); + } +} + +// ANCHOR: here +struct Point { + x: i32, + y: i32, +} + +impl OutlinePrint for Point {} +// ANCHOR_END: here + +fn main() { + let p = Point { x: 1, y: 3 }; + p.outline_print(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/src/main.rs new file mode 100644 index 000000000..fa5be1c7c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-03-impl-display-for-point/src/main.rs @@ -0,0 +1,33 @@ +trait OutlinePrint: fmt::Display { + fn outline_print(&self) { + let output = self.to_string(); + let len = output.len(); + println!("{}", "*".repeat(len + 4)); + println!("*{}*", " ".repeat(len + 2)); + println!("* {output} *"); + println!("*{}*", " ".repeat(len + 2)); + println!("{}", "*".repeat(len + 4)); + } +} + +struct Point { + x: i32, + y: i32, +} + +impl OutlinePrint for Point {} + +// ANCHOR: here +use std::fmt; + +impl fmt::Display for Point { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "({}, {})", self.x, self.y) + } +} +// ANCHOR_END: here + +fn main() { + let p = Point { x: 1, y: 3 }; + p.outline_print(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/src/main.rs new file mode 100644 index 000000000..d3fe32e2f --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-04-kilometers-alias/src/main.rs @@ -0,0 +1,12 @@ +fn main() { + // ANCHOR: there + // ANCHOR: here + type Kilometers = i32; + // ANCHOR_END: here + + let x: i32 = 5; + let y: Kilometers = 5; + + println!("x + y = {}", x + y); + // ANCHOR_END: there +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/src/lib.rs new file mode 100644 index 000000000..8300dccee --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-05-write-trait/src/lib.rs @@ -0,0 +1,10 @@ +use std::fmt; +use std::io::Error; + +pub trait Write { + fn write(&mut self, buf: &[u8]) -> Result; + fn flush(&mut self) -> Result<(), Error>; + + fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>; + fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), Error>; +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/src/lib.rs new file mode 100644 index 000000000..573559934 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-06-result-alias/src/lib.rs @@ -0,0 +1,15 @@ +use std::fmt; + +// ANCHOR: here +type Result = std::result::Result; +// ANCHOR_END: here + +// ANCHOR: there +pub trait Write { + fn write(&mut self, buf: &[u8]) -> Result; + fn flush(&mut self) -> Result<()>; + + fn write_all(&mut self, buf: &[u8]) -> Result<()>; + fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<()>; +} +// ANCHOR_END: there diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.lock new file mode 100644 index 000000000..b1977d01e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "traits-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.toml new file mode 100644 index 000000000..52395a587 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "traits-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/src/lib.rs new file mode 100644 index 000000000..f0f7acac2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-07-never-type/src/lib.rs @@ -0,0 +1,8 @@ +// ANCHOR: here +fn bar() -> ! { + // --snip-- + // ANCHOR_END: here + panic!(); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/src/main.rs new file mode 100644 index 000000000..6d56008ad --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-08-match-arms-different-types/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + let guess = "3"; + // ANCHOR: here + let guess = match guess.trim().parse() { + Ok(_) => 5, + Err(_) => "hello", + }; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/src/lib.rs new file mode 100644 index 000000000..aa4f937ff --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-09-unwrap-definition/src/lib.rs @@ -0,0 +1,17 @@ +enum Option { + Some(T), + None, +} + +use crate::Option::*; + +// ANCHOR: here +impl Option { + pub fn unwrap(self) -> T { + match self { + Some(val) => val, + None => panic!("called `Option::unwrap()` on a `None` value"), + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/src/main.rs new file mode 100644 index 000000000..e7768913b --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-10-loop-returns-never/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + // ANCHOR: here + print!("forever "); + + loop { + print!("and ever "); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/src/main.rs new file mode 100644 index 000000000..075d5110c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-11-cant-create-str/src/main.rs @@ -0,0 +1,6 @@ +fn main() { + // ANCHOR: here + let s1: str = "Hello there!"; + let s2: str = "How's it going?"; + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/src/lib.rs new file mode 100644 index 000000000..69186ddfb --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-12-generic-fn-definition/src/lib.rs @@ -0,0 +1,3 @@ +fn generic(t: T) { + // --snip-- +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/src/lib.rs new file mode 100644 index 000000000..c2d00e216 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-13-generic-implicit-sized-bound/src/lib.rs @@ -0,0 +1,3 @@ +fn generic(t: T) { + // --snip-- +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.lock new file mode 100644 index 000000000..c0c98a79c --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml new file mode 100644 index 000000000..a2ae20c77 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/src/lib.rs new file mode 100644 index 000000000..e4722267a --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-14-generic-maybe-sized/src/lib.rs @@ -0,0 +1,3 @@ +fn generic(t: &T) { + // --snip-- +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/src/main.rs new file mode 100644 index 000000000..b4fcf7eb8 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-15-map-closure/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + let list_of_numbers = vec![1, 2, 3]; + let list_of_strings: Vec = + list_of_numbers.iter().map(|i| i.to_string()).collect(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/src/main.rs new file mode 100644 index 000000000..dff20fe71 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-16-map-function/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + let list_of_numbers = vec![1, 2, 3]; + let list_of_strings: Vec = + list_of_numbers.iter().map(ToString::to_string).collect(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/src/main.rs new file mode 100644 index 000000000..60fb73005 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-17-map-initializer/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + // ANCHOR: here + enum Status { + Value(u32), + Stop, + } + + let list_of_statuses: Vec = (0u32..20).map(Status::Value).collect(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt new file mode 100644 index 000000000..3a2342639 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt @@ -0,0 +1,20 @@ +$ cargo build + Compiling functions-example v0.1.0 (file:///projects/functions-example) +error[E0746]: return type cannot have an unboxed trait object + --> src/lib.rs:1:25 + | +1 | fn returns_closure() -> dyn Fn(i32) -> i32 { + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +help: consider returning an `impl Trait` instead of a `dyn Trait` + | +1 | fn returns_closure() -> impl Fn(i32) -> i32 { + | ~~~~ +help: alternatively, box the return type, and wrap all of the returned values in `Box::new` + | +1 ~ fn returns_closure() -> Box i32> { +2 ~ Box::new(|x| x + 1) + | + +For more information about this error, try `rustc --explain E0746`. +error: could not compile `functions-example` (lib) due to 1 previous error diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/src/lib.rs new file mode 100644 index 000000000..d699ac34e --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-18-returns-closure/src/lib.rs @@ -0,0 +1,3 @@ +fn returns_closure() -> dyn Fn(i32) -> i32 { + |x| x + 1 +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.lock new file mode 100644 index 000000000..b2327c755 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "functions-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml new file mode 100644 index 000000000..b196f35b5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs new file mode 100644 index 000000000..b11407747 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs @@ -0,0 +1,3 @@ +fn returns_closure() -> Box i32> { + Box::new(|x| x + 1) +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.lock new file mode 100644 index 000000000..39afcf282 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml new file mode 100644 index 000000000..c6fb92087 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/src/lib.rs new file mode 100644 index 000000000..e74793184 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/src/lib.rs @@ -0,0 +1,3 @@ +pub trait HelloMacro { + fn hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.lock new file mode 100644 index 000000000..881cd3f6d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.lock @@ -0,0 +1,13 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + +[[package]] +name = "pancakes" +version = "0.1.0" +dependencies = [ + "hello_macro 0.1.0", +] + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml new file mode 100644 index 000000000..3ad910862 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "pancakes" +version = "0.1.0" +edition = "2021" + +[dependencies] +hello_macro = { path = "../hello_macro" } \ No newline at end of file diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/src/main.rs new file mode 100644 index 000000000..10b028b2d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/src/main.rs @@ -0,0 +1,13 @@ +use hello_macro::HelloMacro; + +struct Pancakes; + +impl HelloMacro for Pancakes { + fn hello_macro() { + println!("Hello, Macro! My name is Pancakes!"); + } +} + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.lock new file mode 100644 index 000000000..39afcf282 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml new file mode 100644 index 000000000..c6fb92087 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.lock new file mode 100644 index 000000000..6be987b21 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.lock @@ -0,0 +1,46 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_macro_derive" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml new file mode 100644 index 000000000..ed9e917ad --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "hello_macro_derive" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +syn = "2.0" +quote = "1.0" diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/src/lib.rs new file mode 100644 index 000000000..654b6bee5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/src/lib.rs @@ -0,0 +1,24 @@ +use proc_macro::TokenStream; +use quote::quote; + +#[proc_macro_derive(HelloMacro)] +pub fn hello_macro_derive(input: TokenStream) -> TokenStream { + // Construct a representation of Rust code as a syntax tree + // that we can manipulate + let ast = syn::parse(input).unwrap(); + + // Build the trait implementation + impl_hello_macro(&ast) +} + +fn impl_hello_macro(ast: &syn::DeriveInput) -> TokenStream { + let name = &ast.ident; + let gen = quote! { + impl HelloMacro for #name { + fn hello_macro() { + println!("Hello, Macro! My name is {}!", stringify!(#name)); + } + } + }; + gen.into() +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/lib.rs new file mode 100644 index 000000000..e74793184 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/lib.rs @@ -0,0 +1,3 @@ +pub trait HelloMacro { + fn hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/main.rs new file mode 100644 index 000000000..10b028b2d --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/hello_macro/src/main.rs @@ -0,0 +1,13 @@ +use hello_macro::HelloMacro; + +struct Pancakes; + +impl HelloMacro for Pancakes { + fn hello_macro() { + println!("Hello, Macro! My name is Pancakes!"); + } +} + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.lock new file mode 100644 index 000000000..3849f1521 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.lock @@ -0,0 +1,58 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_macro" +version = "0.1.0" + +[[package]] +name = "hello_macro_derive" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "pancakes" +version = "0.1.0" +dependencies = [ + "hello_macro", + "hello_macro_derive", +] + +[[package]] +name = "proc-macro2" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml new file mode 100644 index 000000000..cb3a98c3a --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "pancakes" +version = "0.1.0" +edition = "2021" + +[dependencies] +hello_macro = { path = "../hello_macro" } +hello_macro_derive = { path = "../hello_macro/hello_macro_derive" } diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/src/main.rs new file mode 100644 index 000000000..468c30aa4 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-21-pancakes/pancakes/src/main.rs @@ -0,0 +1,9 @@ +use hello_macro::HelloMacro; +use hello_macro_derive::HelloMacro; + +#[derive(HelloMacro)] +struct Pancakes; + +fn main() { + Pancakes::hello_macro(); +} diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.lock new file mode 100644 index 000000000..58b70c5b7 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "counter" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml new file mode 100644 index 000000000..9e103f3eb --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "counter" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/src/lib.rs b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/src/lib.rs new file mode 100644 index 000000000..04c7f38f5 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/no-listing-22-iterator-on-counter/src/lib.rs @@ -0,0 +1,25 @@ +struct Counter { + count: u32, +} + +impl Counter { + fn new() -> Counter { + Counter { count: 0 } + } +} + +// ANCHOR: ch19 +impl Iterator for Counter { + type Item = u32; + + fn next(&mut self) -> Option { + // --snip-- + // ANCHOR_END: ch19 + if self.count < 5 { + self.count += 1; + Some(self.count) + } else { + None + } + } +} diff --git a/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.lock b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.lock new file mode 100644 index 000000000..497817bf2 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "unsafe-example" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.toml b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.toml new file mode 100644 index 000000000..3e8a29201 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "unsafe-example" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/output.txt b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/output.txt new file mode 100644 index 000000000..b14994cdd --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/output.txt @@ -0,0 +1,12 @@ +$ cargo run + Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example) +error[E0133]: call to unsafe function `dangerous` is unsafe and requires unsafe function or block + --> src/main.rs:4:5 + | +4 | dangerous(); + | ^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +For more information about this error, try `rustc --explain E0133`. +error: could not compile `unsafe-example` (bin "unsafe-example") due to 1 previous error diff --git a/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/src/main.rs b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/src/main.rs new file mode 100644 index 000000000..01305be74 --- /dev/null +++ b/rustbook-ru/listings/ch19-advanced-features/output-only-01-missing-unsafe/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + // ANCHOR: here + unsafe fn dangerous() {} + + dangerous(); + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-01/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-01/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-01/src/main.rs new file mode 100644 index 000000000..d868c3ec1 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-01/src/main.rs @@ -0,0 +1,11 @@ +use std::net::TcpListener; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + println!("Connection established!"); + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-02/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-02/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-02/src/main.rs new file mode 100644 index 000000000..1eff2eef3 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-02/src/main.rs @@ -0,0 +1,25 @@ +use std::{ + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let http_request: Vec<_> = buf_reader + .lines() + .map(|result| result.unwrap()) + .take_while(|line| !line.is_empty()) + .collect(); + + println!("Request: {http_request:#?}"); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-03/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-03/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-03/src/main.rs new file mode 100644 index 000000000..17c8401d4 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-03/src/main.rs @@ -0,0 +1,29 @@ +use std::{ + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} + +// ANCHOR: here +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let http_request: Vec<_> = buf_reader + .lines() + .map(|result| result.unwrap()) + .take_while(|line| !line.is_empty()) + .collect(); + + let response = "HTTP/1.1 200 OK\r\n\r\n"; + + stream.write_all(response.as_bytes()).unwrap(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-05/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-05/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-05/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-05/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-05/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-05/src/main.rs new file mode 100644 index 000000000..437d9b626 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-05/src/main.rs @@ -0,0 +1,38 @@ +// ANCHOR: here +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; +// --snip-- + +// ANCHOR_END: here +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} + +// ANCHOR: here +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let http_request: Vec<_> = buf_reader + .lines() + .map(|result| result.unwrap()) + .take_while(|line| !line.is_empty()) + .collect(); + + let status_line = "HTTP/1.1 200 OK"; + let contents = fs::read_to_string("hello.html").unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-06/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-06/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-06/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-06/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-06/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-06/src/main.rs new file mode 100644 index 000000000..843d84676 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-06/src/main.rs @@ -0,0 +1,37 @@ +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} +// ANCHOR: here +// --snip-- + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + if request_line == "GET / HTTP/1.1" { + let status_line = "HTTP/1.1 200 OK"; + let contents = fs::read_to_string("hello.html").unwrap(); + let length = contents.len(); + + let response = format!( + "{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}" + ); + + stream.write_all(response.as_bytes()).unwrap(); + } else { + // some other request + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-07/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-07/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-07/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-07/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-07/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-07/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-07/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-07/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-07/src/main.rs new file mode 100644 index 000000000..e19467b83 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-07/src/main.rs @@ -0,0 +1,45 @@ +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + if request_line == "GET / HTTP/1.1" { + let status_line = "HTTP/1.1 200 OK"; + let contents = fs::read_to_string("hello.html").unwrap(); + let length = contents.len(); + + let response = format!( + "{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}" + ); + + stream.write_all(response.as_bytes()).unwrap(); + // ANCHOR: here + // --snip-- + } else { + let status_line = "HTTP/1.1 404 NOT FOUND"; + let contents = fs::read_to_string("404.html").unwrap(); + let length = contents.len(); + + let response = format!( + "{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}" + ); + + stream.write_all(response.as_bytes()).unwrap(); + } + // ANCHOR_END: here +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-09/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-09/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-09/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-09/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-09/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-09/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-09/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-09/src/main.rs new file mode 100644 index 000000000..0f9356ab0 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-09/src/main.rs @@ -0,0 +1,40 @@ +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} +// ANCHOR: here +// --snip-- + +fn handle_connection(mut stream: TcpStream) { + // --snip-- + // ANCHOR_END: here + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + // ANCHOR: here + + let (status_line, filename) = if request_line == "GET / HTTP/1.1" { + ("HTTP/1.1 200 OK", "hello.html") + } else { + ("HTTP/1.1 404 NOT FOUND", "404.html") + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-10/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-10/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-10/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-10/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-10/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-10/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-10/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-10/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-10/src/main.rs new file mode 100644 index 000000000..0679ec600 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-10/src/main.rs @@ -0,0 +1,52 @@ +// ANCHOR: here +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; +// --snip-- +// ANCHOR_END: here + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + handle_connection(stream); + } +} +// ANCHOR: here + +fn handle_connection(mut stream: TcpStream) { + // --snip-- + + // ANCHOR_END: here + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + // ANCHOR: here + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + // --snip-- + // ANCHOR_END: here + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-11/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-11/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-11/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-11/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-11/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-11/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-11/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-11/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-11/src/main.rs new file mode 100644 index 000000000..075a0d9de --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-11/src/main.rs @@ -0,0 +1,43 @@ +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +// ANCHOR: here +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + thread::spawn(|| { + handle_connection(stream); + }); + } +} +// ANCHOR_END: here + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-12/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-12/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/output.txt b/rustbook-ru/listings/ch20-web-server/listing-20-12/output.txt new file mode 100644 index 000000000..0faae9920 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/output.txt @@ -0,0 +1,10 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0433]: failed to resolve: use of undeclared type `ThreadPool` + --> src/main.rs:11:16 + | +11 | let pool = ThreadPool::new(4); + | ^^^^^^^^^^ use of undeclared type `ThreadPool` + +For more information about this error, try `rustc --explain E0433`. +error: could not compile `hello` (bin "hello") due to 1 previous error diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-12/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-12/src/main.rs new file mode 100644 index 000000000..bde3e29d1 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-12/src/main.rs @@ -0,0 +1,44 @@ +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +// ANCHOR: here +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} +// ANCHOR_END: here + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-13/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-13/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-13/src/lib.rs new file mode 100644 index 000000000..35960e7c0 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/src/lib.rs @@ -0,0 +1,27 @@ +pub struct ThreadPool; + +// ANCHOR: here +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + ThreadPool + } + + // --snip-- + // ANCHOR_END: here + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-13/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-13/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-13/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-14/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-14/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-14/src/lib.rs new file mode 100644 index 000000000..c1fa1828b --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/src/lib.rs @@ -0,0 +1,40 @@ +// ANCHOR: here +use std::thread; + +pub struct ThreadPool { + threads: Vec>, +} + +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let mut threads = Vec::with_capacity(size); + + for _ in 0..size { + // create some threads and store them in the vector + } + + ThreadPool { threads } + } + // --snip-- + // ANCHOR_END: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-14/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-14/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-14/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-15/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-15/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-15/src/lib.rs new file mode 100644 index 000000000..80a6eeeb3 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/src/lib.rs @@ -0,0 +1,53 @@ +// ANCHOR: here +use std::thread; + +pub struct ThreadPool { + workers: Vec, +} + +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id)); + } + + ThreadPool { workers } + } + // --snip-- + // ANCHOR_END: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +impl Worker { + fn new(id: usize) -> Worker { + let thread = thread::spawn(|| {}); + + Worker { id, thread } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-15/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-15/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-15/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-16/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-16/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-16/src/lib.rs new file mode 100644 index 000000000..411c1d003 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/src/lib.rs @@ -0,0 +1,58 @@ +// ANCHOR: here +use std::{sync::mpsc, thread}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +struct Job; + +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id)); + } + + ThreadPool { workers, sender } + } + // --snip-- + // ANCHOR_END: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +impl Worker { + fn new(id: usize) -> Worker { + let thread = thread::spawn(|| {}); + + Worker { id, thread } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-16/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-16/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-16/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-17/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-17/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/output.txt b/rustbook-ru/listings/ch20-web-server/listing-20-17/output.txt new file mode 100644 index 000000000..276826551 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/output.txt @@ -0,0 +1,27 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0382]: use of moved value: `receiver` + --> src/lib.rs:26:42 + | +21 | let (sender, receiver) = mpsc::channel(); + | -------- move occurs because `receiver` has type `std::sync::mpsc::Receiver`, which does not implement the `Copy` trait +... +25 | for id in 0..size { + | ----------------- inside of this loop +26 | workers.push(Worker::new(id, receiver)); + | ^^^^^^^^ value moved here, in previous iteration of loop + | +note: consider changing this parameter type in method `new` to borrow instead if owning the value isn't necessary + --> src/lib.rs:47:33 + | +47 | fn new(id: usize, receiver: mpsc::Receiver) -> Worker { + | --- in this method ^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value +help: consider moving the expression out of the loop so it is only moved once + | +25 ~ let mut value = Worker::new(id, receiver); +26 ~ for id in 0..size { +27 ~ workers.push(value); + | + +For more information about this error, try `rustc --explain E0382`. +error: could not compile `hello` (lib) due to 1 previous error diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-17/src/lib.rs new file mode 100644 index 000000000..d764879e5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/src/lib.rs @@ -0,0 +1,65 @@ +use std::{sync::mpsc, thread}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +struct Job; + +// ANCHOR: here +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, receiver)); + } + + ThreadPool { workers, sender } + } + // --snip-- + // ANCHOR_END: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} + +// --snip-- + +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +// ANCHOR: here +impl Worker { + fn new(id: usize, receiver: mpsc::Receiver) -> Worker { + let thread = thread::spawn(|| { + receiver; + }); + + Worker { id, thread } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-17/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-17/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-17/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-18/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-18/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-18/src/lib.rs new file mode 100644 index 000000000..4bff8acad --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/src/lib.rs @@ -0,0 +1,76 @@ +// ANCHOR: here +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; +// --snip-- + +// ANCHOR_END: here +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +struct Job; + +// ANCHOR: here +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + // --snip-- + // ANCHOR_END: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } + // ANCHOR: here +} + +// --snip-- + +// ANCHOR_END: here +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +// ANCHOR: here +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + // --snip-- + // ANCHOR_END: here + let thread = thread::spawn(|| { + receiver; + }); + + Worker { id, thread } + // ANCHOR: here + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-18/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-18/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-18/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-19/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-19/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-19/src/lib.rs new file mode 100644 index 000000000..aeb1facd6 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/src/lib.rs @@ -0,0 +1,69 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +// ANCHOR: here +// --snip-- + +type Job = Box; + +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + // ANCHOR: here + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +// --snip-- +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(|| { + receiver; + }); + + Worker { id, thread } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-19/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-19/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-19/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-20/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-20/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-20/src/lib.rs new file mode 100644 index 000000000..86157c9e7 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/src/lib.rs @@ -0,0 +1,68 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +// ANCHOR: here +// --snip-- + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + Worker { id, thread } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-20/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-20/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-20/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-21/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-21/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-21/src/lib.rs new file mode 100644 index 000000000..17b37e77b --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/src/lib.rs @@ -0,0 +1,67 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} +// ANCHOR: here +// --snip-- + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || { + while let Ok(job) = receiver.lock().unwrap().recv() { + println!("Worker {id} got a job; executing."); + + job(); + } + }); + + Worker { id, thread } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-21/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-21/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-21/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-22/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-22/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/output.txt b/rustbook-ru/listings/ch20-web-server/listing-20-22/output.txt new file mode 100644 index 000000000..554bfd859 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/output.txt @@ -0,0 +1,15 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0507]: cannot move out of `worker.thread` which is behind a mutable reference + --> src/lib.rs:52:13 + | +52 | worker.thread.join().unwrap(); + | ^^^^^^^^^^^^^ ------ `worker.thread` moved due to this method call + | | + | move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait + | +note: `JoinHandle::::join` takes ownership of the receiver `self`, which moves `worker.thread` + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:17 + +For more information about this error, try `rustc --explain E0507`. +error: could not compile `hello` (lib) due to 1 previous error diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-22/src/lib.rs new file mode 100644 index 000000000..72a8c4808 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/src/lib.rs @@ -0,0 +1,76 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +// ANCHOR: here +impl Drop for ThreadPool { + fn drop(&mut self) { + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + worker.thread.join().unwrap(); + } + } +} +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: thread::JoinHandle<()>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + Worker { id, thread } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-22/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-22/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-22/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-23/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-23/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-23/src/lib.rs new file mode 100644 index 000000000..eea339b02 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/src/lib.rs @@ -0,0 +1,95 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +// ANCHOR: here +pub struct ThreadPool { + workers: Vec, + sender: Option>, +} +// --snip-- +// ANCHOR_END: here + +type Job = Box; + +// ANCHOR: here +impl ThreadPool { + // ANCHOR_END: here + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + // ANCHOR: here + pub fn new(size: usize) -> ThreadPool { + // --snip-- + + // ANCHOR_END: here + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + // ANCHOR: here + ThreadPool { + workers, + sender: Some(sender), + } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.as_ref().unwrap().send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + drop(self.sender.take()); + + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + if let Some(thread) = worker.thread.take() { + thread.join().unwrap(); + } + } + } +} +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: Option>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + Worker { + id, + thread: Some(thread), + } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-23/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-23/src/main.rs new file mode 100644 index 000000000..acd703f27 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-23/src/main.rs @@ -0,0 +1,45 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming().take(2) { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } + + println!("Shutting down."); +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-24/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-24/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-24/src/lib.rs new file mode 100644 index 000000000..28c0dea26 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/src/lib.rs @@ -0,0 +1,94 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: Option>, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { + workers, + sender: Some(sender), + } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.as_ref().unwrap().send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + drop(self.sender.take()); + + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + if let Some(thread) = worker.thread.take() { + thread.join().unwrap(); + } + } + } +} + +struct Worker { + id: usize, + thread: Option>, +} + +// ANCHOR: here +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } + } + }); + + Worker { + id, + thread: Some(thread), + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-24/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-24/src/main.rs new file mode 100644 index 000000000..acd703f27 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-24/src/main.rs @@ -0,0 +1,45 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming().take(2) { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } + + println!("Shutting down."); +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/404.html b/rustbook-ru/listings/ch20-web-server/listing-20-25/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.lock b/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.toml b/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/hello.html b/rustbook-ru/listings/ch20-web-server/listing-20-25/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/src/lib.rs b/rustbook-ru/listings/ch20-web-server/listing-20-25/src/lib.rs new file mode 100644 index 000000000..54c0489ab --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/src/lib.rs @@ -0,0 +1,92 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: Option>, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { + workers, + sender: Some(sender), + } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.as_ref().unwrap().send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + drop(self.sender.take()); + + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + if let Some(thread) = worker.thread.take() { + thread.join().unwrap(); + } + } + } +} + +struct Worker { + id: usize, + thread: Option>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } + } + }); + + Worker { + id, + thread: Some(thread), + } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/listing-20-25/src/main.rs b/rustbook-ru/listings/ch20-web-server/listing-20-25/src/main.rs new file mode 100644 index 000000000..ee0f1efe7 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/listing-20-25/src/main.rs @@ -0,0 +1,47 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +// ANCHOR: here +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming().take(2) { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } + + println!("Shutting down."); +} +// ANCHOR_END: here + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/output.txt b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/output.txt new file mode 100644 index 000000000..85ebfb813 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/output.txt @@ -0,0 +1,10 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0599]: no function or associated item named `new` found for struct `ThreadPool` in the current scope + --> src/main.rs:12:28 + | +12 | let pool = ThreadPool::new(4); + | ^^^ function or associated item not found in `ThreadPool` + +For more information about this error, try `rustc --explain E0599`. +error: could not compile `hello` (bin "hello") due to 1 previous error diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/lib.rs new file mode 100644 index 000000000..7312e293d --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/lib.rs @@ -0,0 +1 @@ +pub struct ThreadPool; diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs new file mode 100644 index 000000000..e68f72c70 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs @@ -0,0 +1,45 @@ +// ANCHOR: here +use hello::ThreadPool; +// ANCHOR_END: here +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/output.txt b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/output.txt new file mode 100644 index 000000000..667041862 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/output.txt @@ -0,0 +1,10 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0599]: no method named `execute` found for struct `ThreadPool` in the current scope + --> src/main.rs:17:14 + | +17 | pool.execute(|| { + | -----^^^^^^^ method not found in `ThreadPool` + +For more information about this error, try `rustc --explain E0599`. +error: could not compile `hello` (bin "hello") due to 1 previous error diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/lib.rs new file mode 100644 index 000000000..f0e1890bb --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/lib.rs @@ -0,0 +1,7 @@ +pub struct ThreadPool; + +impl ThreadPool { + pub fn new(size: usize) -> ThreadPool { + ThreadPool + } +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/output.txt b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/output.txt new file mode 100644 index 000000000..10d212672 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/output.txt @@ -0,0 +1,3 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.24s diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/lib.rs new file mode 100644 index 000000000..1321ab873 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/lib.rs @@ -0,0 +1,18 @@ +pub struct ThreadPool; + +// ANCHOR: here +impl ThreadPool { + // --snip-- + // ANCHOR_END: here + pub fn new(size: usize) -> ThreadPool { + ThreadPool + } + + // ANCHOR: here + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-03-define-execute/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt new file mode 100644 index 000000000..6867dcbca --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt @@ -0,0 +1,31 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) +error[E0599]: no method named `join` found for enum `Option` in the current scope + --> src/lib.rs:52:27 + | +52 | worker.thread.join().unwrap(); + | ^^^^ method not found in `Option>` + | +note: the method `join` exists on the type `JoinHandle<()>` + --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:5 +help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None` + | +52 | worker.thread.expect("REASON").join().unwrap(); + | +++++++++++++++++ + +error[E0308]: mismatched types + --> src/lib.rs:72:22 + | +72 | Worker { id, thread } + | ^^^^^^ expected `Option>`, found `JoinHandle<_>` + | + = note: expected enum `Option>` + found struct `JoinHandle<_>` +help: try wrapping the expression in `Some` + | +72 | Worker { id, thread: Some(thread) } + | +++++++++++++ + + +Some errors have detailed explanations: E0308, E0599. +For more information about an error, try `rustc --explain E0308`. +error: could not compile `hello` (lib) due to 2 previous errors diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/lib.rs new file mode 100644 index 000000000..6ef710a26 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/lib.rs @@ -0,0 +1,76 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + worker.thread.join().unwrap(); + } + } +} + +// ANCHOR: here +struct Worker { + id: usize, + thread: Option>, +} +// ANCHOR_END: here + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + Worker { id, thread } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/lib.rs new file mode 100644 index 000000000..ede3750a1 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/lib.rs @@ -0,0 +1,83 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + worker.thread.join().unwrap(); + } + } +} + +struct Worker { + id: usize, + thread: Option>, +} + +// ANCHOR: here +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + // --snip-- + + // ANCHOR_END: here + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + // ANCHOR: here + Worker { + id, + thread: Some(thread), + } + } +} +// ANCHOR_END: here diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs new file mode 100644 index 000000000..1f075fde5 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs @@ -0,0 +1,43 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming() { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs new file mode 100644 index 000000000..b795ea53b --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs @@ -0,0 +1,81 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: mpsc::Sender, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { workers, sender } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.send(job).unwrap(); + } +} + +// ANCHOR: here +impl Drop for ThreadPool { + fn drop(&mut self) { + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + if let Some(thread) = worker.thread.take() { + thread.join().unwrap(); + } + } + } +} +// ANCHOR_END: here + +struct Worker { + id: usize, + thread: Option>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let job = receiver.lock().unwrap().recv().unwrap(); + + println!("Worker {id} got a job; executing."); + + job(); + }); + + Worker { + id, + thread: Some(thread), + } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs new file mode 100644 index 000000000..acd703f27 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs @@ -0,0 +1,45 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming().take(2) { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } + + println!("Shutting down."); +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/404.html b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/404.html new file mode 100644 index 000000000..88d8e9152 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/404.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Oops!

+

Sorry, I don't know what you're asking for.

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.lock b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.lock new file mode 100644 index 000000000..f2d069f46 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello" +version = "0.1.0" + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.toml b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.toml new file mode 100644 index 000000000..fe619478a --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/hello.html b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/hello.html new file mode 100644 index 000000000..fe442d6b9 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/hello.html @@ -0,0 +1,11 @@ + + + + + Hello! + + +

Hello!

+

Hi from Rust

+ + diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/lib.rs b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/lib.rs new file mode 100644 index 000000000..54c0489ab --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/lib.rs @@ -0,0 +1,92 @@ +use std::{ + sync::{mpsc, Arc, Mutex}, + thread, +}; + +pub struct ThreadPool { + workers: Vec, + sender: Option>, +} + +type Job = Box; + +impl ThreadPool { + /// Create a new ThreadPool. + /// + /// The size is the number of threads in the pool. + /// + /// # Panics + /// + /// The `new` function will panic if the size is zero. + pub fn new(size: usize) -> ThreadPool { + assert!(size > 0); + + let (sender, receiver) = mpsc::channel(); + + let receiver = Arc::new(Mutex::new(receiver)); + + let mut workers = Vec::with_capacity(size); + + for id in 0..size { + workers.push(Worker::new(id, Arc::clone(&receiver))); + } + + ThreadPool { + workers, + sender: Some(sender), + } + } + + pub fn execute(&self, f: F) + where + F: FnOnce() + Send + 'static, + { + let job = Box::new(f); + + self.sender.as_ref().unwrap().send(job).unwrap(); + } +} + +impl Drop for ThreadPool { + fn drop(&mut self) { + drop(self.sender.take()); + + for worker in &mut self.workers { + println!("Shutting down worker {}", worker.id); + + if let Some(thread) = worker.thread.take() { + thread.join().unwrap(); + } + } + } +} + +struct Worker { + id: usize, + thread: Option>, +} + +impl Worker { + fn new(id: usize, receiver: Arc>>) -> Worker { + let thread = thread::spawn(move || loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } + } + }); + + Worker { + id, + thread: Some(thread), + } + } +} diff --git a/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/main.rs b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/main.rs new file mode 100644 index 000000000..acd703f27 --- /dev/null +++ b/rustbook-ru/listings/ch20-web-server/no-listing-07-final-code/src/main.rs @@ -0,0 +1,45 @@ +use hello::ThreadPool; +use std::{ + fs, + io::{prelude::*, BufReader}, + net::{TcpListener, TcpStream}, + thread, + time::Duration, +}; + +fn main() { + let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); + let pool = ThreadPool::new(4); + + for stream in listener.incoming().take(2) { + let stream = stream.unwrap(); + + pool.execute(|| { + handle_connection(stream); + }); + } + + println!("Shutting down."); +} + +fn handle_connection(mut stream: TcpStream) { + let buf_reader = BufReader::new(&stream); + let request_line = buf_reader.lines().next().unwrap().unwrap(); + + let (status_line, filename) = match &request_line[..] { + "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), + "GET /sleep HTTP/1.1" => { + thread::sleep(Duration::from_secs(5)); + ("HTTP/1.1 200 OK", "hello.html") + } + _ => ("HTTP/1.1 404 NOT FOUND", "404.html"), + }; + + let contents = fs::read_to_string(filename).unwrap(); + let length = contents.len(); + + let response = + format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}"); + + stream.write_all(response.as_bytes()).unwrap(); +} diff --git a/rustbook-ru/listings1 b/rustbook-ru/listings1 new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/nostarch/acknowledgments.md b/rustbook-ru/nostarch/acknowledgments.md new file mode 100644 index 000000000..c29cb712a --- /dev/null +++ b/rustbook-ru/nostarch/acknowledgments.md @@ -0,0 +1,17 @@ +# Acknowledgments + +We would like to thank everyone who has worked on the Rust language for +creating an amazing language worth writing a book about. We’re grateful to +everyone in the Rust community for being welcoming and creating an environment +worth welcoming more folks into. + +We’re especially thankful for everyone who read early versions of this book +online and provided feedback, bug reports, and pull requests. Special thanks to +Eduard-Mihai Burtescu, Alex Crichton, and JT for providing technical review and +Karen Rustad Tölva for the cover art. Thank you to our team at No Starch, +including Bill Pollock, Liz Chadwick, and Janelle Ludowise, for improving this +book and bringing it to print. + +Carol is grateful for the opportunity to work on this book. She thanks her +family for their constant love and support, especially her husband Jake +Goulding and her daughter Vivian. diff --git a/rustbook-ru/nostarch/appendix.md b/rustbook-ru/nostarch/appendix.md new file mode 100644 index 000000000..98432a1da --- /dev/null +++ b/rustbook-ru/nostarch/appendix.md @@ -0,0 +1,775 @@ + + +[TOC] + +## Appendix A: Keywords + +The following lists contain keywords that are reserved for current or future +use by the Rust language. As such, they cannot be used as identifiers (except +as raw identifiers, as we’ll discuss in “Raw Identifiers” on page XX). +*Identifiers* are names of functions, variables, parameters, struct fields, +modules, crates, constants, macros, static values, attributes, types, traits, +or lifetimes. + +## Keywords Currently in Use + +The following is a list of keywords currently in use, with their functionality +described. + +* **`as` **: perform primitive casting, disambiguate the specific trait +containing an item, or rename items in `use` statements +* **`async` **: return a `Future` instead of blocking the current thread +* **`await` **: suspend execution until the result of a `Future` is ready +* **`break` **: exit a loop immediately +* **`const` **: define constant items or constant raw pointers +* **`continue` **: continue to the next loop iteration +* **`crate` **: in a module path, refers to the crate root +* **`dyn` **: dynamic dispatch to a trait object +* **`else` **: fallback for `if` and `if let` control flow constructs +* **`enum` **: define an enumeration +* **`extern` **: link an external function or variable +* **`false` **: Boolean false literal +* **`fn` **: define a function or the function pointer type +* **`for` **: loop over items from an iterator, implement a trait, or specify a +higher-ranked lifetime +* **`if` **: branch based on the result of a conditional expression +* **`impl` **: implement inherent or trait functionality +* **`in` **: part of `for` loop syntax +* **`let` **: bind a variable +* **`loop` **: loop unconditionally +* **`match` **: match a value to patterns +* **`mod` **: define a module +* **`move` **: make a closure take ownership of all its captures +* **`mut` **: denote mutability in references, raw pointers, or pattern bindings +* **`pub` **: denote public visibility in struct fields, `impl` blocks, or +modules +* **`ref` **: bind by reference +* **`return` **: return from function +* **`Self` **: a type alias for the type we are defining or implementing +* **`self` **: method subject or current module +* **`static` **: global variable or lifetime lasting the entire program +execution +* **`struct` **: define a structure +* **`super` **: parent module of the current module +* **`trait` **: define a trait +* **`true` **: Boolean true literal +* **`type` **: define a type alias or associated type +* **`union` **: define a union; is a keyword only when used in a union +declaration +* **`unsafe` **: denote unsafe code, functions, traits, or implementations +* **`use` **: bring symbols into scope +* **`where` **: denote clauses that constrain a type +* **`while` **: loop conditionally based on the result of an expression + +## Keywords Reserved for Future Use + +The following keywords do not yet have any functionality but are reserved by +Rust for potential future use: + +* `abstract` +* `become` +* `box` +* `do` +* `final` +* `macro` +* `override` +* `priv` +* `try` +* `typeof` +* `unsized` +* `virtual` +* `yield` + +## Raw Identifiers + +*Raw identifiers* are the syntax that lets you use keywords where they wouldn’t +normally be allowed. You use a raw identifier by prefixing a keyword with `r#`. + +For example, `match` is a keyword. If you try to compile the following function +that uses `match` as its name: + +Filename: src/main.rs + +``` +fn match(needle: &str, haystack: &str) -> bool { + haystack.contains(needle) +} +``` + +you’ll get this error: + +``` +error: expected identifier, found keyword `match` + --> src/main.rs:4:4 + | +4 | fn match(needle: &str, haystack: &str) -> bool { + | ^^^^^ expected identifier, found keyword +``` + +The error shows that you can’t use the keyword `match` as the function +identifier. To use `match` as a function name, you need to use the raw +identifier syntax, like this: + +Filename: src/main.rs + +``` +fn r#match(needle: &str, haystack: &str) -> bool { + haystack.contains(needle) +} + +fn main() { + assert!(r#match("foo", "foobar")); +} +``` + +This code will compile without any errors. Note the `r#` prefix on the function +name in its definition as well as where the function is called in `main`. + +Raw identifiers allow you to use any word you choose as an identifier, even if +that word happens to be a reserved keyword. This gives us more freedom to +choose identifier names, as well as lets us integrate with programs written in +a language where these words aren’t keywords. In addition, raw identifiers +allow you to use libraries written in a different Rust edition than your crate +uses. For example, `try` isn’t a keyword in the 2015 edition but is in the 2018 +and 2021 editions. If you depend on a library that is written using the 2015 +edition and has a `try` function, you’ll need to use the raw identifier syntax, +`r#try` in this case, to call that function from your 2021 edition code. See +Appendix E for more information on editions. + +## Appendix B: Operators and Symbols + +This appendix contains a glossary of Rust’s syntax, including operators and +other symbols that appear by themselves or in the context of paths, generics, +trait bounds, macros, attributes, comments, tuples, and brackets. + +## Operators + +Table B-1 contains the operators in Rust, an example of how the operator would +appear in context, a short explanation, and whether that operator is +overloadable. If an operator is overloadable, the relevant trait to use to +overload that operator is listed. + +Table B-1: Operators + +| Operator | Example | Explanation | Overloadable? | +|---|---|---|---| +| `!` | `ident!(...)`, `ident!{...}`, `ident![...]` | Macro expansion | | +| `!` | `!expr` | Bitwise or logical complement | `Not` | +| `!=` | `expr != expr` | Nonequality comparison | `PartialEq` | +| `% | `expr % expr` | Arithmetic remainder | `Rem` | +| `%=` | `var %= expr` | Arithmetic remainder and assignment | `RemAssign` | +| `& | `&expr`, `&mut expr` | Borrow | | +| `&` | `&type`, `&mut type`, `&'a type`, `&'a mut type` | Borrowed pointer +type | | +| `&` | `expr & expr` | Bitwise AND | `BitAnd` | +| `&=` | `var &= expr` | Bitwise AND and assignment | `BitAndAssign` | +| `&&` | `expr && expr` | Short-circuiting logical AND | | +| `* | `expr * expr` | Arithmetic multiplication | `Mul` | +| `*=` | `var *= expr` | Arithmetic multiplication and assignment | `MulAssign` +| +| `*` | `*expr` | Dereference | `Deref` | +| `*` | `*const type`, `*mut type | Raw pointer | | +| `+ | `trait + trait`, `'a + trait` | Compound type constraint | | +| `+ | `expr + expr` | Arithmetic addition | `Add` | +| `+=` | `var += expr` | Arithmetic addition and assignment | `AddAssign` | +| `,` | `expr, expr` | Argument and element separator | | +| `- | `- expr` | Arithmetic negation | `Neg` | +| `- | `expr - expr` | Arithmetic subtraction | `Sub` | +| `-=` | `var -= expr` | Arithmetic subtraction and assignment | `SubAssign` | +| `-> | `fn(...) -> type`, `|…| -> type` | Function and closure return type | | +| `. | `expr.ident` | Member access | | +| `..` | `..`, `expr..`, `..expr`, `expr..expr` | Right-exclusive range literal +| `PartialOrd` | +| `..=` | `..=expr`, `expr..=expr` | Right-inclusive range literal | +`PartialOrd` | +| `..` | `..expr` | Struct literal update syntax | | +| `..` | `variant(x, ..)`, `struct_type { x, .. }` | “And the rest” pattern +binding | | +| `...` | `expr...expr` | (Deprecated, use `..=` instead) In a pattern: +inclusive range pattern | | +| `/ | `expr / expr` | Arithmetic division | `Div` | +| `/=` | `var /= expr` | Arithmetic division and assignment | `DivAssign` | +| `: | `pat: type`, `ident: type` | Constraints | | +| `:` | `ident: expr` | Struct field initializer | | +| `:` | `'a: loop {...}` | Loop label | | +| `; | `expr;` | Statement and item terminator | | +| `;` | `[...; len]` | Part of fixed-size array syntax | | +| `<<` | `expr << expr` | Left-shift | `Shl` | +| `<<=` | `var <<= expr` | Left-shift and assignment | `ShlAssign` | +| `<` | `expr < expr` | Less than comparison | `PartialOrd` | +| `<=` | `expr <= expr` | Less than or equal to comparison | `PartialOrd` | +| `=` | `var = expr`, `ident = type` | Assignment/equivalence | | +| `==` | `expr == expr` | Equality comparison | `PartialEq` | +| `=>` | `pat => expr` | Part of match arm syntax | | +| `>` | `expr > expr` | Greater than comparison | `PartialOrd` | +| `>=` | `expr >= expr` | Greater than or equal to comparison | `PartialOrd` | +| `>>` | `expr >> expr` | Right-shift | `Shr` | +| `>>=` | `var >>= expr` | Right-shift and assignment | `ShrAssign` | +| `@ | `ident @ pat` | Pattern binding | | +| `^` | `expr ^ expr` | Bitwise exclusive OR | `BitXor` | +| `^=` | `var ^= expr` | Bitwise exclusive OR and assignment | `BitXorAssign` | +| `| | `pat | pat` | Pattern alternatives | | +| `|` | `expr | expr` | Bitwise OR | `BitOr` | +| `|=` | `var |= expr` | Bitwise OR and assignment | `BitOrAssign` | +| `||` | `expr || expr` | Short-circuiting logical OR | | +| `? | `expr?` | Error propagation | | + +## Non-operator Symbols + +The following tables contain all symbols that don’t function as operators; that +is, they don’t behave like a function or method call. + +Table B-2 shows symbols that appear on their own and are valid in a variety of +locations. + +Table B-2: Stand-Alone Syntax + +| Symbol | Explanation | +|---|---| +| `'ident | Named lifetime or loop label | +| `...u8`, `...i32`, `...f64`, `...usize`, and so on | Numeric literal of +specific type | +| `"..." | String literal | +| `r"..."`, `r#"..."#`, `r##"..."##`, and so on | Raw string literal; escape +characters not processed | +| `b"..."` | Byte string literal; constructs an array of bytes instead of a +string | +| `br"..."`, `br#"..."#`, `br##"..."##`, and so on | Raw byte string literal; +combination of raw and byte string literal | +| `'...' | Character literal | +| `b'...' | ASCII byte literal | +| `|…| expr | Closure | +| `! | Always-empty bottom type for diverging functions | +| `_ | “Ignored” pattern binding; also used to make integer literals readable | + +Table B-3 shows symbols that appear in the context of a path through the module +hierarchy to an item. + +Table B-3: Path-Related Syntax + +| Symbol | Explanation | +|---|---| +| `ident::ident | Namespace path | +| `::path` | Path relative to the crate root (that is, an explicitly absolute +path) | +| `self::path` | Path relative to the current module (that is, an explicitly +relative path) | +| `super::path` | Path relative to the parent of the current module | +| `type::ident`, `::ident | Associated constants, functions, and +types | +| `::...` | Associated item for a type that cannot be directly named (for +example, `<&T>::...`, `<[T]>::...`, and so on) | +| `trait::method(...)` | Disambiguating a method call by naming the trait that +defines it | +| `type::method(...)` | Disambiguating a method call by naming the type for +which it’s defined | +| `::method(...)` | Disambiguating a method call by naming the +trait and type | + +Table B-4 shows symbols that appear in the context of using generic type +parameters. + +Table B-4: Generics + +| Symbol | Explanation | +|---|---| +| `path<...>` | Specifies parameters to a generic type in a type (for example, +`Vec`) | +| `path::<...>, method::<...>` | Specifies parameters to a generic type, +function, or method in an expression; often referred to as turbofish (for +example, `"42".parse::()`) | +| `fn ident<...> ...` | Define generic function | +| `struct ident<...> ...` | Define generic structure | +| `enum ident<...> ...` | Define generic enumeration | +| `impl<...> ...` | Define generic implementation | +| `for<...> type` | Higher-ranked lifetime bounds | +| `type` | A generic type where one or more associated types have +specific assignments (for example, `Iterator`) | + +Table B-5 shows symbols that appear in the context of constraining generic type +parameters with trait bounds. + +Table B-5: Trait Bound Constraints + +| Symbol | Explanation | +|---|---| +| T: U` | Generic parameter `T` constrained to types that implement `U` | +| `T: 'a` | Generic type `T` must outlive lifetime `'a` (meaning the type +cannot transitively contain any references with lifetimes shorter than `'a`) | +| `T: 'static` | Generic type `T` contains no borrowed references other than +`'static` ones | +| `'b: 'a` | Generic lifetime `'b` must outlive lifetime `'a` | +| `T: ?Sized` | Allow generic type parameter to be a dynamically sized type | +| `'a + trait`, `trait + trait` | Compound type constraint | + +Table B-6 shows symbols that appear in the context of calling or defining +macros and specifying attributes on an item. + +Table B-6: Macros and Attributes + +| Symbol | Explanation | +|---|---| +| `#[meta]` | Outer attribute | +| `#![meta]` | Inner attribute | +| `$ident` | Macro substitution | +| `$ident:kind` | Macro capture | +| `$(…)…` | Macro repetition | +| `ident!(...)`, `ident!{...}`, `ident![...]` | Macro invocation | + +Table B-7 shows symbols that create comments. + +Table B-7: Comments + +| Symbol | Explanation | +|---|---| +| `//` | Line comment | +| `//!` | Inner line doc comment | +| `///` | Outer line doc comment | +| `/*...*/` | Block comment | +| `/*!...*/` | Inner block doc comment | +| `/**...*/` | Outer block doc comment | + +Table B-8 shows symbols that appear in the context of using tuples. + +Table B-8: Tuples + +| Symbol | Explanation | +|---|---| +| `() | Empty tuple (aka unit), both literal and type | +| `(expr)` | Parenthesized expression | +| `(expr,)` | Single-element tuple expression | +| `(type,)` | Single-element tuple type | +| `(expr, ...)` | Tuple expression | +| `(type, ...)` | Tuple type | +| `expr(expr, ...)` | Function call expression; also used to initialize tuple +`struct`s and tuple `enum` variants | +| `expr.0`, `expr.1`, and so on | Tuple indexing | + +Table B-9 shows the contexts in which curly brackets are used. + +Table B-9: Curly Brackets + +| Context | Explanation | +|---|---| +| `{...}` | Block expression | +| `Type {...}` | `struct` literal | + +Table B-10 shows the contexts in which square brackets are used. + +Table B-10: Square Brackets + +| Context | Explanation | +|---|---| +| `[...]` | Array literal | +| `[expr; len]` | Array literal containing `len` copies of `expr` | +| `[type; len]` | Array type containing `len` instances of `type` | +| `expr[expr]` | Collection indexing; overloadable (`Index`, `IndexMut`) | +| `expr[..]`, `expr[a..]`, `expr[..b]`, `expr[a..b]` | Collection indexing +pretending to be collection slicing, using `Range`, `RangeFrom`, `RangeTo`, or +`RangeFull` as the “index” | + +## Appendix C: Derivable Traits + +In various places in the book, we’ve discussed the `derive` attribute, which +you can apply to a struct or enum definition. The `derive` attribute generates +code that will implement a trait with its own default implementation on the +type you’ve annotated with the `derive` syntax. + +In this appendix, we provide a reference of all the traits in the standard +library that you can use with `derive`. Each section covers: + +* What operators and methods deriving this trait will enable +* What the implementation of the trait provided by `derive` does +* What implementing the trait signifies about the type +* The conditions in which you’re allowed or not allowed to implement the trait +* Examples of operations that require the trait + +If you want different behavior from that provided by the `derive` attribute, +consult the standard library documentation for each trait for details on how to +manually implement them. + +The traits listed here are the only ones defined by the standard library that +can be implemented on your types using `derive`. Other traits defined in the +standard library don’t have sensible default behavior, so it’s up to you to +implement them in the way that makes sense for what you’re trying to accomplish. + +An example of a trait that can’t be derived is `Display`, which handles +formatting for end users. You should always consider the appropriate way to +display a type to an end user. What parts of the type should an end user be +allowed to see? What parts would they find relevant? What format of the data +would be most relevant to them? The Rust compiler doesn’t have this insight, so +it can’t provide appropriate default behavior for you. + +The list of derivable traits provided in this appendix is not comprehensive: +libraries can implement `derive` for their own traits, making the list of +traits you can use `derive` with truly open ended. Implementing `derive` +involves using a procedural macro, which is covered in “Macros” on page XX. + +## Debug for Programmer Output + +The `Debug` trait enables debug formatting in format strings, which you +indicate by adding `:?` within `{}` placeholders. + +The `Debug` trait allows you to print instances of a type for debugging +purposes, so you and other programmers using your type can inspect an instance +at a particular point in a program’s execution. + +The `Debug` trait is required, for example, in the use of the `assert_eq!` +macro. This macro prints the values of instances given as arguments if the +equality assertion fails so programmers can see why the two instances weren’t +equal. + +## PartialEq and Eq for Equality Comparisons + +The `PartialEq` trait allows you to compare instances of a type to check for +equality and enables use of the `==` and `!=` operators. + +Deriving `PartialEq` implements the `eq` method. When `PartialEq` is derived on +structs, two instances are equal only if *all* fields are equal, and the +instances are not equal if any fields are not equal. When derived on enums, +each variant is equal to itself and not equal to the other variants. + +The `PartialEq` trait is required, for example, with the use of the +`assert_eq!` macro, which needs to be able to compare two instances of a type +for equality. + +The `Eq` trait has no methods. Its purpose is to signal that for every value of +the annotated type, the value is equal to itself. The `Eq` trait can only be +applied to types that also implement `PartialEq`, although not all types that +implement `PartialEq` can implement `Eq`. One example of this is floating-point +number types: the implementation of floating-point numbers states that two +instances of the not-a-number (`NaN`) value are not equal to each other. + +An example of when `Eq` is required is for keys in a `HashMap` so that +the `HashMap` can tell whether two keys are the same. + +## PartialOrd and Ord for Ordering Comparisons + +The `PartialOrd` trait allows you to compare instances of a type for sorting +purposes. A type that implements `PartialOrd` can be used with the `<`, `>`, +`<=`, and `>=` operators. You can only apply the `PartialOrd` trait to types +that also implement `PartialEq`. + +Deriving `PartialOrd` implements the `partial_cmp` method, which returns an +`Option` that will be `None` when the values given don’t produce an +ordering. An example of a value that doesn’t produce an ordering, even though +most values of that type can be compared, is the not-a-number (`NaN`) floating +point value. Calling `partial_cmp` with any floating-point number and the `NaN` +floating-point value will return `None`. + +When derived on structs, `PartialOrd` compares two instances by comparing the +value in each field in the order in which the fields appear in the struct +definition. When derived on enums, variants of the enum declared earlier in the +enum definition are considered less than the variants listed later. + +The `PartialOrd` trait is required, for example, for the `gen_range` method +from the `rand` crate that generates a random value in the range specified by a +range expression. + +The `Ord` trait allows you to know that for any two values of the annotated +type, a valid ordering will exist. The `Ord` trait implements the `cmp` method, +which returns an `Ordering` rather than an `Option` because a valid +ordering will always be possible. You can only apply the `Ord` trait to types +that also implement `PartialOrd` and `Eq` (and `Eq` requires `PartialEq`). When +derived on structs and enums, `cmp` behaves the same way as the derived +implementation for `partial_cmp` does with `PartialOrd`. + +An example of when `Ord` is required is when storing values in a `BTreeSet`, +a data structure that stores data based on the sort order of the values. + +## Clone and Copy for Duplicating Values + +The `Clone` trait allows you to explicitly create a deep copy of a value, and +the duplication process might involve running arbitrary code and copying heap +data. See “Variables and Data Interacting with Clone” on page XX for more +information on `Clone`. + +Deriving `Clone` implements the `clone` method, which when implemented for the +whole type, calls `clone` on each of the parts of the type. This means all the +fields or values in the type must also implement `Clone` to derive `Clone`. + +An example of when `Clone` is required is when calling the `to_vec` method on a +slice. The slice doesn’t own the type instances it contains, but the vector +returned from `to_vec` will need to own its instances, so `to_vec` calls +`clone` on each item. Thus the type stored in the slice must implement `Clone`. + +The `Copy` trait allows you to duplicate a value by only copying bits stored on +the stack; no arbitrary code is necessary. See “Stack-Only Data: Copy” on page +XX for more information on `Copy`. + +The `Copy` trait doesn’t define any methods to prevent programmers from +overloading those methods and violating the assumption that no arbitrary code +is being run. That way, all programmers can assume that copying a value will be +very fast. + +You can derive `Copy` on any type whose parts all implement `Copy`. A type that +implements `Copy` must also implement `Clone` because a type that implements +`Copy` has a trivial implementation of `Clone` that performs the same task as +`Copy`. + +The `Copy` trait is rarely required; types that implement `Copy` have +optimizations available, meaning you don’t have to call `clone`, which makes +the code more concise. + +Everything possible with `Copy` you can also accomplish with `Clone`, but the +code might be slower or have to use `clone` in places. + +## Hash for Mapping a Value to a Value of Fixed Size + +The `Hash` trait allows you to take an instance of a type of arbitrary size and +map that instance to a value of fixed size using a hash function. Deriving +`Hash` implements the `hash` method. The derived implementation of the `hash` +method combines the result of calling `hash` on each of the parts of the type, +meaning all fields or values must also implement `Hash` to derive `Hash`. + +An example of when `Hash` is required is in storing keys in a `HashMap` +to store data efficiently. + +## Default for Default Values + +The `Default` trait allows you to create a default value for a type. Deriving +`Default` implements the `default` function. The derived implementation of the +`default` function calls the `default` function on each part of the type, +meaning all fields or values in the type must also implement `Default` to +derive `Default`. + +The `Default::default` function is commonly used in combination with the struct +update syntax discussed in “Creating Instances from Other Instances with Struct +Update Syntax” on page XX. You can customize a few fields of a struct and then +set and use a default value for the rest of the fields by using +`..Default::default()`. + +The `Default` trait is required when you use the method `unwrap_or_default` on +`Option` instances, for example. If the `Option` is `None`, the method +`unwrap_or_default` will return the result of `Default::default` for the type +`T` stored in the `Option`. + +## Appendix D: Useful Development Tools + +In this appendix, we talk about some useful development tools that the Rust +project provides. We’ll look at automatic formatting, quick ways to apply +warning fixes, a linter, and integrating with IDEs. + +## Automatic Formatting with rustfmt + +The `rustfmt` tool reformats your code according to the community code style. +Many collaborative projects use `rustfmt` to prevent arguments about which +style to use when writing Rust: everyone formats their code using the tool. + +Rust installations include `rustfmt` by default, so you should already have the +programs `rustfmt` and `cargo-fmt` on your system. These two commands are +analagous to `rustc` and `cargo` in that `rustfmt` allows finer-grained control +and `cargo-fmt` understands conventions of a project that uses Cargo. To format +any Cargo project, enter the following: + +``` +$ cargo fmt +``` + +Running this command reformats all the Rust code in the current crate. This +should only change the code style, not the code semantics. For more information +on `rustfmt`, see its documentation at *https://github.com/rust-lang/rustfmt*. + +## Fix Your Code with rustfix + +The `rustfix` tool is included with Rust installations and can automatically +fix compiler warnings that have a clear way to correct the problem that’s +likely what you want. You’ve probably seen compiler warnings before. For +example, consider this code: + +Filename: src/main.rs + +``` +fn do_something() {} + +fn main() { + for i in 0..100 { + do_something(); + } +} +``` + +Here, we’re calling the `do_something` function 100 times, but we never use the +variable `i` in the body of the `for` loop. Rust warns us about that: + +``` +$ cargo build + Compiling myprogram v0.1.0 (file:///projects/myprogram) +warning: unused variable: `i` + --> src/main.rs:4:9 + | +4 | for i in 0..100 { + | ^ help: consider using `_i` instead + | + = note: #[warn(unused_variables)] on by default + + Finished dev [unoptimized + debuginfo] target(s) in 0.50s +``` + +The warning suggests that we use `_i` as a name instead: the underscore +indicates that we intend for this variable to be unused. We can automatically +apply that suggestion using the `rustfix` tool by running the command `cargo +fix`: + +``` +$ cargo fix + Checking myprogram v0.1.0 (file:///projects/myprogram) + Fixing src/main.rs (1 fix) + Finished dev [unoptimized + debuginfo] target(s) in 0.59s +``` + +When we look at *src/main.rs* again, we’ll see that `cargo fix` has changed the +code: + +Filename: src/main.rs + +``` +fn do_something() {} + +fn main() { + for _i in 0..100 { + do_something(); + } +} +``` + +The `for` loop variable is now named `_i`, and the warning no longer appears. + +You can also use the `cargo fix` command to transition your code between +different Rust editions. Editions are covered in Appendix E. + +## More Lints with Clippy + +The Clippy tool is a collection of lints to analyze your code so you can catch +common mistakes and improve your Rust code. Clippy is included with standard +Rust installations. + +To run Clippy’s lints on any Cargo project, enter the following: + +``` +$ cargo clippy +``` + +For example, say you write a program that uses an approximation of a +mathematical constant, such as pi, as this program does: + +Filename: src/main.rs + +``` +fn main() { + let x = 3.1415; + let r = 8.0; + println!("the area of the circle is {}", x * r * r); +} +``` + +Running `cargo clippy` on this project results in this error: + +``` +error: approximate value of `f{32, 64}::consts::PI` found + --> src/main.rs:2:13 + | +2 | let x = 3.1415; + | ^^^^^^ + | + = note: `#[deny(clippy::approx_constant)]` on by default + = help: consider using the constant directly + = help: for further information visit https://rust-lang.github.io/rust- +clippy/master/index.html#approx_constant +``` + +This error lets you know that Rust already has a more precise `PI` constant +defined, and that your program would be more correct if you used the constant +instead. You would then change your code to use the `PI` constant. + +The following code doesn’t result in any errors or warnings from Clippy: + +Filename: src/main.rs + +``` +fn main() { + let x = std::f64::consts::PI; + let r = 8.0; + println!("the area of the circle is {}", x * r * r); +} +``` + +For more information on Clippy, see its documentation at +*https://github.com/rust-lang/rust-clippy**.* + +## IDE Integration Using rust-analyzer + +To help with IDE integration, the Rust community recommends using +`rust-analyzer`. This tool is a set of compiler-centric utilities that speak +Language Server Protocol, which is a specification for IDEs and programming +languages to communicate with each other. Different clients can use +`rust-analyzer`, such as the Rust analyzer plug-in for Visual Studio Code at +*https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer*. + +Visit the `rust-analyzer` project’s home page at +*https://rust-analyzer.github.io* for installation instructions, then install +the language server support in your particular IDE. Your IDE will gain +capabilities such as autocompletion, jump to definition, and inline errors + +## Appendix E: Editions + +In Chapter 1, you saw that `cargo new` adds a bit of metadata to your +*Cargo.toml* file about an edition. This appendix talks about what that means! + +The Rust language and compiler have a six-week release cycle, meaning users get +a constant stream of new features. Other programming languages release larger +changes less often; Rust releases smaller updates more frequently. After a +while, all of these tiny changes add up. But from release to release, it can be +difficult to look back and say, “Wow, between Rust 1.10 and Rust 1.31, Rust has +changed a lot!” + +Every two or three years, the Rust team produces a new Rust *edition*. Each +edition brings together the features that have landed into a clear package with +fully updated documentation and tooling. New editions ship as part of the usual +six-week release process. + +Editions serve different purposes for different people: + +* For active Rust users, a new edition brings together incremental changes into +an easy-to-understand package. +* For non-users, a new edition signals that some major advancements have +landed, which might make Rust worth another look. +* For those developing Rust, a new edition provides a rallying point for the +project as a whole. + +At the time of this writing, three Rust editions are available: Rust 2015, Rust +2018, and Rust 2021. This book is written using Rust 2021 edition idioms. + +The `edition` key in *Cargo.toml* indicates which edition the compiler should +use for your code. If the key doesn’t exist, Rust uses `2015` as the edition +value for backward compatibility reasons. + +Each project can opt in to an edition other than the default 2015 edition. +Editions can contain incompatible changes, such as including a new keyword that +conflicts with identifiers in code. However, unless you opt in to those +changes, your code will continue to compile even as you upgrade the Rust +compiler version you use. + +All Rust compiler versions support any edition that existed prior to that +compiler’s release, and they can link crates of any supported editions +together. Edition changes only affect the way the compiler initially parses +code. Therefore, if you’re using Rust 2015 and one of your dependencies uses +Rust 2018, your project will compile and be able to use that dependency. The +opposite situation, where your project uses Rust 2018 and a dependency uses +Rust 2015, works as well. + +To be clear: most features will be available on all editions. Developers using +any Rust edition will continue to see improvements as new stable releases are +made. However, in some cases, mainly when new keywords are added, some new +features might only be available in later editions. You will need to switch +editions if you want to take advantage of such features. + +For more details, *The* *Edition Guide* at +*https://doc.rust-lang.org/stable/edition-guide* is a complete book about +editions that enumerates the differences between editions and explains how to +automatically upgrade your code to a new edition via `cargo fix`. + diff --git a/rustbook-ru/nostarch/appendix_a.md b/rustbook-ru/nostarch/appendix_a.md new file mode 100644 index 000000000..ca3883be4 --- /dev/null +++ b/rustbook-ru/nostarch/appendix_a.md @@ -0,0 +1,142 @@ + + +[TOC] + +## Appendix A: Keywords + +The following lists contain keywords that are reserved for current or future +use by the Rust language. As such, they cannot be used as identifiers (except +as raw identifiers, as we’ll discuss in “Raw Identifiers” on page XX). +*Identifiers* are names of functions, variables, parameters, struct fields, +modules, crates, constants, macros, static values, attributes, types, traits, +or lifetimes. + +## Keywords Currently in Use + +The following is a list of keywords currently in use, with their functionality +described. + +* **`as` **: perform primitive casting, disambiguate the specific trait +containing an item, or rename items in `use` statements +* **`async` **: return a `Future` instead of blocking the current thread +* **`await` **: suspend execution until the result of a `Future` is ready +* **`break` **: exit a loop immediately +* **`const` **: define constant items or constant raw pointers +* **`continue` **: continue to the next loop iteration +* **`crate` **: in a module path, refers to the crate root +* **`dyn` **: dynamic dispatch to a trait object +* **`else` **: fallback for `if` and `if let` control flow constructs +* **`enum` **: define an enumeration +* **`extern` **: link an external function or variable +* **`false` **: Boolean false literal +* **`fn` **: define a function or the function pointer type +* **`for` **: loop over items from an iterator, implement a trait, or specify a +higher-ranked lifetime +* **`if` **: branch based on the result of a conditional expression +* **`impl` **: implement inherent or trait functionality +* **`in` **: part of `for` loop syntax +* **`let` **: bind a variable +* **`loop` **: loop unconditionally +* **`match` **: match a value to patterns +* **`mod` **: define a module +* **`move` **: make a closure take ownership of all its captures +* **`mut` **: denote mutability in references, raw pointers, or pattern bindings +* **`pub` **: denote public visibility in struct fields, `impl` blocks, or +modules +* **`ref` **: bind by reference +* **`return` **: return from function +* **`Self` **: a type alias for the type we are defining or implementing +* **`self` **: method subject or current module +* **`static` **: global variable or lifetime lasting the entire program +execution +* **`struct` **: define a structure +* **`super` **: parent module of the current module +* **`trait` **: define a trait +* **`true` **: Boolean true literal +* **`type` **: define a type alias or associated type +* **`union` **: define a union; is a keyword only when used in a union +declaration +* **`unsafe` **: denote unsafe code, functions, traits, or implementations +* **`use` **: bring symbols into scope +* **`where` **: denote clauses that constrain a type +* **`while` **: loop conditionally based on the result of an expression + +## Keywords Reserved for Future Use + +The following keywords do not yet have any functionality but are reserved by +Rust for potential future use: + +* `abstract` +* `become` +* `box` +* `do` +* `final` +* `macro` +* `override` +* `priv` +* `try` +* `typeof` +* `unsized` +* `virtual` +* `yield` + +## Raw Identifiers + +*Raw identifiers* are the syntax that lets you use keywords where they wouldn’t +normally be allowed. You use a raw identifier by prefixing a keyword with `r#`. + +For example, `match` is a keyword. If you try to compile the following function +that uses `match` as its name: + +Filename: src/main.rs + +``` +fn match(needle: &str, haystack: &str) -> bool { + haystack.contains(needle) +} +``` + +you’ll get this error: + +``` +error: expected identifier, found keyword `match` + --> src/main.rs:4:4 + | +4 | fn match(needle: &str, haystack: &str) -> bool { + | ^^^^^ expected identifier, found keyword +``` + +The error shows that you can’t use the keyword `match` as the function +identifier. To use `match` as a function name, you need to use the raw +identifier syntax, like this: + +Filename: src/main.rs + +``` +fn r#match(needle: &str, haystack: &str) -> bool { + haystack.contains(needle) +} + +fn main() { + assert!(r#match("foo", "foobar")); +} +``` + +This code will compile without any errors. Note the `r#` prefix on the function +name in its definition as well as where the function is called in `main`. + +Raw identifiers allow you to use any word you choose as an identifier, even if +that word happens to be a reserved keyword. This gives us more freedom to +choose identifier names, as well as lets us integrate with programs written in +a language where these words aren’t keywords. In addition, raw identifiers +allow you to use libraries written in a different Rust edition than your crate +uses. For example, `try` isn’t a keyword in the 2015 edition but is in the 2018 +and 2021 editions. If you depend on a library that is written using the 2015 +edition and has a `try` function, you’ll need to use the raw identifier syntax, +`r#try` in this case, to call that function from your 2021 edition code. See +Appendix E for more information on editions. + diff --git a/rustbook-ru/nostarch/appendix_b.md b/rustbook-ru/nostarch/appendix_b.md new file mode 100644 index 000000000..236608b6d --- /dev/null +++ b/rustbook-ru/nostarch/appendix_b.md @@ -0,0 +1,241 @@ + + +[TOC] + +## Appendix B: Operators and Symbols + +This appendix contains a glossary of Rust’s syntax, including operators and +other symbols that appear by themselves or in the context of paths, generics, +trait bounds, macros, attributes, comments, tuples, and brackets. + +## Operators + +Table B-1 contains the operators in Rust, an example of how the operator would +appear in context, a short explanation, and whether that operator is +overloadable. If an operator is overloadable, the relevant trait to use to +overload that operator is listed. + +Table B-1: Operators + +| Operator | Example | Explanation | Overloadable? | +|---|---|---|---| +| `!` | `ident!(...)`, `ident!{...}`, `ident![...]` | Macro expansion | | +| `!` | `!expr` | Bitwise or logical complement | `Not` | +| `!=` | `expr != expr` | Nonequality comparison | `PartialEq` | +| `%` | `expr % expr` | Arithmetic remainder | `Rem` | +| `%=` | `var %= expr` | Arithmetic remainder and assignment | `RemAssign` | +| `&` | `&expr`, `&mut expr` | Borrow | | +| `&` | `&type`, `&mut type`, `&'a type`, `&'a mut type` | Borrowed pointer +type | | +| `&` | `expr & expr` | Bitwise AND | `BitAnd` | +| `&=` | `var &= expr` | Bitwise AND and assignment | `BitAndAssign` | +| `&&` | `expr && expr` | Short-circuiting logical AND | | +| `*` | `expr * expr` | Arithmetic multiplication | `Mul` | +| `*=` | `var *= expr` | Arithmetic multiplication and assignment | `MulAssign` +| +| `*` | `*expr` | Dereference | `Deref` | +| `*` | `*const type`, `*mut type` | Raw pointer | | +| `+` | `trait + trait`, `'a + trait` | Compound type constraint | | +| `+` | `expr + expr` | Arithmetic addition | `Add` | +| `+=` | `var += expr` | Arithmetic addition and assignment | `AddAssign` | +| `,` | `expr, expr` | Argument and element separator | | +| `-` | `- expr` | Arithmetic negation | `Neg` | +| `-` | `expr - expr` | Arithmetic subtraction | `Sub` | +| `-=` | `var -= expr` | Arithmetic subtraction and assignment | `SubAssign` | +| `->` | `fn(...) -> type`, `|…| -> type` | Function and closure return type | +| +| `. | `expr.ident` | Member access | | +| `..` | `..`, `expr..`, `..expr`, `expr..expr` | Right-exclusive range literal +| `PartialOrd` | +| `..=` | `..=expr`, `expr..=expr` | Right-inclusive range literal | +`PartialOrd` | +| `..` | `..expr` | Struct literal update syntax | | +| `..` | `variant(x, ..)`, `struct_type { x, .. }` | “And the rest” pattern +binding | | +| `...` | `expr...expr` | (Deprecated, use `..=` instead) In a pattern: +inclusive range pattern | | +| `/` | `expr / expr` | Arithmetic division | `Div` | +| `/=` | `var /= expr` | Arithmetic division and assignment | `DivAssign` | +| `: | `pat: type`, `ident: type` | Constraints | | +| `:` | `ident: expr` | Struct field initializer | | +| `:` | `'a: loop {...}` | Loop label | | +| `;` | `expr;` | Statement and item terminator | | +| `;` | `[...; len]` | Part of fixed-size array syntax | | +| `<<` | `expr << expr` | Left-shift | `Shl` | +| `<<=` | `var <<= expr` | Left-shift and assignment | `ShlAssign` | +| `<` | `expr < expr` | Less than comparison | `PartialOrd` | +| `<=` | `expr <= expr` | Less than or equal to comparison | `PartialOrd` | +| `=` | `var = expr`, `ident = type` | Assignment/equivalence | | +| `==` | `expr == expr` | Equality comparison | `PartialEq` | +| `=>` | `pat => expr` | Part of match arm syntax | | +| `>` | `expr > expr` | Greater than comparison | `PartialOrd` | +| `>=` | `expr >= expr` | Greater than or equal to comparison | `PartialOrd` | +| `>>` | `expr >> expr` | Right-shift | `Shr` | +| `>>=` | `var >>= expr` | Right-shift and assignment | `ShrAssign` | +| `@` | `ident @ pat` | Pattern binding | | +| `^` | `expr ^ expr` | Bitwise exclusive OR | `BitXor` | +| `^=` | `var ^= expr` | Bitwise exclusive OR and assignment | `BitXorAssign` | +| `|` | `pat | pat` | Pattern alternatives | | +| `|` | `expr | expr` | Bitwise OR | `BitOr` | +| `|=` | `var |= expr` | Bitwise OR and assignment | `BitOrAssign` | +| `||` | `expr || expr` | Short-circuiting logical OR | | +| `?` | `expr?` | Error propagation | | + +## Non-operator Symbols + +The following tables contain all symbols that don’t function as operators; that +is, they don’t behave like a function or method call. + +Table B-2 shows symbols that appear on their own and are valid in a variety of +locations. + +Table B-2: Stand-Alone Syntax + +| Symbol | Explanation | +|---|---| +| `'ident` | Named lifetime or loop label | +| `...u8`, `...i32`, `...f64`, `...usize`, and so on | Numeric literal of +specific type | +| `"..."` | String literal | +| `r"..."`, `r#"..."#`, `r##"..."##`, and so on | Raw string literal; escape +characters not processed | +| `b"..."` | Byte string literal; constructs an array of bytes instead of a +string | +| `br"..."`, `br#"..."#`, `br##"..."##`, and so on | Raw byte string literal; +combination of raw and byte string literal | +| `'...'` | Character literal | +| `b'...'` | ASCII byte literal | +| `|…| expr` | Closure | +| `!` | Always-empty bottom type for diverging functions | +| `_` | “Ignored” pattern binding; also used to make integer literals readable | + +Table B-3 shows symbols that appear in the context of a path through the module +hierarchy to an item. + +Table B-3: Path-Related Syntax + +| Symbol | Explanation | +|---|---| +| `ident::ident` | Namespace path | +| `::path` | Path relative to the crate root (that is, an explicitly absolute +path) | +| `self::path` | Path relative to the current module (that is, an explicitly +relative path) | +| `super::path` | Path relative to the parent of the current module | +| `type::ident`, `::ident` | Associated constants, functions, +and types | +| `::...` | Associated item for a type that cannot be directly named (for +example, `<&T>::...`, `<[T]>::...`, and so on) | +| `trait::method(...)` | Disambiguating a method call by naming the trait that +defines it | +| `type::method(...)` | Disambiguating a method call by naming the type for +which it’s defined | +| `::method(...)` | Disambiguating a method call by naming the +trait and type | + +Table B-4 shows symbols that appear in the context of using generic type +parameters. + +Table B-4: Generics + +| Symbol | Explanation | +|---|---| +| `path<...>` | Specifies parameters to a generic type in a type (for example, +`Vec`) | +| `path::<...>, method::<...>` | Specifies parameters to a generic type, +function, or method in an expression; often referred to as turbofish (for +example, `"42".parse::()`) | +| `fn ident<...> ...` | Define generic function | +| `struct ident<...> ...` | Define generic structure | +| `enum ident<...> ...` | Define generic enumeration | +| `impl<...> ...` | Define generic implementation | +| `for<...> type` | Higher-ranked lifetime bounds | +| `type` | A generic type where one or more associated types have +specific assignments (for example, `Iterator`) | + +Table B-5 shows symbols that appear in the context of constraining generic type +parameters with trait bounds. + +Table B-5: Trait Bound Constraints + +| Symbol | Explanation | +|---|---| +| T: U` | Generic parameter `T` constrained to types that implement `U` | +| `T: 'a` | Generic type `T` must outlive lifetime `'a` (meaning the type +cannot transitively contain any references with lifetimes shorter than `'a`) | +| `T: 'static` | Generic type `T` contains no borrowed references other than +`'static` ones | +| `'b: 'a` | Generic lifetime `'b` must outlive lifetime `'a` | +| `T: ?Sized` | Allow generic type parameter to be a dynamically sized type | +| `'a + trait`, `trait + trait` | Compound type constraint | + +Table B-6 shows symbols that appear in the context of calling or defining +macros and specifying attributes on an item. + +Table B-6: Macros and Attributes + +| Symbol | Explanation | +|---|---| +| `#[meta]` | Outer attribute | +| `#![meta]` | Inner attribute | +| `$ident` | Macro substitution | +| `$ident:kind` | Macro capture | +| `$(…)…` | Macro repetition | +| `ident!(...)`, `ident!{...}`, `ident![...]` | Macro invocation | + +Table B-7 shows symbols that create comments. + +Table B-7: Comments + +| Symbol | Explanation | +|---|---| +| `//` | Line comment | +| `//!` | Inner line doc comment | +| `///` | Outer line doc comment | +| `/*...*/` | Block comment | +| `/*!...*/` | Inner block doc comment | +| `/**...*/` | Outer block doc comment | + +Table B-8 shows symbols that appear in the context of using tuples. + +Table B-8: Tuples + +| Symbol | Explanation | +|---|---| +| `()` | Empty tuple (aka unit), both literal and type | +| `(expr)` | Parenthesized expression | +| `(expr,)` | Single-element tuple expression | +| `(type,)` | Single-element tuple type | +| `(expr, ...)` | Tuple expression | +| `(type, ...)` | Tuple type | +| `expr(expr, ...)` | Function call expression; also used to initialize tuple +`struct`s and tuple `enum` variants | +| `expr.0`, `expr.1`, and so on | Tuple indexing | + +Table B-9 shows the contexts in which curly brackets are used. + +Table B-9: Curly Brackets + +| Context | Explanation | +|---|---| +| `{...}` | Block expression | +| `Type {...}` | `struct` literal | + +Table B-10 shows the contexts in which square brackets are used. + +Table B-10: Square Brackets + +| Context | Explanation | +|---|---| +| `[...]` | Array literal | +| `[expr; len]` | Array literal containing `len` copies of `expr` | +| `[type; len]` | Array type containing `len` instances of `type` | +| `expr[expr]` | Collection indexing; overloadable (`Index`, `IndexMut`) | +| `expr[..]`, `expr[a..]`, `expr[..b]`, `expr[a..b]` | Collection indexing +pretending to be collection slicing, using `Range`, `RangeFrom`, `RangeTo`, or +`RangeFull` as the “index” | + diff --git a/rustbook-ru/nostarch/appendix_c.md b/rustbook-ru/nostarch/appendix_c.md new file mode 100644 index 000000000..53131eb5f --- /dev/null +++ b/rustbook-ru/nostarch/appendix_c.md @@ -0,0 +1,184 @@ + + +[TOC] + +## Appendix C: Derivable Traits + +In various places in the book, we’ve discussed the `derive` attribute, which +you can apply to a struct or enum definition. The `derive` attribute generates +code that will implement a trait with its own default implementation on the +type you’ve annotated with the `derive` syntax. + +In this appendix, we provide a reference of all the traits in the standard +library that you can use with `derive`. Each section covers: + +* What operators and methods deriving this trait will enable +* What the implementation of the trait provided by `derive` does +* What implementing the trait signifies about the type +* The conditions in which you’re allowed or not allowed to implement the trait +* Examples of operations that require the trait + +If you want different behavior from that provided by the `derive` attribute, +consult the standard library documentation for each trait for details on how to +manually implement them. + +The traits listed here are the only ones defined by the standard library that +can be implemented on your types using `derive`. Other traits defined in the +standard library don’t have sensible default behavior, so it’s up to you to +implement them in the way that makes sense for what you’re trying to accomplish. + +An example of a trait that can’t be derived is `Display`, which handles +formatting for end users. You should always consider the appropriate way to +display a type to an end user. What parts of the type should an end user be +allowed to see? What parts would they find relevant? What format of the data +would be most relevant to them? The Rust compiler doesn’t have this insight, so +it can’t provide appropriate default behavior for you. + +The list of derivable traits provided in this appendix is not comprehensive: +libraries can implement `derive` for their own traits, making the list of +traits you can use `derive` with truly open ended. Implementing `derive` +involves using a procedural macro, which is covered in “Macros” on page XX. + +## Debug for Programmer Output + +The `Debug` trait enables debug formatting in format strings, which you +indicate by adding `:?` within `{}` placeholders. + +The `Debug` trait allows you to print instances of a type for debugging +purposes, so you and other programmers using your type can inspect an instance +at a particular point in a program’s execution. + +The `Debug` trait is required, for example, in the use of the `assert_eq!` +macro. This macro prints the values of instances given as arguments if the +equality assertion fails so programmers can see why the two instances weren’t +equal. + +## PartialEq and Eq for Equality Comparisons + +The `PartialEq` trait allows you to compare instances of a type to check for +equality and enables use of the `==` and `!=` operators. + +Deriving `PartialEq` implements the `eq` method. When `PartialEq` is derived on +structs, two instances are equal only if *all* fields are equal, and the +instances are not equal if any fields are not equal. When derived on enums, +each variant is equal to itself and not equal to the other variants. + +The `PartialEq` trait is required, for example, with the use of the +`assert_eq!` macro, which needs to be able to compare two instances of a type +for equality. + +The `Eq` trait has no methods. Its purpose is to signal that for every value of +the annotated type, the value is equal to itself. The `Eq` trait can only be +applied to types that also implement `PartialEq`, although not all types that +implement `PartialEq` can implement `Eq`. One example of this is floating-point +number types: the implementation of floating-point numbers states that two +instances of the not-a-number (`NaN`) value are not equal to each other. + +An example of when `Eq` is required is for keys in a `HashMap` so that +the `HashMap` can tell whether two keys are the same. + +## PartialOrd and Ord for Ordering Comparisons + +The `PartialOrd` trait allows you to compare instances of a type for sorting +purposes. A type that implements `PartialOrd` can be used with the `<`, `>`, +`<=`, and `>=` operators. You can only apply the `PartialOrd` trait to types +that also implement `PartialEq`. + +Deriving `PartialOrd` implements the `partial_cmp` method, which returns an +`Option` that will be `None` when the values given don’t produce an +ordering. An example of a value that doesn’t produce an ordering, even though +most values of that type can be compared, is the not-a-number (`NaN`) floating +point value. Calling `partial_cmp` with any floating-point number and the `NaN` +floating-point value will return `None`. + +When derived on structs, `PartialOrd` compares two instances by comparing the +value in each field in the order in which the fields appear in the struct +definition. When derived on enums, variants of the enum declared earlier in the +enum definition are considered less than the variants listed later. + +The `PartialOrd` trait is required, for example, for the `gen_range` method +from the `rand` crate that generates a random value in the range specified by a +range expression. + +The `Ord` trait allows you to know that for any two values of the annotated +type, a valid ordering will exist. The `Ord` trait implements the `cmp` method, +which returns an `Ordering` rather than an `Option` because a valid +ordering will always be possible. You can only apply the `Ord` trait to types +that also implement `PartialOrd` and `Eq` (and `Eq` requires `PartialEq`). When +derived on structs and enums, `cmp` behaves the same way as the derived +implementation for `partial_cmp` does with `PartialOrd`. + +An example of when `Ord` is required is when storing values in a `BTreeSet`, +a data structure that stores data based on the sort order of the values. + +## Clone and Copy for Duplicating Values + +The `Clone` trait allows you to explicitly create a deep copy of a value, and +the duplication process might involve running arbitrary code and copying heap +data. See “Variables and Data Interacting with Clone” on page XX for more +information on `Clone`. + +Deriving `Clone` implements the `clone` method, which when implemented for the +whole type, calls `clone` on each of the parts of the type. This means all the +fields or values in the type must also implement `Clone` to derive `Clone`. + +An example of when `Clone` is required is when calling the `to_vec` method on a +slice. The slice doesn’t own the type instances it contains, but the vector +returned from `to_vec` will need to own its instances, so `to_vec` calls +`clone` on each item. Thus the type stored in the slice must implement `Clone`. + +The `Copy` trait allows you to duplicate a value by only copying bits stored on +the stack; no arbitrary code is necessary. See “Stack-Only Data: Copy” on page +XX for more information on `Copy`. + +The `Copy` trait doesn’t define any methods to prevent programmers from +overloading those methods and violating the assumption that no arbitrary code +is being run. That way, all programmers can assume that copying a value will be +very fast. + +You can derive `Copy` on any type whose parts all implement `Copy`. A type that +implements `Copy` must also implement `Clone` because a type that implements +`Copy` has a trivial implementation of `Clone` that performs the same task as +`Copy`. + +The `Copy` trait is rarely required; types that implement `Copy` have +optimizations available, meaning you don’t have to call `clone`, which makes +the code more concise. + +Everything possible with `Copy` you can also accomplish with `Clone`, but the +code might be slower or have to use `clone` in places. + +## Hash for Mapping a Value to a Value of Fixed Size + +The `Hash` trait allows you to take an instance of a type of arbitrary size and +map that instance to a value of fixed size using a hash function. Deriving +`Hash` implements the `hash` method. The derived implementation of the `hash` +method combines the result of calling `hash` on each of the parts of the type, +meaning all fields or values must also implement `Hash` to derive `Hash`. + +An example of when `Hash` is required is in storing keys in a `HashMap` +to store data efficiently. + +## Default for Default Values + +The `Default` trait allows you to create a default value for a type. Deriving +`Default` implements the `default` function. The derived implementation of the +`default` function calls the `default` function on each part of the type, +meaning all fields or values in the type must also implement `Default` to +derive `Default`. + +The `Default::default` function is commonly used in combination with the struct +update syntax discussed in “Creating Instances from Other Instances with Struct +Update Syntax” on page XX. You can customize a few fields of a struct and then +set and use a default value for the rest of the fields by using +`..Default::default()`. + +The `Default` trait is required when you use the method `unwrap_or_default` on +`Option` instances, for example. If the `Option` is `None`, the method +`unwrap_or_default` will return the result of `Default::default` for the type +`T` stored in the `Option`. + diff --git a/rustbook-ru/nostarch/appendix_d.md b/rustbook-ru/nostarch/appendix_d.md new file mode 100644 index 000000000..96b73e954 --- /dev/null +++ b/rustbook-ru/nostarch/appendix_d.md @@ -0,0 +1,175 @@ + + +[TOC] + +## Appendix D: Useful Development Tools + +In this appendix, we talk about some useful development tools that the Rust +project provides. We’ll look at automatic formatting, quick ways to apply +warning fixes, a linter, and integrating with IDEs. + +## Automatic Formatting with rustfmt + +The `rustfmt` tool reformats your code according to the community code style. +Many collaborative projects use `rustfmt` to prevent arguments about which +style to use when writing Rust: everyone formats their code using the tool. + +Rust installations include `rustfmt` by default, so you should already have the +programs `rustfmt` and `cargo-fmt` on your system. These two commands are +analagous to `rustc` and `cargo` in that `rustfmt` allows finer-grained control +and `cargo-fmt` understands conventions of a project that uses Cargo. To format +any Cargo project, enter the following: + +``` +$ cargo fmt +``` + +Running this command reformats all the Rust code in the current crate. This +should only change the code style, not the code semantics. For more information +on `rustfmt`, see its documentation at *https://github.com/rust-lang/rustfmt*. + +## Fix Your Code with rustfix + +The `rustfix` tool is included with Rust installations and can automatically +fix compiler warnings that have a clear way to correct the problem that’s +likely what you want. You’ve probably seen compiler warnings before. For +example, consider this code: + +Filename: src/main.rs + +``` +fn do_something() {} + +fn main() { + for i in 0..100 { + do_something(); + } +} +``` + +Here, we’re calling the `do_something` function 100 times, but we never use the +variable `i` in the body of the `for` loop. Rust warns us about that: + +``` +$ cargo build + Compiling myprogram v0.1.0 (file:///projects/myprogram) +warning: unused variable: `i` + --> src/main.rs:4:9 + | +4 | for i in 0..100 { + | ^ help: consider using `_i` instead + | + = note: #[warn(unused_variables)] on by default + + Finished dev [unoptimized + debuginfo] target(s) in 0.50s +``` + +The warning suggests that we use `_i` as a name instead: the underscore +indicates that we intend for this variable to be unused. We can automatically +apply that suggestion using the `rustfix` tool by running the command `cargo +fix`: + +``` +$ cargo fix + Checking myprogram v0.1.0 (file:///projects/myprogram) + Fixing src/main.rs (1 fix) + Finished dev [unoptimized + debuginfo] target(s) in 0.59s +``` + +When we look at *src/main.rs* again, we’ll see that `cargo fix` has changed the +code: + +Filename: src/main.rs + +``` +fn do_something() {} + +fn main() { + for _i in 0..100 { + do_something(); + } +} +``` + +The `for` loop variable is now named `_i`, and the warning no longer appears. + +You can also use the `cargo fix` command to transition your code between +different Rust editions. Editions are covered in Appendix E. + +## More Lints with Clippy + +The Clippy tool is a collection of lints to analyze your code so you can catch +common mistakes and improve your Rust code. Clippy is included with standard +Rust installations. + +To run Clippy’s lints on any Cargo project, enter the following: + +``` +$ cargo clippy +``` + +For example, say you write a program that uses an approximation of a +mathematical constant, such as pi, as this program does: + +Filename: src/main.rs + +``` +fn main() { + let x = 3.1415; + let r = 8.0; + println!("the area of the circle is {}", x * r * r); +} +``` + +Running `cargo clippy` on this project results in this error: + +``` +error: approximate value of `f{32, 64}::consts::PI` found + --> src/main.rs:2:13 + | +2 | let x = 3.1415; + | ^^^^^^ + | + = note: `#[deny(clippy::approx_constant)]` on by default + = help: consider using the constant directly + = help: for further information visit https://rust-lang.github.io/rust- +clippy/master/index.html#approx_constant +``` + +This error lets you know that Rust already has a more precise `PI` constant +defined, and that your program would be more correct if you used the constant +instead. You would then change your code to use the `PI` constant. + +The following code doesn’t result in any errors or warnings from Clippy: + +Filename: src/main.rs + +``` +fn main() { + let x = std::f64::consts::PI; + let r = 8.0; + println!("the area of the circle is {}", x * r * r); +} +``` + +For more information on Clippy, see its documentation at +*https://github.com/rust-lang/rust-clippy**.* + +## IDE Integration Using rust-analyzer + +To help with IDE integration, the Rust community recommends using +`rust-analyzer`. This tool is a set of compiler-centric utilities that speak +Language Server Protocol, which is a specification for IDEs and programming +languages to communicate with each other. Different clients can use +`rust-analyzer`, such as the Rust analyzer plug-in for Visual Studio Code at +*https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer*. + +Visit the `rust-analyzer` project’s home page at +*https://rust-analyzer.github.io* for installation instructions, then install +the language server support in your particular IDE. Your IDE will gain +capabilities such as autocompletion, jump to definition, and inline errors + diff --git a/rustbook-ru/nostarch/appendix_e.md b/rustbook-ru/nostarch/appendix_e.md new file mode 100644 index 000000000..ddb12b782 --- /dev/null +++ b/rustbook-ru/nostarch/appendix_e.md @@ -0,0 +1,66 @@ + + +[TOC] + +## Appendix E: Editions + +In Chapter 1, you saw that `cargo new` adds a bit of metadata to your +*Cargo.toml* file about an edition. This appendix talks about what that means! + +The Rust language and compiler have a six-week release cycle, meaning users get +a constant stream of new features. Other programming languages release larger +changes less often; Rust releases smaller updates more frequently. After a +while, all of these tiny changes add up. But from release to release, it can be +difficult to look back and say, “Wow, between Rust 1.10 and Rust 1.31, Rust has +changed a lot!” + +Every two or three years, the Rust team produces a new Rust *edition*. Each +edition brings together the features that have landed into a clear package with +fully updated documentation and tooling. New editions ship as part of the usual +six-week release process. + +Editions serve different purposes for different people: + +* For active Rust users, a new edition brings together incremental changes into +an easy-to-understand package. +* For non-users, a new edition signals that some major advancements have +landed, which might make Rust worth another look. +* For those developing Rust, a new edition provides a rallying point for the +project as a whole. + +At the time of this writing, three Rust editions are available: Rust 2015, Rust +2018, and Rust 2021. This book is written using Rust 2021 edition idioms. + +The `edition` key in *Cargo.toml* indicates which edition the compiler should +use for your code. If the key doesn’t exist, Rust uses `2015` as the edition +value for backward compatibility reasons. + +Each project can opt in to an edition other than the default 2015 edition. +Editions can contain incompatible changes, such as including a new keyword that +conflicts with identifiers in code. However, unless you opt in to those +changes, your code will continue to compile even as you upgrade the Rust +compiler version you use. + +All Rust compiler versions support any edition that existed prior to that +compiler’s release, and they can link crates of any supported editions +together. Edition changes only affect the way the compiler initially parses +code. Therefore, if you’re using Rust 2015 and one of your dependencies uses +Rust 2018, your project will compile and be able to use that dependency. The +opposite situation, where your project uses Rust 2018 and a dependency uses +Rust 2015, works as well. + +To be clear: most features will be available on all editions. Developers using +any Rust edition will continue to see improvements as new stable releases are +made. However, in some cases, mainly when new keywords are added, some new +features might only be available in later editions. You will need to switch +editions if you want to take advantage of such features. + +For more details, *The* *Edition Guide* at +*https://doc.rust-lang.org/stable/edition-guide* is a complete book about +editions that enumerates the differences between editions and explains how to +automatically upgrade your code to a new edition via `cargo fix`. + diff --git a/rustbook-ru/nostarch/bio.md b/rustbook-ru/nostarch/bio.md new file mode 100644 index 000000000..38b0508bc --- /dev/null +++ b/rustbook-ru/nostarch/bio.md @@ -0,0 +1,6 @@ +# About the Authors + +Carol Nichols is a member of the Rust Crates.io Team and a former member of the +Rust Core Team. She’s a co-founder of Integer 32, LLC, the world’s first +Rust-focused software consultancy. Nichols has also organized the Rust Belt +Rust Conference. diff --git a/rustbook-ru/nostarch/book.toml b/rustbook-ru/nostarch/book.toml new file mode 100644 index 000000000..15dd273bc --- /dev/null +++ b/rustbook-ru/nostarch/book.toml @@ -0,0 +1,15 @@ +[book] +title = "Язык программирования Ржавчина" +authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"] +src = "../src" # needs to be explicit (it is implicit in `/book.toml`). + +[output.html] +additional-css = ["../ferris.css", "../theme/2018-edition.css", "../theme/semantic-notes.css"] +additional-js = ["../ferris.js"] +git-repository-url = "https://github.com/rust-lang/book" + +[build] +build-dir = "../tmp" + +[preprocessor.trpl-listing] +output-mode = "simple" diff --git a/rustbook-ru/nostarch/chapter01.md b/rustbook-ru/nostarch/chapter01.md new file mode 100644 index 000000000..3379b14f2 --- /dev/null +++ b/rustbook-ru/nostarch/chapter01.md @@ -0,0 +1,614 @@ + + +[TOC] + +# Getting Started + +Let’s start your Rust journey! There’s a lot to learn, but every journey starts +somewhere. In this chapter, we’ll discuss: + +* Installing Rust on Linux, macOS, and Windows +* Writing a program that prints `Hello, world!` +* Using `cargo`, Rust’s package manager and build system + +## Installation + +The first step is to install Rust. We’ll download Rust through `rustup`, a +command line tool for managing Rust versions and associated tools. You’ll need +an internet connection for the download. + +> Note: If you prefer not to use `rustup` for some reason, please see the Other +Rust Installation Methods page at +*https://forge.rust-lang.org/infra/other-installation-methods.html* for more +options. + +The following steps install the latest stable version of the Rust compiler. +Rust’s stability guarantees ensure that all the examples in the book that +compile will continue to compile with newer Rust versions. The output might +differ slightly between versions because Rust often improves error messages and +warnings. In other words, any newer, stable version of Rust you install using +these steps should work as expected with the content of this book. + +> ### Command Line Notation +> +> In this chapter and throughout the book, we’ll show some commands used in the +terminal. Lines that you should enter in a terminal all start with `$`. You +don’t need to type the `$` character; it’s the command line prompt shown to +indicate the start of each command. Lines that don’t start with `$` typically +show the output of the previous command. Additionally, PowerShell-specific +examples will use `>` rather than `$`. + +### Installing rustup on Linux or macOS + +If you’re using Linux or macOS, open a terminal and enter the following command: + +``` +$ curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh +``` + +The command downloads a script and starts the installation of the `rustup` +tool, which installs the latest stable version of Rust. You might be prompted +for your password. If the install is successful, the following line will appear: + +``` +Rust is installed now. Great! +``` + +You will also need a *linker*, which is a program that Rust uses to join its +compiled outputs into one file. It is likely you already have one. If you get +linker errors, you should install a C compiler, which will typically include a +linker. A C compiler is also useful because some common Rust packages depend on +C code and will need a C compiler. + +On macOS, you can get a C compiler by running: + +``` +$ xcode-select --install +``` + +Linux users should generally install GCC or Clang, according to their +distribution’s documentation. For example, if you use Ubuntu, you can install +the `build-essential` package. + +### Installing rustup on Windows + +On Windows, go to *https://www.rust-lang.org/tools/install* and follow the +instructions for installing Rust. At some point in the installation, you’ll +receive a message explaining that you’ll also need the MSVC build tools for +Visual Studio 2013 or later. + +To acquire the build tools, you’ll need to install Visual Studio 2022 from +*https://visualstudio.microsoft.com/downloads*. When asked which workloads to +install, include: + +* “Desktop Development with C++” +* The Windows 10 or 11 SDK +* The English language pack component, along with any other language pack of +your choosing + +The rest of this book uses commands that work in both *cmd.exe* and PowerShell. +If there are specific differences, we’ll explain which to use. + +### Troubleshooting + +To check whether you have Rust installed correctly, open a shell and enter this +line: + +``` +$ rustc --version +``` + +You should see the version number, commit hash, and commit date for the latest +stable version that has been released, in the following format: + +``` +rustc x.y.z (abcabcabc yyyy-mm-dd) +``` + +If you see this information, you have installed Rust successfully! If you don’t +see this information, check that Rust is in your `%PATH%` system variable as +follows. + +In Windows CMD, use: + +``` +> echo %PATH% +``` + +In PowerShell, use: + +``` +> echo $env:Path +``` + +In Linux and macOS, use: + +``` +$ echo $PATH +``` + +If that’s all correct and Rust still isn’t working, there are a number of +places you can get help. Find out how to get in touch with other Rustaceans (a +silly nickname we call ourselves) on the community page at +*https://www.rust-lang.org/community*. + +### Updating and Uninstalling + +Once Rust is installed via `rustup`, updating to a newly released version is +easy. From your shell, run the following update script: + +``` +$ rustup update +``` + +To uninstall Rust and `rustup`, run the following uninstall script from your +shell: + +``` +$ rustup self uninstall +``` + +### Local Documentation + +The installation of Rust also includes a local copy of the documentation so +that you can read it offline. Run `rustup doc` to open the local documentation +in your browser. + +Any time a type or function is provided by the standard library and you’re not +sure what it does or how to use it, use the application programming interface +(API) documentation to find out! + +## Hello, World! + +Now that you’ve installed Rust, it’s time to write your first Rust program. +It’s traditional when learning a new language to write a little program that +prints the text `Hello, world!` to the screen, so we’ll do the same here! + +> Note: This book assumes basic familiarity with the command line. Rust makes +no specific demands about your editing or tooling or where your code lives, so +if you prefer to use an integrated development environment (IDE) instead of the +command line, feel free to use your favorite IDE. Many IDEs now have some +degree of Rust support; check the IDE’s documentation for details. The Rust +team has been focusing on enabling great IDE support via `rust-analyzer`. See +Appendix D for more details. + +### Creating a Project Directory + +You’ll start by making a directory to store your Rust code. It doesn’t matter +to Rust where your code lives, but for the exercises and projects in this book, +we suggest making a *projects* directory in your home directory and keeping all +your projects there. + +Open a terminal and enter the following commands to make a *projects* directory +and a directory for the “Hello, world!” project within the *projects* directory. + +For Linux, macOS, and PowerShell on Windows, enter this: + +``` +$ mkdir ~/projects +$ cd ~/projects +$ mkdir hello_world +$ cd hello_world +``` + +For Windows CMD, enter this: + +``` +> mkdir "%USERPROFILE%\projects" +> cd /d "%USERPROFILE%\projects" +> mkdir hello_world +> cd hello_world +``` + +### Writing and Running a Rust Program + +Next, make a new source file and call it *main.rs*. Rust files always end with +the *.rs* extension. If you’re using more than one word in your filename, the +convention is to use an underscore to separate them. For example, use +*hello_world.rs* rather than *helloworld.rs*. + +Now open the *main.rs* file you just created and enter the code in Listing 1-1. + +Filename: main.rs + +``` +fn main() { + println!("Hello, world!"); +} +``` + +Listing 1-1: A program that prints `Hello, world!` + +Save the file and go back to your terminal window in the +*~/projects/hello_world* directory. On Linux or macOS, enter the following +commands to compile and run the file: + +``` +$ rustc main.rs +$ ./main +Hello, world! +``` + +On Windows, enter the command `.\main.exe` instead of `./main`: + +``` +> rustc main.rs +> .\main.exe +Hello, world! +``` + +Regardless of your operating system, the string `Hello, world!` should print to +the terminal. If you don’t see this output, refer back to “Troubleshooting” on +page XX for ways to get help. + +If `Hello, world!` did print, congratulations! You’ve officially written a Rust +program. That makes you a Rust programmer—welcome! + +### Anatomy of a Rust Program + +Let’s review this “Hello, world!” program in detail. Here’s the first piece of +the puzzle: + +``` +fn main() { + +} +``` + +These lines define a function named `main`. The `main` function is special: it +is always the first code that runs in every executable Rust program. Here, the +first line declares a function named `main` that has no parameters and returns +nothing. If there were parameters, they would go inside the parentheses `()`. + +The function body is wrapped in `{}`. Rust requires curly brackets around all +function bodies. It’s good style to place the opening curly bracket on the same +line as the function declaration, adding one space in between. + +> Note: If you want to stick to a standard style across Rust projects, you can +use an automatic formatter tool called `rustfmt` to format your code in a +particular style (more on `rustfmt` in Appendix D). The Rust team has included +this tool with the standard Rust distribution, as `rustc` is, so it should +already be installed on your computer! + +The body of the `main` function holds the following code: + +``` + println!("Hello, world!"); +``` + +This line does all the work in this little program: it prints text to the +screen. There are four important details to notice here. + +First, Rust style is to indent with four spaces, not a tab. + +Second, `println!` calls a Rust macro. If it had called a function instead, it +would be entered as `println` (without the `!`). We’ll discuss Rust macros in +more detail in Chapter 19. For now, you just need to know that using a `!` +means that you’re calling a macro instead of a normal function and that macros +don’t always follow the same rules as functions. + +Third, you see the `"Hello, world!"` string. We pass this string as an argument +to `println!`, and the string is printed to the screen. + +Fourth, we end the line with a semicolon (`;`), which indicates that this +expression is over and the next one is ready to begin. Most lines of Rust code +end with a semicolon. + +### Compiling and Running Are Separate Steps + +You’ve just run a newly created program, so let’s examine each step in the +process. + +Before running a Rust program, you must compile it using the Rust compiler by +entering the `rustc` command and passing it the name of your source file, like +this: + +``` +$ rustc main.rs +``` + +If you have a C or C++ background, you’ll notice that this is similar to `gcc` +or `clang`. After compiling successfully, Rust outputs a binary executable. + +On Linux, macOS, and PowerShell on Windows, you can see the executable by +entering the `ls` command in your shell: + +``` +$ ls +main main.rs +``` + +On Linux and macOS, you’ll see two files. With PowerShell on Windows, you’ll +see the same three files that you would see using CMD. With CMD on Windows, you +would enter the following: + +``` +> dir /B %= the /B option says to only show the file names =% +main.exe +main.pdb +main.rs +``` + +This shows the source code file with the *.rs* extension, the executable file +(*main.exe* on Windows, but *main* on all other platforms), and, when using +Windows, a file containing debugging information with the *.pdb* extension. +From here, you run the *main* or *main.exe* file, like this: + +``` +$ ./main # or .\main.exe on Windows +``` + +If your *main.rs* is your “Hello, world!” program, this line prints `Hello, +world!` to your terminal. + +If you’re more familiar with a dynamic language, such as Ruby, Python, or +JavaScript, you might not be used to compiling and running a program as +separate steps. Rust is an *ahead-of-time compiled* language, meaning you can +compile a program and give the executable to someone else, and they can run it +even without having Rust installed. If you give someone a *.rb*, *.py*, or +*.js* file, they need to have a Ruby, Python, or JavaScript implementation +installed (respectively). But in those languages, you only need one command to +compile and run your program. Everything is a trade-off in language design. + +Just compiling with `rustc` is fine for simple programs, but as your project +grows, you’ll want to manage all the options and make it easy to share your +code. Next, we’ll introduce you to the Cargo tool, which will help you write +real-world Rust programs. + +## Hello, Cargo! + +Cargo is Rust’s build system and package manager. Most Rustaceans use this tool +to manage their Rust projects because Cargo handles a lot of tasks for you, +such as building your code, downloading the libraries your code depends on, and +building those libraries. (We call the libraries that your code needs +*dependencies*.) + +The simplest Rust programs, like the one we’ve written so far, don’t have any +dependencies. If we had built the “Hello, world!” project with Cargo, it would +only use the part of Cargo that handles building your code. As you write more +complex Rust programs, you’ll add dependencies, and if you start a project +using Cargo, adding dependencies will be much easier to do. + +Because the vast majority of Rust projects use Cargo, the rest of this book +assumes that you’re using Cargo too. Cargo comes installed with Rust if you +used the official installers discussed in “Installation” on page XX. If you +installed Rust through some other means, check whether Cargo is installed by +entering the following in your terminal: + +``` +$ cargo --version +``` + +If you see a version number, you have it! If you see an error, such as `command +not found`, look at the documentation for your method of installation to +determine how to install Cargo separately. + +### Creating a Project with Cargo + +Let’s create a new project using Cargo and look at how it differs from our +original “Hello, world!” project. Navigate back to your *projects* directory +(or wherever you decided to store your code). Then, on any operating system, +run the following: + +``` +$ cargo new hello_cargo +$ cd hello_cargo +``` + +The first command creates a new directory and project called *hello_cargo*. +We’ve named our project *hello_cargo*, and Cargo creates its files in a +directory of the same name. + +Go into the *hello_cargo* directory and list the files. You’ll see that Cargo +has generated two files and one directory for us: a *Cargo.toml* file and a +*src* directory with a *main.rs* file inside. + +It has also initialized a new Git repository along with a *.gitignore* file. +Git files won’t be generated if you run `cargo new` within an existing Git +repository; you can override this behavior by using `cargo new --vcs=git`. + +> Note: Git is a common version control system. You can change `cargo new` to +use a different version control system or no version control system by using +the `--vcs` flag. Run `cargo new --help` to see the available options. + +Open *Cargo.toml* in your text editor of choice. It should look similar to the +code in Listing 1-2. + +Filename: Cargo.toml + +``` +[package] +name = "hello_cargo" +version = "0.1.0" +edition = "2021" + +[dependencies] +``` + +Listing 1-2: Contents of *Cargo.toml* generated by `cargo new` + +This file is in the *TOML* (*Tom’s Obvious, Minimal Language*) format, which is +Cargo’s configuration format. + +The first line, `[package]`, is a section heading that indicates that the +following statements are configuring a package. As we add more information to +this file, we’ll add other sections. + +The next three lines set the configuration information Cargo needs to compile +your program: the name, the version, and the edition of Rust to use. We’ll talk +about the `edition` key in Appendix E. + +The last line, `[dependencies]`, is the start of a section for you to list any +of your project’s dependencies. In Rust, packages of code are referred to as +*crates*. We won’t need any other crates for this project, but we will in the +first project in Chapter 2, so we’ll use this dependencies section then. + +Now open *src/main.rs* and take a look: + +Filename: src/main.rs + +``` +fn main() { + println!("Hello, world!"); +} +``` + +Cargo has generated a “Hello, world!” program for you, just like the one we +wrote in Listing 1-1! So far, the differences between our project and the +project Cargo generated are that Cargo placed the code in the *src* directory +and we have a *Cargo.toml* configuration file in the top directory. + +Cargo expects your source files to live inside the *src* directory. The +top-level project directory is just for README files, license information, +configuration files, and anything else not related to your code. Using Cargo +helps you organize your projects. There’s a place for everything, and +everything is in its place. + +If you started a project that doesn’t use Cargo, as we did with the “Hello, +world!” project, you can convert it to a project that does use Cargo. Move the +project code into the *src* directory and create an appropriate *Cargo.toml* +file. + +### Building and Running a Cargo Project + +Now let’s look at what’s different when we build and run the “Hello, world!” +program with Cargo! From your *hello_cargo* directory, build your project by +entering the following command: + +``` +$ cargo build + Compiling hello_cargo v0.1.0 (file:///projects/hello_cargo) + Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs +``` + +This command creates an executable file in *target/debug/hello_cargo* (or +*target\debug\hello_cargo.exe* on Windows) rather than in your current +directory. Because the default build is a debug build, Cargo puts the binary in +a directory named *debug*. You can run the executable with this command: + +``` +$ ./target/debug/hello_cargo # or .\target\debug\hello_cargo.exe on Windows +Hello, world! +``` + +If all goes well, `Hello, world!` should print to the terminal. Running `cargo +build` for the first time also causes Cargo to create a new file at the top +level: *Cargo.lock*. This file keeps track of the exact versions of +dependencies in your project. This project doesn’t have dependencies, so the +file is a bit sparse. You won’t ever need to change this file manually; Cargo +manages its contents for you. + +We just built a project with `cargo build` and ran it with +`./target/debug/hello_cargo`, but we can also use `cargo run` to compile the +code and then run the resultant executable all in one command: + +``` +$ cargo run + Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs + Running `target/debug/hello_cargo` +Hello, world! +``` + +Using `cargo run` is more convenient than having to remember to run `cargo +build` and then use the whole path to the binary, so most developers use `cargo +run`. + +Notice that this time we didn’t see output indicating that Cargo was compiling +`hello_cargo`. Cargo figured out that the files hadn’t changed, so it didn’t +rebuild but just ran the binary. If you had modified your source code, Cargo +would have rebuilt the project before running it, and you would have seen this +output: + +``` +$ cargo run + Compiling hello_cargo v0.1.0 (file:///projects/hello_cargo) + Finished dev [unoptimized + debuginfo] target(s) in 0.33 secs + Running `target/debug/hello_cargo` +Hello, world! +``` + +Cargo also provides a command called `cargo check`. This command quickly checks +your code to make sure it compiles but doesn’t produce an executable: + +``` +$ cargo check + Checking hello_cargo v0.1.0 (file:///projects/hello_cargo) + Finished dev [unoptimized + debuginfo] target(s) in 0.32 secs +``` + +Why would you not want an executable? Often, `cargo check` is much faster than +`cargo build` because it skips the step of producing an executable. If you’re +continually checking your work while writing the code, using `cargo check` will +speed up the process of letting you know if your project is still compiling! As +such, many Rustaceans run `cargo check` periodically as they write their +program to make sure it compiles. Then they run `cargo build` when they’re +ready to use the executable. + +Let’s recap what we’ve learned so far about Cargo: + +* We can create a project using `cargo new`. +* We can build a project using `cargo build`. +* We can build and run a project in one step using `cargo run`. +* We can build a project without producing a binary to check for errors using +`cargo check`. +* Instead of saving the result of the build in the same directory as our code, +Cargo stores it in the *target/debug* directory. + +An additional advantage of using Cargo is that the commands are the same no +matter which operating system you’re working on. So, at this point, we’ll no +longer provide specific instructions for Linux and macOS versus Windows. + +### Building for Release + +When your project is finally ready for release, you can use `cargo build +--release` to compile it with optimizations. This command will create an +executable in *target/release* instead of *target/debug*. The optimizations +make your Rust code run faster, but turning them on lengthens the time it takes +for your program to compile. This is why there are two different profiles: one +for development, when you want to rebuild quickly and often, and another for +building the final program you’ll give to a user that won’t be rebuilt +repeatedly and that will run as fast as possible. If you’re benchmarking your +code’s running time, be sure to run `cargo build --release` and benchmark with +the executable in *target/release*. + +### Cargo as Convention + +With simple projects, Cargo doesn’t provide a lot of value over just using +`rustc`, but it will prove its worth as your programs become more intricate. +Once programs grow to multiple files or need a dependency, it’s much easier to +let Cargo coordinate the build. + +Even though the `hello_cargo` project is simple, it now uses much of the real +tooling you’ll use in the rest of your Rust career. In fact, to work on any +existing projects, you can use the following commands to check out the code +using Git, change to that project’s directory, and build: + +``` +$ git clone example.org/someproject +$ cd someproject +$ cargo build +``` + +For more information about Cargo, check out its documentation at +*https://doc.rust-lang.org/cargo*. + +## Summary + +You’re already off to a great start on your Rust journey! In this chapter, +you’ve learned how to: + +* Install the latest stable version of Rust using `rustup` +* Update to a newer Rust version +* Open locally installed documentation +* Write and run a “Hello, world!” program using `rustc` directly +* Create and run a new project using the conventions of Cargo + +This is a great time to build a more substantial program to get used to reading +and writing Rust code. So, in Chapter 2, we’ll build a guessing game program. +If you would rather start by learning how common programming concepts work in +Rust, see Chapter 3 and then return to Chapter 2. + diff --git a/rustbook-ru/nostarch/chapter02.md b/rustbook-ru/nostarch/chapter02.md new file mode 100644 index 000000000..b01770dc5 --- /dev/null +++ b/rustbook-ru/nostarch/chapter02.md @@ -0,0 +1,1006 @@ + + +[TOC] + +# Programming a Guessing Game + +Let’s jump into Rust by working through a hands-on project together! This +chapter introduces you to a few common Rust concepts by showing you how to use +them in a real program. You’ll learn about `let`, `match`, methods, associated +functions, external crates, and more! In the following chapters, we’ll explore +these ideas in more detail. In this chapter, you’ll just practice the +fundamentals. + +We’ll implement a classic beginner programming problem: a guessing game. Here’s +how it works: the program will generate a random integer between 1 and 100. It +will then prompt the player to enter a guess. After a guess is entered, the +program will indicate whether the guess is too low or too high. If the guess is +correct, the game will print a congratulatory message and exit. + +## Setting Up a New Project + +To set up a new project, go to the *projects* directory that you created in +Chapter 1 and make a new project using Cargo, like so: + +``` +$ cargo new guessing_game +$ cd guessing_game +``` + +The first command, `cargo new`, takes the name of the project (`guessing_game`) +as the first argument. The second command changes to the new project’s +directory. + +Look at the generated *Cargo.toml* file: + +Filename: Cargo.toml + +``` +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at +https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +``` + +As you saw in Chapter 1, `cargo new` generates a “Hello, world!” program for +you. Check out the *src/main.rs* file: + +Filename: src/main.rs + +``` +fn main() { + println!("Hello, world!"); +} +``` + +Now let’s compile this “Hello, world!” program and run it in the same step +using the `cargo run` command: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 1.50s + Running `target/debug/guessing_game` +Hello, world! +``` + +The `run` command comes in handy when you need to rapidly iterate on a project, +as we’ll do in this game, quickly testing each iteration before moving on to +the next one. + +Reopen the *src/main.rs* file. You’ll be writing all the code in this file. + +## Processing a Guess + +The first part of the guessing game program will ask for user input, process +that input, and check that the input is in the expected form. To start, we’ll +allow the player to input a guess. Enter the code in Listing 2-1 into +*src/main.rs*. + +Filename: src/main.rs + +``` +use std::io; + +fn main() { + println!("Guess the number!"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {guess}"); +} +``` + +Listing 2-1: Code that gets a guess from the user and prints it + +This code contains a lot of information, so let’s go over it line by line. To +obtain user input and then print the result as output, we need to bring the +`io` input/output library into scope. The `io` library comes from the standard +library, known as `std`: + +``` +use std::io; +``` + +By default, Rust has a set of items defined in the standard library that it +brings into the scope of every program. This set is called the *prelude*, and +you can see everything in it at +*https://doc.rust-lang.org/std/prelude/index.html*. + +If a type you want to use isn’t in the prelude, you have to bring that type +into scope explicitly with a `use` statement. Using the `std::io` library +provides you with a number of useful features, including the ability to accept +user input. + +As you saw in Chapter 1, the `main` function is the entry point into the +program: + +``` +fn main() { +``` + +The `fn` syntax declares a new function; the parentheses, `()`, indicate there +are no parameters; and the curly bracket, `{`, starts the body of the function. + +As you also learned in Chapter 1, `println!` is a macro that prints a string to +the screen: + +``` +println!("Guess the number!"); + +println!("Please input your guess."); +``` + +This code is printing a prompt stating what the game is and requesting input +from the user. + +### Storing Values with Variables + +Next, we’ll create a *variable* to store the user input, like this: + +``` +let mut guess = String::new(); +``` + +Now the program is getting interesting! There’s a lot going on in this little +line. We use the `let` statement to create the variable. Here’s another example: + +``` +let apples = 5; +``` + +This line creates a new variable named `apples` and binds it to the value 5. In +Rust, variables are immutable by default, meaning once we give the variable a +value, the value won’t change. We’ll be discussing this concept in detail in +“Variables and Mutability” on page XX. To make a variable mutable, we add `mut` +before the variable name: + +``` +let apples = 5; // immutable +let mut bananas = 5; // mutable +``` + +> Note: The `//` syntax starts a comment that continues until the end of the +line. Rust ignores everything in comments. We’ll discuss comments in more +detail in Chapter 3. + +Returning to the guessing game program, you now know that `let mut guess` will +introduce a mutable variable named `guess`. The equal sign (`=`) tells Rust we +want to bind something to the variable now. On the right of the equal sign is +the value that `guess` is bound to, which is the result of calling +`String::new`, a function that returns a new instance of a `String`. `String` +is a string type provided by the standard library that is a growable, UTF-8 +encoded bit of text. + +The `::` syntax in the `::new` line indicates that `new` is an associated +function of the `String` type. An *associated function* is a function that’s +implemented on a type, in this case `String`. This `new` function creates a +new, empty string. You’ll find a `new` function on many types because it’s a +common name for a function that makes a new value of some kind. + +In full, the `let mut guess = String::new();` line has created a mutable +variable that is currently bound to a new, empty instance of a `String`. Whew! + +### Receiving User Input + +Recall that we included the input/output functionality from the standard +library with `use std::io;` on the first line of the program. Now we’ll call +the `stdin` function from the `io` module, which will allow us to handle user +input: + +``` +io::stdin() + .read_line(&mut guess) +``` + +If we hadn’t imported the `io` library with `use std::io;` at the beginning of +the program, we could still use the function by writing this function call as +`std::io::stdin`. The `stdin` function returns an instance of `std::io::Stdin`, +which is a type that represents a handle to the standard input for your +terminal. + +Next, the line `.read_line(&mut guess)` calls the `read_line` method on the +standard input handle to get input from the user. We’re also passing `&mut +guess` as the argument to `read_line` to tell it what string to store the user +input in. The full job of `read_line` is to take whatever the user types into +standard input and append that into a string (without overwriting its +contents), so we therefore pass that string as an argument. The string argument +needs to be mutable so the method can change the string’s content. + +The `&` indicates that this argument is a *reference*, which gives you a way to +let multiple parts of your code access one piece of data without needing to +copy that data into memory multiple times. References are a complex feature, +and one of Rust’s major advantages is how safe and easy it is to use +references. You don’t need to know a lot of those details to finish this +program. For now, all you need to know is that, like variables, references are +immutable by default. Hence, you need to write `&mut guess` rather than +`&guess` to make it mutable. (Chapter 4 will explain references more +thoroughly.) + +### Handling Potential Failure with Result + +We’re still working on this line of code. We’re now discussing a third line of +text, but note that it’s still part of a single logical line of code. The next +part is this method: + +``` +.expect("Failed to read line"); +``` + +We could have written this code as: + +``` +io::stdin().read_line(&mut guess).expect("Failed to read line"); +``` + +However, one long line is difficult to read, so it’s best to divide it. It’s +often wise to introduce a newline and other whitespace to help break up long +lines when you call a method with the `.method_name()` syntax. Now let’s +discuss what this line does. + +As mentioned earlier, `read_line` puts whatever the user enters into the string +we pass to it, but it also returns a `Result` value. `Result` is an +*enumeration*, often called an *enum*, which is a type that can be in one of +multiple possible states. We call each possible state a *variant*. + +Chapter 6 will cover enums in more detail. The purpose of these `Result` types +is to encode error-handling information. + +`Result`’s variants are `Ok` and `Err`. The `Ok` variant indicates the +operation was successful, and inside `Ok` is the successfully generated value. +The `Err` variant means the operation failed, and `Err` contains information +about how or why the operation failed. + +Values of the `Result` type, like values of any type, have methods defined on +them. An instance of `Result` has an `expect` method that you can call. If this +instance of `Result` is an `Err` value, `expect` will cause the program to +crash and display the message that you passed as an argument to `expect`. If +the `read_line` method returns an `Err`, it would likely be the result of an +error coming from the underlying operating system. If this instance of `Result` +is an `Ok` value, `expect` will take the return value that `Ok` is holding and +return just that value to you so you can use it. In this case, that value is +the number of bytes in the user’s input. + +If you don’t call `expect`, the program will compile, but you’ll get a warning: + +``` +$ cargo build + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) +warning: unused `Result` that must be used + --> src/main.rs:10:5 + | +10 | io::stdin().read_line(&mut guess); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_must_use)]` on by default + = note: this `Result` may be an `Err` variant, which should be handled + +warning: `guessing_game` (bin "guessing_game") generated 1 warning + Finished dev [unoptimized + debuginfo] target(s) in 0.59s +``` + +Rust warns that you haven’t used the `Result` value returned from `read_line`, +indicating that the program hasn’t handled a possible error. + +The right way to suppress the warning is to actually write error-handling code, +but in our case we just want to crash this program when a problem occurs, so we +can use `expect`. You’ll learn about recovering from errors in Chapter 9. + +### Printing Values with println! Placeholders + +Aside from the closing curly bracket, there’s only one more line to discuss in +the code so far: + +``` +println!("You guessed: {guess}"); +``` + +This line prints the string that now contains the user’s input. The `{}` set of +curly brackets is a placeholder: think of `{}` as little crab pincers that hold +a value in place. When printing the value of a variable, the variable name can +go inside the curly brackets. When printing the result of evaluating an +expression, place empty curly brackets in the format string, then follow the +format string with a comma-separated list of expressions to print in each empty +curly bracket placeholder in the same order. Printing a variable and the result +of an expression in one call to `println!` would look like this: + +``` +let x = 5; +let y = 10; + +println!("x = {x} and y + 2 = {}", y + 2); +``` + +This code would print `x = 5 and y = 12`. + +### Testing the First Part + +Let’s test the first part of the guessing game. Run it using `cargo run`: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 6.44s + Running `target/debug/guessing_game` +Guess the number! +Please input your guess. +6 +You guessed: 6 +``` + +At this point, the first part of the game is done: we’re getting input from the +keyboard and then printing it. + +## Generating a Secret Number + +Next, we need to generate a secret number that the user will try to guess. The +secret number should be different every time so the game is fun to play more +than once. We’ll use a random number between 1 and 100 so the game isn’t too +difficult. Rust doesn’t yet include random number functionality in its standard +library. However, the Rust team does provide a `rand` crate at +*https://crates.io/crates/rand* with said functionality. + +### Using a Crate to Get More Functionality + +Remember that a crate is a collection of Rust source code files. The project +we’ve been building is a *binary crate*, which is an executable. The `rand` +crate is a *library crate*, which contains code that is intended to be used in +other programs and can’t be executed on its own. + +Cargo’s coordination of external crates is where Cargo really shines. Before we +can write code that uses `rand`, we need to modify the *Cargo.toml* file to +include the `rand` crate as a dependency. Open that file now and add the +following line to the bottom, beneath the `[dependencies]` section header that +Cargo created for you. Be sure to specify `rand` exactly as we have here, with +this version number, or the code examples in this tutorial may not work: + +Filename: Cargo.toml + +``` +[dependencies] +rand = "0.8.5" +``` + +In the *Cargo.toml* file, everything that follows a header is part of that +section that continues until another section starts. In `[dependencies]` you +tell Cargo which external crates your project depends on and which versions of +those crates you require. In this case, we specify the `rand` crate with the +semantic version specifier `0.8.5`. Cargo understands Semantic Versioning +(sometimes called *SemVer*), which is a standard for writing version numbers. +The specifier `0.8.5` is actually shorthand for `^0.8.5`, which means any +version that is at least 0.8.5 but below 0.9.0. + +Cargo considers these versions to have public APIs compatible with version +0.8.5, and this specification ensures you’ll get the latest patch release that +will still compile with the code in this chapter. Any version 0.9.0 or greater +is not guaranteed to have the same API as what the following examples use. + +Now, without changing any of the code, let’s build the project, as shown in +Listing 2-2. + +``` +$ cargo build + Updating crates.io index + Downloaded rand v0.8.5 + Downloaded libc v0.2.127 + Downloaded getrandom v0.2.7 + Downloaded cfg-if v1.0.0 + Downloaded ppv-lite86 v0.2.16 + Downloaded rand_chacha v0.3.1 + Downloaded rand_core v0.6.3 + Compiling rand_core v0.6.3 + Compiling libc v0.2.127 + Compiling getrandom v0.2.7 + Compiling cfg-if v1.0.0 + Compiling ppv-lite86 v0.2.16 + Compiling rand_chacha v0.3.1 + Compiling rand v0.8.5 + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 2.53s +``` + +Listing 2-2: The output from running `cargo build` after adding the `rand` +crate as a dependency + +You may see different version numbers (but they will all be compatible with the +code, thanks to SemVer!) and different lines (depending on the operating +system), and the lines may be in a different order. + +When we include an external dependency, Cargo fetches the latest versions of +everything that dependency needs from the *registry*, which is a copy of data +from Crates.io at *https://crates.io*. Crates.io is where people in the Rust +ecosystem post their open source Rust projects for others to use. + +After updating the registry, Cargo checks the `[dependencies]` section and +downloads any crates listed that aren’t already downloaded. In this case, +although we only listed `rand` as a dependency, Cargo also grabbed other crates +that `rand` depends on to work. After downloading the crates, Rust compiles +them and then compiles the project with the dependencies available. + +If you immediately run `cargo build` again without making any changes, you +won’t get any output aside from the `Finished` line. Cargo knows it has already +downloaded and compiled the dependencies, and you haven’t changed anything +about them in your *Cargo.toml* file. Cargo also knows that you haven’t changed +anything about your code, so it doesn’t recompile that either. With nothing to +do, it simply exits. + +If you open the *src/main.rs* file, make a trivial change, and then save it and +build again, you’ll only see two lines of output: + +``` +$ cargo build + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 2.53 secs +``` + +These lines show that Cargo only updates the build with your tiny change to the +*src/main.rs* file. Your dependencies haven’t changed, so Cargo knows it can +reuse what it has already downloaded and compiled for those. + +#### Ensuring Reproducible Builds with the Cargo.lock File + +Cargo has a mechanism that ensures you can rebuild the same artifact every time +you or anyone else builds your code: Cargo will use only the versions of the +dependencies you specified until you indicate otherwise. For example, say that +next week version 0.8.6 of the `rand` crate comes out, and that version +contains an important bug fix, but it also contains a regression that will +break your code. To handle this, Rust creates the *Cargo.lock* file the first +time you run `cargo build`, so we now have this in the *guessing_game* +directory. + +When you build a project for the first time, Cargo figures out all the versions +of the dependencies that fit the criteria and then writes them to the +*Cargo.lock* file. When you build your project in the future, Cargo will see +that the *Cargo.lock* file exists and will use the versions specified there +rather than doing all the work of figuring out versions again. This lets you +have a reproducible build automatically. In other words, your project will +remain at 0.8.5 until you explicitly upgrade, thanks to the *Cargo.lock* file. +Because the *Cargo.lock* file is important for reproducible builds, it’s often +checked into source control with the rest of the code in your project. + +#### Updating a Crate to Get a New Version + +When you *do* want to update a crate, Cargo provides the command `update`, +which will ignore the *Cargo.lock* file and figure out all the latest versions +that fit your specifications in *Cargo.toml*. Cargo will then write those +versions to the *Cargo.lock* file. Otherwise, by default, Cargo will only look +for versions greater than 0.8.5 and less than 0.9.0. If the `rand` crate has +released the two new versions 0.8.6 and 0.9.0, you would see the following if +you ran `cargo update`: + +``` +$ cargo update + Updating crates.io index + Updating rand v0.8.5 -> v0.8.6 +``` + +Cargo ignores the 0.9.0 release. At this point, you would also notice a change +in your *Cargo.lock* file noting that the version of the `rand` crate you are +now using is 0.8.6. To use `rand` version 0.9.0 or any version in the 0.9.*x* +series, you’d have to update the *Cargo.toml* file to look like this instead: + +``` +[dependencies] +rand = "0.9.0" +``` + +The next time you run `cargo build`, Cargo will update the registry of crates +available and reevaluate your `rand` requirements according to the new version +you have specified. + +There’s a lot more to say about Cargo and its ecosystem, which we’ll discuss in +Chapter 14, but for now, that’s all you need to know. Cargo makes it very easy +to reuse libraries, so Rustaceans are able to write smaller projects that are +assembled from a number of packages. + +### Generating a Random Number + +Let’s start using `rand` to generate a number to guess. The next step is to +update *src/main.rs*, as shown in Listing 2-3. + +Filename: src/main.rs + +``` +use std::io; +1 use rand::Rng; + +fn main() { + println!("Guess the number!"); + + 2 let secret_number = rand::thread_rng().gen_range(1..=100); + + 3 println!("The secret number is: {secret_number}"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {guess}"); +} +``` + +Listing 2-3: Adding code to generate a random number + +First we add the line `use rand::Rng;` [1]. The `Rng` trait defines methods +that random number generators implement, and this trait must be in scope for us +to use those methods. Chapter 10 will cover traits in detail. + +Next, we’re adding two lines in the middle. In the first line [2], we call the +`rand::thread_rng` function that gives us the particular random number +generator we’re going to use: one that is local to the current thread of +execution and is seeded by the operating system. Then we call the `gen_range` +method on the random number generator. This method is defined by the `Rng` +trait that we brought into scope with the `use rand::Rng;` statement. The +`gen_range` method takes a range expression as an argument and generates a +random number in the range. The kind of range expression we’re using here takes +the form `start..=end` and is inclusive on the lower and upper bounds, so we +need to specify `1..=100` to request a number between 1 and 100. + +> Note: You won’t just know which traits to use and which methods and functions +to call from a crate, so each crate has documentation with instructions for +using it. Another neat feature of Cargo is that running the `cargo doc --open` +command will build documentation provided by all your dependencies locally and +open it in your browser. If you’re interested in other functionality in the +`rand` crate, for example, run `cargo doc --open` and click `rand` in the +sidebar on the left. + +The second new line [3] prints the secret number. This is useful while we’re +developing the program to be able to test it, but we’ll delete it from the +final version. It’s not much of a game if the program prints the answer as soon +as it starts! + +Try running the program a few times: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 2.53s + Running `target/debug/guessing_game` +Guess the number! +The secret number is: 7 +Please input your guess. +4 +You guessed: 4 + +$ cargo run + Finished dev [unoptimized + debuginfo] target(s) in 0.02s + Running `target/debug/guessing_game` +Guess the number! +The secret number is: 83 +Please input your guess. +5 +You guessed: 5 +``` + +You should get different random numbers, and they should all be numbers between +1 and 100. Great job! + +## Comparing the Guess to the Secret Number + +Now that we have user input and a random number, we can compare them. That step +is shown in Listing 2-4. Note that this code won’t compile just yet, as we will +explain. + +Filename: src/main.rs + +``` +use rand::Rng; +1 use std::cmp::Ordering; +use std::io; + +fn main() { + --snip-- + + println!("You guessed: {guess}"); + + 2 match guess.3 cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } +} +``` + +Listing 2-4: Handling the possible return values of comparing two numbers + +First we add another `use` statement [1], bringing a type called +`std::cmp::Ordering` into scope from the standard library. The `Ordering` type +is another enum and has the variants `Less`, `Greater`, and `Equal`. These are +the three outcomes that are possible when you compare two values. + +Then we add five new lines at the bottom that use the `Ordering` type. The +`cmp` method [3] compares two values and can be called on anything that can be +compared. It takes a reference to whatever you want to compare with: here it’s +comparing `guess` to `secret_number`. Then it returns a variant of the +`Ordering` enum we brought into scope with the `use` statement. We use a +`match` expression [2] to decide what to do next based on which variant of +`Ordering` was returned from the call to `cmp` with the values in `guess` and +`secret_number`. + +A `match` expression is made up of *arms*. An arm consists of a *pattern* to +match against, and the code that should be run if the value given to `match` +fits that arm’s pattern. Rust takes the value given to `match` and looks +through each arm’s pattern in turn. Patterns and the `match` construct are +powerful Rust features: they let you express a variety of situations your code +might encounter and they make sure you handle them all. These features will be +covered in detail in Chapter 6 and Chapter 18, respectively. + +Let’s walk through an example with the `match` expression we use here. Say that +the user has guessed 50 and the randomly generated secret number this time is +38. + +When the code compares 50 to 38, the `cmp` method will return +`Ordering::Greater` because 50 is greater than 38. The `match` expression gets +the `Ordering::Greater` value and starts checking each arm’s pattern. It looks +at the first arm’s pattern, `Ordering::Less`, and sees that the value +`Ordering::Greater` does not match `Ordering::Less`, so it ignores the code in +that arm and moves to the next arm. The next arm’s pattern is +`Ordering::Greater`, which *does* match `Ordering::Greater`! The associated +code in that arm will execute and print `Too big!` to the screen. The `match` +expression ends after the first successful match, so it won’t look at the last +arm in this scenario. + +However, the code in Listing 2-4 won’t compile yet. Let’s try it: + +``` +$ cargo build + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) +error[E0308]: mismatched types + --> src/main.rs:22:21 + | +22 | match guess.cmp(&secret_number) { + | ^^^^^^^^^^^^^^ expected struct `String`, found integer + | + = note: expected reference `&String` + found reference `&{integer}` +``` + +The core of the error states that there are *mismatched types*. Rust has a +strong, static type system. However, it also has type inference. When we wrote +`let mut guess = String::new()`, Rust was able to infer that `guess` should be +a `String` and didn’t make us write the type. The `secret_number`, on the other +hand, is a number type. A few of Rust’s number types can have a value between 1 +and 100: `i32`, a 32-bit number; `u32`, an unsigned 32-bit number; `i64`, a +64-bit number; as well as others. Unless otherwise specified, Rust defaults to +an `i32`, which is the type of `secret_number` unless you add type information +elsewhere that would cause Rust to infer a different numerical type. The reason +for the error is that Rust cannot compare a string and a number type. + +Ultimately, we want to convert the `String` the program reads as input into a +real number type so we can compare it numerically to the secret number. We do +so by adding this line to the `main` function body: + +Filename: src/main.rs + +``` +--snip-- + +let mut guess = String::new(); + +io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + +let guess: u32 = guess + .trim() + .parse() + .expect("Please type a number!"); + +println!("You guessed: {guess}"); + +match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), +} +``` + +We create a variable named `guess`. But wait, doesn’t the program already have +a variable named `guess`? It does, but helpfully Rust allows us to shadow the +previous value of `guess` with a new one. *Shadowing* lets us reuse the `guess` +variable name rather than forcing us to create two unique variables, such as +`guess_str` and `guess`, for example. We’ll cover this in more detail in +Chapter 3, but for now, know that this feature is often used when you want to +convert a value from one type to another type. + +We bind this new variable to the expression `guess.trim().parse()`. The `guess` +in the expression refers to the original `guess` variable that contained the +input as a string. The `trim` method on a `String` instance will eliminate any +whitespace at the beginning and end, which we must do to be able to compare the +string to the `u32`, which can only contain numerical data. The user must press +enter to satisfy `read_line` and input their guess, which adds a newline +character to the string. For example, if the user types `5` and presses enter, +`guess` looks like this: `5\n`. The `\n` represents “newline.” (On Windows, +pressing enter results in a carriage return and a newline, `\r\n`.) The `trim` +method eliminates `\n` or `\r\n`, resulting in just `5`. + +The `parse` method on strings converts a string to another type. Here, we use +it to convert from a string to a number. We need to tell Rust the exact number +type we want by using `let guess: u32`. The colon (`:`) after `guess` tells +Rust we’ll annotate the variable’s type. Rust has a few built-in number types; +the `u32` seen here is an unsigned, 32-bit integer. It’s a good default choice +for a small positive number. You’ll learn about other number types in Chapter 3. + +Additionally, the `u32` annotation in this example program and the comparison +with `secret_number` means Rust will infer that `secret_number` should be a +`u32` as well. So now the comparison will be between two values of the same +type! + +The `parse` method will only work on characters that can logically be converted +into numbers and so can easily cause errors. If, for example, the string +contained `A`👍`%`, there would be no way to convert that to a number. Because +it might fail, the `parse` method returns a `Result` type, much as the +`read_line` method does (discussed earlier in “Handling Potential Failure with +Result” on page XX). We’ll treat this `Result` the same way by using the +`expect` method again. If `parse` returns an `Err` `Result` variant because it +couldn’t create a number from the string, the `expect` call will crash the game +and print the message we give it. If `parse` can successfully convert the +string to a number, it will return the `Ok` variant of `Result`, and `expect` +will return the number that we want from the `Ok` value. + +Let’s run the program now: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 0.43s + Running `target/debug/guessing_game` +Guess the number! +The secret number is: 58 +Please input your guess. + 76 +You guessed: 76 +Too big! +``` + +Nice! Even though spaces were added before the guess, the program still figured +out that the user guessed 76. Run the program a few times to verify the +different behavior with different kinds of input: guess the number correctly, +guess a number that is too high, and guess a number that is too low. + +We have most of the game working now, but the user can make only one guess. +Let’s change that by adding a loop! + +## Allowing Multiple Guesses with Looping + +The `loop` keyword creates an infinite loop. We’ll add a loop to give users +more chances at guessing the number: + +Filename: src/main.rs + +``` +--snip-- + +println!("The secret number is: {secret_number}"); + +loop { + println!("Please input your guess."); + + --snip-- + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => println!("You win!"), + } +} +``` + +As you can see, we’ve moved everything from the guess input prompt onward into +a loop. Be sure to indent the lines inside the loop another four spaces each +and run the program again. The program will now ask for another guess forever, +which actually introduces a new problem. It doesn’t seem like the user can quit! + +The user could always interrupt the program by using the keyboard shortcut +ctrl-C. But there’s another way to escape this insatiable monster, as mentioned +in the `parse` discussion in “Comparing the Guess to the Secret Number” on page +XX: if the user enters a non-number answer, the program will crash. We can take +advantage of that to allow the user to quit, as shown here: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 1.50s + Running `target/debug/guessing_game` +Guess the number! +The secret number is: 59 +Please input your guess. +45 +You guessed: 45 +Too small! +Please input your guess. +60 +You guessed: 60 +Too big! +Please input your guess. +59 +You guessed: 59 +You win! +Please input your guess. +quit +thread 'main' panicked at 'Please type a number!: ParseIntError +{ kind: InvalidDigit }', src/main.rs:28:47 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +Typing `quit` will quit the game, but as you’ll notice, so will entering any +other non-number input. This is suboptimal, to say the least; we want the game +to also stop when the correct number is guessed. + +### Quitting After a Correct Guess + +Let’s program the game to quit when the user wins by adding a `break` statement: + +Filename: src/main.rs + +``` +--snip-- + +match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } +} +``` + +Adding the `break` line after `You win!` makes the program exit the loop when +the user guesses the secret number correctly. Exiting the loop also means +exiting the program, because the loop is the last part of `main`. + +### Handling Invalid Input + +To further refine the game’s behavior, rather than crashing the program when +the user inputs a non-number, let’s make the game ignore a non-number so the +user can continue guessing. We can do that by altering the line where `guess` +is converted from a `String` to a `u32`, as shown in Listing 2-5. + +Filename: src/main.rs + +``` +--snip-- + +io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + +let guess: u32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, +}; + +println!("You guessed: {guess}"); + +--snip-- +``` + +Listing 2-5: Ignoring a non-number guess and asking for another guess instead +of crashing the program + +We switch from an `expect` call to a `match` expression to move from crashing +on an error to handling the error. Remember that `parse` returns a `Result` +type and `Result` is an enum that has the variants `Ok` and `Err`. We’re using +a `match` expression here, as we did with the `Ordering` result of the `cmp` +method. + +If `parse` is able to successfully turn the string into a number, it will +return an `Ok` value that contains the resultant number. That `Ok` value will +match the first arm’s pattern, and the `match` expression will just return the +`num` value that `parse` produced and put inside the `Ok` value. That number +will end up right where we want it in the new `guess` variable we’re creating. + +If `parse` is *not* able to turn the string into a number, it will return an +`Err` value that contains more information about the error. The `Err` value +does not match the `Ok(num)` pattern in the first `match` arm, but it does +match the `Err(_)` pattern in the second arm. The underscore, `_`, is a +catchall value; in this example, we’re saying we want to match all `Err` +values, no matter what information they have inside them. So the program will +execute the second arm’s code, `continue`, which tells the program to go to the +next iteration of the `loop` and ask for another guess. So, effectively, the +program ignores all errors that `parse` might encounter! + +Now everything in the program should work as expected. Let’s try it: + +``` +$ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished dev [unoptimized + debuginfo] target(s) in 4.45s + Running `target/debug/guessing_game` +Guess the number! +The secret number is: 61 +Please input your guess. +10 +You guessed: 10 +Too small! +Please input your guess. +99 +You guessed: 99 +Too big! +Please input your guess. +foo +Please input your guess. +61 +You guessed: 61 +You win! +``` + +Awesome! With one tiny final tweak, we will finish the guessing game. Recall +that the program is still printing the secret number. That worked well for +testing, but it ruins the game. Let’s delete the `println!` that outputs the +secret number. Listing 2-6 shows the final code. + +Filename: src/main.rs + +``` +use rand::Rng; +use std::cmp::Ordering; +use std::io; + +fn main() { + println!("Guess the number!"); + + let secret_number = rand::thread_rng().gen_range(1..=100); + + loop { + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + let guess: u32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + + println!("You guessed: {guess}"); + + match guess.cmp(&secret_number) { + Ordering::Less => println!("Too small!"), + Ordering::Greater => println!("Too big!"), + Ordering::Equal => { + println!("You win!"); + break; + } + } + } +} +``` + +Listing 2-6: Complete guessing game code + +At this point, you’ve successfully built the guessing game. Congratulations! + +## Summary + +This project was a hands-on way to introduce you to many new Rust concepts: +`let`, `match`, functions, the use of external crates, and more. In the next +few chapters, you’ll learn about these concepts in more detail. Chapter 3 +covers concepts that most programming languages have, such as variables, data +types, and functions, and shows how to use them in Rust. Chapter 4 explores +ownership, a feature that makes Rust different from other languages. Chapter 5 +discusses structs and method syntax, and Chapter 6 explains how enums work. + diff --git a/rustbook-ru/nostarch/chapter03.md b/rustbook-ru/nostarch/chapter03.md new file mode 100644 index 000000000..249032fd7 --- /dev/null +++ b/rustbook-ru/nostarch/chapter03.md @@ -0,0 +1,1633 @@ + + +[TOC] + +# Common Programming Concepts + +This chapter covers concepts that appear in almost every programming language +and how they work in Rust. Many programming languages have much in common at +their core. None of the concepts presented in this chapter are unique to Rust, +but we’ll discuss them in the context of Rust and explain the conventions +around using these concepts. + +Specifically, you’ll learn about variables, basic types, functions, comments, +and control flow. These foundations will be in every Rust program, and learning +them early will give you a strong core to start from. + +> ### Keywords +> +> The Rust language has a set of *keywords* that are reserved for use by the +language only, much as in other languages. Keep in mind that you cannot use +these words as names of variables or functions. Most of the keywords have +special meanings, and you’ll be using them to do various tasks in your Rust +programs; a few have no current functionality associated with them but have +been reserved for functionality that might be added to Rust in the future. You +can find a list of the keywords in Appendix A. + +## Variables and Mutability + +As mentioned in “Storing Values with Variables” on page XX, by default, +variables are immutable. This is one of many nudges Rust gives you to write +your code in a way that takes advantage of the safety and easy concurrency that +Rust offers. However, you still have the option to make your variables mutable. +Let’s explore how and why Rust encourages you to favor immutability and why +sometimes you might want to opt out. + +When a variable is immutable, once a value is bound to a name, you can’t change +that value. To illustrate this, generate a new project called *variables* in +your *projects* directory by using `cargo new variables`. + +Then, in your new *variables* directory, open *src/main.rs* and replace its +code with the following code, which won’t compile just yet: + +Filename: src/main.rs + +``` +fn main() { + let x = 5; + println!("The value of x is: {x}"); + x = 6; + println!("The value of x is: {x}"); +} +``` + +Save and run the program using `cargo run`. You should receive an error message +regarding an immutability error, as shown in this output: + +``` +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) +error[E0384]: cannot assign twice to immutable variable `x` + --> src/main.rs:4:5 + | +2 | let x = 5; + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +3 | println!("The value of x is: {x}"); +4 | x = 6; + | ^^^^^ cannot assign twice to immutable variable +``` + +This example shows how the compiler helps you find errors in your programs. +Compiler errors can be frustrating, but really they only mean your program +isn’t safely doing what you want it to do yet; they do *not* mean that you’re +not a good programmer! Experienced Rustaceans still get compiler errors. + +You received the error message `cannot assign twice to immutable variable `x`` +because you tried to assign a second value to the immutable `x` variable. + +It’s important that we get compile-time errors when we attempt to change a +value that’s designated as immutable because this very situation can lead to +bugs. If one part of our code operates on the assumption that a value will +never change and another part of our code changes that value, it’s possible +that the first part of the code won’t do what it was designed to do. The cause +of this kind of bug can be difficult to track down after the fact, especially +when the second piece of code changes the value only *sometimes*. The Rust +compiler guarantees that when you state that a value won’t change, it really +won’t change, so you don’t have to keep track of it yourself. Your code is thus +easier to reason through. + +But mutability can be very useful, and can make code more convenient to write. +Although variables are immutable by default, you can make them mutable by +adding `mut` in front of the variable name as you did in Chapter 2. Adding +`mut` also conveys intent to future readers of the code by indicating that +other parts of the code will be changing this variable’s value. + +For example, let’s change *src/main.rs* to the following: + +Filename: src/main.rs + +``` +fn main() { + let mut x = 5; + println!("The value of x is: {x}"); + x = 6; + println!("The value of x is: {x}"); +} +``` + +When we run the program now, we get this: + +``` +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) + Finished dev [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/variables` +The value of x is: 5 +The value of x is: 6 +``` + +We’re allowed to change the value bound to `x` from `5` to `6` when `mut` is +used. Ultimately, deciding whether to use mutability or not is up to you and +depends on what you think is clearest in that particular situation. + +### Constants + +Like immutable variables, *constants* are values that are bound to a name and +are not allowed to change, but there are a few differences between constants +and variables. + +First, you aren’t allowed to use `mut` with constants. Constants aren’t just +immutable by default—they’re always immutable. You declare constants using the +`const` keyword instead of the `let` keyword, and the type of the value *must* +be annotated. We’ll cover types and type annotations in “Data Types” on page +XX, so don’t worry about the details right now. Just know that you must always +annotate the type. + +Constants can be declared in any scope, including the global scope, which makes +them useful for values that many parts of code need to know about. + +The last difference is that constants may be set only to a constant expression, +not the result of a value that could only be computed at runtime. + +Here’s an example of a constant declaration: + +``` +const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3; +``` + +The constant’s name is `THREE_HOURS_IN_SECONDS` and its value is set to the +result of multiplying 60 (the number of seconds in a minute) by 60 (the number +of minutes in an hour) by 3 (the number of hours we want to count in this +program). Rust’s naming convention for constants is to use all uppercase with +underscores between words. The compiler is able to evaluate a limited set of +operations at compile time, which lets us choose to write out this value in a +way that’s easier to understand and verify, rather than setting this constant +to the value `10,800`. See the Rust Reference’s section on constant evaluation +at *https://doc.rust-lang.org/reference/const_eval.html* for more information +on what operations can be used when declaring constants. + +Constants are valid for the entire time a program runs, within the scope in +which they were declared. This property makes constants useful for values in +your application domain that multiple parts of the program might need to know +about, such as the maximum number of points any player of a game is allowed to +earn, or the speed of light. + +Naming hardcoded values used throughout your program as constants is useful in +conveying the meaning of that value to future maintainers of the code. It also +helps to have only one place in your code you would need to change if the +hardcoded value needed to be updated in the future. + +### Shadowing + +As you saw in the guessing game tutorial in Chapter 2, you can declare a new +variable with the same name as a previous variable. Rustaceans say that the +first variable is *shadowed* by the second, which means that the second +variable is what the compiler will see when you use the name of the variable. +In effect, the second variable overshadows the first, taking any uses of the +variable name to itself until either it itself is shadowed or the scope ends. +We can shadow a variable by using the same variable’s name and repeating the +use of the `let` keyword as follows: + +Filename: src/main.rs + +``` +fn main() { + let x = 5; + + let x = x + 1; + + { + let x = x * 2; + println!("The value of x in the inner scope is: {x}"); + } + + println!("The value of x is: {x}"); +} +``` + +This program first binds `x` to a value of `5`. Then it creates a new variable +`x` by repeating `let x =`, taking the original value and adding `1` so the +value of `x` is then `6`. Then, within an inner scope created with the curly +brackets, the third `let` statement also shadows `x` and creates a new +variable, multiplying the previous value by `2` to give `x` a value of `12`. +When that scope is over, the inner shadowing ends and `x` returns to being `6`. +When we run this program, it will output the following: + +``` +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) + Finished dev [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/variables` +The value of x in the inner scope is: 12 +The value of x is: 6 +``` + +Shadowing is different from marking a variable as `mut` because we’ll get a +compile-time error if we accidentally try to reassign to this variable without +using the `let` keyword. By using `let`, we can perform a few transformations +on a value but have the variable be immutable after those transformations have +been completed. + +The other difference between `mut` and shadowing is that because we’re +effectively creating a new variable when we use the `let` keyword again, we can +change the type of the value but reuse the same name. For example, say our +program asks a user to show how many spaces they want between some text by +inputting space characters, and then we want to store that input as a number: + +``` +let spaces = " "; +let spaces = spaces.len(); +``` + +The first `spaces` variable is a string type and the second `spaces` variable +is a number type. Shadowing thus spares us from having to come up with +different names, such as `spaces_str` and `spaces_num`; instead, we can reuse +the simpler `spaces` name. However, if we try to use `mut` for this, as shown +here, we’ll get a compile-time error: + +``` +let mut spaces = " "; +spaces = spaces.len(); +``` + +The error says we’re not allowed to mutate a variable’s type: + +``` +$ cargo run + Compiling variables v0.1.0 (file:///projects/variables) +error[E0308]: mismatched types + --> src/main.rs:3:14 + | +2 | let mut spaces = " "; + | ----- expected due to this value +3 | spaces = spaces.len(); + | ^^^^^^^^^^^^ expected `&str`, found `usize` +``` + +Now that we’ve explored how variables work, let’s look at more data types they +can have. + +## Data Types + +Every value in Rust is of a certain *data type*, which tells Rust what kind of +data is being specified so it knows how to work with that data. We’ll look at +two data type subsets: scalar and compound. + +Keep in mind that Rust is a *statically typed* language, which means that it +must know the types of all variables at compile time. The compiler can usually +infer what type we want to use based on the value and how we use it. In cases +when many types are possible, such as when we converted a `String` to a numeric +type using `parse` in “Comparing the Guess to the Secret Number” on page XX, we +must add a type annotation, like this: + +``` +let guess: u32 = "42".parse().expect("Not a number!"); +``` + +If we don’t add the `: u32` type annotation shown in the preceding code, Rust +will display the following error, which means the compiler needs more +information from us to know which type we want to use: + +``` +$ cargo build + Compiling no_type_annotations v0.1.0 (file:///projects/no_type_annotations) +error[E0282]: type annotations needed + --> src/main.rs:2:9 + | +2 | let guess = "42".parse().expect("Not a number!"); + | ^^^^^ consider giving `guess` a type +``` + +You’ll see different type annotations for other data types. + +### Scalar Types + +A *scalar* type represents a single value. Rust has four primary scalar types: +integers, floating-point numbers, Booleans, and characters. You may recognize +these from other programming languages. Let’s jump into how they work in Rust. + +#### Integer Types + +An *integer* is a number without a fractional component. We used one integer +type in Chapter 2, the `u32` type. This type declaration indicates that the +value it’s associated with should be an unsigned integer (signed integer types +start with `i` instead of `u`) that takes up 32 bits of space. Table 3-1 shows +the built-in integer types in Rust. We can use any of these variants to declare +the type of an integer value. + +Table 3-1: Integer Types in Rust + +| Length | Signed | Unsigned | +|---|---|---| +| 8-bit | `i8` | `u8` | +| 16-bit | `i16` | `u16` | +| 32-bit | `i32` | `u32` | +| 64-bit | `i64` | `u64` | +| 128-bit | `i128` | `u128` | +| arch | `isize` | `usize` | + +Each variant can be either signed or unsigned and has an explicit size. +*Signed* and *unsigned* refer to whether it’s possible for the number to be +negative—in other words, whether the number needs to have a sign with it +(signed) or whether it will only ever be positive and can therefore be +represented without a sign (unsigned). It’s like writing numbers on paper: when +the sign matters, a number is shown with a plus sign or a minus sign; however, +when it’s safe to assume the number is positive, it’s shown with no sign. +Signed numbers are stored using two’s complement representation. + +Each signed variant can store numbers from -(2n - 1) to 2n - +1 - 1 inclusive, where *n* is the number of bits that variant uses. So an +`i8` can store numbers from -(27) to 27 - 1, which equals +-128 to 127. Unsigned variants can store numbers from 0 to 2n - 1, +so a `u8` can store numbers from 0 to 28 - 1, which equals 0 to 255. + +Additionally, the `isize` and `usize` types depend on the architecture of the +computer your program is running on, which is denoted in the table as “arch”: +64 bits if you’re on a 64-bit architecture and 32 bits if you’re on a 32-bit +architecture. + +You can write integer literals in any of the forms shown in Table 3-2. Note +that number literals that can be multiple numeric types allow a type suffix, +such as `57u8`, to designate the type. Number literals can also use `_` as a +visual separator to make the number easier to read, such as `1_000`, which will +have the same value as if you had specified `1000`. + +Table 3-2: Integer Literals in Rust + +| Number literals | Example | +|---|---| +| Decimal | `98_222` | +| Hex | `0xff` | +| Octal | `0o77` | +| Binary | `0b1111_0000` | +| Byte (`u8` only) | `b'A'` | + +So how do you know which type of integer to use? If you’re unsure, Rust’s +defaults are generally good places to start: integer types default to `i32`. +The primary situation in which you’d use `isize` or `usize` is when indexing +some sort of collection. + +> ### Integer Overflow +> +> Let’s say you have a variable of type `u8` that can hold values between 0 and +255. If you try to change the variable to a value outside that range, such as +256, *integer overflow* will occur, which can result in one of two behaviors. +When you’re compiling in debug mode, Rust includes checks for integer overflow +that cause your program to *panic* at runtime if this behavior occurs. Rust +uses the term *panicking* when a program exits with an error; we’ll discuss +panics in more depth in “Unrecoverable Errors with panic!” on page XX. +> +> When you’re compiling in release mode with the `--release` flag, Rust does +*not* include checks for integer overflow that cause panics. Instead, if +overflow occurs, Rust performs *two’s complement wrapping*. In short, values +greater than the maximum value the type can hold “wrap around” to the minimum +of the values the type can hold. In the case of a `u8`, the value 256 becomes +0, the value 257 becomes 1, and so on. The program won’t panic, but the +variable will have a value that probably isn’t what you were expecting it to +have. Relying on integer overflow’s wrapping behavior is considered an error. +> +> To explicitly handle the possibility of overflow, you can use these families +of methods provided by the standard library for primitive numeric types: +> +> * Wrap in all modes with the `wrapping_*` methods, such as `wrapping_add`. +> * Return the `None` value if there is overflow with the `checked_*` methods. +> * Return the value and a boolean indicating whether there was overflow with +the `overflowing_*` methods. +> * Saturate at the value’s minimum or maximum values with the `saturating_*` +methods. + +#### Floating-Point Types + +Rust also has two primitive types for *floating-point numbers*, which are +numbers with decimal points. Rust’s floating-point types are `f32` and `f64`, +which are 32 bits and 64 bits in size, respectively. The default type is `f64` +because on modern CPUs, it’s roughly the same speed as `f32` but is capable of +more precision. All floating-point types are signed. + +Here’s an example that shows floating-point numbers in action: + +Filename: src/main.rs + +``` +fn main() { + let x = 2.0; // f64 + + let y: f32 = 3.0; // f32 +} +``` + +Floating-point numbers are represented according to the IEEE-754 standard. The +`f32` type is a single-precision float, and `f64` has double precision. + +#### Numeric Operations + +Rust supports the basic mathematical operations you’d expect for all the number +types: addition, subtraction, multiplication, division, and remainder. Integer +division truncates toward zero to the nearest integer. The following code shows +how you’d use each numeric operation in a `let` statement: + +Filename: src/main.rs + +``` +fn main() { + // addition + let sum = 5 + 10; + + // subtraction + let difference = 95.5 - 4.3; + + // multiplication + let product = 4 * 30; + + // division + let quotient = 56.7 / 32.2; + let truncated = -5 / 3; // Results in -1 + + // remainder + let remainder = 43 % 5; +} +``` + +Each expression in these statements uses a mathematical operator and evaluates +to a single value, which is then bound to a variable. Appendix B contains a +list of all operators that Rust provides. + +#### The Boolean Type + +As in most other programming languages, a Boolean type in Rust has two possible +values: `true` and `false`. Booleans are one byte in size. The Boolean type in +Rust is specified using `bool`. For example: + +Filename: src/main.rs + +``` +fn main() { + let t = true; + + let f: bool = false; // with explicit type annotation +} +``` + +The main way to use Boolean values is through conditionals, such as an `if` +expression. We’ll cover how `if` expressions work in Rust in “Control Flow” on +page XX. + +#### The Character Type + +Rust’s `char` type is the language’s most primitive alphabetic type. Here are +some examples of declaring `char` values: + +Filename: src/main.rs + +``` +fn main() { + let c = 'z'; + let z: char = 'ℤ'; // with explicit type annotation + let heart_eyed_cat = '😻'; +} +``` + +Note that we specify `char` literals with single quotes, as opposed to string +literals, which use double quotes. Rust’s `char` type is four bytes in size and +represents a Unicode Scalar Value, which means it can represent a lot more than +just ASCII. Accented letters; Chinese, Japanese, and Korean characters; emoji; +and zero-width spaces are all valid `char` values in Rust. Unicode Scalar +Values range from `U+0000` to `U+D7FF` and `U+E000` to `U+10FFFF` inclusive. +However, a “character” isn’t really a concept in Unicode, so your human +intuition for what a “character” is may not match up with what a `char` is in +Rust. We’ll discuss this topic in detail in “Storing UTF-8 Encoded Text with +Strings” on page XX. + +### Compound Types + +*Compound types* can group multiple values into one type. Rust has two +primitive compound types: tuples and arrays. + +#### The Tuple Type + +A *tuple* is a general way of grouping together a number of values with a +variety of types into one compound type. Tuples have a fixed length: once +declared, they cannot grow or shrink in size. + +We create a tuple by writing a comma-separated list of values inside +parentheses. Each position in the tuple has a type, and the types of the +different values in the tuple don’t have to be the same. We’ve added optional +type annotations in this example: + +Filename: src/main.rs + +``` +fn main() { + let tup: (i32, f64, u8) = (500, 6.4, 1); +} +``` + +The variable `tup` binds to the entire tuple because a tuple is considered a +single compound element. To get the individual values out of a tuple, we can +use pattern matching to destructure a tuple value, like this: + +Filename: src/main.rs + +``` +fn main() { + let tup = (500, 6.4, 1); + + let (x, y, z) = tup; + + println!("The value of y is: {y}"); +} +``` + +This program first creates a tuple and binds it to the variable `tup`. It then +uses a pattern with `let` to take `tup` and turn it into three separate +variables, `x`, `y`, and `z`. This is called *destructuring* because it breaks +the single tuple into three parts. Finally, the program prints the value of +`y`, which is `6.4`. + +We can also access a tuple element directly by using a period (`.`) followed by +the index of the value we want to access. For example: + +Filename: src/main.rs + +``` +fn main() { + let x: (i32, f64, u8) = (500, 6.4, 1); + + let five_hundred = x.0; + + let six_point_four = x.1; + + let one = x.2; +} +``` + +This program creates the tuple `x` and then accesses each element of the tuple +using their respective indices. As with most programming languages, the first +index in a tuple is 0. + +The tuple without any values has a special name, *unit*. This value and its +corresponding type are both written `()` and represent an empty value or an +empty return type. Expressions implicitly return the unit value if they don’t +return any other value. + +#### The Array Type + +Another way to have a collection of multiple values is with an *array*. Unlike +a tuple, every element of an array must have the same type. Unlike arrays in +some other languages, arrays in Rust have a fixed length. + +We write the values in an array as a comma-separated list inside square +brackets: + +Filename: src/main.rs + +``` +fn main() { + let a = [1, 2, 3, 4, 5]; +} +``` + +Arrays are useful when you want your data allocated on the stack rather than +the heap (we will discuss the stack and the heap more in Chapter 4) or when you +want to ensure you always have a fixed number of elements. An array isn’t as +flexible as the vector type, though. A *vector* is a similar collection type +provided by the standard library that *is* allowed to grow or shrink in size. +If you’re unsure whether to use an array or a vector, chances are you should +use a vector. Chapter 8 discusses vectors in more detail. + +However, arrays are more useful when you know the number of elements will not +need to change. For example, if you were using the names of the month in a +program, you would probably use an array rather than a vector because you know +it will always contain 12 elements: + +``` +let months = ["January", "February", "March", "April", "May", "June", "July", + "August", "September", "October", "November", "December"]; +``` + +You write an array’s type using square brackets with the type of each element, +a semicolon, and then the number of elements in the array, like so: + +``` +let a: [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. + +You can also initialize an array to contain the same value for each element by +specifying the initial value, followed by a semicolon, and then the length of +the array in square brackets, as shown here: + +``` +let a = [3; 5]; +``` + +The array named `a` will contain `5` elements that will all be set to the value +`3` initially. This is the same as writing `let a = [3, 3, 3, 3, 3];` but in a +more concise way. + +#### Accessing Array Elements + +An array is a single chunk of memory of a known, fixed size that can be +allocated on the stack. You can access elements of an array using indexing, +like this: + +Filename: src/main.rs + +``` +fn main() { + let a = [1, 2, 3, 4, 5]; + + let first = a[0]; + let second = a[1]; +} +``` + +In this example, the variable named `first` will get the value `1` because that +is the value at index `[0]` in the array. The variable named `second` will get +the value `2` from index `[1]` in the array. + +#### Invalid Array Element Access + +Let’s see what happens if you try to access an element of an array that is past +the end of the array. Say you run this code, similar to the guessing game in +Chapter 2, to get an array index from the user: + +Filename: src/main.rs + +``` +use std::io; + +fn main() { + let a = [1, 2, 3, 4, 5]; + + println!("Please enter an array index."); + + let mut index = String::new(); + + io::stdin() + .read_line(&mut index) + .expect("Failed to read line"); + + let index: usize = index + .trim() + .parse() + .expect("Index entered was not a number"); + + let element = a[index]; + + println!( + "The value of the element at index {index} is: {element}" + ); +} +``` + +This code compiles successfully. If you run this code using `cargo run` and +enter `0`, `1`, `2`, `3`, or `4`, the program will print out the corresponding +value at that index in the array. If you instead enter a number past the end of +the array, such as `10`, you’ll see output like this: + +``` +thread 'main' panicked at 'index out of bounds: the len is 5 but the index is +10', src/main.rs:19:19 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +The program resulted in a *runtime* error at the point of using an invalid +value in the indexing operation. The program exited with an error message and +didn’t execute the final `println!` statement. When you attempt to access an +element using indexing, Rust will check that the index you’ve specified is less +than the array length. If the index is greater than or equal to the length, +Rust will panic. This check has to happen at runtime, especially in this case, +because the compiler can’t possibly know what value a user will enter when they +run the code later. + +This is an example of Rust’s memory safety principles in action. In many +low-level languages, this kind of check is not done, and when you provide an +incorrect index, invalid memory can be accessed. Rust protects you against this +kind of error by immediately exiting instead of allowing the memory access and +continuing. Chapter 9 discusses more of Rust’s error handling and how you can +write readable, safe code that neither panics nor allows invalid memory access. + +## Functions + +Functions are prevalent in Rust code. You’ve already seen one of the most +important functions in the language: the `main` function, which is the entry +point of many programs. You’ve also seen the `fn` keyword, which allows you to +declare new functions. + +Rust code uses *snake case* as the conventional style for function and variable +names, in which all letters are lowercase and underscores separate words. +Here’s a program that contains an example function definition: + +Filename: src/main.rs + +``` +fn main() { + println!("Hello, world!"); + + another_function(); +} + +fn another_function() { + println!("Another function."); +} +``` + +We define a function in Rust by entering `fn` followed by a function name and a +set of parentheses. The curly brackets tell the compiler where the function +body begins and ends. + +We can call any function we’ve defined by entering its name followed by a set +of parentheses. Because `another_function` is defined in the program, it can be +called from inside the `main` function. Note that we defined `another_function` +*after* the `main` function in the source code; we could have defined it before +as well. Rust doesn’t care where you define your functions, only that they’re +defined somewhere in a scope that can be seen by the caller. + +Let’s start a new binary project named *functions* to explore functions +further. Place the `another_function` example in *src/main.rs* and run it. You +should see the following output: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished dev [unoptimized + debuginfo] target(s) in 0.28s + Running `target/debug/functions` +Hello, world! +Another function. +``` + +The lines execute in the order in which they appear in the `main` function. +First the “Hello, world!” message prints, and then `another_function` is called +and its message is printed. + +### Parameters + +We can define functions to have *parameters*, which are special variables that +are part of a function’s signature. When a function has parameters, you can +provide it with concrete values for those parameters. Technically, the concrete +values are called *arguments*, but in casual conversation, people tend to use +the words *parameter* and *argument* interchangeably for either the variables +in a function’s definition or the concrete values passed in when you call a +function. + +In this version of `another_function` we add a parameter: + +Filename: src/main.rs + +``` +fn main() { + another_function(5); +} + +fn another_function(x: i32) { + println!("The value of x is: {x}"); +} +``` + +Try running this program; you should get the following output: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished dev [unoptimized + debuginfo] target(s) in 1.21s + Running `target/debug/functions` +The value of x is: 5 +``` + +The declaration of `another_function` has one parameter named `x`. The type of +`x` is specified as `i32`. When we pass `5` in to `another_function`, the +`println!` macro puts `5` where the pair of curly brackets containing `x` was +in the format string. + +In function signatures, you *must* declare the type of each parameter. This is +a deliberate decision in Rust’s design: requiring type annotations in function +definitions means the compiler almost never needs you to use them elsewhere in +the code to figure out what type you mean. The compiler is also able to give +more helpful error messages if it knows what types the function expects. + +When defining multiple parameters, separate the parameter declarations with +commas, like this: + +Filename: src/main.rs + +``` +fn main() { + print_labeled_measurement(5, 'h'); +} + +fn print_labeled_measurement(value: i32, unit_label: char) { + println!("The measurement is: {value}{unit_label}"); +} +``` + +This example creates a function named `print_labeled_measurement` with two +parameters. The first parameter is named `value` and is an `i32`. The second is +named `unit_label` and is type `char`. The function then prints text containing +both the `value` and the `unit_label`. + +Let’s try running this code. Replace the program currently in your *functions* +project’s *src/main.rs* file with the preceding example and run it using `cargo +run`: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished dev [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/functions` +The measurement is: 5h +``` + +Because we called the function with `5` as the value for `value` and `'h'` as +the value for `unit_label`, the program output contains those values. + +### Statements and Expressions + +Function bodies are made up of a series of statements optionally ending in an +expression. So far, the functions we’ve covered haven’t included an ending +expression, but you have seen an expression as part of a statement. Because +Rust is an expression-based language, this is an important distinction to +understand. Other languages don’t have the same distinctions, so let’s look at +what statements and expressions are and how their differences affect the bodies +of functions. + +* **Statements **: are instructions that perform some action and do not return +a value. +* **Expressions **: evaluate to a resultant value. Let’s look at some examples. + +We’ve actually already used statements and expressions. Creating a variable and +assigning a value to it with the `let` keyword is a statement. In Listing 3-1, +`let y = 6;` is a statement. + +Filename: src/main.rs + +``` +fn main() { + let y = 6; +} +``` + +Listing 3-1: A `main` function declaration containing one statement + +Function definitions are also statements; the entire preceding example is a +statement in itself. + +Statements do not return values. Therefore, you can’t assign a `let` statement +to another variable, as the following code tries to do; you’ll get an error: + +Filename: src/main.rs + +``` +fn main() { + let x = (let y = 6); +} +``` + +When you run this program, the error you’ll get looks like this: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) +error: expected expression, found statement (`let`) + --> src/main.rs:2:14 + | +2 | let x = (let y = 6); + | ^^^^^^^^^ + | + = note: variable declaration using `let` is a statement + +error[E0658]: `let` expressions in this position are unstable + --> src/main.rs:2:14 + | +2 | let x = (let y = 6); + | ^^^^^^^^^ + | + = note: see issue #53667 for +more information +``` + +The `let y = 6` statement does not return a value, so there isn’t anything for +`x` to bind to. This is different from what happens in other languages, such as +C and Ruby, where the assignment returns the value of the assignment. In those +languages, you can write `x = y = 6` and have both `x` and `y` have the value +`6`; that is not the case in Rust. + +Expressions evaluate to a value and make up most of the rest of the code that +you’ll write in Rust. Consider a math operation, such as `5 + 6`, which is an +expression that evaluates to the value `11`. Expressions can be part of +statements: in Listing 3-1, the `6` in the statement `let y = 6;` is an +expression that evaluates to the value `6`. Calling a function is an +expression. Calling a macro is an expression. A new scope block created with +curly brackets is an expression, for example: + +Filename: src/main.rs + +``` +fn main() { + 1 let y = {2 + let x = 3; + 3 x + 1 + }; + + println!("The value of y is: {y}"); +} +``` + +The expression [2] is a block that, in this case, evaluates to `4`. That value +gets bound to `y` as part of the `let` statement [1]. Note the line without a +semicolon at the end [3], which is unlike most of the lines you’ve seen so far. +Expressions do not include ending semicolons. If you add a semicolon to the end +of an expression, you turn it into a statement, and it will then not return a +value. Keep this in mind as you explore function return values and expressions +next. + +### Functions with Return Values + +Functions can return values to the code that calls them. We don’t name return +values, but we must declare their type after an arrow (`->`). In Rust, the +return value of the function is synonymous with the value of the final +expression in the block of the body of a function. You can return early from a +function by using the `return` keyword and specifying a value, but most +functions return the last expression implicitly. Here’s an example of a +function that returns a value: + +Filename: src/main.rs + +``` +fn five() -> i32 { + 5 +} + +fn main() { + let x = five(); + + println!("The value of x is: {x}"); +} +``` + +There are no function calls, macros, or even `let` statements in the `five` +function—just the number `5` by itself. That’s a perfectly valid function in +Rust. Note that the function’s return type is specified too, as `-> i32`. Try +running this code; the output should look like this: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) + Finished dev [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/functions` +The value of x is: 5 +``` + +The `5` in `five` is the function’s return value, which is why the return type +is `i32`. Let’s examine this in more detail. There are two important bits: +first, the line `let x = five();` shows that we’re using the return value of a +function to initialize a variable. Because the function `five` returns a `5`, +that line is the same as the following: + +``` +let x = 5; +``` + +Second, the `five` function has no parameters and defines the type of the +return value, but the body of the function is a lonely `5` with no semicolon +because it’s an expression whose value we want to return. + +Let’s look at another example: + +Filename: src/main.rs + +``` +fn main() { + let x = plus_one(5); + + println!("The value of x is: {x}"); +} + +fn plus_one(x: i32) -> i32 { + x + 1 +} +``` + +Running this code will print `The value of x is: 6`. But if we place a +semicolon at the end of the line containing `x + 1`, changing it from an +expression to a statement, we’ll get an error: + +Filename: src/main.rs + +``` +fn main() { + let x = plus_one(5); + + println!("The value of x is: {x}"); +} + +fn plus_one(x: i32) -> i32 { + x + 1; +} +``` + +Compiling this code produces an error, as follows: + +``` +$ cargo run + Compiling functions v0.1.0 (file:///projects/functions) +error[E0308]: mismatched types + --> src/main.rs:7:24 + | +7 | fn plus_one(x: i32) -> i32 { + | -------- ^^^ expected `i32`, found `()` + | | + | implicitly returns `()` as its body has no tail or `return` expression +8 | x + 1; + | - help: remove this semicolon +``` + +The main error message, `mismatched types`, reveals the core issue with this +code. The definition of the function `plus_one` says that it will return an +`i32`, but statements don’t evaluate to a value, which is expressed by `()`, +the unit type. Therefore, nothing is returned, which contradicts the function +definition and results in an error. In this output, Rust provides a message to +possibly help rectify this issue: it suggests removing the semicolon, which +would fix the error. + +## Comments + +All programmers strive to make their code easy to understand, but sometimes +extra explanation is warranted. In these cases, programmers leave *comments* in +their source code that the compiler will ignore but people reading the source +code may find useful. + +Here’s a simple comment: + +``` +// hello, world +``` + +In Rust, the idiomatic comment style starts a comment with two slashes, and the +comment continues until the end of the line. For comments that extend beyond a +single line, you’ll need to include `//` on each line, like this: + +``` +// So we’re doing something complicated here, long enough that we need +// multiple lines of comments to do it! Whew! Hopefully, this comment will +// explain what’s going on. +``` + +Comments can also be placed at the end of lines containing code: + +Filename: src/main.rs + +``` +fn main() { + let lucky_number = 7; // I’m feeling lucky today +} +``` + +But you’ll more often see them used in this format, with the comment on a +separate line above the code it’s annotating: + +Filename: src/main.rs + +``` +fn main() { + // I’m feeling lucky today + let lucky_number = 7; +} +``` + +Rust also has another kind of comment, documentation comments, which we’ll +discuss in “Publishing a Crate to Crates.io” on page XX. + +## Control Flow + +The ability to run some code depending on whether a condition is `true` and to +run some code repeatedly while a condition is `true` are basic building blocks +in most programming languages. The most common constructs that let you control +the flow of execution of Rust code are `if` expressions and loops. + +### if Expressions + +An `if` expression allows you to branch your code depending on conditions. You +provide a condition and then state, “If this condition is met, run this block +of code. If the condition is not met, do not run this block of code.” + +Create a new project called *branches* in your *projects* directory to explore +the `if` expression. In the *src/main.rs* file, input the following: + +Filename: src/main.rs + +``` +fn main() { + let number = 3; + + if number < 5 { + println!("condition was true"); + } else { + println!("condition was false"); + } +} +``` + +All `if` expressions start with the keyword `if`, followed by a condition. In +this case, the condition checks whether or not the variable `number` has a +value less than 5. We place the block of code to execute if the condition is +`true` immediately after the condition inside curly brackets. Blocks of code +associated with the conditions in `if` expressions are sometimes called *arms*, +just like the arms in `match` expressions that we discussed in “Comparing the +Guess to the Secret Number” on page XX. + +Optionally, we can also include an `else` expression, which we chose to do +here, to give the program an alternative block of code to execute should the +condition evaluate to `false`. If you don’t provide an `else` expression and +the condition is `false`, the program will just skip the `if` block and move on +to the next bit of code. + +Try running this code; you should see the following output: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished dev [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +condition was true +``` + +Let’s try changing the value of `number` to a value that makes the condition +`false` to see what happens: + +``` + let number = 7; +``` + +Run the program again, and look at the output: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished dev [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +condition was false +``` + +It’s also worth noting that the condition in this code *must* be a `bool`. If +the condition isn’t a `bool`, we’ll get an error. For example, try running the +following code: + +Filename: src/main.rs + +``` +fn main() { + let number = 3; + + if number { + println!("number was three"); + } +} +``` + +The `if` condition evaluates to a value of `3` this time, and Rust throws an +error: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) +error[E0308]: mismatched types + --> src/main.rs:4:8 + | +4 | if number { + | ^^^^^^ expected `bool`, found integer +``` + +The error indicates that Rust expected a `bool` but got an integer. Unlike +languages such as Ruby and JavaScript, Rust will not automatically try to +convert non-Boolean types to a Boolean. You must be explicit and always provide +`if` with a Boolean as its condition. If we want the `if` code block to run +only when a number is not equal to `0`, for example, we can change the `if` +expression to the following: + +Filename: src/main.rs + +``` +fn main() { + let number = 3; + + if number != 0 { + println!("number was something other than zero"); + } +} +``` + +Running this code will print `number was something other than zero`. + +#### Handling Multiple Conditions with else if + +You can use multiple conditions by combining `if` and `else` in an `else if` +expression. For example: + +Filename: src/main.rs + +``` +fn main() { + let number = 6; + + if number % 4 == 0 { + println!("number is divisible by 4"); + } else if number % 3 == 0 { + println!("number is divisible by 3"); + } else if number % 2 == 0 { + println!("number is divisible by 2"); + } else { + println!("number is not divisible by 4, 3, or 2"); + } +} +``` + +This program has four possible paths it can take. After running it, you should +see the following output: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished dev [unoptimized + debuginfo] target(s) in 0.31s + Running `target/debug/branches` +number is divisible by 3 +``` + +When this program executes, it checks each `if` expression in turn and executes +the first body for which the condition evaluates to `true`. Note that even +though 6 is divisible by 2, we don’t see the output `number is divisible by 2`, +nor do we see the `number is not divisible by 4, 3, or 2` text from the `else` +block. That’s because Rust only executes the block for the first `true` +condition, and once it finds one, it doesn’t even check the rest. + +Using too many `else if` expressions can clutter your code, so if you have more +than one, you might want to refactor your code. Chapter 6 describes a powerful +Rust branching construct called `match` for these cases. + +#### Using if in a let Statement + +Because `if` is an expression, we can use it on the right side of a `let` +statement to assign the outcome to a variable, as in Listing 3-2. + +Filename: src/main.rs + +``` +fn main() { + let condition = true; + let number = if condition { 5 } else { 6 }; + + println!("The value of number is: {number}"); +} +``` + +Listing 3-2: Assigning the result of an `if` expression to a variable + +The `number` variable will be bound to a value based on the outcome of the `if` +expression. Run this code to see what happens: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) + Finished dev [unoptimized + debuginfo] target(s) in 0.30s + Running `target/debug/branches` +The value of number is: 5 +``` + +Remember that blocks of code evaluate to the last expression in them, and +numbers by themselves are also expressions. In this case, the value of the +whole `if` expression depends on which block of code executes. This means the +values that have the potential to be results from each arm of the `if` must be +the same type; in Listing 3-2, the results of both the `if` arm and the `else` +arm were `i32` integers. If the types are mismatched, as in the following +example, we’ll get an error: + +Filename: src/main.rs + +``` +fn main() { + let condition = true; + + let number = if condition { 5 } else { "six" }; + + println!("The value of number is: {number}"); +} +``` + +When we try to compile this code, we’ll get an error. The `if` and `else` arms +have value types that are incompatible, and Rust indicates exactly where to +find the problem in the program: + +``` +$ cargo run + Compiling branches v0.1.0 (file:///projects/branches) +error[E0308]: `if` and `else` have incompatible types + --> src/main.rs:4:44 + | +4 | let number = if condition { 5 } else { "six" }; + | - ^^^^^ expected integer, found +`&str` + | | + | expected because of this +``` + +The expression in the `if` block evaluates to an integer, and the expression in +the `else` block evaluates to a string. This won’t work because variables must +have a single type, and Rust needs to know at compile time what type the +`number` variable is, definitively. Knowing the type of `number` lets the +compiler verify the type is valid everywhere we use `number`. Rust wouldn’t be +able to do that if the type of `number` was only determined at runtime; the +compiler would be more complex and would make fewer guarantees about the code +if it had to keep track of multiple hypothetical types for any variable. + +### Repetition with Loops + +It’s often useful to execute a block of code more than once. For this task, +Rust provides several *loops*, which will run through the code inside the loop +body to the end and then start immediately back at the beginning. To experiment +with loops, let’s make a new project called *loops*. + +Rust has three kinds of loops: `loop`, `while`, and `for`. Let’s try each one. + +#### Repeating Code with loop + +The `loop` keyword tells Rust to execute a block of code over and over again +forever or until you explicitly tell it to stop. + +As an example, change the *src/main.rs* file in your *loops* directory to look +like this: + +Filename: src/main.rs + +``` +fn main() { + loop { + println!("again!"); + } +} +``` + +When we run this program, we’ll see `again!` printed over and over continuously +until we stop the program manually. Most terminals support the keyboard +shortcut ctrl-C to interrupt a program that is stuck in a continual loop. Give +it a try: + +``` +$ cargo run + Compiling loops v0.1.0 (file:///projects/loops) + Finished dev [unoptimized + debuginfo] target(s) in 0.29s + Running `target/debug/loops` +again! +again! +again! +again! +^Cagain! +``` + +The symbol `^C` represents where you pressed ctrl-C. You may or may not see the +word `again!` printed after the `^C`, depending on where the code was in the +loop when it received the interrupt signal. + +Fortunately, Rust also provides a way to break out of a loop using code. You +can place the `break` keyword within the loop to tell the program when to stop +executing the loop. Recall that we did this in the guessing game in “Quitting +After a Correct Guess” on page XX to exit the program when the user won the +game by guessing the correct number. + +We also used `continue` in the guessing game, which in a loop tells the program +to skip over any remaining code in this iteration of the loop and go to the +next iteration. + +#### Returning Values from Loops + +One of the uses of a `loop` is to retry an operation you know might fail, such +as checking whether a thread has completed its job. You might also need to pass +the result of that operation out of the loop to the rest of your code. To do +this, you can add the value you want returned after the `break` expression you +use to stop the loop; that value will be returned out of the loop so you can +use it, as shown here: + +``` +fn main() { + let mut counter = 0; + + let result = loop { + counter += 1; + + if counter == 10 { + break counter * 2; + } + }; + + println!("The result is {result}"); +} +``` + +Before the loop, we declare a variable named `counter` and initialize it to +`0`. Then we declare a variable named `result` to hold the value returned from +the loop. On every iteration of the loop, we add `1` to the `counter` variable, +and then check whether the `counter` is equal to `10`. When it is, we use the +`break` keyword with the value `counter * 2`. After the loop, we use a +semicolon to end the statement that assigns the value to `result`. Finally, we +print the value in `result`, which in this case is `20`. + +#### Loop Labels to Disambiguate Between Multiple Loops + +If you have loops within loops, `break` and `continue` apply to the innermost +loop at that point. You can optionally specify a *loop label* on a loop that +you can then use with `break` or `continue` to specify that those keywords +apply to the labeled loop instead of the innermost loop. Loop labels must begin +with a single quote. Here’s an example with two nested loops: + +``` +fn main() { + let mut count = 0; + 'counting_up: loop { + println!("count = {count}"); + let mut remaining = 10; + + loop { + println!("remaining = {remaining}"); + if remaining == 9 { + break; + } + if count == 2 { + break 'counting_up; + } + remaining -= 1; + } + + count += 1; + } + println!("End count = {count}"); +} +``` + +The outer loop has the label `'counting_up`, and it will count up from 0 to 2. +The inner loop without a label counts down from 10 to 9. The first `break` that +doesn’t specify a label will exit the inner loop only. The `break +'counting_up;` statement will exit the outer loop. This code prints: + +``` + Compiling loops v0.1.0 (file:///projects/loops) + Finished dev [unoptimized + debuginfo] target(s) in 0.58s + Running `target/debug/loops` +count = 0 +remaining = 10 +remaining = 9 +count = 1 +remaining = 10 +remaining = 9 +count = 2 +remaining = 10 +End count = 2 +``` + +#### Conditional Loops with while + +A program will often need to evaluate a condition within a loop. While the +condition is `true`, the loop runs. When the condition ceases to be `true`, the +program calls `break`, stopping the loop. It’s possible to implement behavior +like this using a combination of `loop`, `if`, `else`, and `break`; you could +try that now in a program, if you’d like. However, this pattern is so common +that Rust has a built-in language construct for it, called a `while` loop. In +Listing 3-3, we use `while` to loop the program three times, counting down each +time, and then, after the loop, print a message and exit. + +Filename: src/main.rs + +``` +fn main() { + let mut number = 3; + + while number != 0 { + println!("{number}!"); + + number -= 1; + } + + println!("LIFTOFF!!!"); +} +``` + +Listing 3-3: Using a `while` loop to run code while a condition evaluates to +`true` + +This construct eliminates a lot of nesting that would be necessary if you used +`loop`, `if`, `else`, and `break`, and it’s clearer. While a condition +evaluates to `true`, the code runs; otherwise, it exits the loop. + +#### Looping Through a Collection with for + +You can choose to use the `while` construct to loop over the elements of a +collection, such as an array. For example, the loop in Listing 3-4 prints each +element in the array `a`. + +Filename: src/main.rs + +``` +fn main() { + let a = [10, 20, 30, 40, 50]; + let mut index = 0; + + while index < 5 { + println!("the value is: {}", a[index]); + + index += 1; + } +} +``` + +Listing 3-4: Looping through each element of a collection using a `while` loop + +Here, the code counts up through the elements in the array. It starts at index +`0`, and then loops until it reaches the final index in the array (that is, +when `index < 5` is no longer `true`). Running this code will print every +element in the array: + +``` +$ cargo run + Compiling loops v0.1.0 (file:///projects/loops) + Finished dev [unoptimized + debuginfo] target(s) in 0.32s + Running `target/debug/loops` +the value is: 10 +the value is: 20 +the value is: 30 +the value is: 40 +the value is: 50 +``` + +All five array values appear in the terminal, as expected. Even though `index` +will reach a value of `5` at some point, the loop stops executing before trying +to fetch a sixth value from the array. + +However, this approach is error prone; we could cause the program to panic if +the index value or test condition is incorrect. For example, if you changed the +definition of the `a` array to have four elements but forgot to update the +condition to `while index < 4`, the code would panic. It’s also slow, because +the compiler adds runtime code to perform the conditional check of whether the +index is within the bounds of the array on every iteration through the loop. + +As a more concise alternative, you can use a `for` loop and execute some code +for each item in a collection. A `for` loop looks like the code in Listing 3-5. + +Filename: src/main.rs + +``` +fn main() { + let a = [10, 20, 30, 40, 50]; + + for element in a { + println!("the value is: {element}"); + } +} +``` + +Listing 3-5: Looping through each element of a collection using a `for` loop + +When we run this code, we’ll see the same output as in Listing 3-4. More +importantly, we’ve now increased the safety of the code and eliminated the +chance of bugs that might result from going beyond the end of the array or not +going far enough and missing some items. + +Using the `for` loop, you wouldn’t need to remember to change any other code if +you changed the number of values in the array, as you would with the method +used in Listing 3-4. + +The safety and conciseness of `for` loops make them the most commonly used loop +construct in Rust. Even in situations in which you want to run some code a +certain number of times, as in the countdown example that used a `while` loop +in Listing 3-3, most Rustaceans would use a `for` loop. The way to do that +would be to use a `Range`, provided by the standard library, which generates +all numbers in sequence starting from one number and ending before another +number. + +Here’s what the countdown would look like using a `for` loop and another method +we’ve not yet talked about, `rev`, to reverse the range: + +Filename: src/main.rs + +``` +fn main() { + for number in (1..4).rev() { + println!("{number}!"); + } + println!("LIFTOFF!!!"); +} +``` + +This code is a bit nicer, isn’t it? + +## Summary + +You made it! This was a sizable chapter: you learned about variables, scalar +and compound data types, functions, comments, `if` expressions, and loops! To +practice with the concepts discussed in this chapter, try building programs to +do the following: + +* Convert temperatures between Fahrenheit and Celsius. +* Generate the *n*th Fibonacci number. +* Print the lyrics to the Christmas carol “The Twelve Days of Christmas,” +taking advantage of the repetition in the song. + +When you’re ready to move on, we’ll talk about a concept in Rust that *doesn’t* +commonly exist in other programming languages: ownership. + diff --git a/rustbook-ru/nostarch/chapter04.md b/rustbook-ru/nostarch/chapter04.md new file mode 100644 index 000000000..11f7f4944 --- /dev/null +++ b/rustbook-ru/nostarch/chapter04.md @@ -0,0 +1,1284 @@ + + +[TOC] + +# Understanding Ownership + +Ownership is Rust’s most unique feature and has deep implications for the rest +of the language. It enables Rust to make memory safety guarantees without +needing a garbage collector, so it’s important to understand how ownership +works. In this chapter, we’ll talk about ownership as well as several related +features: borrowing, slices, and how Rust lays data out in memory. + +## What Is Ownership? + +*Ownership* is a set of rules that govern how a Rust program manages memory. +All programs have to manage the way they use a computer’s memory while running. +Some languages have garbage collection that regularly looks for no-longer-used +memory as the program runs; in other languages, the programmer must explicitly +allocate and free the memory. Rust uses a third approach: memory is managed +through a system of ownership with a set of rules that the compiler checks. If +any of the rules are violated, the program won’t compile. None of the features +of ownership will slow down your program while it’s running. + +Because ownership is a new concept for many programmers, it does take some time +to get used to. The good news is that the more experienced you become with Rust +and the rules of the ownership system, the easier you’ll find it to naturally +develop code that is safe and efficient. Keep at it! + +When you understand ownership, you’ll have a solid foundation for understanding +the features that make Rust unique. In this chapter, you’ll learn ownership by +working through some examples that focus on a very common data structure: +strings. + +> ### The Stack and the Heap +> +> Many programming languages don’t require you to think about the stack and the +heap very often. But in a systems programming language like Rust, whether a +value is on the stack or the heap affects how the language behaves and why you +have to make certain decisions. Parts of ownership will be described in +relation to the stack and the heap later in this chapter, so here is a brief +explanation in preparation. +> +> Both the stack and the heap are parts of memory available to your code to use +at runtime, but they are structured in different ways. The stack stores values +in the order it gets them and removes the values in the opposite order. This is +referred to as *last in, first out*. Think of a stack of plates: when you add +more plates, you put them on top of the pile, and when you need a plate, you +take one off the top. Adding or removing plates from the middle or bottom +wouldn’t work as well! Adding data is called *pushing onto the stack*, and +removing data is called *popping off the stack*. All data stored on the stack +must have a known, fixed size. Data with an unknown size at compile time or a +size that might change must be stored on the heap instead. +> +> The heap is less organized: when you put data on the heap, you request a +certain amount of space. The memory allocator finds an empty spot in the heap +that is big enough, marks it as being in use, and returns a *pointer*, which is +the address of that location. This process is called *allocating on the heap* +and is sometimes abbreviated as just *allocating* (pushing values onto the +stack is not considered allocating). Because the pointer to the heap is a +known, fixed size, you can store the pointer on the stack, but when you want +the actual data, you must follow the pointer. Think of being seated at a +restaurant. When you enter, you state the number of people in your group, and +the host finds an empty table that fits everyone and leads you there. If +someone in your group comes late, they can ask where you’ve been seated to find +you. +> +> Pushing to the stack is faster than allocating on the heap because the +allocator never has to search for a place to store new data; that location is +always at the top of the stack. Comparatively, allocating space on the heap +requires more work because the allocator must first find a big enough space to +hold the data and then perform bookkeeping to prepare for the next allocation. +> +> Accessing data in the heap is slower than accessing data on the stack because +you have to follow a pointer to get there. Contemporary processors are faster +if they jump around less in memory. Continuing the analogy, consider a server +at a restaurant taking orders from many tables. It’s most efficient to get all +the orders at one table before moving on to the next table. Taking an order +from table A, then an order from table B, then one from A again, and then one +from B again would be a much slower process. By the same token, a processor can +do its job better if it works on data that’s close to other data (as it is on +the stack) rather than farther away (as it can be on the heap). +> +> When your code calls a function, the values passed into the function +(including, potentially, pointers to data on the heap) and the function’s local +variables get pushed onto the stack. When the function is over, those values +get popped off the stack. +> +> Keeping track of what parts of code are using what data on the heap, +minimizing the amount of duplicate data on the heap, and cleaning up unused +data on the heap so you don’t run out of space are all problems that ownership +addresses. Once you understand ownership, you won’t need to think about the +stack and the heap very often, but knowing that the main purpose of ownership +is to manage heap data can help explain why it works the way it does. + +### Ownership Rules + +First, let’s take a look at the ownership rules. Keep these rules in mind as we +work through the examples that illustrate them: + +* Each value in Rust has an *owner*. +* There can only be one owner at a time. +* When the owner goes out of scope, the value will be dropped. + +### Variable Scope + +Now that we’re past basic Rust syntax, we won’t include all the `fn main() {` +code in examples, so if you’re following along, make sure to put the following +examples inside a `main` function manually. As a result, our examples will be a +bit more concise, letting us focus on the actual details rather than +boilerplate code. + +As a first example of ownership, we’ll look at the *scope* of some variables. A +scope is the range within a program for which an item is valid. Take the +following variable: + +``` +let s = "hello"; +``` + +The variable `s` refers to a string literal, where the value of the string is +hardcoded into the text of our program. The variable is valid from the point at +which it’s declared until the end of the current *scope*. Listing 4-1 shows a +program with comments annotating where the variable `s` would be valid. + +``` +{ // s is not valid here, since it's not yet declared + let s = "hello"; // s is valid from this point forward + + // do stuff with s +} // this scope is now over, and s is no longer valid +``` + +Listing 4-1: A variable and the scope in which it is valid + +In other words, there are two important points in time here: + +* When `s` comes *into* scope, it is valid. +* It remains valid until it goes *out of* scope. + +At this point, the relationship between scopes and when variables are valid is +similar to that in other programming languages. Now we’ll build on top of this +understanding by introducing the `String` type. + +### The String Type + +To illustrate the rules of ownership, we need a data type that is more complex +than those we covered in “Data Types” on page XX. The types covered previously +are of a known size, can be stored on the stack and popped off the stack when +their scope is over, and can be quickly and trivially copied to make a new, +independent instance if another part of code needs to use the same value in a +different scope. But we want to look at data that is stored on the heap and +explore how Rust knows when to clean up that data, and the `String` type is a +great example. + +We’ll concentrate on the parts of `String` that relate to ownership. These +aspects also apply to other complex data types, whether they are provided by +the standard library or created by you. We’ll discuss `String` in more depth in +Chapter 8. + +We’ve already seen string literals, where a string value is hardcoded into our +program. String literals are convenient, but they aren’t suitable for every +situation in which we may want to use text. One reason is that they’re +immutable. Another is that not every string value can be known when we write +our code: for example, what if we want to take user input and store it? For +these situations, Rust has a second string type, `String`. This type manages +data allocated on the heap and as such is able to store an amount of text that +is unknown to us at compile time. You can create a `String` from a string +literal using the `from` function, like so: + +``` +let s = String::from("hello"); +``` + +The double colon `::` operator allows us to namespace this particular `from` +function under the `String` type rather than using some sort of name like +`string_from`. We’ll discuss this syntax more in “Method Syntax” on page XX, +and when we talk about namespacing with modules in “Paths for Referring to an +Item in the Module Tree” on page XX. + +This kind of string *can* be mutated: + +``` +let mut s = String::from("hello"); + +s.push_str(", world!"); // push_str() appends a literal to a String + +println!("{s}"); // This will print `hello, world!` +``` + +So, what’s the difference here? Why can `String` be mutated but literals +cannot? The difference is in how these two types deal with memory. + +### Memory and Allocation + +In the case of a string literal, we know the contents at compile time, so the +text is hardcoded directly into the final executable. This is why string +literals are fast and efficient. But these properties only come from the string +literal’s immutability. Unfortunately, we can’t put a blob of memory into the +binary for each piece of text whose size is unknown at compile time and whose +size might change while running the program. + +With the `String` type, in order to support a mutable, growable piece of text, +we need to allocate an amount of memory on the heap, unknown at compile time, +to hold the contents. This means: + +* The memory must be requested from the memory allocator at runtime. +* We need a way of returning this memory to the allocator when we’re done with +our `String`. + +That first part is done by us: when we call `String::from`, its implementation +requests the memory it needs. This is pretty much universal in programming +languages. + +However, the second part is different. In languages with a *garbage collector +(GC)*, the GC keeps track of and cleans up memory that isn’t being used +anymore, and we don’t need to think about it. In most languages without a GC, +it’s our responsibility to identify when memory is no longer being used and to +call code to explicitly free it, just as we did to request it. Doing this +correctly has historically been a difficult programming problem. If we forget, +we’ll waste memory. If we do it too early, we’ll have an invalid variable. If +we do it twice, that’s a bug too. We need to pair exactly one `allocate` with +exactly one `free`. + +Rust takes a different path: the memory is automatically returned once the +variable that owns it goes out of scope. Here’s a version of our scope example +from Listing 4-1 using a `String` instead of a string literal: + +``` +{ + let s = String::from("hello"); // s is valid from this point forward + + // do stuff with s +} // this scope is now over, and s is no + // longer valid +``` + +There is a natural point at which we can return the memory our `String` needs +to the allocator: when `s` goes out of scope. When a variable goes out of +scope, Rust calls a special function for us. This function is called `drop`, +and it’s where the author of `String` can put the code to return the memory. +Rust calls `drop` automatically at the closing curly bracket. + +> Note: In C++, this pattern of deallocating resources at the end of an item’s +lifetime is sometimes called *Resource Acquisition Is Initialization* *(RAII)*. +The `drop` function in Rust will be familiar to you if you’ve used RAII +patterns. + +This pattern has a profound impact on the way Rust code is written. It may seem +simple right now, but the behavior of code can be unexpected in more +complicated situations when we want to have multiple variables use the data +we’ve allocated on the heap. Let’s explore some of those situations now. + +#### Variables and Data Interacting with Move + +Multiple variables can interact with the same data in different ways in Rust. +Let’s look at an example using an integer in Listing 4-2. + +``` +let x = 5; +let y = x; +``` + +Listing 4-2: Assigning the integer value of variable `x` to `y` + +We can probably guess what this is doing: “bind the value `5` to `x`; then make +a copy of the value in `x` and bind it to `y`.” We now have two variables, `x` +and `y`, and both equal `5`. This is indeed what is happening, because integers +are simple values with a known, fixed size, and these two `5` values are pushed +onto the stack. + +Now let’s look at the `String` version: + +``` +let s1 = String::from("hello"); +let s2 = s1; +``` + +This looks very similar, so we might assume that the way it works would be the +same: that is, the second line would make a copy of the value in `s1` and bind +it to `s2`. But this isn’t quite what happens. + +Take a look at Figure 4-1 to see what is happening to `String` under the +covers. A `String` is made up of three parts, shown on the left: a pointer to +the memory that holds the contents of the string, a length, and a capacity. +This group of data is stored on the stack. On the right is the memory on the +heap that holds the contents. + +Figure 4-1: Representation in memory of a `String` holding the value `"hello"` +bound to `s1` + +The length is how much memory, in bytes, the contents of the `String` are +currently using. The capacity is the total amount of memory, in bytes, that the +`String` has received from the allocator. The difference between length and +capacity matters, but not in this context, so for now, it’s fine to ignore the +capacity. + +When we assign `s1` to `s2`, the `String` data is copied, meaning we copy the +pointer, the length, and the capacity that are on the stack. We do not copy the +data on the heap that the pointer refers to. In other words, the data +representation in memory looks like Figure 4-2. + +Figure 4-2: Representation in memory of the variable `s2` that has a copy of +the pointer, length, and capacity of `s1` + +The representation does *not* look like Figure 4-3, which is what memory would +look like if Rust instead copied the heap data as well. If Rust did this, the +operation `s2 = s1` could be very expensive in terms of runtime performance if +the data on the heap were large. + +Figure 4-3: Another possibility for what `s2 = s1` might do if Rust copied the +heap data as well + +Earlier, we said that when a variable goes out of scope, Rust automatically +calls the `drop` function and cleans up the heap memory for that variable. But +Figure 4-2 shows both data pointers pointing to the same location. This is a +problem: when `s2` and `s1` go out of scope, they will both try to free the +same memory. This is known as a *double free* error and is one of the memory +safety bugs we mentioned previously. Freeing memory twice can lead to memory +corruption, which can potentially lead to security vulnerabilities. + +To ensure memory safety, after the line `let s2 = s1;`, Rust considers `s1` as +no longer valid. Therefore, Rust doesn’t need to free anything when `s1` goes +out of scope. Check out what happens when you try to use `s1` after `s2` is +created; it won’t work: + +``` +let s1 = String::from("hello"); +let s2 = s1; + +println!("{s1}, world!"); +``` + +You’ll get an error like this because Rust prevents you from using the +invalidated reference: + +``` +error[E0382]: borrow of moved value: `s1` + --> src/main.rs:5:28 + | +2 | let s1 = String::from("hello"); + | -- move occurs because `s1` has type `String`, which + does not implement the `Copy` trait +3 | let s2 = s1; + | -- value moved here +4 | +5 | println!("{s1}, world!"); + | ^^ value borrowed here after move +``` + +If you’ve heard the terms *shallow copy* and *deep copy* while working with +other languages, the concept of copying the pointer, length, and capacity +without copying the data probably sounds like making a shallow copy. But +because Rust also invalidates the first variable, instead of being called a +shallow copy, it’s known as a *move*. In this example, we would say that `s1` +was *moved* into `s2`. So, what actually happens is shown in Figure 4-4. + +Figure 4-4: Representation in memory after `s1` has been invalidated + +That solves our problem! With only `s2` valid, when it goes out of scope it +alone will free the memory, and we’re done. + +In addition, there’s a design choice that’s implied by this: Rust will never +automatically create “deep” copies of your data. Therefore, any *automatic* +copying can be assumed to be inexpensive in terms of runtime performance. + +#### Variables and Data Interacting with Clone + +If we *do* want to deeply copy the heap data of the `String`, not just the +stack data, we can use a common method called `clone`. We’ll discuss method +syntax in Chapter 5, but because methods are a common feature in many +programming languages, you’ve probably seen them before. + +Here’s an example of the `clone` method in action: + +``` +let s1 = String::from("hello"); +let s2 = s1.clone(); + +println!("s1 = {s1}, s2 = {s2}"); +``` + +This works just fine and explicitly produces the behavior shown in Figure 4-3, +where the heap data *does* get copied. + +When you see a call to `clone`, you know that some arbitrary code is being +executed and that code may be expensive. It’s a visual indicator that something +different is going on. + +#### Stack-Only Data: Copy + +There’s another wrinkle we haven’t talked about yet. This code using +integers—part of which was shown in Listing 4-2—works and is valid: + +``` +let x = 5; +let y = x; + +println!("x = {x}, y = {y}"); +``` + +But this code seems to contradict what we just learned: we don’t have a call to +`clone`, but `x` is still valid and wasn’t moved into `y`. + +The reason is that types such as integers that have a known size at compile +time are stored entirely on the stack, so copies of the actual values are quick +to make. That means there’s no reason we would want to prevent `x` from being +valid after we create the variable `y`. In other words, there’s no difference +between deep and shallow copying here, so calling `clone` wouldn’t do anything +different from the usual shallow copying, and we can leave it out. + +Rust has a special annotation called the `Copy` trait that we can place on +types that are stored on the stack, as integers are (we’ll talk more about +traits in Chapter 10). If a type implements the `Copy` trait, variables that +use it do not move, but rather are trivially copied, making them still valid +after assignment to another variable. + +Rust won’t let us annotate a type with `Copy` if the type, or any of its parts, +has implemented the `Drop` trait. If the type needs something special to happen +when the value goes out of scope and we add the `Copy` annotation to that type, +we’ll get a compile-time error. To learn about how to add the `Copy` annotation +to your type to implement the trait, see “Derivable Traits” on page XX. + +So, what types implement the `Copy` trait? You can check the documentation for +the given type to be sure, but as a general rule, any group of simple scalar +values can implement `Copy`, and nothing that requires allocation or is some +form of resource can implement `Copy`. Here are some of the types that +implement `Copy`: + +* All the integer types, such as `u32`. +* The Boolean type, `bool`, with values `true` and `false`. +* All the floating-point types, such as `f64`. +* The character type, `char`. +* Tuples, if they only contain types that also implement `Copy`. For example, +`(i32, i32)` implements `Copy`, but `(i32, String)` does not. + +### Ownership and Functions + +The mechanics of passing a value to a function are similar to those when +assigning a value to a variable. Passing a variable to a function will move or +copy, just as assignment does. Listing 4-3 has an example with some annotations +showing where variables go into and out of scope. + +``` +// src/main.rs +fn main() { + let s = String::from("hello"); // s comes into scope + + takes_ownership(s); // s's value moves into the function... + // ... and so is no longer valid here + + let x = 5; // x comes into scope + + makes_copy(x); // x would move into the function, + // but i32 is Copy, so it's okay to still + // use x afterward + +} // Here, x goes out of scope, then s. However, because s's value was moved, + // nothing special happens + +fn takes_ownership(some_string: String) { // some_string comes into scope + println!("{some_string}"); +} // Here, some_string goes out of scope and `drop` is called. The backing + // memory is freed + +fn makes_copy(some_integer: i32) { // some_integer comes into scope + println!("{some_integer}"); +} // Here, some_integer goes out of scope. Nothing special happens +``` + +Listing 4-3: Functions with ownership and scope annotated + +If we tried to use `s` after the call to `takes_ownership`, Rust would throw a +compile-time error. These static checks protect us from mistakes. Try adding +code to `main` that uses `s` and `x` to see where you can use them and where +the ownership rules prevent you from doing so. + +### Return Values and Scope + +Returning values can also transfer ownership. Listing 4-4 shows an example of a +function that returns some value, with similar annotations as those in Listing +4-3. + +``` +// src/main.rs +fn main() { + let s1 = gives_ownership(); // gives_ownership moves its return + // value into s1 + + let s2 = String::from("hello"); // s2 comes into scope + + let s3 = takes_and_gives_back(s2); // s2 is moved into + // takes_and_gives_back, which also + // moves its return value into s3 +} // Here, s3 goes out of scope and is dropped. s2 was moved, so nothing + // happens. s1 goes out of scope and is dropped + +fn gives_ownership() -> String { // gives_ownership will move its + // return value into the function + // that calls it + + let some_string = String::from("yours"); // some_string comes into scope + + some_string // some_string is returned and + // moves out to the calling + // function +} + +// This function takes a String and returns a String +fn takes_and_gives_back(a_string: String) -> String { // a_string comes into + // scope + + a_string // a_string is returned and moves out to the calling function +} +``` + +Listing 4-4: Transferring ownership of return values + +The ownership of a variable follows the same pattern every time: assigning a +value to another variable moves it. When a variable that includes data on the +heap goes out of scope, the value will be cleaned up by `drop` unless ownership +of the data has been moved to another variable. + +While this works, taking ownership and then returning ownership with every +function is a bit tedious. What if we want to let a function use a value but +not take ownership? It’s quite annoying that anything we pass in also needs to +be passed back if we want to use it again, in addition to any data resulting +from the body of the function that we might want to return as well. + +Rust does let us return multiple values using a tuple, as shown in Listing 4-5. + +Filename: src/main.rs + +``` +fn main() { + let s1 = String::from("hello"); + + let (s2, len) = calculate_length(s1); + + println!("The length of '{s2}' is {len}."); +} + +fn calculate_length(s: String) -> (String, usize) { + let length = s.len(); // len() returns the length of a String + + (s, length) +} +``` + +Listing 4-5: Returning ownership of parameters + +But this is too much ceremony and a lot of work for a concept that should be +common. Luckily for us, Rust has a feature for using a value without +transferring ownership, called *references*. + +## References and Borrowing + +The issue with the tuple code in Listing 4-5 is that we have to return the +`String` to the calling function so we can still use the `String` after the +call to `calculate_length`, because the `String` was moved into +`calculate_length`. Instead, we can provide a reference to the `String` value. +A *reference* is like a pointer in that it’s an address we can follow to access +the data stored at that address; that data is owned by some other variable. +Unlike a pointer, a reference is guaranteed to point to a valid value of a +particular type for the life of that reference. + +Here is how you would define and use a `calculate_length` function that has a +reference to an object as a parameter instead of taking ownership of the value: + +Filename: src/main.rs + +``` +fn main() { + let s1 = String::from("hello"); + + let len = calculate_length(&s1); + + println!("The length of '{s1}' is {len}."); +} + +fn calculate_length(s: &String) -> usize { + s.len() +} +``` + +First, notice that all the tuple code in the variable declaration and the +function return value is gone. Second, note that we pass `&s1` into +`calculate_length` and, in its definition, we take `&String` rather than +`String`. These ampersands represent *references*, and they allow you to refer +to some value without taking ownership of it. Figure 4-5 depicts this concept. + +Figure 4-5: A diagram of `&String s` pointing at `String s1` + +> Note: The opposite of referencing by using `&` is *dereferencing*, which is +accomplished with the dereference operator, `*`. We’ll see some uses of the +dereference operator in Chapter 8 and discuss details of dereferencing in +Chapter 15. + +Let’s take a closer look at the function call here: + +``` +let s1 = String::from("hello"); + +let len = calculate_length(&s1); +``` + +The `&s1` syntax lets us create a reference that *refers* to the value of `s1` +but does not own it. Because it does not own it, the value it points to will +not be dropped when the reference stops being used. + +Likewise, the signature of the function uses `&` to indicate that the type of +the parameter `s` is a reference. Let’s add some explanatory annotations: + +``` +fn calculate_length(s: &String) -> usize { // s is a reference to a String + s.len() +} // Here, s goes out of scope. But because it does not have ownership of what + // it refers to, the String is not dropped +``` + +The scope in which the variable `s` is valid is the same as any function +parameter’s scope, but the value pointed to by the reference is not dropped +when `s` stops being used, because `s` doesn’t have ownership. When functions +have references as parameters instead of the actual values, we won’t need to +return the values in order to give back ownership, because we never had +ownership. + +We call the action of creating a reference *borrowing*. As in real life, if a +person owns something, you can borrow it from them. When you’re done, you have +to give it back. You don’t own it. + +So, what happens if we try to modify something we’re borrowing? Try the code in +Listing 4-6. Spoiler alert: it doesn’t work! + +Filename: src/main.rs + +``` +fn main() { + let s = String::from("hello"); + + change(&s); +} + +fn change(some_string: &String) { + some_string.push_str(", world"); +} +``` + +Listing 4-6: Attempting to modify a borrowed value + +Here’s the error: + +``` +error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` +reference + --> src/main.rs:8:5 + | +7 | fn change(some_string: &String) { + | ------- help: consider changing this to be a mutable +reference: `&mut String` +8 | some_string.push_str(", world"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `some_string` is a `&` reference, so +the data it refers to cannot be borrowed as mutable +``` + +Just as variables are immutable by default, so are references. We’re not +allowed to modify something we have a reference to. + +### Mutable References + +We can fix the code from Listing 4-6 to allow us to modify a borrowed value +with just a few small tweaks that use, instead, a *mutable reference*: + +Filename: src/main.rs + +``` +fn main() { + let mut s = String::from("hello"); + + change(&mut s); +} + +fn change(some_string: &mut String) { + some_string.push_str(", world"); +} +``` + +First we change `s` to be `mut`. Then we create a mutable reference with `&mut +s` where we call the `change` function, and update the function signature to +accept a mutable reference with `some_string: &mut String`. This makes it very +clear that the `change` function will mutate the value it borrows. + +Mutable references have one big restriction: if you have a mutable reference to +a value, you can have no other references to that value. This code that +attempts to create two mutable references to `s` will fail: + +Filename: src/main.rs + +``` +let mut s = String::from("hello"); + +let r1 = &mut s; +let r2 = &mut s; + +println!("{r1}, {r2}"); +``` + +Here’s the error: + +``` +error[E0499]: cannot borrow `s` as mutable more than once at a time + --> src/main.rs:5:14 + | +4 | let r1 = &mut s; + | ------ first mutable borrow occurs here +5 | let r2 = &mut s; + | ^^^^^^ second mutable borrow occurs here +6 | +7 | println!("{r1}, {r2}"); + | -- first borrow later used here +``` + +This error says that this code is invalid because we cannot borrow `s` as +mutable more than once at a time. The first mutable borrow is in `r1` and must +last until it’s used in the `println!`, but between the creation of that +mutable reference and its usage, we tried to create another mutable reference +in `r2` that borrows the same data as `r1`. + +The restriction preventing multiple mutable references to the same data at the +same time allows for mutation but in a very controlled fashion. It’s something +that new Rustaceans struggle with because most languages let you mutate +whenever you’d like. The benefit of having this restriction is that Rust can +prevent data races at compile time. A *data race* is similar to a race +condition and happens when these three behaviors occur: + +* Two or more pointers access the same data at the same time. +* At least one of the pointers is being used to write to the data. +* There’s no mechanism being used to synchronize access to the data. + +Data races cause undefined behavior and can be difficult to diagnose and fix +when you’re trying to track them down at runtime; Rust prevents this problem by +refusing to compile code with data races! + +As always, we can use curly brackets to create a new scope, allowing for +multiple mutable references, just not *simultaneous* ones: + +``` +let mut s = String::from("hello"); + +{ + let r1 = &mut s; +} // r1 goes out of scope here, so we can make a new reference with no problems + +let r2 = &mut s; +``` + +Rust enforces a similar rule for combining mutable and immutable references. +This code results in an error: + +``` +let mut s = String::from("hello"); + +let r1 = &s; // no problem +let r2 = &s; // no problem +let r3 = &mut s; // BIG PROBLEM + +println!("{r1}, {r2}, and {r3}"); +``` + +Here’s the error: + +``` +error[E0502]: cannot borrow `s` as mutable because it is also borrowed as +immutable + --> src/main.rs:6:14 + | +4 | let r1 = &s; // no problem + | -- immutable borrow occurs here +5 | let r2 = &s; // no problem +6 | let r3 = &mut s; // BIG PROBLEM + | ^^^^^^ mutable borrow occurs here +7 | +8 | println!("{r1}, {r2}, and {r3}"); + | -- immutable borrow later used here +``` + +Whew! We *also* cannot have a mutable reference while we have an immutable one +to the same value. + +Users of an immutable reference don’t expect the value to suddenly change out +from under them! However, multiple immutable references are allowed because no +one who is just reading the data has the ability to affect anyone else’s +reading of the data. + +Note that a reference’s scope starts from where it is introduced and continues +through the last time that reference is used. For instance, this code will +compile because the last usage of the immutable references, the `println!`, +occurs before the mutable reference is introduced: + +``` +let mut s = String::from("hello"); + +let r1 = &s; // no problem +let r2 = &s; // no problem +println!("{r1} and {r2}"); +// variables r1 and r2 will not be used after this point + +let r3 = &mut s; // no problem +println!("{r3}"); +``` + +The scopes of the immutable references `r1` and `r2` end after the `println!` +where they are last used, which is before the mutable reference `r3` is +created. These scopes don’t overlap, so this code is allowed: the compiler can +tell that the reference is no longer being used at a point before the end of +the scope. + +Even though borrowing errors may be frustrating at times, remember that it’s +the Rust compiler pointing out a potential bug early (at compile time rather +than at runtime) and showing you exactly where the problem is. Then you don’t +have to track down why your data isn’t what you thought it was. + +### Dangling References + +In languages with pointers, it’s easy to erroneously create a *dangling +pointer*—a pointer that references a location in memory that may have been +given to someone else—by freeing some memory while preserving a pointer to that +memory. In Rust, by contrast, the compiler guarantees that references will +never be dangling references: if you have a reference to some data, the +compiler will ensure that the data will not go out of scope before the +reference to the data does. + +Let’s try to create a dangling reference to see how Rust prevents them with a +compile-time error: + +Filename: src/main.rs + +``` +fn main() { + let reference_to_nothing = dangle(); +} + +fn dangle() -> &String { + let s = String::from("hello"); + + &s +} +``` + +Here’s the error: + +``` +error[E0106]: missing lifetime specifier + --> src/main.rs:5:16 + | +5 | fn dangle() -> &String { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, +but there is no value for it to be borrowed from +help: consider using the `'static` lifetime + | +5 | fn dangle() -> &'static String { + | ~~~~~~~~ +``` + +This error message refers to a feature we haven’t covered yet: lifetimes. We’ll +discuss lifetimes in detail in Chapter 10. But, if you disregard the parts +about lifetimes, the message does contain the key to why this code is a problem: + +``` +this function's return type contains a borrowed value, but there +is no value for it to be borrowed from +``` + +Let’s take a closer look at exactly what’s happening at each stage of our +`dangle` code: + +``` +// src/main.rs +fn dangle() -> &String { // dangle returns a reference to a String + + let s = String::from("hello"); // s is a new String + + &s // we return a reference to the String, s +} // Here, s goes out of scope and is dropped, so its memory goes away + // Danger! +``` + +Because `s` is created inside `dangle`, when the code of `dangle` is finished, +`s` will be deallocated. But we tried to return a reference to it. That means +this reference would be pointing to an invalid `String`. That’s no good! Rust +won’t let us do this. + +The solution here is to return the `String` directly: + +``` +fn no_dangle() -> String { + let s = String::from("hello"); + + s +} +``` + +This works without any problems. Ownership is moved out, and nothing is +deallocated. + +### The Rules of References + +Let’s recap what we’ve discussed about references: + +* At any given time, you can have *either* one mutable reference *or* any +number of immutable references. +* References must always be valid. + +Next, we’ll look at a different kind of reference: slices. + +## The Slice Type + +*Slices* let you reference a contiguous sequence of elements in a collection +rather than the whole collection. A slice is a kind of reference, so it does +not have ownership. + +Here’s a small programming problem: write a function that takes a string of +words separated by spaces and returns the first word it finds in that string. +If the function doesn’t find a space in the string, the whole string must be +one word, so the entire string should be returned. + +Let’s work through how we’d write the signature of this function without using +slices, to understand the problem that slices will solve: + +``` +fn first_word(s: &String) -> ? +``` + +The `first_word` function has a `&String` as a parameter. We don’t want +ownership, so this is fine. But what should we return? We don’t really have a +way to talk about *part* of a string. However, we could return the index of the +end of the word, indicated by a space. Let’s try that, as shown in Listing 4-7. + +Filename: src/main.rs + +``` +fn first_word(s: &String) -> usize { + 1 let bytes = s.as_bytes(); + + for (2 i, &item) in 3 bytes.iter().enumerate() { + 4 if item == b' ' { + return i; + } + } + + 5 s.len() +} +``` + +Listing 4-7: The `first_word` function that returns a byte index value into the +`String` parameter + +Because we need to go through the `String` element by element and check whether +a value is a space, we’ll convert our `String` to an array of bytes using the +`as_bytes` method [1]. + +Next, we create an iterator over the array of bytes using the `iter` method +[3]. We’ll discuss iterators in more detail in Chapter 13. For now, know that +`iter` is a method that returns each element in a collection and that +`enumerate` wraps the result of `iter` and returns each element as part of a +tuple instead. The first element of the tuple returned from `enumerate` is the +index, and the second element is a reference to the element. This is a bit more +convenient than calculating the index ourselves. + +Because the `enumerate` method returns a tuple, we can use patterns to +destructure that tuple. We’ll be discussing patterns more in Chapter 6. In the +`for` loop, we specify a pattern that has `i` for the index in the tuple and +`&item` for the single byte in the tuple [2]. Because we get a reference to the +element from `.iter().enumerate()`, we use `&` in the pattern. + +Inside the `for` loop, we search for the byte that represents the space by +using the byte literal syntax [4]. If we find a space, we return the position. +Otherwise, we return the length of the string by using `s.len()` [5]. + +We now have a way to find out the index of the end of the first word in the +string, but there’s a problem. We’re returning a `usize` on its own, but it’s +only a meaningful number in the context of the `&String`. In other words, +because it’s a separate value from the `String`, there’s no guarantee that it +will still be valid in the future. Consider the program in Listing 4-8 that +uses the `first_word` function from Listing 4-7. + +``` +// src/main.rs +fn main() { + let mut s = String::from("hello world"); + + let word = first_word(&s); // word will get the value 5 + + s.clear(); // this empties the String, making it equal to "" + + // word still has the value 5 here, but there's no more string that + // we could meaningfully use the value 5 with. word is now totally invalid! +} +``` + +Listing 4-8: Storing the result from calling the `first_word` function and then +changing the `String` contents + +This program compiles without any errors and would also do so if we used `word` +after calling `s.clear()`. Because `word` isn’t connected to the state of `s` +at all, `word` still contains the value `5`. We could use that value `5` with +the variable `s` to try to extract the first word out, but this would be a bug +because the contents of `s` have changed since we saved `5` in `word`. + +Having to worry about the index in `word` getting out of sync with the data in +`s` is tedious and error prone! Managing these indices is even more brittle if +we write a `second_word` function. Its signature would have to look like this: + +``` +fn second_word(s: &String) -> (usize, usize) { +``` + +Now we’re tracking a starting *and* an ending index, and we have even more +values that were calculated from data in a particular state but aren’t tied to +that state at all. We have three unrelated variables floating around that need +to be kept in sync. + +Luckily, Rust has a solution to this problem: string slices. + +### String Slices + +A *string slice* is a reference to part of a `String`, and it looks like this: + +``` +let s = String::from("hello world"); + +let hello = &s[0..5]; +let world = &s[6..11]; +``` + +Rather than a reference to the entire `String`, `hello` is a reference to a +portion of the `String`, specified in the extra `[0..5]` bit. We create slices +using a range within brackets by specifying `[starting_index..ending_index]`, +where `starting_index` is the first position in the slice and `ending_index` is +one more than the last position in the slice. Internally, the slice data +structure stores the starting position and the length of the slice, which +corresponds to `ending_index` minus `starting_index`. So, in the case of `let +world = &s[6..11];`, `world` would be a slice that contains a pointer to the +byte at index 6 of `s` with a length value of `5`. + +Figure 4-6 shows this in a diagram. + +Figure 4-6: String slice referring to part of a `String` + +With Rust’s `..` range syntax, if you want to start at index 0, you can drop +the value before the two periods. In other words, these are equal: + +``` +let s = String::from("hello"); + +let slice = &s[0..2]; +let slice = &s[..2]; +``` + +By the same token, if your slice includes the last byte of the `String`, you +can drop the trailing number. That means these are equal: + +``` +let s = String::from("hello"); + +let len = s.len(); + +let slice = &s[3..len]; +let slice = &s[3..]; +``` + +You can also drop both values to take a slice of the entire string. So these +are equal: + +``` +let s = String::from("hello"); + +let len = s.len(); + +let slice = &s[0..len]; +let slice = &s[..]; +``` + +> Note: String slice range indices must occur at valid UTF-8 character +boundaries. If you attempt to create a string slice in the middle of a +multibyte character, your program will exit with an error. For the purposes of +introducing string slices, we are assuming ASCII only in this section; a more +thorough discussion of UTF-8 handling is in “Storing UTF-8 Encoded Text with +Strings” on page XX. + +With all this information in mind, let’s rewrite `first_word` to return a +slice. The type that signifies “string slice” is written as `&str`: + +Filename: src/main.rs + +``` +fn first_word(s: &String) -> &str { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} +``` + +We get the index for the end of the word the same way we did in Listing 4-7, by +looking for the first occurrence of a space. When we find a space, we return a +string slice using the start of the string and the index of the space as the +starting and ending indices. + +Now when we call `first_word`, we get back a single value that is tied to the +underlying data. The value is made up of a reference to the starting point of +the slice and the number of elements in the slice. + +Returning a slice would also work for a `second_word` function: + +``` +fn second_word(s: &String) -> &str { +``` + +We now have a straightforward API that’s much harder to mess up because the +compiler will ensure the references into the `String` remain valid. Remember +the bug in the program in Listing 4-8, when we got the index to the end of the +first word but then cleared the string so our index was invalid? That code was +logically incorrect but didn’t show any immediate errors. The problems would +show up later if we kept trying to use the first word index with an emptied +string. Slices make this bug impossible and let us know we have a problem with +our code much sooner. Using the slice version of `first_word` will throw a +compile-time error: + +Filename: src/main.rs + +``` +fn main() { + let mut s = String::from("hello world"); + + let word = first_word(&s); + + s.clear(); // error! + + println!("the first word is: {word}"); +} +``` + +Here’s the compiler error: + +``` +error[E0502]: cannot borrow `s` as mutable because it is also borrowed as +immutable + --> src/main.rs:18:5 + | +16 | let word = first_word(&s); + | -- immutable borrow occurs here +17 | +18 | s.clear(); // error! + | ^^^^^^^^^ mutable borrow occurs here +19 | +20 | println!("the first word is: {word}"); + | ---- immutable borrow later used here +``` + +Recall from the borrowing rules that if we have an immutable reference to +something, we cannot also take a mutable reference. Because `clear` needs to +truncate the `String`, it needs to get a mutable reference. The `println!` +after the call to `clear` uses the reference in `word`, so the immutable +reference must still be active at that point. Rust disallows the mutable +reference in `clear` and the immutable reference in `word` from existing at the +same time, and compilation fails. Not only has Rust made our API easier to use, +but it has also eliminated an entire class of errors at compile time! + +#### String Literals as Slices + +Recall that we talked about string literals being stored inside the binary. Now +that we know about slices, we can properly understand string literals: + +``` +let s = "Hello, world!"; +``` + +The type of `s` here is `&str`: it’s a slice pointing to that specific point of +the binary. This is also why string literals are immutable; `&str` is an +immutable reference. + +#### String Slices as Parameters + +Knowing that you can take slices of literals and `String` values leads us to +one more improvement on `first_word`, and that’s its signature: + +``` +fn first_word(s: &String) -> &str { +``` + +A more experienced Rustacean would write the signature shown in Listing 4-9 +instead because it allows us to use the same function on both `&String` values +and `&str` values. + +``` +fn first_word(s: &str) -> &str { +``` + +Listing 4-9: Improving the `first_word` function by using a string slice for +the type of the `s` parameter + +If we have a string slice, we can pass that directly. If we have a `String`, we +can pass a slice of the `String` or a reference to the `String`. This +flexibility takes advantage of *deref coercions*, a feature we will cover in +“Implicit Deref Coercions with Functions and Methods” on page XX. + +Defining a function to take a string slice instead of a reference to a `String` +makes our API more general and useful without losing any functionality: + +Filename: src/main.rs + +``` +fn main() { + let my_string = String::from("hello world"); + + // `first_word` works on slices of `String`s, whether partial + // or whole + let word = first_word(&my_string[0..6]); + let word = first_word(&my_string[..]); + // `first_word` also works on references to `String`s, which + // are equivalent to whole slices of `String`s + let word = first_word(&my_string); + + let my_string_literal = "hello world"; + + // `first_word` works on slices of string literals, + // whether partial or whole + let word = first_word(&my_string_literal[0..6]); + let word = first_word(&my_string_literal[..]); + + // Because string literals *are* string slices already, + // this works too, without the slice syntax! + let word = first_word(my_string_literal); +} +``` + +### Other Slices + +String slices, as you might imagine, are specific to strings. But there’s a +more general slice type too. Consider this array: + +``` +let a = [1, 2, 3, 4, 5]; +``` + +Just as we might want to refer to part of a string, we might want to refer to +part of an array. We’d do so like this: + +``` +let a = [1, 2, 3, 4, 5]; + +let slice = &a[1..3]; + +assert_eq!(slice, &[2, 3]); +``` + +This slice has the type `&[i32]`. It works the same way as string slices do, by +storing a reference to the first element and a length. You’ll use this kind of +slice for all sorts of other collections. We’ll discuss these collections in +detail when we talk about vectors in Chapter 8. + +## Summary + +The concepts of ownership, borrowing, and slices ensure memory safety in Rust +programs at compile time. The Rust language gives you control over your memory +usage in the same way as other systems programming languages, but having the +owner of data automatically clean up that data when the owner goes out of scope +means you don’t have to write and debug extra code to get this control. + +Ownership affects how lots of other parts of Rust work, so we’ll talk about +these concepts further throughout the rest of the book. Let’s move on to +Chapter 5 and look at grouping pieces of data together in a `struct`. + diff --git a/rustbook-ru/nostarch/chapter05.md b/rustbook-ru/nostarch/chapter05.md new file mode 100644 index 000000000..9881a3b74 --- /dev/null +++ b/rustbook-ru/nostarch/chapter05.md @@ -0,0 +1,995 @@ + + +[TOC] + +# Using Structs to Structure Related Data + +A *struct*, or *structure*, is a custom data type that lets you package +together and name multiple related values that make up a meaningful group. If +you’re familiar with an object-oriented language, a *struct* is like an +object’s data attributes. In this chapter, we’ll compare and contrast tuples +with structs to build on what you already know and demonstrate when structs are +a better way to group data. + +We’ll demonstrate how to define and instantiate structs. We’ll discuss how to +define associated functions, especially the kind of associated functions called +*methods*, to specify behavior associated with a struct type. Structs and enums +(discussed in Chapter 6) are the building blocks for creating new types in your +program’s domain to take full advantage of Rust’s compile-time type checking. + +## Defining and Instantiating Structs + +Structs are similar to tuples, discussed in “The Tuple Type” on page XX, in +that both hold multiple related values. Like tuples, the pieces of a struct can +be different types. Unlike with tuples, in a struct you’ll name each piece of +data so it’s clear what the values mean. Adding these names means that structs +are more flexible than tuples: you don’t have to rely on the order of the data +to specify or access the values of an instance. + +To define a struct, we enter the keyword `struct` and name the entire struct. A +struct’s name should describe the significance of the pieces of data being +grouped together. Then, inside curly brackets, we define the names and types of +the pieces of data, which we call *fields*. For example, Listing 5-1 shows a +struct that stores information about a user account. + +Filename: src/main.rs + +``` +struct User { + active: bool, + username: String, + email: String, + sign_in_count: u64, +} +``` + +Listing 5-1: A `User` struct definition + +To use a struct after we’ve defined it, we create an *instance* of that struct +by specifying concrete values for each of the fields. We create an instance by +stating the name of the struct and then add curly brackets containing key: +value pairs, where the keys are the names of the fields and the values are the +data we want to store in those fields. We don’t have to specify the fields in +the same order in which we declared them in the struct. In other words, the +struct definition is like a general template for the type, and instances fill +in that template with particular data to create values of the type. For +example, we can declare a particular user as shown in Listing 5-2. + +Filename: src/main.rs + +``` +fn main() { + let user1 = User { + active: true, + username: String::from("someusername123"), + email: String::from("someone@example.com"), + sign_in_count: 1, + }; +} +``` + +Listing 5-2: Creating an instance of the `User` struct + +To get a specific value from a struct, we use dot notation. For example, to +access this user’s email address, we use `user1.email`. If the instance is +mutable, we can change a value by using the dot notation and assigning into a +particular field. Listing 5-3 shows how to change the value in the `email` +field of a mutable `User` instance. + +Filename: src/main.rs + +``` +fn main() { + let mut user1 = User { + active: true, + username: String::from("someusername123"), + email: String::from("someone@example.com"), + sign_in_count: 1, + }; + + user1.email = String::from("anotheremail@example.com"); +} +``` + +Listing 5-3: Changing the value in the `email` field of a `User` instance + +Note that the entire instance must be mutable; Rust doesn’t allow us to mark +only certain fields as mutable. As with any expression, we can construct a new +instance of the struct as the last expression in the function body to +implicitly return that new instance. + +Listing 5-4 shows a `build_user` function that returns a `User` instance with +the given email and username. The `active` field gets the value of `true`, and +the `sign_in_count` gets a value of `1`. + +``` +fn build_user(email: String, username: String) -> User { + User { + active: true, + username: username, + email: email, + sign_in_count: 1, + } +} +``` + +Listing 5-4: A `build_user` function that takes an email and username and +returns a `User` instance + +It makes sense to name the function parameters with the same name as the struct +fields, but having to repeat the `email` and `username` field names and +variables is a bit tedious. If the struct had more fields, repeating each name +would get even more annoying. Luckily, there’s a convenient shorthand! + +### Using the Field Init Shorthand + +Because the parameter names and the struct field names are exactly the same in +Listing 5-4, we can use the *field init shorthand* syntax to rewrite +`build_user` so it behaves exactly the same but doesn’t have the repetition of +`username` and `email`, as shown in Listing 5-5. + +``` +fn build_user(email: String, username: String) -> User { + User { + active: true, + username, + email, + sign_in_count: 1, + } +} +``` + +Listing 5-5: A `build_user` function that uses field init shorthand because the +`username` and `email` parameters have the same name as struct fields + +Here, we’re creating a new instance of the `User` struct, which has a field +named `email`. We want to set the `email` field’s value to the value in the +`email` parameter of the `build_user` function. Because the `email` field and +the `email` parameter have the same name, we only need to write `email` rather +than `email: email`. + +### Creating Instances from Other Instances with Struct Update Syntax + +It’s often useful to create a new instance of a struct that includes most of +the values from another instance, but changes some. You can do this using +*struct update syntax*. + +First, in Listing 5-6 we show how to create a new `User` instance in `user2` +regularly, without the update syntax. We set a new value for `email` but +otherwise use the same values from `user1` that we created in Listing 5-2. + +Filename: src/main.rs + +``` +fn main() { + --snip-- + + let user2 = User { + active: user1.active, + username: user1.username, + email: String::from("another@example.com"), + sign_in_count: user1.sign_in_count, + }; +} +``` + +Listing 5-6: Creating a new `User` instance using one of the values from `user1` + +Using struct update syntax, we can achieve the same effect with less code, as +shown in Listing 5-7. The syntax `..` specifies that the remaining fields not +explicitly set should have the same value as the fields in the given instance. + +Filename: src/main.rs + +``` +fn main() { + --snip-- + + + let user2 = User { + email: String::from("another@example.com"), + ..user1 + }; +} +``` + +Listing 5-7: Using struct update syntax to set a new `email` value for a `User` +instance but to use the rest of the values from `user1` + +The code in Listing 5-7 also creates an instance in `user2` that has a +different value for `email` but has the same values for the `username`, +`active`, and `sign_in_count` fields from `user1`. The `..user1` must come last +to specify that any remaining fields should get their values from the +corresponding fields in `user1`, but we can choose to specify values for as +many fields as we want in any order, regardless of the order of the fields in +the struct’s definition. + +Note that the struct update syntax uses `=` like an assignment; this is because +it moves the data, just as we saw in “Variables and Data Interacting with Move” +on page XX. In this example, we can no longer use `user1` after creating +`user2` because the `String` in the `username` field of `user1` was moved into +`user2`. If we had given `user2` new `String` values for both `email` and +`username`, and thus only used the `active` and `sign_in_count` values from +`user1`, then `user1` would still be valid after creating `user2`. Both +`active` and `sign_in_count` are types that implement the `Copy` trait, so the +behavior we discussed in “Stack-Only Data: Copy” on page XX would apply. + +### Using Tuple Structs Without Named Fields to Create Different Types + +Rust also supports structs that look similar to tuples, called *tuple structs*. +Tuple structs have the added meaning the struct name provides but don’t have +names associated with their fields; rather, they just have the types of the +fields. Tuple structs are useful when you want to give the whole tuple a name +and make the tuple a different type from other tuples, and when naming each +field as in a regular struct would be verbose or redundant. + +To define a tuple struct, start with the `struct` keyword and the struct name +followed by the types in the tuple. For example, here we define and use two +tuple structs named `Color` and `Point`: + +Filename: src/main.rs + +``` +struct Color(i32, i32, i32); +struct Point(i32, i32, i32); + +fn main() { + let black = Color(0, 0, 0); + let origin = Point(0, 0, 0); +} +``` + +Note that the `black` and `origin` values are different types because they’re +instances of different tuple structs. Each struct you define is its own type, +even though the fields within the struct might have the same types. For +example, a function that takes a parameter of type `Color` cannot take a +`Point` as an argument, even though both types are made up of three `i32` +values. Otherwise, tuple struct instances are similar to tuples in that you can +destructure them into their individual pieces, and you can use a `.` followed +by the index to access an individual value. + +### Unit-Like Structs Without Any Fields + +You can also define structs that don’t have any fields! These are called +*unit-like structs* because they behave similarly to `()`, the unit type that +we mentioned in “The Tuple Type” on page XX. Unit-like structs can be useful +when you need to implement a trait on some type but don’t have any data that +you want to store in the type itself. We’ll discuss traits in Chapter 10. +Here’s an example of declaring and instantiating a unit struct named +`AlwaysEqual`: + +Filename: src/main.rs + +``` +struct AlwaysEqual; + +fn main() { + let subject = AlwaysEqual; +} +``` + +To define `AlwaysEqual`, we use the `struct` keyword, the name we want, and +then a semicolon. No need for curly brackets or parentheses! Then we can get an +instance of `AlwaysEqual` in the `subject` variable in a similar way: using the +name we defined, without any curly brackets or parentheses. Imagine that later +we’ll implement behavior for this type such that every instance of +`AlwaysEqual` is always equal to every instance of any other type, perhaps to +have a known result for testing purposes. We wouldn’t need any data to +implement that behavior! You’ll see in Chapter 10 how to define traits and +implement them on any type, including unit-like structs. + +> ### Ownership of Struct Data +> +> In the `User` struct definition in Listing 5-1, we used the owned `String` +type rather than the `&str` string slice type. This is a deliberate choice +because we want each instance of this struct to own all of its data and for +that data to be valid for as long as the entire struct is valid. +> +> It’s also possible for structs to store references to data owned by something +else, but to do so requires the use of *lifetimes*, a Rust feature that we’ll +discuss in Chapter 10. Lifetimes ensure that the data referenced by a struct is +valid for as long as the struct is. Let’s say you try to store a reference in a +struct without specifying lifetimes, like the following in *src/main.rs*; this +won’t work: +> +> ``` +> struct User { +> active: bool, +> username: &str, +> email: &str, +> sign_in_count: u64, +> } +> +> fn main() { +> let user1 = User { +> active: true, +> username: "someusername123", +> email: "someone@example.com", +> sign_in_count: 1, +> }; +> } +> ``` +> +> The compiler will complain that it needs lifetime specifiers: +> +> ``` +> $ `cargo run` +> Compiling structs v0.1.0 (file:///projects/structs) +> error[E0106]: missing lifetime specifier +> --> src/main.rs:3:15 +> | +> 3 | username: &str, +> | ^ expected named lifetime parameter +> | +> help: consider introducing a named lifetime parameter +> | +> 1 ~ struct User<'a> { +> 2 | active: bool, +> 3 ~ username: &'a str, +> | +> +> error[E0106]: missing lifetime specifier +> --> src/main.rs:4:12 +> | +> 4 | email: &str, +> | ^ expected named lifetime parameter +> | +> help: consider introducing a named lifetime parameter +> | +> 1 ~ struct User<'a> { +> 2 | active: bool, +> 3 | username: &str, +> 4 ~ email: &'a str, +> | +> ``` +> +> In Chapter 10, we’ll discuss how to fix these errors so you can store +references in structs, but for now, we’ll fix errors like these using owned +types like `String` instead of references like `&str`. + +## An Example Program Using Structs + +To understand when we might want to use structs, let’s write a program that +calculates the area of a rectangle. We’ll start by using single variables, and +then refactor the program until we’re using structs instead. + +Let’s make a new binary project with Cargo called *rectangles* that will take +the width and height of a rectangle specified in pixels and calculate the area +of the rectangle. Listing 5-8 shows a short program with one way of doing +exactly that in our project’s *src/main.rs*. + +Filename: src/main.rs + +``` +fn main() { + let width1 = 30; + let height1 = 50; + + println!( + "The area of the rectangle is {} square pixels.", + area(width1, height1) + ); +} + +fn area(width: u32, height: u32) -> u32 { + width * height +} +``` + +Listing 5-8: Calculating the area of a rectangle specified by separate width +and height variables + +Now, run this program using `cargo run`: + +``` +The area of the rectangle is 1500 square pixels. +``` + +This code succeeds in figuring out the area of the rectangle by calling the +`area` function with each dimension, but we can do more to make this code clear +and readable. + +The issue with this code is evident in the signature of `area`: + +``` +fn area(width: u32, height: u32) -> u32 { +``` + +The `area` function is supposed to calculate the area of one rectangle, but the +function we wrote has two parameters, and it’s not clear anywhere in our +program that the parameters are related. It would be more readable and more +manageable to group width and height together. We’ve already discussed one way +we might do that in “The Tuple Type” on page XX: by using tuples. + +### Refactoring with Tuples + +Listing 5-9 shows another version of our program that uses tuples. + +Filename: src/main.rs + +``` +fn main() { + let rect1 = (30, 50); + + println!( + "The area of the rectangle is {} square pixels.", + 1 area(rect1) + ); +} + +fn area(dimensions: (u32, u32)) -> u32 { + 2 dimensions.0 * dimensions.1 +} +``` + +Listing 5-9: Specifying the width and height of the rectangle with a tuple + +In one way, this program is better. Tuples let us add a bit of structure, and +we’re now passing just one argument [1]. But in another way, this version is +less clear: tuples don’t name their elements, so we have to index into the +parts of the tuple [2], making our calculation less obvious. + +Mixing up the width and height wouldn’t matter for the area calculation, but if +we want to draw the rectangle on the screen, it would matter! We would have to +keep in mind that `width` is the tuple index `0` and `height` is the tuple +index `1`. This would be even harder for someone else to figure out and keep in +mind if they were to use our code. Because we haven’t conveyed the meaning of +our data in our code, it’s now easier to introduce errors. + +### Refactoring with Structs: Adding More Meaning + +We use structs to add meaning by labeling the data. We can transform the tuple +we’re using into a struct with a name for the whole as well as names for the +parts, as shown in Listing 5-10. + +Filename: src/main.rs + +``` +1 struct Rectangle { + 2 width: u32, + height: u32, +} + +fn main() { + 3 let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!( + "The area of the rectangle is {} square pixels.", + area(&rect1) + ); +} + +4 fn area(rectangle: &Rectangle) -> u32 { + 5 rectangle.width * rectangle.height +} +``` + +Listing 5-10: Defining a `Rectangle` struct + +Here, we’ve defined a struct and named it `Rectangle` [1]. Inside the curly +brackets, we defined the fields as `width` and `height`, both of which have +type `u32` [2]. Then, in `main`, we created a particular instance of +`Rectangle` that has a width of `30` and a height of `50` [3]. + +Our `area` function is now defined with one parameter, which we’ve named +`rectangle`, whose type is an immutable borrow of a struct `Rectangle` instance +[4]. As mentioned in Chapter 4, we want to borrow the struct rather than take +ownership of it. This way, `main` retains its ownership and can continue using +`rect1`, which is the reason we use the `&` in the function signature and where +we call the function. + +The `area` function accesses the `width` and `height` fields of the `Rectangle` +instance [5] (note that accessing fields of a borrowed struct instance does not +move the field values, which is why you often see borrows of structs). Our +function signature for `area` now says exactly what we mean: calculate the area +of `Rectangle`, using its `width` and `height` fields. This conveys that the +width and height are related to each other, and it gives descriptive names to +the values rather than using the tuple index values of `0` and `1`. This is a +win for clarity. + +### Adding Useful Functionality with Derived Traits + +It’d be useful to be able to print an instance of `Rectangle` while we’re +debugging our program and see the values for all its fields. Listing 5-11 tries +using the `println!` macro as we have used in previous chapters. This won’t +work, however. + +Filename: src/main.rs + +``` +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {}", rect1); +} +``` + +Listing 5-11: Attempting to print a `Rectangle` instance + +When we compile this code, we get an error with this core message: + +``` +error[E0277]: `Rectangle` doesn't implement `std::fmt::Display` +``` + +The `println!` macro can do many kinds of formatting, and by default, the curly +brackets tell `println!` to use formatting known as `Display`: output intended +for direct end user consumption. The primitive types we’ve seen so far +implement `Display` by default because there’s only one way you’d want to show +a `1` or any other primitive type to a user. But with structs, the way +`println!` should format the output is less clear because there are more +display possibilities: Do you want commas or not? Do you want to print the +curly brackets? Should all the fields be shown? Due to this ambiguity, Rust +doesn’t try to guess what we want, and structs don’t have a provided +implementation of `Display` to use with `println!` and the `{}` placeholder. + +If we continue reading the errors, we’ll find this helpful note: + +``` += help: the trait `std::fmt::Display` is not implemented for `Rectangle` += note: in format strings you may be able to use `{:?}` (or {:#?} for +pretty-print) instead +``` + +Let’s try it! The `println!` macro call will now look like `println!("rect1 is +{:?}", rect1);`. Putting the specifier `:?` inside the curly brackets tells +`println!` we want to use an output format called `Debug`. The `Debug` trait +enables us to print our struct in a way that is useful for developers so we can +see its value while we’re debugging our code. + +Compile the code with this change. Drat! We still get an error: + +``` +error[E0277]: `Rectangle` doesn't implement `Debug` +``` + +But again, the compiler gives us a helpful note: + +``` += help: the trait `Debug` is not implemented for `Rectangle` += note: add `#[derive(Debug)]` or manually implement `Debug` +``` + +Rust *does* include functionality to print out debugging information, but we +have to explicitly opt in to make that functionality available for our struct. +To do that, we add the outer attribute `#[derive(Debug)]` just before the +struct definition, as shown in Listing 5-12. + +Filename: src/main.rs + +``` +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!("rect1 is {:?}", rect1); +} +``` + +Listing 5-12: Adding the attribute to derive the `Debug` trait and printing the +`Rectangle` instance using debug formatting + +Now when we run the program, we won’t get any errors, and we’ll see the +following output: + +``` +rect1 is Rectangle { width: 30, height: 50 } +``` + +Nice! It’s not the prettiest output, but it shows the values of all the fields +for this instance, which would definitely help during debugging. When we have +larger structs, it’s useful to have output that’s a bit easier to read; in +those cases, we can use `{:#?}` instead of `{:?}` in the `println!` string. In +this example, using the `{:#?}` style will output the following: + +``` +rect1 is Rectangle { + width: 30, + height: 50, +} +``` + +Another way to print out a value using the `Debug` format is to use the `dbg!` +macro, which takes ownership of an expression (as opposed to `println!`, which +takes a reference), prints the file and line number of where that `dbg!` macro +call occurs in your code along with the resultant value of that expression, and +returns ownership of the value. + +> Note: Calling the `dbg!` macro prints to the standard error console stream +(`stderr`), as opposed to `println!`, which prints to the standard output +console stream (`stdout`). We’ll talk more about `stderr` and `stdout` in +“Writing Error Messages to Standard Error Instead of Standard Output” on page +XX. + +Here’s an example where we’re interested in the value that gets assigned to the +`width` field, as well as the value of the whole struct in `rect1`: + +Filename: src/main.rs + +``` +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let scale = 2; + let rect1 = Rectangle { + 1 width: dbg!(30 * scale), + height: 50, + }; + + 2 dbg!(&rect1); +} +``` + +We can put `dbg!` around the expression `30 * scale` [1] and, because `dbg!` +returns ownership of the expression’s value, the `width` field will get the +same value as if we didn’t have the `dbg!` call there. We don’t want `dbg!` to +take ownership of `rect1`, so we use a reference to `rect1` in the next call +[2]. Here’s what the output of this example looks like: + +``` +[src/main.rs:10] 30 * scale = 60 +[src/main.rs:14] &rect1 = Rectangle { + width: 60, + height: 50, +} +``` + +We can see the first bit of output came from [1] where we’re debugging the +expression `30 * scale`, and its resultant value is `60` (the `Debug` +formatting implemented for integers is to print only their value). The `dbg!` +call at [2] outputs the value of `&rect1`, which is the `Rectangle` struct. +This output uses the pretty `Debug` formatting of the `Rectangle` type. The +`dbg!` macro can be really helpful when you’re trying to figure out what your +code is doing! + +In addition to the `Debug` trait, Rust has provided a number of traits for us +to use with the `derive` attribute that can add useful behavior to our custom +types. Those traits and their behaviors are listed in Appendix C. We’ll cover +how to implement these traits with custom behavior as well as how to create +your own traits in Chapter 10. There are also many attributes other than +`derive`; for more information, see the “Attributes” section of the Rust +Reference at *https://doc.rust-lang.org/reference/attributes.html*. + +Our `area` function is very specific: it only computes the area of rectangles. +It would be helpful to tie this behavior more closely to our `Rectangle` struct +because it won’t work with any other type. Let’s look at how we can continue to +refactor this code by turning the `area` function into an `area` *method* +defined on our `Rectangle` type. + +## Method Syntax + +*Methods* are similar to functions: we declare them with the `fn` keyword and a +name, they can have parameters and a return value, and they contain some code +that’s run when the method is called from somewhere else. Unlike functions, +methods are defined within the context of a struct (or an enum or a trait +object, which we cover in Chapter 6 and Chapter 17, respectively), and their +first parameter is always `self`, which represents the instance of the struct +the method is being called on. + +### Defining Methods + +Let’s change the `area` function that has a `Rectangle` instance as a parameter +and instead make an `area` method defined on the `Rectangle` struct, as shown +in Listing 5-13. + +Filename: src/main.rs + +``` +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +1 impl Rectangle { + 2 fn area(&self) -> u32 { + self.width * self.height + } +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + println!( + "The area of the rectangle is {} square pixels.", + 3 rect1.area() + ); +} +``` + +Listing 5-13: Defining an `area` method on the `Rectangle` struct + +To define the function within the context of `Rectangle`, we start an `impl` +(implementation) block for `Rectangle` [1]. Everything within this `impl` block +will be associated with the `Rectangle` type. Then we move the `area` function +within the `impl` curly brackets [2] and change the first (and in this case, +only) parameter to be `self` in the signature and everywhere within the body. +In `main`, where we called the `area` function and passed `rect1` as an +argument, we can instead use *method syntax* to call the `area` method on our +`Rectangle` instance [3]. The method syntax goes after an instance: we add a +dot followed by the method name, parentheses, and any arguments. + +In the signature for `area`, we use `&self` instead of `rectangle: &Rectangle`. +The `&self` is actually short for `self: &Self`. Within an `impl` block, the +type `Self` is an alias for the type that the `impl` block is for. Methods must +have a parameter named `self` of type `Self` for their first parameter, so Rust +lets you abbreviate this with only the name `self` in the first parameter spot. +Note that we still need to use the `&` in front of the `self` shorthand to +indicate that this method borrows the `Self` instance, just as we did in +`rectangle: &Rectangle`. Methods can take ownership of `self`, borrow `self` +immutably, as we’ve done here, or borrow `self` mutably, just as they can any +other parameter. + +We chose `&self` here for the same reason we used `&Rectangle` in the function +version: we don’t want to take ownership, and we just want to read the data in +the struct, not write to it. If we wanted to change the instance that we’ve +called the method on as part of what the method does, we’d use `&mut self` as +the first parameter. Having a method that takes ownership of the instance by +using just `self` as the first parameter is rare; this technique is usually +used when the method transforms `self` into something else and you want to +prevent the caller from using the original instance after the transformation. + +The main reason for using methods instead of functions, in addition to +providing method syntax and not having to repeat the type of `self` in every +method’s signature, is for organization. We’ve put all the things we can do +with an instance of a type in one `impl` block rather than making future users +of our code search for capabilities of `Rectangle` in various places in the +library we provide. + +Note that we can choose to give a method the same name as one of the struct’s +fields. For example, we can define a method on `Rectangle` that is also named +`width`: + +Filename: src/main.rs + +``` +impl Rectangle { + fn width(&self) -> bool { + self.width > 0 + } +} + +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + + if rect1.width() { + println!( + "The rectangle has a nonzero width; it is {}", + rect1.width + ); + } +} +``` + +Here, we’re choosing to make the `width` method return `true` if the value in +the instance’s `width` field is greater than `0` and `false` if the value is +`0`: we can use a field within a method of the same name for any purpose. In +`main`, when we follow `rect1.width` with parentheses, Rust knows we mean the +method `width`. When we don’t use parentheses, Rust knows we mean the field +`width`. + +Often, but not always, when we give methods with the same name as a field we +want it to only return the value in the field and do nothing else. Methods like +this are called *getters*, and Rust does not implement them automatically for +struct fields as some other languages do. Getters are useful because you can +make the field private but the method public, and thus enable read-only access +to that field as part of the type’s public API. We will discuss what public and +private are and how to designate a field or method as public or private in +Chapter 7. + +> ### Where’s the -> Operator? +> +> In C and C++, two different operators are used for calling methods: you use +`.` if you’re calling a method on the object directly and `->` if you’re +calling the method on a pointer to the object and need to dereference the +pointer first. In other words, if `object` is a pointer, +`object->`something`()` is similar to `(*object).`something`()`. +> +> Rust doesn’t have an equivalent to the `->` operator; instead, Rust has a +feature called *automatic referencing and dereferencing*. Calling methods is +one of the few places in Rust that has this behavior. +> +> Here’s how it works: when you call a method with `object.`something`()`, Rust +automatically adds in `&`, `&mut`, or `*` so `object` matches the signature of +the method. In other words, the following are the same: +> +> ``` +> p1.distance(&p2); +> (&p1).distance(&p2); +> ``` +> +> The first one looks much cleaner. This automatic referencing behavior works +because methods have a clear receiver—the type of `self`. Given the receiver +and name of a method, Rust can figure out definitively whether the method is +reading (`&self`), mutating (`&mut self`), or consuming (`self`). The fact that +Rust makes borrowing implicit for method receivers is a big part of making +ownership ergonomic in practice. + +### Methods with More Parameters + +Let’s practice using methods by implementing a second method on the `Rectangle` +struct. This time we want an instance of `Rectangle` to take another instance +of `Rectangle` and return `true` if the second `Rectangle` can fit completely +within `self` (the first `Rectangle`); otherwise, it should return `false`. +That is, once we’ve defined the `can_hold` method, we want to be able to write +the program shown in Listing 5-14. + +Filename: src/main.rs + +``` +fn main() { + let rect1 = Rectangle { + width: 30, + height: 50, + }; + let rect2 = Rectangle { + width: 10, + height: 40, + }; + let rect3 = Rectangle { + width: 60, + height: 45, + }; + + println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2)); + println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3)); +} +``` + +Listing 5-14: Using the as-yet-unwritten `can_hold` method + +The expected output would look like the following because both dimensions of +`rect2` are smaller than the dimensions of `rect1`, but `rect3` is wider than +`rect1`: + +``` +Can rect1 hold rect2? true +Can rect1 hold rect3? false +``` + +We know we want to define a method, so it will be within the `impl Rectangle` +block. The method name will be `can_hold`, and it will take an immutable borrow +of another `Rectangle` as a parameter. We can tell what the type of the +parameter will be by looking at the code that calls the method: +`rect1.can_hold(&rect2)` passes in `&rect2`, which is an immutable borrow to +`rect2`, an instance of `Rectangle`. This makes sense because we only need to +read `rect2` (rather than write, which would mean we’d need a mutable borrow), +and we want `main` to retain ownership of `rect2` so we can use it again after +calling the `can_hold` method. The return value of `can_hold` will be a +Boolean, and the implementation will check whether the width and height of +`self` are greater than the width and height of the other `Rectangle`, +respectively. Let’s add the new `can_hold` method to the `impl` block from +Listing 5-13, shown in Listing 5-15. + +Filename: src/main.rs + +``` +impl Rectangle { + fn area(&self) -> u32 { + self.width * self.height + } + + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} +``` + +Listing 5-15: Implementing the `can_hold` method on `Rectangle` that takes +another `Rectangle` instance as a parameter + +When we run this code with the `main` function in Listing 5-14, we’ll get our +desired output. Methods can take multiple parameters that we add to the +signature after the `self` parameter, and those parameters work just like +parameters in functions. + +### Associated Functions + +All functions defined within an `impl` block are called *associated functions* +because they’re associated with the type named after the `impl`. We can define +associated functions that don’t have `self` as their first parameter (and thus +are not methods) because they don’t need an instance of the type to work with. +We’ve already used one function like this: the `String::from` function that’s +defined on the `String` type. + +Associated functions that aren’t methods are often used for constructors that +will return a new instance of the struct. These are often called `new`, but +`new` isn’t a special name and isn’t built into the language. For example, we +could choose to provide an associated function named `square` that would have +one dimension parameter and use that as both width and height, thus making it +easier to create a square `Rectangle` rather than having to specify the same +value twice: + +Filename: src/main.rs + +``` +impl Rectangle { + fn square(size: u32) -> 1 Self { + 2 Self { + width: size, + height: size, + } + } +} +``` + +The `Self` keywords in the return type [1] and in the body of the function [2] +are aliases for the type that appears after the `impl` keyword, which in this +case is `Rectangle`. + +To call this associated function, we use the `::` syntax with the struct name; +`let sq = Rectangle::square(3);` is an example. This function is namespaced by +the struct: the `::` syntax is used for both associated functions and +namespaces created by modules. We’ll discuss modules in Chapter 7. + +### Multiple impl Blocks + +Each struct is allowed to have multiple `impl` blocks. For example, Listing +5-15 is equivalent to the code shown in Listing 5-16, which has each method in +its own `impl` block. + +``` +impl Rectangle { + fn area(&self) -> u32 { + self.width * self.height + } +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} +``` + +Listing 5-16: Rewriting Listing 5-15 using multiple `impl` blocks + +There’s no reason to separate these methods into multiple `impl` blocks here, +but this is valid syntax. We’ll see a case in which multiple `impl` blocks are +useful in Chapter 10, where we discuss generic types and traits. + +## Summary + +Structs let you create custom types that are meaningful for your domain. By +using structs, you can keep associated pieces of data connected to each other +and name each piece to make your code clear. In `impl` blocks, you can define +functions that are associated with your type, and methods are a kind of +associated function that let you specify the behavior that instances of your +structs have. + +But structs aren’t the only way you can create custom types: let’s turn to +Rust’s enum feature to add another tool to your toolbox. + diff --git a/rustbook-ru/nostarch/chapter06.md b/rustbook-ru/nostarch/chapter06.md new file mode 100644 index 000000000..ea4328bea --- /dev/null +++ b/rustbook-ru/nostarch/chapter06.md @@ -0,0 +1,845 @@ + + +[TOC] + +# Enums and Pattern Matching + +In this chapter, we’ll look at *enumerations*, also referred to as *enums*. +Enums allow you to define a type by enumerating its possible *variants*. First +we’ll define and use an enum to show how an enum can encode meaning along with +data. Next, we’ll explore a particularly useful enum, called `Option`, which +expresses that a value can be either something or nothing. Then we’ll look at +how pattern matching in the `match` expression makes it easy to run different +code for different values of an enum. Finally, we’ll cover how the `if let` +construct is another convenient and concise idiom available to handle enums in +your code. + +## Defining an Enum + +Where structs give you a way of grouping together related fields and data, like +a `Rectangle` with its `width` and `height`, enums give you a way of saying a +value is one of a possible set of values. For example, we may want to say that +`Rectangle` is one of a set of possible shapes that also includes `Circle` and +`Triangle`. To do this, Rust allows us to encode these possibilities as an enum. + +Let’s look at a situation we might want to express in code and see why enums +are useful and more appropriate than structs in this case. Say we need to work +with IP addresses. Currently, two major standards are used for IP addresses: +version four and version six. Because these are the only possibilities for an +IP address that our program will come across, we can *enumerate* all possible +variants, which is where enumeration gets its name. + +Any IP address can be either a version four or a version six address, but not +both at the same time. That property of IP addresses makes the enum data +structure appropriate because an enum value can only be one of its variants. +Both version four and version six addresses are still fundamentally IP +addresses, so they should be treated as the same type when the code is handling +situations that apply to any kind of IP address. + +We can express this concept in code by defining an `IpAddrKind` enumeration and +listing the possible kinds an IP address can be, `V4` and `V6`. These are the +variants of the enum: + +``` +enum IpAddrKind { + V4, + V6, +} +``` + +`IpAddrKind` is now a custom data type that we can use elsewhere in our code. + +### Enum Values + +We can create instances of each of the two variants of `IpAddrKind` like this: + +``` +let four = IpAddrKind::V4; +let six = IpAddrKind::V6; +``` + +Note that the variants of the enum are namespaced under its identifier, and we +use a double colon to separate the two. This is useful because now both values +`IpAddrKind::V4` and `IpAddrKind::V6` are of the same type: `IpAddrKind`. We +can then, for instance, define a function that takes any `IpAddrKind`: + +``` +fn route(ip_kind: IpAddrKind) {} +``` + +And we can call this function with either variant: + +``` +route(IpAddrKind::V4); +route(IpAddrKind::V6); +``` + +Using enums has even more advantages. Thinking more about our IP address type, +at the moment we don’t have a way to store the actual IP address *data*; we +only know what *kind* it is. Given that you just learned about structs in +Chapter 5, you might be tempted to tackle this problem with structs as shown in +Listing 6-1. + +``` +1 enum IpAddrKind { + V4, + V6, +} + +2 struct IpAddr { + 3 kind: IpAddrKind, + 4 address: String, +} + +5 let home = IpAddr { + kind: IpAddrKind::V4, + address: String::from("127.0.0.1"), +}; + +6 let loopback = IpAddr { + kind: IpAddrKind::V6, + address: String::from("::1"), +}; +``` + +Listing 6-1: Storing the data and `IpAddrKind` variant of an IP address using a +`struct` + +Here, we’ve defined a struct `IpAddr` [2] that has two fields: a `kind` field +[3] that is of type `IpAddrKind` (the enum we defined previously [1]) and an +`address` field [4] of type `String`. We have two instances of this struct. The +first is `home` [5], and it has the value `IpAddrKind::V4` as its `kind` with +associated address data of `127.0.0.1`. The second instance is `loopback` [6]. +It has the other variant of `IpAddrKind` as its `kind` value, `V6`, and has +address `::1` associated with it. We’ve used a struct to bundle the `kind` and +`address` values together, so now the variant is associated with the value. + +However, representing the same concept using just an enum is more concise: +rather than an enum inside a struct, we can put data directly into each enum +variant. This new definition of the `IpAddr` enum says that both `V4` and `V6` +variants will have associated `String` values: + +``` +enum IpAddr { + V4(String), + V6(String), +} + +let home = IpAddr::V4(String::from("127.0.0.1")); + +let loopback = IpAddr::V6(String::from("::1")); +``` + +We attach data to each variant of the enum directly, so there is no need for an +extra struct. Here, it’s also easier to see another detail of how enums work: +the name of each enum variant that we define also becomes a function that +constructs an instance of the enum. That is, `IpAddr::V4()` is a function call +that takes a `String` argument and returns an instance of the `IpAddr` type. We +automatically get this constructor function defined as a result of defining the +enum. + +There’s another advantage to using an enum rather than a struct: each variant +can have different types and amounts of associated data. Version four IP +addresses will always have four numeric components that will have values +between 0 and 255. If we wanted to store `V4` addresses as four `u8` values but +still express `V6` addresses as one `String` value, we wouldn’t be able to with +a struct. Enums handle this case with ease: + +``` +enum IpAddr { + V4(u8, u8, u8, u8), + V6(String), +} + +let home = IpAddr::V4(127, 0, 0, 1); + +let loopback = IpAddr::V6(String::from("::1")); +``` + +We’ve shown several different ways to define data structures to store version +four and version six IP addresses. However, as it turns out, wanting to store +IP addresses and encode which kind they are is so common that the standard +library has a definition we can use! Let’s look at how the standard library +defines `IpAddr`: it has the exact enum and variants that we’ve defined and +used, but it embeds the address data inside the variants in the form of two +different structs, which are defined differently for each variant: + +``` +struct Ipv4Addr { + --snip-- +} + +struct Ipv6Addr { + --snip-- +} + +enum IpAddr { + V4(Ipv4Addr), + V6(Ipv6Addr), +} +``` + +This code illustrates that you can put any kind of data inside an enum variant: +strings, numeric types, or structs, for example. You can even include another +enum! Also, standard library types are often not much more complicated than +what you might come up with. + +Note that even though the standard library contains a definition for `IpAddr`, +we can still create and use our own definition without conflict because we +haven’t brought the standard library’s definition into our scope. We’ll talk +more about bringing types into scope in Chapter 7. + +Let’s look at another example of an enum in Listing 6-2: this one has a wide +variety of types embedded in its variants. + +``` +enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(i32, i32, i32), +} +``` + +Listing 6-2: A `Message` enum whose variants each store different amounts and +types of values + +This enum has four variants with different types: + +* `Quit` has no data associated with it at all. +* `Move` has named fields, like a struct does. +* `Write` includes a single `String`. +* `ChangeColor` includes three `i32` values. + +Defining an enum with variants such as the ones in Listing 6-2 is similar to +defining different kinds of struct definitions, except the enum doesn’t use the +`struct` keyword and all the variants are grouped together under the `Message` +type. The following structs could hold the same data that the preceding enum +variants hold: + +``` +struct QuitMessage; // unit struct +struct MoveMessage { + x: i32, + y: i32, +} +struct WriteMessage(String); // tuple struct +struct ChangeColorMessage(i32, i32, i32); // tuple struct +``` + +But if we used the different structs, each of which has its own type, we +couldn’t as easily define a function to take any of these kinds of messages as +we could with the `Message` enum defined in Listing 6-2, which is a single type. + +There is one more similarity between enums and structs: just as we’re able to +define methods on structs using `impl`, we’re also able to define methods on +enums. Here’s a method named `call` that we could define on our `Message` enum: + +``` +impl Message { + fn call(&self) { + 1 // method body would be defined here + } +} + +2 let m = Message::Write(String::from("hello")); +m.call(); +``` + +The body of the method would use `self` to get the value that we called the +method on. In this example, we’ve created a variable `m` [2] that has the value +`Message::Write(String::from("hello"))`, and that is what `self` will be in the +body of the `call` method [1] when `m.call()` runs. + +Let’s look at another enum in the standard library that is very common and +useful: `Option`. + +### The Option Enum and Its Advantages Over Null Values + +This section explores a case study of `Option`, which is another enum defined +by the standard library. The `Option` type encodes the very common scenario in +which a value could be something or it could be nothing. + +For example, if you request the first item in a list containing multiple items, +you would get a value. If you request the first item in an empty list, you +would get nothing. Expressing this concept in terms of the type system means +the compiler can check whether you’ve handled all the cases you should be +handling; this functionality can prevent bugs that are extremely common in +other programming languages. + +Programming language design is often thought of in terms of which features you +include, but the features you exclude are important too. Rust doesn’t have the +null feature that many other languages have. *Null* is a value that means there +is no value there. In languages with null, variables can always be in one of +two states: null or not-null. + +In his 2009 presentation “Null References: The Billion Dollar Mistake,” Tony +Hoare, the inventor of null, has this to say: + +> I call it my billion-dollar mistake. At that time, I was designing the first +comprehensive type system for references in an object-oriented language. My +goal was to ensure that all use of references should be absolutely safe, with +checking performed automatically by the compiler. But I couldn’t resist the +temptation to put in a null reference, simply because it was so easy to +implement. This has led to innumerable errors, vulnerabilities, and system +crashes, which have probably caused a billion dollars of pain and damage in the +last forty years.The problem with null values is that if you try to use a null +value as a not-null value, you’ll get an error of some kind. Because this null +or not-null property is pervasive, it’s extremely easy to make this kind of +error. + +However, the concept that null is trying to express is still a useful one: a +null is a value that is currently invalid or absent for some reason. + +The problem isn’t really with the concept but with the particular +implementation. As such, Rust does not have nulls, but it does have an enum +that can encode the concept of a value being present or absent. This enum is +`Option`, and it is defined by the standard library as follows: + +``` +enum Option { + None, + Some(T), +} +``` + +The `Option` enum is so useful that it’s even included in the prelude; you +don’t need to bring it into scope explicitly. Its variants are also included in +the prelude: you can use `Some` and `None` directly without the `Option::` +prefix. The `Option` enum is still just a regular enum, and `Some(T)` and +`None` are still variants of type `Option`. + +The `` syntax is a feature of Rust we haven’t talked about yet. It’s a +generic type parameter, and we’ll cover generics in more detail in Chapter 10. +For now, all you need to know is that `` means that the `Some` variant of +the `Option` enum can hold one piece of data of any type, and that each +concrete type that gets used in place of `T` makes the overall `Option` type +a different type. Here are some examples of using `Option` values to hold +number types and string types: + +``` +let some_number = Some(5); +let some_char = Some('e'); + +let absent_number: Option = None; +``` + +The type of `some_number` is `Option`. The type of `some_char` is +`Option`, which is a different type. Rust can infer these types because +we’ve specified a value inside the `Some` variant. For `absent_number`, Rust +requires us to annotate the overall `Option` type: the compiler can’t infer the +type that the corresponding `Some` variant will hold by looking only at a +`None` value. Here, we tell Rust that we mean for `absent_number` to be of type +`Option`. + +When we have a `Some` value, we know that a value is present and the value is +held within the `Some`. When we have a `None` value, in some sense it means the +same thing as null: we don’t have a valid value. So why is having `Option` +any better than having null? + +In short, because `Option` and `T` (where `T` can be any type) are different +types, the compiler won’t let us use an `Option` value as if it were +definitely a valid value. For example, this code won’t compile, because it’s +trying to add an `i8` to an `Option`: + +``` +let x: i8 = 5; +let y: Option = Some(5); + +let sum = x + y; +``` + +If we run this code, we get an error message like this one: + +``` +error[E0277]: cannot add `Option` to `i8` + --> src/main.rs:5:17 + | +5 | let sum = x + y; + | ^ no implementation for `i8 + Option` + | + = help: the trait `Add>` is not implemented for `i8` +``` + +Intense! In effect, this error message means that Rust doesn’t understand how +to add an `i8` and an `Option`, because they’re different types. When we +have a value of a type like `i8` in Rust, the compiler will ensure that we +always have a valid value. We can proceed confidently without having to check +for null before using that value. Only when we have an `Option` (or +whatever type of value we’re working with) do we have to worry about possibly +not having a value, and the compiler will make sure we handle that case before +using the value. + +In other words, you have to convert an `Option` to a `T` before you can +perform `T` operations with it. Generally, this helps catch one of the most +common issues with null: assuming that something isn’t null when it actually is. + +Eliminating the risk of incorrectly assuming a not-null value helps you to be +more confident in your code. In order to have a value that can possibly be +null, you must explicitly opt in by making the type of that value `Option`. +Then, when you use that value, you are required to explicitly handle the case +when the value is null. Everywhere that a value has a type that isn’t an +`Option`, you *can* safely assume that the value isn’t null. This was a +deliberate design decision for Rust to limit null’s pervasiveness and increase +the safety of Rust code. + +So how do you get the `T` value out of a `Some` variant when you have a value +of type `Option` so that you can use that value? The `Option` enum has a +large number of methods that are useful in a variety of situations; you can +check them out in its documentation. Becoming familiar with the methods on +`Option` will be extremely useful in your journey with Rust. + +In general, in order to use an `Option` value, you want to have code that +will handle each variant. You want some code that will run only when you have a +`Some(T)` value, and this code is allowed to use the inner `T`. You want some +other code to run only if you have a `None` value, and that code doesn’t have a +`T` value available. The `match` expression is a control flow construct that +does just this when used with enums: it will run different code depending on +which variant of the enum it has, and that code can use the data inside the +matching value. + +## The match Control Flow Construct + +Rust has an extremely powerful control flow construct called `match` that +allows you to compare a value against a series of patterns and then execute +code based on which pattern matches. Patterns can be made up of literal values, +variable names, wildcards, and many other things; Chapter 18 covers all the +different kinds of patterns and what they do. The power of `match` comes from +the expressiveness of the patterns and the fact that the compiler confirms that +all possible cases are handled. + +Think of a `match` expression as being like a coin-sorting machine: coins slide +down a track with variously sized holes along it, and each coin falls through +the first hole it encounters that it fits into. In the same way, values go +through each pattern in a `match`, and at the first pattern the value “fits,” +the value falls into the associated code block to be used during execution. + +Speaking of coins, let’s use them as an example using `match`! We can write a +function that takes an unknown US coin and, in a similar way as the counting +machine, determines which coin it is and returns its value in cents, as shown +in Listing 6-3. + +``` +1 enum Coin { + Penny, + Nickel, + Dime, + Quarter, +} + +fn value_in_cents(coin: Coin) -> u8 { + 2 match coin { + 3 Coin::Penny => 1, + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter => 25, + } +} +``` + +Listing 6-3: An enum and a `match` expression that has the variants of the enum +as its patterns + +Let’s break down the `match` in the `value_in_cents` function. First we list +the `match` keyword followed by an expression, which in this case is the value +`coin` [2]. This seems very similar to an expression used with `if`, but +there’s a big difference: with `if`, the expression needs to return a Boolean +value, but here it can return any type. The type of `coin` in this example is +the `Coin` enum that we defined at [1]. + +Next are the `match` arms. An arm has two parts: a pattern and some code. The +first arm here has a pattern that is the value `Coin::Penny` and then the `=>` +operator that separates the pattern and the code to run [3]. The code in this +case is just the value `1`. Each arm is separated from the next with a comma. + +When the `match` expression executes, it compares the resultant value against +the pattern of each arm, in order. If a pattern matches the value, the code +associated with that pattern is executed. If that pattern doesn’t match the +value, execution continues to the next arm, much as in a coin-sorting machine. +We can have as many arms as we need: in Listing 6-3, our `match` has four arms. + +The code associated with each arm is an expression, and the resultant value of +the expression in the matching arm is the value that gets returned for the +entire `match` expression. + +We don’t typically use curly brackets if the match arm code is short, as it is +in Listing 6-3 where each arm just returns a value. If you want to run multiple +lines of code in a match arm, you must use curly brackets, and the comma +following the arm is then optional. For example, the following code prints +“Lucky penny!” every time the method is called with a `Coin::Penny`, but still +returns the last value of the block, `1`: + +``` +fn value_in_cents(coin: Coin) -> u8 { + match coin { + Coin::Penny => { + println!("Lucky penny!"); + 1 + } + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter => 25, + } +} +``` + +### Patterns That Bind to Values + +Another useful feature of match arms is that they can bind to the parts of the +values that match the pattern. This is how we can extract values out of enum +variants. + +As an example, let’s change one of our enum variants to hold data inside it. +From 1999 through 2008, the United States minted quarters with different +designs for each of the 50 states on one side. No other coins got state +designs, so only quarters have this extra value. We can add this information to +our `enum` by changing the `Quarter` variant to include a `UsState` value +stored inside it, which we’ve done in Listing 6-4. + +``` +#[derive(Debug)] // so we can inspect the state in a minute +enum UsState { + Alabama, + Alaska, + --snip-- +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} +``` + +Listing 6-4: A `Coin` enum in which the `Quarter` variant also holds a +`UsState` value + +Let’s imagine that a friend is trying to collect all 50 state quarters. While +we sort our loose change by coin type, we’ll also call out the name of the +state associated with each quarter so that if it’s one our friend doesn’t have, +they can add it to their collection. + +In the match expression for this code, we add a variable called `state` to the +pattern that matches values of the variant `Coin::Quarter`. When a +`Coin::Quarter` matches, the `state` variable will bind to the value of that +quarter’s state. Then we can use `state` in the code for that arm, like so: + +``` +fn value_in_cents(coin: Coin) -> u8 { + match coin { + Coin::Penny => 1, + Coin::Nickel => 5, + Coin::Dime => 10, + Coin::Quarter(state) => { + println!("State quarter from {:?}!", state); + 25 + } + } +} +``` + +If we were to call `value_in_cents(Coin::Quarter(UsState::Alaska))`, `coin` +would be `Coin::Quarter(UsState::Alaska)`. When we compare that value with each +of the match arms, none of them match until we reach `Coin::Quarter(state)`. At +that point, the binding for `state` will be the value `UsState::Alaska`. We can +then use that binding in the `println!` expression, thus getting the inner +state value out of the `Coin` enum variant for `Quarter`. + +### Matching with Option + +In the previous section, we wanted to get the inner `T` value out of the `Some` +case when using `Option`; we can also handle `Option` using `match`, as +we did with the `Coin` enum! Instead of comparing coins, we’ll compare the +variants of `Option`, but the way the `match` expression works remains the +same. + +Let’s say we want to write a function that takes an `Option` and, if +there’s a value inside, adds 1 to that value. If there isn’t a value inside, +the function should return the `None` value and not attempt to perform any +operations. + +This function is very easy to write, thanks to `match`, and will look like +Listing 6-5. + +``` +fn plus_one(x: Option) -> Option { + match x { + 1 None => None, + 2 Some(i) => Some(i + 1), + } +} + +let five = Some(5); +let six = plus_one(five); 3 +let none = plus_one(None); 4 +``` + +Listing 6-5: A function that uses a `match` expression on an `Option` + +Let’s examine the first execution of `plus_one` in more detail. When we call +`plus_one(five)` [3], the variable `x` in the body of `plus_one` will have the +value `Some(5)`. We then compare that against each match arm: + +``` +None => None, +``` + +The `Some(5)` value doesn’t match the pattern `None` [1], so we continue to the +next arm: + +``` +Some(i) => Some(i + 1), +``` + +Does `Some(5)` match `Some(i)` [2]? Why yes, it does! We have the same variant. +The `i` binds to the value contained in `Some`, so `i` takes the value `5`. The +code in the match arm is then executed, so we add 1 to the value of `i` and +create a new `Some` value with our total `6` inside. + +Now let’s consider the second call of `plus_one` in Listing 6-5, where `x` is +`None` [4]. We enter the `match` and compare to the first arm [1]. + +It matches! There’s no value to add to, so the program stops and returns the +`None` value on the right side of `=>`. Because the first arm matched, no other +arms are compared. + +Combining `match` and enums is useful in many situations. You’ll see this +pattern a lot in Rust code: `match` against an enum, bind a variable to the +data inside, and then execute code based on it. It’s a bit tricky at first, but +once you get used to it, you’ll wish you had it in all languages. It’s +consistently a user favorite. + +### Matches Are Exhaustive + +There’s one other aspect of `match` we need to discuss: the arms’ patterns must +cover all possibilities. Consider this version of our `plus_one` function, +which has a bug and won’t compile: + +``` +fn plus_one(x: Option) -> Option { + match x { + Some(i) => Some(i + 1), + } +} +``` + +We didn’t handle the `None` case, so this code will cause a bug. Luckily, it’s +a bug Rust knows how to catch. If we try to compile this code, we’ll get this +error: + +``` +error[E0004]: non-exhaustive patterns: `None` not covered + --> src/main.rs:3:15 + | +3 | match x { + | ^ pattern `None` not covered + | + note: `Option` defined here + = note: the matched value is of type `Option` +help: ensure that all possible cases are being handled by adding +a match arm with a wildcard pattern or an explicit pattern as +shown + | +4 ~ Some(i) => Some(i + 1), +5 ~ None => todo!(), + | +``` + +Rust knows that we didn’t cover every possible case, and even knows which +pattern we forgot! Matches in Rust are *exhaustive*: we must exhaust every last +possibility in order for the code to be valid. Especially in the case of +`Option`, when Rust prevents us from forgetting to explicitly handle the +`None` case, it protects us from assuming that we have a value when we might +have null, thus making the billion-dollar mistake discussed earlier impossible. + +### Catch-all Patterns and the _ Placeholder + +Using enums, we can also take special actions for a few particular values, but +for all other values take one default action. Imagine we’re implementing a game +where, if you roll a 3 on a dice roll, your player doesn’t move, but instead +gets a new fancy hat. If you roll a 7, your player loses a fancy hat. For all +other values, your player moves that number of spaces on the game board. Here’s +a `match` that implements that logic, with the result of the dice roll +hardcoded rather than a random value, and all other logic represented by +functions without bodies because actually implementing them is out of scope for +this example: + +``` +let dice_roll = 9; +match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + 1 other => move_player(other), +} + +fn add_fancy_hat() {} +fn remove_fancy_hat() {} +fn move_player(num_spaces: u8) {} +``` + +For the first two arms, the patterns are the literal values `3` and `7`. For +the last arm that covers every other possible value, the pattern is the +variable we’ve chosen to name `other` [1]. The code that runs for the `other` +arm uses the variable by passing it to the `move_player` function. + +This code compiles, even though we haven’t listed all the possible values a +`u8` can have, because the last pattern will match all values not specifically +listed. This catch-all pattern meets the requirement that `match` must be +exhaustive. Note that we have to put the catch-all arm last because the +patterns are evaluated in order. If we put the catch-all arm earlier, the other +arms would never run, so Rust will warn us if we add arms after a catch-all! + +Rust also has a pattern we can use when we want a catch-all but don’t want to +*use* the value in the catch-all pattern: `_` is a special pattern that matches +any value and does not bind to that value. This tells Rust we aren’t going to +use the value, so Rust won’t warn us about an unused variable. + +Let’s change the rules of the game: now, if you roll anything other than a 3 or +a 7, you must roll again. We no longer need to use the catch-all value, so we +can change our code to use `_` instead of the variable named `other`: + +``` +let dice_roll = 9; +match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + _ => reroll(), +} + +fn add_fancy_hat() {} +fn remove_fancy_hat() {} +fn reroll() {} +``` + +This example also meets the exhaustiveness requirement because we’re explicitly +ignoring all other values in the last arm; we haven’t forgotten anything. + +Finally, we’ll change the rules of the game one more time so that nothing else +happens on your turn if you roll anything other than a 3 or a 7. We can express +that by using the unit value (the empty tuple type we mentioned in “The Tuple +Type” on page XX) as the code that goes with the `_` arm: + +``` +let dice_roll = 9; +match dice_roll { + 3 => add_fancy_hat(), + 7 => remove_fancy_hat(), + _ => (), +} + +fn add_fancy_hat() {} +fn remove_fancy_hat() {} +``` + +Here, we’re telling Rust explicitly that we aren’t going to use any other value +that doesn’t match a pattern in an earlier arm, and we don’t want to run any +code in this case. + +There’s more about patterns and matching that we’ll cover in Chapter 18. For +now, we’re going to move on to the `if let` syntax, which can be useful in +situations where the `match` expression is a bit wordy. + +## Concise Control Flow with if let + +The `if let` syntax lets you combine `if` and `let` into a less verbose way to +handle values that match one pattern while ignoring the rest. Consider the +program in Listing 6-6 that matches on an `Option` value in the +`config_max` variable but only wants to execute code if the value is the `Some` +variant. + +``` +let config_max = Some(3u8); +match config_max { + Some(max) => println!("The maximum is configured to be {max}"), + _ => (), +} +``` + +Listing 6-6: A `match` that only cares about executing code when the value is +`Some` + +If the value is `Some`, we print out the value in the `Some` variant by binding +the value to the variable `max` in the pattern. We don’t want to do anything +with the `None` value. To satisfy the `match` expression, we have to add `_ => +()` after processing just one variant, which is annoying boilerplate code to +add. + +Instead, we could write this in a shorter way using `if let`. The following +code behaves the same as the `match` in Listing 6-6: + +``` +let config_max = Some(3u8); +if let Some(max) = config_max { + println!("The maximum is configured to be {max}"); +} +``` + +The syntax `if let` takes a pattern and an expression separated by an equal +sign. It works the same way as a `match`, where the expression is given to the +`match` and the pattern is its first arm. In this case, the pattern is +`Some(max)`, and the `max` binds to the value inside the `Some`. We can then +use `max` in the body of the `if let` block in the same way we used `max` in +the corresponding `match` arm. The code in the `if let` block isn’t run if the +value doesn’t match the pattern. + +Using `if let` means less typing, less indentation, and less boilerplate code. +However, you lose the exhaustive checking that `match` enforces. Choosing +between `match` and `if let` depends on what you’re doing in your particular +situation and whether gaining conciseness is an appropriate trade-off for +losing exhaustive checking. + +In other words, you can think of `if let` as syntax sugar for a `match` that +runs code when the value matches one pattern and then ignores all other values. + +We can include an `else` with an `if let`. The block of code that goes with the +`else` is the same as the block of code that would go with the `_` case in the +`match` expression that is equivalent to the `if let` and `else`. Recall the +`Coin` enum definition in Listing 6-4, where the `Quarter` variant also held a +`UsState` value. If we wanted to count all non-quarter coins we see while also +announcing the state of the quarters, we could do that with a `match` +expression, like this: + +``` +let mut count = 0; +match coin { + Coin::Quarter(state) => println!("State quarter from {:?}!", state), + _ => count += 1, +} +``` + +Or we could use an `if let` and `else` expression, like this: + +``` +let mut count = 0; +if let Coin::Quarter(state) = coin { + println!("State quarter from {:?}!", state); +} else { + count += 1; +} +``` + +If you have a situation in which your program has logic that is too verbose to +express using a `match`, remember that `if let` is in your Rust toolbox as well. + +## Summary + +We’ve now covered how to use enums to create custom types that can be one of a +set of enumerated values. We’ve shown how the standard library’s `Option` +type helps you use the type system to prevent errors. When enum values have +data inside them, you can use `match` or `if let` to extract and use those +values, depending on how many cases you need to handle. + +Your Rust programs can now express concepts in your domain using structs and +enums. Creating custom types to use in your API ensures type safety: the +compiler will make certain your functions only get values of the type each +function expects. + +In order to provide a well-organized API to your users that is straightforward +to use and only exposes exactly what your users will need, let’s now turn to +Rust’s modules. + diff --git a/rustbook-ru/nostarch/chapter07.md b/rustbook-ru/nostarch/chapter07.md new file mode 100644 index 000000000..0a7a40793 --- /dev/null +++ b/rustbook-ru/nostarch/chapter07.md @@ -0,0 +1,1291 @@ + + +[TOC] + +# Managing Growing Projects with Packages, Crates, and Modules + +As you write large programs, organizing your code will become increasingly +important. By grouping related functionality and separating code with distinct +features, you’ll clarify where to find code that implements a particular +feature and where to go to change how a feature works. + +The programs we’ve written so far have been in one module in one file. As a +project grows, you should organize code by splitting it into multiple modules +and then multiple files. A package can contain multiple binary crates and +optionally one library crate. As a package grows, you can extract parts into +separate crates that become external dependencies. This chapter covers all +these techniques. For very large projects comprising a set of interrelated +packages that evolve together, Cargo provides *workspaces*, which we’ll cover +in the “Cargo Workspaces” section in Chapter 14. + +We’ll also discuss encapsulating implementation details, which lets you reuse +code at a higher level: once you’ve implemented an operation, other code can +call your code via its public interface without having to know how the +implementation works. The way you write code defines which parts are public for +other code to use and which parts are private implementation details that you +reserve the right to change. This is another way to limit the amount of detail +you have to keep in your head. + +A related concept is scope: the nested context in which code is written has a +set of names that are defined as “in scope.” When reading, writing, and +compiling code, programmers and compilers need to know whether a particular +name at a particular spot refers to a variable, function, struct, enum, module, +constant, or other item and what that item means. You can create scopes and +change which names are in or out of scope. You can’t have two items with the +same name in the same scope; tools are available to resolve name conflicts. + +Rust has a number of features that allow you to manage your code’s +organization, including which details are exposed, which details are private, +and what names are in each scope in your programs. These features, sometimes +collectively referred to as the *module system*, include: + +* **Packages:** A Cargo feature that lets you build, test, and share crates +* **Crates:** A tree of modules that produces a library or executable +* **Modules** and **use:** Let you control the organization, scope, and + privacy of paths +* **Paths:** A way of naming an item, such as a struct, function, or module + +In this chapter, we’ll cover all these features, discuss how they interact, and +explain how to use them to manage scope. By the end, you should have a solid +understanding of the module system and be able to work with scopes like a pro! + +## Packages and Crates + +The first parts of the module system we’ll cover are packages and crates. + +A *crate* is the smallest amount of code that the Rust compiler considers at a +time. Even if you run `rustc` rather than `cargo` and pass a single source code +file (as we did all the way back in the “Writing and Running a Rust Program” +section of Chapter 1), the compiler considers that file to be a crate. Crates +can contain modules, and the modules may be defined in other files that get +compiled with the crate, as we’ll see in the coming sections. + +A crate can come in one of two forms: a binary crate or a library crate. +*Binary crates* are programs you can compile to an executable that you can run, +such as a command-line program or a server. Each must have a function called +`main` that defines what happens when the executable runs. All the crates we’ve +created so far have been binary crates. + +*Library crates* don’t have a `main` function, and they don’t compile to an +executable. Instead, they define functionality intended to be shared with +multiple projects. For example, the `rand` crate we used in Chapter +2 provides functionality that generates random numbers. +Most of the time when Rustaceans say “crate”, they mean library crate, and they +use “crate” interchangeably with the general programming concept of a “library”. + +The *crate root* is a source file that the Rust compiler starts from and makes +up the root module of your crate (we’ll explain modules in depth in the +“Defining Modules to Control Scope and Privacy” +section). + +A *package* is a bundle of one or more crates that provides a set of +functionality. A package contains a *Cargo.toml* file that describes how to +build those crates. Cargo is actually a package that contains the binary crate +for the command-line tool you’ve been using to build your code. The Cargo +package also contains a library crate that the binary crate depends on. Other +projects can depend on the Cargo library crate to use the same logic the Cargo +command-line tool uses. + +A crate can come in one of two forms: a binary crate or a library crate. A +package can contain as many binary crates as you like, but at most only one +library crate. A package must contain at least one crate, whether that’s a +library or binary crate. + +Let’s walk through what happens when we create a package. First we enter the +command `cargo new my-project`: + +``` +$ cargo new my-project + Created binary (application) `my-project` package +$ ls my-project +Cargo.toml +src +$ ls my-project/src +main.rs +``` + +After we run `cargo new my-project`, we use `ls` to see what Cargo creates. In +the project directory, there’s a *Cargo.toml* file, giving us a package. +There’s also a *src* directory that contains *main.rs*. Open *Cargo.toml* in +your text editor, and note there’s no mention of *src/main.rs*. Cargo follows a +convention that *src/main.rs* is the crate root of a binary crate with the same +name as the package. Likewise, Cargo knows that if the package directory +contains *src/lib.rs*, the package contains a library crate with the same name +as the package, and *src/lib.rs* is its crate root. Cargo passes the crate root +files to `rustc` to build the library or binary. + +Here, we have a package that only contains *src/main.rs*, meaning it only +contains a binary crate named `my-project`. If a package contains *src/main.rs* +and *src/lib.rs*, it has two crates: a binary and a library, both with the same +name as the package. A package can have multiple binary crates by placing files +in the *src/bin* directory: each file will be a separate binary crate. + +## Defining Modules to Control Scope and Privacy + +In this section, we’ll talk about modules and other parts of the module system, +namely *paths*, which allow you to name items; the `use` keyword that brings a +path into scope; and the `pub` keyword to make items public. We’ll also discuss +the `as` keyword, external packages, and the glob operator. + +### Modules Cheat Sheet + +Before we get to the details of modules and paths, here we provide a quick +reference on how modules, paths, the `use` keyword, and the `pub` keyword work +in the compiler, and how most developers organize their code. We’ll be going +through examples of each of these rules throughout this chapter, but this is a +great place to refer to as a reminder of how modules work. + +* **Start from the crate root**: When compiling a crate, the compiler first + looks in the crate root file (usually *src/lib.rs* for a library crate or + *src/main.rs* for a binary crate) for code to compile. +* **Declaring modules**: In the crate root file, you can declare new modules; + say you declare a “garden” module with `mod garden;`. The compiler will look + for the module’s code in these places: + * Inline, within curly brackets that replace the semicolon following `mod garden` + * In the file *src/garden.rs* + * In the file *src/garden/mod.rs* +* **Declaring submodules**: In any file other than the crate root, you can + declare submodules. For example, you might declare `mod vegetables;` in + *src/garden.rs*. The compiler will look for the submodule’s code within the + directory named for the parent module in these places: + * Inline, directly following `mod vegetables`, within curly brackets instead + of the semicolon + * In the file *src/garden/vegetables.rs* + * In the file *src/garden/vegetables/mod.rs* +* **Paths to code in modules**: Once a module is part of your crate, you can + refer to code in that module from anywhere else in that same crate, as long + as the privacy rules allow, using the path to the code. For example, an + `Asparagus` type in the garden vegetables module would be found at + `crate::garden::vegetables::Asparagus`. +* **Private vs. public**: Code within a module is private from its parent + modules by default. To make a module public, declare it with `pub mod` + instead of `mod`. To make items within a public module public as well, use + `pub` before their declarations. +* **The `use` keyword**: Within a scope, the `use` keyword creates shortcuts to + items to reduce repetition of long paths. In any scope that can refer to + `crate::garden::vegetables::Asparagus`, you can create a shortcut with `use crate::garden::vegetables::Asparagus;` and from then on you only need to + write `Asparagus` to make use of that type in the scope. + +Here, we create a binary crate named `backyard` that illustrates these rules. +The crate’s directory, also named `backyard`, contains these files and +directories: + +``` +backyard +├── Cargo.lock +├── Cargo.toml +└── src + ├── garden + │   └── vegetables.rs + ├── garden.rs + └── main.rs +``` + +The crate root file in this case is *src/main.rs*, and it contains: + +Filename: src/main.rs + +``` +use crate::garden::vegetables::Asparagus; + +pub mod garden; + +fn main() { + let plant = Asparagus {}; + println!("I'm growing {plant:?}!"); +} +``` + +The `pub mod garden;` line tells the compiler to include the code it finds in +*src/garden.rs*, which is: + +Filename: src/garden.rs + +``` +pub mod vegetables; +``` + +Here, `pub mod vegetables;` means the code in *src/garden/vegetables.rs* is +included too. That code is: + +``` +#[derive(Debug)] +pub struct Asparagus {} +``` + +Now let’s get into the details of these rules and demonstrate them in action! + +### Grouping Related Code in Modules + +*Modules* let us organize code within a crate for readability and easy reuse. +Modules also allow us to control the *privacy* of items because code within a +module is private by default. Private items are internal implementation details +not available for outside use. We can choose to make modules and the items +within them public, which exposes them to allow external code to use and depend +on them. + +As an example, let’s write a library crate that provides the functionality of a +restaurant. We’ll define the signatures of functions but leave their bodies +empty to concentrate on the organization of the code rather than the +implementation of a restaurant. + +In the restaurant industry, some parts of a restaurant are referred to as +*front of house* and others as *back of house*. Front of house is where +customers are; this encompasses where the hosts seat customers, servers take +orders and payment, and bartenders make drinks. Back of house is where the +chefs and cooks work in the kitchen, dishwashers clean up, and managers do +administrative work. + +To structure our crate in this way, we can organize its functions into nested +modules. Create a new library named `restaurant` by running `cargo new restaurant --lib`. Then enter the code in Listing 7-1 into *src/lib.rs* to +define some modules and function signatures; this code is the front of house +section. + +Filename: src/lib.rs + +``` +mod front_of_house { + mod hosting { + fn add_to_waitlist() {} + + fn seat_at_table() {} + } + + mod serving { + fn take_order() {} + + fn serve_order() {} + + fn take_payment() {} + } +} +``` + +Listing 7-1: A `front_of_house` module containing other +modules that then contain functions + +We define a module with the `mod` keyword followed by the name of the module +(in this case, `front_of_house`). The body of the module then goes inside curly +brackets. Inside modules, we can place other modules, as in this case with the +modules `hosting` and `serving`. Modules can also hold definitions for other +items, such as structs, enums, constants, traits, and—as in Listing +7-1—functions. + +By using modules, we can group related definitions together and name why +they’re related. Programmers using this code can navigate the code based on the +groups rather than having to read through all the definitions, making it easier +to find the definitions relevant to them. Programmers adding new functionality +to this code would know where to place the code to keep the program organized. + +Earlier, we mentioned that *src/main.rs* and *src/lib.rs* are called crate +roots. The reason for their name is that the contents of either of these two +files form a module named `crate` at the root of the crate’s module structure, +known as the *module tree*. + +Listing 7-2 shows the module tree for the structure in Listing 7-1. + +``` +crate + └── front_of_house + ├── hosting + │ ├── add_to_waitlist + │ └── seat_at_table + └── serving + ├── take_order + ├── serve_order + └── take_payment +``` + +Listing 7-2: The module tree for the code in Listing +7-1 + +This tree shows how some of the modules nest inside other modules; for example, +`hosting` nests inside `front_of_house`. The tree also shows that some modules +are *siblings*, meaning they’re defined in the same module; `hosting` and +`serving` are siblings defined within `front_of_house`. If module A is +contained inside module B, we say that module A is the *child* of module B and +that module B is the *parent* of module A. Notice that the entire module tree +is rooted under the implicit module named `crate`. + +The module tree might remind you of the filesystem’s directory tree on your +computer; this is a very apt comparison! Just like directories in a filesystem, +you use modules to organize your code. And just like files in a directory, we +need a way to find our modules. + +## Paths for Referring to an Item in the Module Tree + +To show Rust where to find an item in a module tree, we use a path in the same +way we use a path when navigating a filesystem. To call a function, we need to +know its path. + +A path can take two forms: + +* An *absolute path* is the full path starting from a crate root; for code + from an external crate, the absolute path begins with the crate name, and for + code from the current crate, it starts with the literal `crate`. +* A *relative path* starts from the current module and uses `self`, `super`, or + an identifier in the current module. + +Both absolute and relative paths are followed by one or more identifiers +separated by double colons (`::`). + +Returning to Listing 7-1, say we want to call the `add_to_waitlist` function. +This is the same as asking: what’s the path of the `add_to_waitlist` function? +Listing 7-3 contains Listing 7-1 with some of the modules and functions +removed. + +We’ll show two ways to call the `add_to_waitlist` function from a new function, +`eat_at_restaurant`, defined in the crate root. These paths are correct, but +there’s another problem remaining that will prevent this example from compiling +as is. We’ll explain why in a bit. + +The `eat_at_restaurant` function is part of our library crate’s public API, so +we mark it with the `pub` keyword. In the “Exposing Paths with the `pub` +Keyword” section, we’ll go into more detail about `pub`. + +Filename: src/lib.rs + +``` +mod front_of_house { + mod hosting { + fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} +``` + +Listing 7-3: Calling the `add_to_waitlist` function using +absolute and relative paths + +The first time we call the `add_to_waitlist` function in `eat_at_restaurant`, +we use an absolute path. The `add_to_waitlist` function is defined in the same +crate as `eat_at_restaurant`, which means we can use the `crate` keyword to +start an absolute path. We then include each of the successive modules until we +make our way to `add_to_waitlist`. You can imagine a filesystem with the same +structure: we’d specify the path `/front_of_house/hosting/add_to_waitlist` to +run the `add_to_waitlist` program; using the `crate` name to start from the +crate root is like using `/` to start from the filesystem root in your shell. + +The second time we call `add_to_waitlist` in `eat_at_restaurant`, we use a +relative path. The path starts with `front_of_house`, the name of the module +defined at the same level of the module tree as `eat_at_restaurant`. Here the +filesystem equivalent would be using the path +`front_of_house/hosting/add_to_waitlist`. Starting with a module name means +that the path is relative. + +Choosing whether to use a relative or absolute path is a decision you’ll make +based on your project, and it depends on whether you’re more likely to move +item definition code separately from or together with the code that uses the +item. For example, if we moved the `front_of_house` module and the +`eat_at_restaurant` function into a module named `customer_experience`, we’d +need to update the absolute path to `add_to_waitlist`, but the relative path +would still be valid. However, if we moved the `eat_at_restaurant` function +separately into a module named `dining`, the absolute path to the +`add_to_waitlist` call would stay the same, but the relative path would need to +be updated. Our preference in general is to specify absolute paths because it’s +more likely we’ll want to move code definitions and item calls independently of +each other. + +Let’s try to compile Listing 7-3 and find out why it won’t compile yet! The +errors we get are shown in Listing 7-4. + +``` +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0603]: module `hosting` is private + --> src/lib.rs:9:28 + | +9 | crate::front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^ --------------- function `add_to_waitlist` is not publicly re-exported + | | + | private module + | +note: the module `hosting` is defined here + --> src/lib.rs:2:5 + | +2 | mod hosting { + | ^^^^^^^^^^^ + +error[E0603]: module `hosting` is private + --> src/lib.rs:12:21 + | +12 | front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^ --------------- function `add_to_waitlist` is not publicly re-exported + | | + | private module + | +note: the module `hosting` is defined here + --> src/lib.rs:2:5 + | +2 | mod hosting { + | ^^^^^^^^^^^ + +For more information about this error, try `rustc --explain E0603`. +error: could not compile `restaurant` (lib) due to 2 previous errors +``` + +Listing 7-4: Compiler errors from building the code in +Listing 7-3 + +The error messages say that module `hosting` is private. In other words, we +have the correct paths for the `hosting` module and the `add_to_waitlist` +function, but Rust won’t let us use them because it doesn’t have access to the +private sections. In Rust, all items (functions, methods, structs, enums, +modules, and constants) are private to parent modules by default. If you want +to make an item like a function or struct private, you put it in a module. + +Items in a parent module can’t use the private items inside child modules, but +items in child modules can use the items in their ancestor modules. This is +because child modules wrap and hide their implementation details, but the child +modules can see the context in which they’re defined. To continue with our +metaphor, think of the privacy rules as being like the back office of a +restaurant: what goes on in there is private to restaurant customers, but +office managers can see and do everything in the restaurant they operate. + +Rust chose to have the module system function this way so that hiding inner +implementation details is the default. That way, you know which parts of the +inner code you can change without breaking outer code. However, Rust does give +you the option to expose inner parts of child modules’ code to outer ancestor +modules by using the `pub` keyword to make an item public. + +### Exposing Paths with the `pub` Keyword + +Let’s return to the error in Listing 7-4 that told us the `hosting` module is +private. We want the `eat_at_restaurant` function in the parent module to have +access to the `add_to_waitlist` function in the child module, so we mark the +`hosting` module with the `pub` keyword, as shown in Listing 7-5. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} +``` + +Listing 7-5: Declaring the `hosting` module as `pub` to +use it from `eat_at_restaurant` + +Unfortunately, the code in Listing 7-5 still results in compiler errors, as +shown in Listing 7-6. + +``` +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0603]: function `add_to_waitlist` is private + --> src/lib.rs:9:37 + | +9 | crate::front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^^^^^^^^^ private function + | +note: the function `add_to_waitlist` is defined here + --> src/lib.rs:3:9 + | +3 | fn add_to_waitlist() {} + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: function `add_to_waitlist` is private + --> src/lib.rs:12:30 + | +12 | front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^^^^^^^^^ private function + | +note: the function `add_to_waitlist` is defined here + --> src/lib.rs:3:9 + | +3 | fn add_to_waitlist() {} + | ^^^^^^^^^^^^^^^^^^^^ + +For more information about this error, try `rustc --explain E0603`. +error: could not compile `restaurant` (lib) due to 2 previous errors +``` + +Listing 7-6: Compiler errors from building the code in +Listing 7-5 + +What happened? Adding the `pub` keyword in front of `mod hosting` makes the +module public. With this change, if we can access `front_of_house`, we can +access `hosting`. But the *contents* of `hosting` are still private; making the +module public doesn’t make its contents public. The `pub` keyword on a module +only lets code in its ancestor modules refer to it, not access its inner code. +Because modules are containers, there’s not much we can do by only making the +module public; we need to go further and choose to make one or more of the +items within the module public as well. + +The errors in Listing 7-6 say that the `add_to_waitlist` function is private. +The privacy rules apply to structs, enums, functions, and methods as well as +modules. + +Let’s also make the `add_to_waitlist` function public by adding the `pub` +keyword before its definition, as in Listing 7-7. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +pub fn eat_at_restaurant() { + // Absolute path + crate::front_of_house::hosting::add_to_waitlist(); + + // Relative path + front_of_house::hosting::add_to_waitlist(); +} +``` + +Listing 7-7: Adding the `pub` keyword to `mod hosting` +and `fn add_to_waitlist` lets us call the function from +`eat_at_restaurant` + +Now the code will compile! To see why adding the `pub` keyword lets us use +these paths in `eat_at_restaurant` with respect to the privacy rules, let’s look +at the absolute and the relative paths. + +In the absolute path, we start with `crate`, the root of our crate’s module +tree. The `front_of_house` module is defined in the crate root. While +`front_of_house` isn’t public, because the `eat_at_restaurant` function is +defined in the same module as `front_of_house` (that is, `eat_at_restaurant` +and `front_of_house` are siblings), we can refer to `front_of_house` from +`eat_at_restaurant`. Next is the `hosting` module marked with `pub`. We can +access the parent module of `hosting`, so we can access `hosting`. Finally, the +`add_to_waitlist` function is marked with `pub` and we can access its parent +module, so this function call works! + +In the relative path, the logic is the same as the absolute path except for the +first step: rather than starting from the crate root, the path starts from +`front_of_house`. The `front_of_house` module is defined within the same module +as `eat_at_restaurant`, so the relative path starting from the module in which +`eat_at_restaurant` is defined works. Then, because `hosting` and +`add_to_waitlist` are marked with `pub`, the rest of the path works, and this +function call is valid! + +If you plan on sharing your library crate so other projects can use your code, +your public API is your contract with users of your crate that determines how +they can interact with your code. There are many considerations around managing +changes to your public API to make it easier for people to depend on your +crate. These considerations are out of the scope of this book; if you’re +interested in this topic, see The Rust API Guidelines at *https://rust-lang.github.io/api-guidelines/*. + + > + > #### Best Practices for Packages with a Binary and a Library + > + > We mentioned that a package can contain both a *src/main.rs* binary crate + > root as well as a *src/lib.rs* library crate root, and both crates will have + > the package name by default. Typically, packages with this pattern of + > containing both a library and a binary crate will have just enough code in the + > binary crate to start an executable that calls code within the library crate. + > This lets other projects benefit from most of the functionality that the + > package provides because the library crate’s code can be shared. + > + > The module tree should be defined in *src/lib.rs*. Then, any public items can + > be used in the binary crate by starting paths with the name of the package. + > The binary crate becomes a user of the library crate just like a completely + > external crate would use the library crate: it can only use the public API. + > This helps you design a good API; not only are you the author, you’re also a + > client! + > + > In Chapter 12, we’ll demonstrate this organizational + > practice with a command-line program that will contain both a binary crate + > and a library crate. + +### Starting Relative Paths with `super` + +We can construct relative paths that begin in the parent module, rather than +the current module or the crate root, by using `super` at the start of the +path. This is like starting a filesystem path with the `..` syntax. Using +`super` allows us to reference an item that we know is in the parent module, +which can make rearranging the module tree easier when the module is closely +related to the parent but the parent might be moved elsewhere in the module +tree someday. + +Consider the code in Listing 7-8 that models the situation in which a chef +fixes an incorrect order and personally brings it out to the customer. The +function `fix_incorrect_order` defined in the `back_of_house` module calls the +function `deliver_order` defined in the parent module by specifying the path to +`deliver_order`, starting with `super`. + +Filename: src/lib.rs + +``` +fn deliver_order() {} + +mod back_of_house { + fn fix_incorrect_order() { + cook_order(); + super::deliver_order(); + } + + fn cook_order() {} +} +``` + +Listing 7-8: Calling a function using a relative path +starting with `super` + +The `fix_incorrect_order` function is in the `back_of_house` module, so we can +use `super` to go to the parent module of `back_of_house`, which in this case +is `crate`, the root. From there, we look for `deliver_order` and find it. +Success! We think the `back_of_house` module and the `deliver_order` function +are likely to stay in the same relationship to each other and get moved +together should we decide to reorganize the crate’s module tree. Therefore, we +used `super` so we’ll have fewer places to update code in the future if this +code gets moved to a different module. + +### Making Structs and Enums Public + +We can also use `pub` to designate structs and enums as public, but there are a +few extra details to the usage of `pub` with structs and enums. If we use `pub` +before a struct definition, we make the struct public, but the struct’s fields +will still be private. We can make each field public or not on a case-by-case +basis. In Listing 7-9, we’ve defined a public `back_of_house::Breakfast` struct +with a public `toast` field but a private `seasonal_fruit` field. This models +the case in a restaurant where the customer can pick the type of bread that +comes with a meal, but the chef decides which fruit accompanies the meal based +on what’s in season and in stock. The available fruit changes quickly, so +customers can’t choose the fruit or even see which fruit they’ll get. + +Filename: src/lib.rs + +``` +mod back_of_house { + pub struct Breakfast { + pub toast: String, + seasonal_fruit: String, + } + + impl Breakfast { + pub fn summer(toast: &str) -> Breakfast { + Breakfast { + toast: String::from(toast), + seasonal_fruit: String::from("peaches"), + } + } + } +} + +pub fn eat_at_restaurant() { + // Order a breakfast in the summer with Rye toast + let mut meal = back_of_house::Breakfast::summer("Rye"); + // Change our mind about what bread we'd like + meal.toast = String::from("Wheat"); + println!("I'd like {} toast please", meal.toast); + + // The next line won't compile if we uncomment it; we're not allowed + // to see or modify the seasonal fruit that comes with the meal + // meal.seasonal_fruit = String::from("blueberries"); +} +``` + +Listing 7-9: A struct with some public fields and some +private fields + +Because the `toast` field in the `back_of_house::Breakfast` struct is public, +in `eat_at_restaurant` we can write and read to the `toast` field using dot +notation. Notice that we can’t use the `seasonal_fruit` field in +`eat_at_restaurant`, because `seasonal_fruit` is private. Try uncommenting the +line modifying the `seasonal_fruit` field value to see what error you get! + +Also, note that because `back_of_house::Breakfast` has a private field, the +struct needs to provide a public associated function that constructs an +instance of `Breakfast` (we’ve named it `summer` here). If `Breakfast` didn’t +have such a function, we couldn’t create an instance of `Breakfast` in +`eat_at_restaurant` because we couldn’t set the value of the private +`seasonal_fruit` field in `eat_at_restaurant`. + +In contrast, if we make an enum public, all of its variants are then public. We +only need the `pub` before the `enum` keyword, as shown in Listing 7-10. + +Filename: src/lib.rs + +``` +mod back_of_house { + pub enum Appetizer { + Soup, + Salad, + } +} + +pub fn eat_at_restaurant() { + let order1 = back_of_house::Appetizer::Soup; + let order2 = back_of_house::Appetizer::Salad; +} +``` + +Listing 7-10: Designating an enum as public makes all its +variants public + +Because we made the `Appetizer` enum public, we can use the `Soup` and `Salad` +variants in `eat_at_restaurant`. + +Enums aren’t very useful unless their variants are public; it would be annoying +to have to annotate all enum variants with `pub` in every case, so the default +for enum variants is to be public. Structs are often useful without their +fields being public, so struct fields follow the general rule of everything +being private by default unless annotated with `pub`. + +There’s one more situation involving `pub` that we haven’t covered, and that is +our last module system feature: the `use` keyword. We’ll cover `use` by itself +first, and then we’ll show how to combine `pub` and `use`. + +## Bringing Paths into Scope with the `use` Keyword + +Having to write out the paths to call functions can feel inconvenient and +repetitive. In Listing 7-7, whether we chose the absolute or relative path to +the `add_to_waitlist` function, every time we wanted to call `add_to_waitlist` +we had to specify `front_of_house` and `hosting` too. Fortunately, there’s a +way to simplify this process: we can create a shortcut to a path with the `use` +keyword once, and then use the shorter name everywhere else in the scope. + +In Listing 7-11, we bring the `crate::front_of_house::hosting` module into the +scope of the `eat_at_restaurant` function so we only have to specify +`hosting::add_to_waitlist` to call the `add_to_waitlist` function in +`eat_at_restaurant`. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} +``` + +Listing 7-11: Bringing a module into scope with +`use` + +Adding `use` and a path in a scope is similar to creating a symbolic link in +the filesystem. By adding `use crate::front_of_house::hosting` in the crate +root, `hosting` is now a valid name in that scope, just as though the `hosting` +module had been defined in the crate root. Paths brought into scope with `use` +also check privacy, like any other paths. + +Note that `use` only creates the shortcut for the particular scope in which the +`use` occurs. Listing 7-12 moves the `eat_at_restaurant` function into a new +child module named `customer`, which is then a different scope than the `use` +statement, so the function body won’t compile. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting; + +mod customer { + pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); + } +} +``` + +Listing 7-12: A `use` statement only applies in the scope +it’s in + +The compiler error shows that the shortcut no longer applies within the +`customer` module: + +``` +$ cargo build + Compiling restaurant v0.1.0 (file:///projects/restaurant) +error[E0433]: failed to resolve: use of undeclared crate or module `hosting` + --> src/lib.rs:11:9 + | +11 | hosting::add_to_waitlist(); + | ^^^^^^^ use of undeclared crate or module `hosting` + | +help: consider importing this module through its public re-export + | +10 + use crate::hosting; + | + +warning: unused import: `crate::front_of_house::hosting` + --> src/lib.rs:7:5 + | +7 | use crate::front_of_house::hosting; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +For more information about this error, try `rustc --explain E0433`. +warning: `restaurant` (lib) generated 1 warning +error: could not compile `restaurant` (lib) due to 1 previous error; 1 warning emitted +``` + +Notice there’s also a warning that the `use` is no longer used in its scope! To +fix this problem, move the `use` within the `customer` module too, or reference +the shortcut in the parent module with `super::hosting` within the child +`customer` module. + +### Creating Idiomatic `use` Paths + +In Listing 7-11, you might have wondered why we specified `use crate::front_of_house::hosting` and then called `hosting::add_to_waitlist` in +`eat_at_restaurant`, rather than specifying the `use` path all the way out to +the `add_to_waitlist` function to achieve the same result, as in Listing 7-13. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +use crate::front_of_house::hosting::add_to_waitlist; + +pub fn eat_at_restaurant() { + add_to_waitlist(); +} +``` + +Listing 7-13: Bringing the `add_to_waitlist` function +into scope with `use`, which is unidiomatic + +Although both Listing 7-11 and Listing 7-13 accomplish the same task, Listing +7-11 is the idiomatic way to bring a function into scope with `use`. Bringing +the function’s parent module into scope with `use` means we have to specify the +parent module when calling the function. Specifying the parent module when +calling the function makes it clear that the function isn’t locally defined +while still minimizing repetition of the full path. The code in Listing 7-13 is +unclear as to where `add_to_waitlist` is defined. + +On the other hand, when bringing in structs, enums, and other items with `use`, +it’s idiomatic to specify the full path. Listing 7-14 shows the idiomatic way +to bring the standard library’s `HashMap` struct into the scope of a binary +crate. + +Filename: src/main.rs + +``` +use std::collections::HashMap; + +fn main() { + let mut map = HashMap::new(); + map.insert(1, 2); +} +``` + +Listing 7-14: Bringing `HashMap` into scope in an +idiomatic way + +There’s no strong reason behind this idiom: it’s just the convention that has +emerged, and folks have gotten used to reading and writing Rust code this way. + +The exception to this idiom is if we’re bringing two items with the same name +into scope with `use` statements, because Rust doesn’t allow that. Listing 7-15 +shows how to bring two `Result` types into scope that have the same name but +different parent modules, and how to refer to them. + +Filename: src/lib.rs + +``` +use std::fmt; +use std::io; + +fn function1() -> fmt::Result { + // --snip-- +} + +fn function2() -> io::Result<()> { + // --snip-- +} +``` + +Listing 7-15: Bringing two types with the same name into +the same scope requires using their parent modules. + +As you can see, using the parent modules distinguishes the two `Result` types. +If instead we specified `use std::fmt::Result` and `use std::io::Result`, we’d +have two `Result` types in the same scope, and Rust wouldn’t know which one we +meant when we used `Result`. + +### Providing New Names with the `as` Keyword + +There’s another solution to the problem of bringing two types of the same name +into the same scope with `use`: after the path, we can specify `as` and a new +local name, or *alias*, for the type. Listing 7-16 shows another way to write +the code in Listing 7-15 by renaming one of the two `Result` types using `as`. + +Filename: src/lib.rs + +``` +use std::fmt::Result; +use std::io::Result as IoResult; + +fn function1() -> Result { + // --snip-- +} + +fn function2() -> IoResult<()> { + // --snip-- +} +``` + +Listing 7-16: Renaming a type when it’s brought into +scope with the `as` keyword + +In the second `use` statement, we chose the new name `IoResult` for the +`std::io::Result` type, which won’t conflict with the `Result` from `std::fmt` +that we’ve also brought into scope. Listing 7-15 and Listing 7-16 are +considered idiomatic, so the choice is up to you! + +### Re-exporting Names with `pub use` + +When we bring a name into scope with the `use` keyword, the name available in +the new scope is private. To enable the code that calls our code to refer to +that name as if it had been defined in that code’s scope, we can combine `pub` +and `use`. This technique is called *re-exporting* because we’re bringing an +item into scope but also making that item available for others to bring into +their scope. + +Listing 7-17 shows the code in Listing 7-11 with `use` in the root module +changed to `pub use`. + +Filename: src/lib.rs + +``` +mod front_of_house { + pub mod hosting { + pub fn add_to_waitlist() {} + } +} + +pub use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} +``` + +Listing 7-17: Making a name available for any code to use +from a new scope with `pub use` + +Before this change, external code would have to call the `add_to_waitlist` +function by using the path +`restaurant::front_of_house::hosting::add_to_waitlist()`, which also would have +required the `front_of_house` module to be marked as `pub`. Now that this `pub use` has re-exported the `hosting` module from the root module, external code +can use the path `restaurant::hosting::add_to_waitlist()` instead. + +Re-exporting is useful when the internal structure of your code is different +from how programmers calling your code would think about the domain. For +example, in this restaurant metaphor, the people running the restaurant think +about “front of house” and “back of house.” But customers visiting a restaurant +probably won’t think about the parts of the restaurant in those terms. With +`pub use`, we can write our code with one structure but expose a different +structure. Doing so makes our library well organized for programmers working on +the library and programmers calling the library. We’ll look at another example +of `pub use` and how it affects your crate’s documentation in the “Exporting a +Convenient Public API with `pub use`” section of +Chapter 14. + +### Using External Packages + +In Chapter 2, we programmed a guessing game project that used an external +package called `rand` to get random numbers. To use `rand` in our project, we +added this line to *Cargo.toml*: + + + +Filename: Cargo.toml + +``` +rand = "0.8.5" +``` + +Adding `rand` as a dependency in *Cargo.toml* tells Cargo to download the +`rand` package and any dependencies from crates.io at *https://crates.io/* and +make `rand` available to our project. + +Then, to bring `rand` definitions into the scope of our package, we added a +`use` line starting with the name of the crate, `rand`, and listed the items +we wanted to bring into scope. Recall that in the “Generating a Random +Number” section in Chapter 2, we brought the `Rng` trait +into scope and called the `rand::thread_rng` function: + +``` +use rand::Rng; + +fn main() { + let secret_number = rand::thread_rng().gen_range(1..=100); +} +``` + +Members of the Rust community have made many packages available at +crates.io at *https://crates.io/*, and pulling any of them into your package +involves these same steps: listing them in your package’s *Cargo.toml* file and +using `use` to bring items from their crates into scope. + +Note that the standard `std` library is also a crate that’s external to our +package. Because the standard library is shipped with the Rust language, we +don’t need to change *Cargo.toml* to include `std`. But we do need to refer to +it with `use` to bring items from there into our package’s scope. For example, +with `HashMap` we would use this line: + +``` +use std::collections::HashMap; +``` + +This is an absolute path starting with `std`, the name of the standard library +crate. + +### Using Nested Paths to Clean Up Large `use` Lists + +If we’re using multiple items defined in the same crate or same module, listing +each item on its own line can take up a lot of vertical space in our files. For +example, these two `use` statements we had in the guessing game in Listing 2-4 +bring items from `std` into scope: + +Filename: src/main.rs + +``` +// --snip-- +use std::cmp::Ordering; +use std::io; +// --snip-- +``` + +Instead, we can use nested paths to bring the same items into scope in one +line. We do this by specifying the common part of the path, followed by two +colons, and then curly brackets around a list of the parts of the paths that +differ, as shown in Listing 7-18. + +Filename: src/main.rs + +``` +// --snip-- +use std::{cmp::Ordering, io}; +// --snip-- +``` + +Listing 7-18: Specifying a nested path to bring multiple +items with the same prefix into scope + +In bigger programs, bringing many items into scope from the same crate or +module using nested paths can reduce the number of separate `use` statements +needed by a lot! + +We can use a nested path at any level in a path, which is useful when combining +two `use` statements that share a subpath. For example, Listing 7-19 shows two +`use` statements: one that brings `std::io` into scope and one that brings +`std::io::Write` into scope. + +Filename: src/lib.rs + +``` +use std::io; +use std::io::Write; +``` + +Listing 7-19: Two `use` statements where one is a subpath +of the other + +The common part of these two paths is `std::io`, and that’s the complete first +path. To merge these two paths into one `use` statement, we can use `self` in +the nested path, as shown in Listing 7-20. + +Filename: src/lib.rs + +``` +use std::io::{self, Write}; +``` + +Listing 7-20: Combining the paths in Listing 7-19 into +one `use` statement + +This line brings `std::io` and `std::io::Write` into scope. + +### The Glob Operator + +If we want to bring *all* public items defined in a path into scope, we can +specify that path followed by the `*` glob operator: + +``` +use std::collections::*; +``` + +This `use` statement brings all public items defined in `std::collections` into +the current scope. Be careful when using the glob operator! Glob can make it +harder to tell what names are in scope and where a name used in your program +was defined. + +The glob operator is often used when testing to bring everything under test +into the `tests` module; we’ll talk about that in the “How to Write +Tests” section in Chapter 11. The glob operator +is also sometimes used as part of the prelude pattern: see the standard +library documentation +for more information on that pattern. + +## Separating Modules into Different Files + +So far, all the examples in this chapter defined multiple modules in one file. +When modules get large, you might want to move their definitions to a separate +file to make the code easier to navigate. + +For example, let’s start from the code in Listing 7-17 that had multiple +restaurant modules. We’ll extract modules into files instead of having all the +modules defined in the crate root file. In this case, the crate root file is +*src/lib.rs*, but this procedure also works with binary crates whose crate root +file is *src/main.rs*. + +First we’ll extract the `front_of_house` module to its own file. Remove the +code inside the curly brackets for the `front_of_house` module, leaving only +the `mod front_of_house;` declaration, so that *src/lib.rs* contains the code +shown in Listing 7-21. Note that this won’t compile until we create the +*src/front_of_house.rs* file in Listing 7-22. + +Filename: src/lib.rs + +``` +mod front_of_house; + +pub use crate::front_of_house::hosting; + +pub fn eat_at_restaurant() { + hosting::add_to_waitlist(); +} +``` + +Listing 7-21: Declaring the `front_of_house` module whose +body will be in *src/front_of_house.rs* + +Next, place the code that was in the curly brackets into a new file named +*src/front_of_house.rs*, as shown in Listing 7-22. The compiler knows to look +in this file because it came across the module declaration in the crate root +with the name `front_of_house`. + +Filename: src/front_of_house.rs + +``` +pub mod hosting { + pub fn add_to_waitlist() {} +} +``` + +Listing 7-22: Definitions inside the `front_of_house` +module in *src/front_of_house.rs* + +Note that you only need to load a file using a `mod` declaration *once* in your +module tree. Once the compiler knows the file is part of the project (and knows +where in the module tree the code resides because of where you’ve put the `mod` +statement), other files in your project should refer to the loaded file’s code +using a path to where it was declared, as covered in the “Paths for Referring +to an Item in the Module Tree” section. In other words, +`mod` is *not* an “include” operation that you may have seen in other +programming languages. + +Next, we’ll extract the `hosting` module to its own file. The process is a bit +different because `hosting` is a child module of `front_of_house`, not of the +root module. We’ll place the file for `hosting` in a new directory that will be +named for its ancestors in the module tree, in this case *src/front_of_house*. + +To start moving `hosting`, we change *src/front_of_house.rs* to contain only +the declaration of the `hosting` module: + +Filename: src/front_of_house.rs + +``` +pub mod hosting; +``` + +Then we create a *src/front_of_house* directory and a *hosting.rs* file to +contain the definitions made in the `hosting` module: + +Filename: src/front_of_house/hosting.rs + +``` +pub fn add_to_waitlist() {} +``` + +If we instead put *hosting.rs* in the *src* directory, the compiler would +expect the *hosting.rs* code to be in a `hosting` module declared in the crate +root, and not declared as a child of the `front_of_house` module. The +compiler’s rules for which files to check for which modules’ code mean the +directories and files more closely match the module tree. + + > + > ### Alternate File Paths + > + > So far we’ve covered the most idiomatic file paths the Rust compiler uses, + > but Rust also supports an older style of file path. For a module named + > `front_of_house` declared in the crate root, the compiler will look for the + > module’s code in: + > + > * *src/front_of_house.rs* (what we covered) + > * *src/front_of_house/mod.rs* (older style, still supported path) + > + > For a module named `hosting` that is a submodule of `front_of_house`, the + > compiler will look for the module’s code in: + > + > * *src/front_of_house/hosting.rs* (what we covered) + > * *src/front_of_house/hosting/mod.rs* (older style, still supported path) + > + > If you use both styles for the same module, you’ll get a compiler error. + > Using a mix of both styles for different modules in the same project is + > allowed, but might be confusing for people navigating your project. + > + > The main downside to the style that uses files named *mod.rs* is that your + > project can end up with many files named *mod.rs*, which can get confusing + > when you have them open in your editor at the same time. + +We’ve moved each module’s code to a separate file, and the module tree remains +the same. The function calls in `eat_at_restaurant` will work without any +modification, even though the definitions live in different files. This +technique lets you move modules to new files as they grow in size. + +Note that the `pub use crate::front_of_house::hosting` statement in +*src/lib.rs* also hasn’t changed, nor does `use` have any impact on what files +are compiled as part of the crate. The `mod` keyword declares modules, and Rust +looks in a file with the same name as the module for the code that goes into +that module. + +## Summary + +Rust lets you split a package into multiple crates and a crate into modules so +you can refer to items defined in one module from another module. You can do +this by specifying absolute or relative paths. These paths can be brought into +scope with a `use` statement so you can use a shorter path for multiple uses of +the item in that scope. Module code is private by default, but you can make +definitions public by adding the `pub` keyword. + +In the next chapter, we’ll look at some collection data structures in the +standard library that you can use in your neatly organized code. diff --git a/rustbook-ru/nostarch/chapter08.md b/rustbook-ru/nostarch/chapter08.md new file mode 100644 index 000000000..fd1cd9308 --- /dev/null +++ b/rustbook-ru/nostarch/chapter08.md @@ -0,0 +1,1099 @@ + + +[TOC] + +# Common Collections + +Rust’s standard library includes a number of very useful data structures called +*collections*. Most other data types represent one specific value, but +collections can contain multiple values. Unlike the built-in array and tuple +types, the data these collections point to is stored on the heap, which means +the amount of data does not need to be known at compile time and can grow or +shrink as the program runs. Each kind of collection has different capabilities +and costs, and choosing an appropriate one for your current situation is a +skill you’ll develop over time. In this chapter, we’ll discuss three +collections that are used very often in Rust programs: + +* A *vector* allows you to store a variable number of values next to each other. +* A *string* is a collection of characters. We’ve mentioned the `String` type + previously, but in this chapter we’ll talk about it in depth. +* A *hash map* allows you to associate a value with a specific key. It’s a + particular implementation of the more general data structure called a *map*. + +To learn about the other kinds of collections provided by the standard library, +see the documentation at *../std/collections/index.html*. + +We’ll discuss how to create and update vectors, strings, and hash maps, as well +as what makes each special. + +## Storing Lists of Values with Vectors + +The first collection type we’ll look at is `Vec`, also known as a *vector*. +Vectors allow you to store more than one value in a single data structure that +puts all the values next to each other in memory. Vectors can only store values +of the same type. They are useful when you have a list of items, such as the +lines of text in a file or the prices of items in a shopping cart. + +### Creating a New Vector + +To create a new empty vector, we call the `Vec::new` function, as shown in +Listing 8-1. + +``` + let v: Vec = Vec::new(); +``` + +Listing 8-1: Creating a new, empty vector to hold values +of type `i32` + +Note that 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. This is an important point. Vectors are implemented using generics; +we’ll cover how to use generics with your own types in Chapter 10. For now, +know that the `Vec` type provided by the standard library can hold any type. +When we create a vector to hold a specific type, we can specify the type within +angle brackets. In Listing 8-1, we’ve told Rust that the `Vec` in `v` will +hold elements of the `i32` type. + +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. Listing 8-2 creates a new +`Vec` that holds the values `1`, `2`, and `3`. The integer type is `i32` +because that’s the default integer type, as we discussed in the “Data +Types” section of Chapter 3. + +``` + let v = vec![1, 2, 3]; +``` + +Listing 8-2: Creating a new vector containing +values + +Because we’ve given initial `i32` values, Rust can infer that the type of `v` +is `Vec`, and the type annotation isn’t necessary. Next, we’ll look at how +to modify a vector. + +### Updating a Vector + +To create a vector and then add elements to it, we can use the `push` method, +as shown in Listing 8-3. + +``` + let mut v = Vec::new(); + + v.push(5); + v.push(6); + v.push(7); + v.push(8); +``` + +Listing 8-3: Using the `push` method to add values to a +vector + +As with any variable, if we want to be able to change its value, we need to +make it mutable using the `mut` keyword, as discussed in Chapter 3. The numbers +we place inside are all of type `i32`, and Rust infers this from the data, so +we don’t need the `Vec` annotation. + +### Reading Elements of Vectors + +There are two ways to reference a value stored in a vector: via indexing or by +using the `get` method. In the following examples, we’ve annotated the types of +the values that are returned from these functions for extra clarity. + +Listing 8-4 shows both methods of accessing a value in a vector, with indexing +syntax and the `get` method. + +``` + let v = vec![1, 2, 3, 4, 5]; + + let third: &i32 = &v[2]; + println!("The third element is {third}"); + + let third: Option<&i32> = v.get(2); + match third { + Some(third) => println!("The third element is {third}"), + None => println!("There is no third element."), + } +``` + +Listing 8-4: Using indexing syntax and using the `get` +method to access an item in a vector + +Note a few details here. We use the index value of `2` to get the third element +because vectors are indexed by number, starting at zero. Using `&` and `[]` +gives us a reference to the element at the index value. When we use the `get` +method with the index passed as an argument, we get an `Option<&T>` that we can +use with `match`. + +Rust provides these two ways to reference an element so you can choose how the +program behaves when you try to use an index value outside the range of +existing elements. As an example, let’s see what happens when we have a vector +of five elements and then we try to access an element at index 100 with each +technique, as shown in Listing 8-5. + +``` + let v = vec![1, 2, 3, 4, 5]; + + let does_not_exist = &v[100]; + let does_not_exist = v.get(100); +``` + +Listing 8-5: Attempting to access the element at index +100 in a vector containing five elements + +When we run this code, the first `[]` method will cause the program to panic +because it references a nonexistent element. This method is best used when you +want your program to crash if there’s an attempt to access an element past the +end of the vector. + +When the `get` method is passed an index that is outside the vector, it returns +`None` without panicking. You would use this method if accessing an element +beyond the range of the vector may happen occasionally under normal +circumstances. Your code will then have logic to handle having either +`Some(&element)` or `None`, as discussed in Chapter 6. For example, the index +could be coming from a person entering a number. If they accidentally enter a +number that’s too large and the program gets a `None` value, you could tell the +user how many items are in the current vector and give them another chance to +enter a valid value. That would be more user-friendly than crashing the program +due to a typo! + +When the program has a valid reference, the borrow checker enforces the +ownership and borrowing rules (covered in Chapter 4) to ensure this reference +and any other references to the contents of the vector remain valid. Recall the +rule that states you can’t have mutable and immutable references in the same +scope. That rule applies in Listing 8-6, where we hold an immutable reference +to the first element in a vector and try to add an element to the end. This +program won’t work if we also try to refer to that element later in the +function. + +``` + let mut v = vec![1, 2, 3, 4, 5]; + + let first = &v[0]; + + v.push(6); + + println!("The first element is: {first}"); +``` + +Listing 8-6: Attempting to add an element to a vector +while holding a reference to an item + +Compiling this code will result in this error: + +``` +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) +error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable + --> src/main.rs:6:5 + | +4 | let first = &v[0]; + | - immutable borrow occurs here +5 | +6 | v.push(6); + | ^^^^^^^^^ mutable borrow occurs here +7 | +8 | println!("The first element is: {first}"); + | ------- immutable borrow later used here + +For more information about this error, try `rustc --explain E0502`. +error: could not compile `collections` (bin "collections") due to 1 previous error +``` + +The code in Listing 8-6 might look like it should work: why should a reference +to the first element care about changes at the end of the vector? This error is +due to the way vectors work: because vectors put the values next to each other +in memory, adding a new element onto the end of the vector might require +allocating new memory and copying the old elements to the new space, if there +isn’t enough room to put all the elements next to each other where the vector +is currently stored. In that case, the reference to the first element would be +pointing to deallocated memory. The borrowing rules prevent programs from +ending up in that situation. + +> Note: For more on the implementation details of the `Vec` type, see “The +> Rustonomicon” at *../nomicon/vec/vec.html*. + +### Iterating Over the Values in a Vector + +To access each element in a vector in turn, we would iterate through all of the +elements rather than use indices to access one at a time. Listing 8-7 shows how +to use a `for` loop to get immutable references to each element in a vector of +`i32` values and print them. + +``` + let v = vec![100, 32, 57]; + for i in &v { + println!("{i}"); + } +``` + +Listing 8-7: Printing each element in a vector by +iterating over the elements using a `for` loop + +We can also iterate over mutable references to each element in a mutable vector +in order to make changes to all the elements. The `for` loop in Listing 8-8 +will add `50` to each element. + +``` + let mut v = vec![100, 32, 57]; + for i in &mut v { + *i += 50; + } +``` + +Listing 8-8: Iterating over mutable references to +elements in a vector + +To change the value that the mutable reference refers to, we have to use the +`*` dereference operator to get to the value in `i` before we can use the `+=` +operator. We’ll talk more about the dereference operator in the “Following the +Pointer to the Value with the Dereference Operator” +section of Chapter 15. + +Iterating over a vector, whether immutably or mutably, is safe because of the +borrow checker’s rules. If we attempted to insert or remove items in the `for` +loop bodies in Listing 8-7 and Listing 8-8, we would get a compiler error +similar to the one we got with the code in Listing 8-6. The reference to the +vector that the `for` loop holds prevents simultaneous modification of the +whole vector. + +### Using an Enum to Store Multiple Types + +Vectors can only store values that are of the same type. This can be +inconvenient; there are definitely use cases for needing to store a list of +items of different types. Fortunately, the variants of an enum are defined +under the same enum type, so when we need one type to represent elements of +different types, we can define and use an enum! + +For example, say we want to get values from a row in a spreadsheet in which +some of the columns in the row contain integers, some floating-point numbers, +and some strings. We can define an enum whose variants will hold the different +value types, and all the enum variants will be considered the same type: that +of the enum. Then we can create a vector to hold that enum and so, ultimately, +hold different types. We’ve demonstrated this in Listing 8-9. + +``` + enum SpreadsheetCell { + Int(i32), + Float(f64), + Text(String), + } + + let row = vec![ + SpreadsheetCell::Int(3), + SpreadsheetCell::Text(String::from("blue")), + SpreadsheetCell::Float(10.12), + ]; +``` + +Listing 8-9: Defining an `enum` to store values of +different types in one vector + +Rust needs to know what types will be in the vector at compile time so it knows +exactly how much memory on the heap will be needed to store each element. We +must also be explicit about what types are allowed in this vector. If Rust +allowed a vector to hold any type, there would be a chance that one or more of +the types would cause errors with the operations performed on the elements of +the vector. Using an enum plus a `match` expression means that Rust will ensure +at compile time that every possible case is handled, as discussed in Chapter 6. + +If you don’t know the exhaustive set of types a program will get at runtime to +store in a vector, the enum technique won’t work. Instead, you can use a trait +object, which we’ll cover in Chapter 17. + +Now that we’ve discussed some of the most common ways to use vectors, be sure +to review the API documentation for all of the many +useful methods defined on `Vec` by the standard library. For example, in +addition to `push`, a `pop` method removes and returns the last element. + +### Dropping a Vector Drops Its Elements + +Like any other `struct`, a vector is freed when it goes out of scope, as +annotated in Listing 8-10. + +``` + { + let v = vec![1, 2, 3, 4]; + + // do stuff with v + } // <- v goes out of scope and is freed here +``` + +Listing 8-10: Showing where the vector and its elements +are dropped + +When the vector gets dropped, all of its contents are also dropped, meaning the +integers it holds will be cleaned up. The borrow checker ensures that any +references to contents of a vector are only used while the vector itself is +valid. + +Let’s move on to the next collection type: `String`! + +## Storing UTF-8 Encoded Text with Strings + +We talked about strings in Chapter 4, but we’ll look at them in more depth now. +New Rustaceans commonly get stuck on strings for a combination of three +reasons: Rust’s propensity for exposing possible errors, strings being a more +complicated data structure than many programmers give them credit for, and +UTF-8. These factors combine in a way that can seem difficult when you’re +coming from other programming languages. + +We discuss strings in the context of collections because strings are +implemented as a collection of bytes, plus some methods to provide useful +functionality when those bytes are interpreted as text. In this section, we’ll +talk about the operations on `String` that every collection type has, such as +creating, updating, and reading. We’ll also discuss the ways in which `String` +is different from the other collections, namely how indexing into a `String` is +complicated by the differences between how people and computers interpret +`String` data. + +### What Is a String? + +We’ll first define what we mean by the term *string*. Rust has only one string +type in the core language, which is the string slice `str` that is usually seen +in its borrowed form `&str`. In Chapter 4, we talked about *string slices*, +which are references to some UTF-8 encoded string data stored elsewhere. String +literals, for example, are stored in the program’s binary and are therefore +string slices. + +The `String` type, which is provided by Rust’s standard library rather than +coded into the core language, is a growable, mutable, owned, UTF-8 encoded +string type. When Rustaceans refer to “strings” in Rust, they might be +referring to either the `String` or the string slice `&str` types, not just one +of those types. Although this section is largely about `String`, both types are +used heavily in Rust’s standard library, and both `String` and string slices +are UTF-8 encoded. + +### Creating a New String + +Many of the same operations available with `Vec` are available with `String` +as well because `String` is actually implemented as a wrapper around a vector +of bytes with some extra guarantees, restrictions, and capabilities. An example +of a function that works the same way with `Vec` and `String` is the `new` +function to create an instance, shown in Listing 8-11. + +``` + let mut s = String::new(); +``` + +Listing 8-11: Creating a new, empty `String` + +This line creates a new, empty string called `s`, into which we can then load +data. Often, we’ll have some initial data with which we want to start the +string. For that, we use the `to_string` method, which is available on any type +that implements the `Display` trait, as string literals do. Listing 8-12 shows +two examples. + +``` + let data = "initial contents"; + + let s = data.to_string(); + + // the method also works on a literal directly: + let s = "initial contents".to_string(); +``` + +Listing 8-12: Using the `to_string` method to create a +`String` from a string literal + +This code creates a string containing `initial contents`. + +We can also use the function `String::from` to create a `String` from a string +literal. The code in Listing 8-13 is equivalent to the code in Listing 8-12 +that uses `to_string`. + +``` + let s = String::from("initial contents"); +``` + +Listing 8-13: Using the `String::from` function to create +a `String` from a string literal + +Because strings are used for so many things, we can use many different generic +APIs for strings, providing us with a lot of options. Some of them can seem +redundant, but they all have their place! In this case, `String::from` and +`to_string` do the same thing, so which one you choose is a matter of style and +readability. + +Remember that strings are UTF-8 encoded, so we can include any properly encoded +data in them, as shown in Listing 8-14. + +``` + let hello = String::from("السلام عليكم"); + let hello = String::from("Dobrý den"); + let hello = String::from("Hello"); + let hello = String::from("שלום"); + let hello = String::from("नमस्ते"); + let hello = String::from("こんにちは"); + let hello = String::from("안녕하세요"); + let hello = String::from("你好"); + let hello = String::from("Olá"); + let hello = String::from("Здравствуйте"); + let hello = String::from("Hola"); +``` + +Listing 8-14: Storing greetings in different languages in +strings + +All of these are valid `String` values. + +### Updating a String + +A `String` can grow in size and its contents can change, just like the contents +of a `Vec`, if you push more data into it. In addition, you can conveniently +use the `+` operator or the `format!` macro to concatenate `String` values. + +#### Appending to a String with `push_str` and `push` + +We can grow a `String` by using the `push_str` method to append a string slice, +as shown in Listing 8-15. + +``` + let mut s = String::from("foo"); + s.push_str("bar"); +``` + +Listing 8-15: Appending a string slice to a `String` +using the `push_str` method + +After these two lines, `s` will contain `foobar`. The `push_str` method takes a +string slice because we don’t necessarily want to take ownership of the +parameter. For example, in the code in Listing 8-16, we want to be able to use +`s2` after appending its contents to `s1`. + +``` + let mut s1 = String::from("foo"); + let s2 = "bar"; + s1.push_str(s2); + println!("s2 is {s2}"); +``` + +Listing 8-16: Using a string slice after appending its +contents to a `String` + +If the `push_str` method took ownership of `s2`, we wouldn’t be able to print +its value on the last line. However, this code works as we’d expect! + +The `push` method takes a single character as a parameter and adds it to the +`String`. Listing 8-17 adds the letter *l* to a `String` using the `push` +method. + +``` + let mut s = String::from("lo"); + s.push('l'); +``` + +Listing 8-17: Adding one character to a `String` value +using `push` + +As a result, `s` will contain `lol`. + +#### Concatenation with the `+` Operator or the `format!` Macro + +Often, you’ll want to combine two existing strings. One way to do so is to use +the `+` operator, as shown in Listing 8-18. + +``` + let s1 = String::from("Hello, "); + let s2 = String::from("world!"); + let s3 = s1 + &s2; // note s1 has been moved here and can no longer be used +``` + +Listing 8-18: Using the `+` operator to combine two +`String` values into a new `String` value + +The string `s3` will contain `Hello, world!`. The reason `s1` is no longer +valid after the addition, and the reason we used a reference to `s2`, has to do +with the signature of the method that’s called when we use the `+` operator. +The `+` operator uses the `add` method, whose signature looks something like +this: + +``` +fn add(self, s: &str) -> String { +``` + +In the standard library, you’ll see `add` defined using generics and associated +types. Here, we’ve substituted in concrete types, which is what happens when we +call this method with `String` values. We’ll discuss generics in Chapter 10. +This signature gives us the clues we need in order to understand the tricky +bits of the `+` operator. + +First, `s2` has an `&`, meaning that we’re adding a *reference* of the second +string to the first string. This is because of the `s` parameter in the `add` +function: we can only add a `&str` to a `String`; we can’t add two `String` +values together. But wait—the type of `&s2` is `&String`, not `&str`, as +specified in the second parameter to `add`. So why does Listing 8-18 compile? + +The reason we’re able to use `&s2` in the call to `add` is that the compiler +can *coerce* the `&String` argument into a `&str`. When we call the `add` +method, Rust uses a *deref coercion*, which here turns `&s2` into `&s2[..]`. +We’ll discuss deref coercion in more depth in Chapter 15. Because `add` does +not take ownership of the `s` parameter, `s2` will still be a valid `String` +after this operation. + +Second, we can see in the signature that `add` takes ownership of `self` +because `self` does *not* have an `&`. This means `s1` in Listing 8-18 will be +moved into the `add` call and will no longer be valid after that. So, although +`let s3 = s1 + &s2;` looks like it will copy both strings and create a new one, +this statement actually takes ownership of `s1`, appends a copy of the contents +of `s2`, and then returns ownership of the result. In other words, it looks +like it’s making a lot of copies, but it isn’t; the implementation is more +efficient than copying. + +If we need to concatenate multiple strings, the behavior of the `+` operator +gets unwieldy: + +``` + let s1 = String::from("tic"); + let s2 = String::from("tac"); + let s3 = String::from("toe"); + + let s = s1 + "-" + &s2 + "-" + &s3; +``` + +At this point, `s` will be `tic-tac-toe`. With all of the `+` and `"` +characters, it’s difficult to see what’s going on. For combining strings in +more complicated ways, we can instead use the `format!` macro: + +``` + let s1 = String::from("tic"); + let s2 = String::from("tac"); + let s3 = String::from("toe"); + + let s = format!("{s1}-{s2}-{s3}"); +``` + +This code also sets `s` to `tic-tac-toe`. The `format!` macro works like +`println!`, but instead of printing the output to the screen, it returns a +`String` with the contents. The version of the code using `format!` is much +easier to read, and the code generated by the `format!` macro uses references +so that this call doesn’t take ownership of any of its parameters. + +### Indexing into Strings + +In many other programming languages, accessing individual characters in a +string by referencing them by index is a valid and common operation. However, +if you try to access parts of a `String` using indexing syntax in Rust, you’ll +get an error. Consider the invalid code in Listing 8-19. + +``` + let s1 = String::from("hello"); + let h = s1[0]; +``` + +Listing 8-19: Attempting to use indexing syntax with a +String + +This code will result in the following error: + +``` +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) +error[E0277]: the type `String` cannot be indexed by `{integer}` + --> src/main.rs:3:16 + | +3 | let h = s1[0]; + | ^ `String` cannot be indexed by `{integer}` + | + = help: the trait `Index<{integer}>` is not implemented for `String` + = help: the following other types implement trait `Index`: + > + >> + >> + >> + >> + >> + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `collections` (bin "collections") due to 1 previous error +``` + +The error and the note tell the story: Rust strings don’t support indexing. But +why not? To answer that question, we need to discuss how Rust stores strings in +memory. + +#### Internal Representation + +A `String` is a wrapper over a `Vec`. Let’s look at some of our properly +encoded UTF-8 example strings from Listing 8-14. First, this one: + +``` + let hello = String::from("Hola"); +``` + +In this case, `len` will be `4`, which means the vector storing the string +`"Hola"` is 4 bytes long. Each of these letters takes one byte when encoded in +UTF-8. The following line, however, may surprise you (note that this string +begins with the capital Cyrillic letter *Ze*, not the number 3): + +``` + let hello = String::from("Здравствуйте"); +``` + +If you were asked how long the string is, you might say 12. In fact, Rust’s +answer is 24: that’s the number of bytes it takes to encode “Здравствуйте” in +UTF-8, because each Unicode scalar value in that string takes 2 bytes of +storage. Therefore, an index into the string’s bytes will not always correlate +to a valid Unicode scalar value. To demonstrate, consider this invalid Rust +code: + +``` +let hello = "Здравствуйте"; +let answer = &hello[0]; +``` + +You already know that `answer` will not be `З`, the first letter. When encoded +in UTF-8, the first byte of `З` is `208` and the second is `151`, so it would +seem that `answer` should in fact be `208`, but `208` is not a valid character +on its own. Returning `208` is likely not what a user would want if they asked +for the first letter of this string; however, that’s the only data that Rust +has at byte index 0. Users generally don’t want the byte value returned, even +if the string contains only Latin letters: if `&"hello"[0]` were valid code +that returned the byte value, it would return `104`, not `h`. + +The answer, then, is that to avoid returning an unexpected value and causing +bugs that might not be discovered immediately, Rust doesn’t compile this code +at all and prevents misunderstandings early in the development process. + +#### Bytes and Scalar Values and Grapheme Clusters! Oh My! + +Another point about UTF-8 is that there are actually three relevant ways to +look at strings from Rust’s perspective: as bytes, scalar values, and grapheme +clusters (the closest thing to what we would call *letters*). + +If we look at the Hindi word “नमस्ते” written in the Devanagari script, it is +stored as a vector of `u8` values that looks like this: + +``` +[224, 164, 168, 224, 164, 174, 224, 164, 184, 224, 165, 141, 224, 164, 164, +224, 165, 135] +``` + +That’s 18 bytes and is how computers ultimately store this data. If we look at +them as Unicode scalar values, which are what Rust’s `char` type is, those +bytes look like this: + +``` +['न', 'म', 'स', '्', 'त', 'े'] +``` + +There are six `char` values here, but the fourth and sixth are not letters: +they’re diacritics that don’t make sense on their own. Finally, if we look at +them as grapheme clusters, we’d get what a person would call the four letters +that make up the Hindi word: + +``` +["न", "म", "स्", "ते"] +``` + +Rust provides different ways of interpreting the raw string data that computers +store so that each program can choose the interpretation it needs, no matter +what human language the data is in. + +A final reason Rust doesn’t allow us to index into a `String` to get a +character is that indexing operations are expected to always take constant time +(O(1)). But it isn’t possible to guarantee that performance with a `String`, +because Rust would have to walk through the contents from the beginning to the +index to determine how many valid characters there were. + +### Slicing Strings + +Indexing into a string is often a bad idea because it’s not clear what the +return type of the string-indexing operation should be: a byte value, a +character, a grapheme cluster, or a string slice. If you really need to use +indices to create string slices, therefore, Rust asks you to be more specific. + +Rather than indexing using `[]` with a single number, you can use `[]` with a +range to create a string slice containing particular bytes: + +``` +let hello = "Здравствуйте"; + +let s = &hello[0..4]; +``` + +Here, `s` will be a `&str` that contains the first four bytes of the string. +Earlier, we mentioned that each of these characters was two bytes, which means +`s` will be `Зд`. + +If we were to try to slice only part of a character’s bytes with something like +`&hello[0..1]`, Rust would panic at runtime in the same way as if an invalid +index were accessed in a vector: + +``` +$ cargo run + Compiling collections v0.1.0 (file:///projects/collections) + Finished dev [unoptimized + debuginfo] target(s) in 0.43s + Running `target/debug/collections` +thread 'main' panicked at src/main.rs:4:19: +byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +You should use caution when creating string slices with ranges, because doing +so can crash your program. + +### Methods for Iterating Over Strings + +The best way to operate on pieces of strings is to be explicit about whether +you want characters or bytes. For individual Unicode scalar values, use the +`chars` method. Calling `chars` on “Зд” separates out and returns two values of +type `char`, and you can iterate over the result to access each element: + +``` +for c in "Зд".chars() { + println!("{c}"); +} +``` + +This code will print the following: + +``` +З +д +``` + +Alternatively, the `bytes` method returns each raw byte, which might be +appropriate for your domain: + +``` +for b in "Зд".bytes() { + println!("{b}"); +} +``` + +This code will print the four bytes that make up this string: + +``` +208 +151 +208 +180 +``` + +But be sure to remember that valid Unicode scalar values may be made up of more +than one byte. + +Getting grapheme clusters from strings, as with the Devanagari script, is +complex, so this functionality is not provided by the standard library. Crates +are available on crates.io if this is the +functionality you need. + +### Strings Are Not So Simple + +To summarize, strings are complicated. Different programming languages make +different choices about how to present this complexity to the programmer. Rust +has chosen to make the correct handling of `String` data the default behavior +for all Rust programs, which means programmers have to put more thought into +handling UTF-8 data up front. This trade-off exposes more of the complexity of +strings than is apparent in other programming languages, but it prevents you +from having to handle errors involving non-ASCII characters later in your +development life cycle. + +The good news is that the standard library offers a lot of functionality built +off the `String` and `&str` types to help handle these complex situations +correctly. Be sure to check out the documentation for useful methods like +`contains` for searching in a string and `replace` for substituting parts of a +string with another string. + +Let’s switch to something a bit less complex: hash maps! + +## Storing Keys with Associated Values in Hash Maps + +The last of our common collections is the *hash map*. The type `HashMap` +stores a mapping of keys of type `K` to values of type `V` using a *hashing +function*, which determines how it places these keys and values into memory. +Many programming languages support this kind of data structure, but they often +use a different name, such as *hash*, *map*, *object*, *hash table*, +*dictionary*, or *associative array*, just to name a few. + +Hash maps are useful when you want to look up data not by using an index, as +you can with vectors, but by using a key that can be of any type. For example, +in a game, you could keep track of each team’s score in a hash map in which +each key is a team’s name and the values are each team’s score. Given a team +name, you can retrieve its score. + +We’ll go over the basic API of hash maps in this section, but many more goodies +are hiding in the functions defined on `HashMap` by the standard library. +As always, check the standard library documentation for more information. + +### Creating a New Hash Map + +One way to create an empty hash map is to use `new` and to add elements with +`insert`. In Listing 8-20, we’re keeping track of the scores of two teams whose +names are *Blue* and *Yellow*. The Blue team starts with 10 points, and the +Yellow team starts with 50. + +``` + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); +``` + +Listing 8-20: Creating a new hash map and inserting some +keys and values + +Note that we need to first `use` the `HashMap` from the collections portion of +the standard library. Of our three common collections, this one is the least +often used, so it’s not included in the features brought into scope +automatically in the prelude. Hash maps also have less support from the +standard library; there’s no built-in macro to construct them, for example. + +Just like vectors, hash maps store their data on the heap. This `HashMap` has +keys of type `String` and values of type `i32`. Like vectors, hash maps are +homogeneous: all of the keys must have the same type, and all of the values +must have the same type. + +### Accessing Values in a Hash Map + +We can get a value out of the hash map by providing its key to the `get` +method, as shown in Listing 8-21. + +``` + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); + + let team_name = String::from("Blue"); + let score = scores.get(&team_name).copied().unwrap_or(0); +``` + +Listing 8-21: Accessing the score for the Blue team +stored in the hash map + +Here, `score` will have the value that’s associated with the Blue team, and the +result will be `10`. The `get` method returns an `Option<&V>`; if there’s no +value for that key in the hash map, `get` will return `None`. 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. + +We can iterate over each key–value pair in a hash map in a similar manner as we +do with vectors, using a `for` loop: + +``` + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Yellow"), 50); + + for (key, value) in &scores { + println!("{key}: {value}"); + } +``` + +This code will print each pair in an arbitrary order: + +``` +Yellow: 50 +Blue: 10 +``` + +### Hash Maps and Ownership + +For types that implement the `Copy` trait, like `i32`, the values are copied +into the hash map. For owned values like `String`, the values will be moved and +the hash map will be the owner of those values, as demonstrated in Listing 8-22. + +``` + use std::collections::HashMap; + + let field_name = String::from("Favorite color"); + let field_value = String::from("Blue"); + + let mut map = HashMap::new(); + map.insert(field_name, field_value); + // field_name and field_value are invalid at this point, try using them and + // see what compiler error you get! +``` + +Listing 8-22: Showing that keys and values are owned by +the hash map once they’re inserted + +We aren’t able to use the variables `field_name` and `field_value` after +they’ve been moved into the hash map with the call to `insert`. + +If we insert references to values into the hash map, the values won’t be moved +into the hash map. The values that the references point to must be valid for at +least as long as the hash map is valid. We’ll talk more about these issues in +the “Validating References with +Lifetimes” section in +Chapter 10. + +### Updating a Hash Map + +Although the number of key and value pairs is growable, each unique key can +only have one value associated with it at a time (but not vice versa: for +example, both the Blue team and the Yellow team could have the value `10` +stored in the `scores` hash map). + +When you want to change the data in a hash map, you have to decide how to +handle the case when a key already has a value assigned. You could replace the +old value with the new value, completely disregarding the old value. You could +keep the old value and ignore the new value, only adding the new value if the +key *doesn’t* already have a value. Or you could combine the old value and the +new value. Let’s look at how to do each of these! + +#### Overwriting a Value + +If we insert a key and a value into a hash map and then insert that same key +with a different value, the value associated with that key will be replaced. +Even though the code in Listing 8-23 calls `insert` twice, the hash map will +only contain one key–value pair because we’re inserting the value for the Blue +team’s key both times. + +``` + use std::collections::HashMap; + + let mut scores = HashMap::new(); + + scores.insert(String::from("Blue"), 10); + scores.insert(String::from("Blue"), 25); + + println!("{scores:?}"); +``` + +Listing 8-23: Replacing a value stored with a particular +key + +This code will print `{"Blue": 25}`. The original value of `10` has been +overwritten. + + + + +#### Adding a Key and Value Only If a Key Isn’t Present + +It’s common to check whether a particular key already exists in the hash map +with a value and then to take the following actions: if the key does exist in +the hash map, the existing value should remain the way it is; if the key +doesn’t exist, insert it and a value for it. + +Hash maps have a special API for this called `entry` that takes the key you +want to check as a parameter. The return value of the `entry` method is an enum +called `Entry` that represents a value that might or might not exist. Let’s say +we want to check whether the key for the Yellow team has a value associated +with it. If it doesn’t, we want to insert the value `50`, and the same for the +Blue team. Using the `entry` API, the code looks like Listing 8-24. + +``` + use std::collections::HashMap; + + let mut scores = HashMap::new(); + scores.insert(String::from("Blue"), 10); + + scores.entry(String::from("Yellow")).or_insert(50); + scores.entry(String::from("Blue")).or_insert(50); + + println!("{scores:?}"); +``` + +Listing 8-24: Using the `entry` method to only insert if +the key does not already have a value + +The `or_insert` method on `Entry` is defined to return a mutable reference to +the value for the corresponding `Entry` key if that key exists, and if not, it +inserts the parameter as the new value for this key and returns a mutable +reference to the new value. This technique is much cleaner than writing the +logic ourselves and, in addition, plays more nicely with the borrow checker. + +Running the code in Listing 8-24 will print `{"Yellow": 50, "Blue": 10}`. The +first call to `entry` will insert the key for the Yellow team with the value +`50` because the Yellow team doesn’t have a value already. The second call to +`entry` will not change the hash map because the Blue team already has the +value `10`. + +#### Updating a Value Based on the Old Value + +Another common use case for hash maps is to look up a key’s value and then +update it based on the old value. For instance, Listing 8-25 shows code that +counts how many times each word appears in some text. We use a hash map with +the words as keys and increment the value to keep track of how many times we’ve +seen that word. If it’s the first time we’ve seen a word, we’ll first insert +the value `0`. + +``` + use std::collections::HashMap; + + let text = "hello world wonderful world"; + + let mut map = HashMap::new(); + + for word in text.split_whitespace() { + let count = map.entry(word).or_insert(0); + *count += 1; + } + + println!("{map:?}"); +``` + +Listing 8-25: Counting occurrences of words using a hash +map that stores words and counts + +This code will print `{"world": 2, "hello": 1, "wonderful": 1}`. You might see +the same key–value pairs printed in a different order: recall from the +“Accessing Values in a Hash Map” section that +iterating over a hash map happens in an arbitrary order. + +The `split_whitespace` method returns an iterator over subslices, separated by +whitespace, of the value in `text`. The `or_insert` method returns a mutable +reference (`&mut V`) to the value for the specified key. Here, we store that +mutable reference in the `count` variable, so in order to assign to that value, +we must first dereference `count` using the asterisk (`*`). The mutable +reference goes out of scope at the end of the `for` loop, so all of these +changes are safe and allowed by the borrowing rules. + +### Hashing Functions + +By default, `HashMap` uses a hashing function called *SipHash* that can provide +resistance to denial-of-service (DoS) attacks involving hash +tables^siphash at *[https://en.wikipedia.org/wiki/SipHash](https://en.wikipedia.org/wiki/SipHash)*. This is not the fastest hashing algorithm +available, but the trade-off for better security that comes with the drop in +performance is worth it. If you profile your code and find that the default +hash function is too slow for your purposes, you can switch to another function +by specifying a different hasher. A *hasher* is a type that implements the +`BuildHasher` trait. We’ll talk about traits and how to implement them in +Chapter 10. You don’t necessarily have to implement +your own hasher from scratch; crates.io +has libraries shared by other Rust users that provide hashers implementing many +common hashing algorithms. + + +## Summary + +Vectors, strings, and hash maps will provide a large amount of functionality +necessary in programs when you need to store, access, and modify data. Here are +some exercises you should now be equipped to solve: + +1. Given a list of integers, use a vector and return the median (when sorted, + the value in the middle position) and mode (the value that occurs most + often; a hash map will be helpful here) of the list. +1. Convert strings to pig latin. The first consonant of each word is moved to + the end of the word and *ay* is added, so *first* becomes *irst-fay*. Words + that start with a vowel have *hay* added to the end instead (*apple* becomes + *apple-hay*). Keep in mind the details about UTF-8 encoding! +1. Using a hash map and vectors, create a text interface to allow a user to add + employee names to a department in a company; for example, “Add Sally to + Engineering” or “Add Amir to Sales.” Then let the user retrieve a list of all + people in a department or all people in the company by department, sorted + alphabetically. + +The standard library API documentation describes methods that vectors, strings, +and hash maps have that will be helpful for these exercises! + +We’re getting into more complex programs in which operations can fail, so it’s +a perfect time to discuss error handling. We’ll do that next! diff --git a/rustbook-ru/nostarch/chapter09.md b/rustbook-ru/nostarch/chapter09.md new file mode 100644 index 000000000..a7188076c --- /dev/null +++ b/rustbook-ru/nostarch/chapter09.md @@ -0,0 +1,1116 @@ + + +[TOC] + +# Error Handling + +Errors are a fact of life in software, so Rust has a number of features for +handling situations in which something goes wrong. In many cases, Rust requires +you to acknowledge the possibility of an error and take some action before your +code will compile. This requirement makes your program more robust by ensuring +that you’ll discover errors and handle them appropriately before you’ve +deployed your code to production! + +Rust groups errors into two major categories: *recoverable* and *unrecoverable* +errors. For a recoverable error, such as a *file not found* error, we most +likely just want to report the problem to the user and retry the operation. +Unrecoverable errors are always symptoms of bugs, such as trying to access a +location beyond the end of an array, and so we want to immediately stop the +program. + +Most languages don’t distinguish between these two kinds of errors and handle +both in the same way, using mechanisms such as exceptions. Rust doesn’t have +exceptions. Instead, it has the type `Result` for recoverable errors and +the `panic!` macro that stops execution when the program encounters an +unrecoverable error. This chapter covers calling `panic!` first and then talks +about returning `Result` values. Additionally, we’ll explore +considerations when deciding whether to try to recover from an error or to stop +execution. + +## Unrecoverable Errors with `panic!` + +Sometimes bad things happen in your code, and there’s nothing you can do about +it. In these cases, Rust has the `panic!` macro. There are two ways to cause a +panic in practice: by taking an action that causes our code to panic (such as +accessing an array past the end) or by explicitly calling the `panic!` macro. +In both cases, we cause a panic in our program. By default, these panics will +print a failure message, unwind, clean up the stack, and quit. Via an +environment variable, you can also have Rust display the call stack when a +panic occurs to make it easier to track down the source of the panic. + +> ### Unwinding the Stack or Aborting in Response to a Panic +> +> By default, when a panic occurs the program starts *unwinding*, which means +> Rust walks back up the stack and cleans up the data from each function it +> encounters. However, walking back and cleaning up is a lot of work. Rust, +> therefore, allows you to choose the alternative of immediately *aborting*, +> which ends the program without cleaning up. +> +> Memory that the program was using will then need to be cleaned up by the +> operating system. If in your project you need to make the resultant binary as +> small as possible, you can switch from unwinding to aborting upon a panic by +> adding `panic = 'abort'` to the appropriate `[profile]` sections in your +> *Cargo.toml* file. For example, if you want to abort on panic in release mode, +> add this: +> +> ```toml +> profile.release +> panic = 'abort' +> ``` + +Let’s try calling `panic!` in a simple program: + +Filename: src/main.rs + +``` +fn main() { + panic!("crash and burn"); +} +``` + +When you run the program, you’ll see something like this: + +``` +$ cargo run + Compiling panic v0.1.0 (file:///projects/panic) + Finished dev [unoptimized + debuginfo] target(s) in 0.25s + Running `target/debug/panic` +thread 'main' panicked at src/main.rs:2:5: +crash and burn +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +The call to `panic!` causes the error message contained in the last two lines. +The first line shows our panic message and the place in our source code where +the panic occurred: *src/main.rs:2:5* indicates that it’s the second line, +fifth character of our *src/main.rs* file. + +In this case, the line indicated is part of our code, and if we go to that +line, we see the `panic!` macro call. In other cases, the `panic!` call might +be in code that our code calls, and the filename and line number reported by +the error message will be someone else’s code where the `panic!` macro is +called, not the line of our code that eventually led to the `panic!` call. + + + + +We can use the backtrace of the functions the `panic!` call came from to figure +out the part of our code that is causing the problem. To understand how to use +a `panic!` backtrace, let’s look at another example and see what it’s like when +a `panic!` call comes from a library because of a bug in our code instead of +from our code calling the macro directly. Listing 9-1 has some code that +attempts to access an index in a vector beyond the range of valid indexes. + +Filename: src/main.rs + +``` +fn main() { + let v = vec![1, 2, 3]; + + v[99]; +} +``` + +Listing 9-1: Attempting to access an element beyond the +end of a vector, which will cause a call to `panic!` + +Here, we’re attempting to access the 100th element of our vector (which is at +index 99 because indexing starts at zero), but the vector has only three +elements. In this situation, Rust will panic. Using `[]` is supposed to return +an element, but if you pass an invalid index, there’s no element that Rust +could return here that would be correct. + +In C, attempting to read beyond the end of a data structure is undefined +behavior. You might get whatever is at the location in memory that would +correspond to that element in the data structure, even though the memory +doesn’t belong to that structure. This is called a *buffer overread* and can +lead to security vulnerabilities if an attacker is able to manipulate the index +in such a way as to read data they shouldn’t be allowed to that is stored after +the data structure. + +To protect your program from this sort of vulnerability, if you try to read an +element at an index that doesn’t exist, Rust will stop execution and refuse to +continue. Let’s try it and see: + +``` +$ cargo run + Compiling panic v0.1.0 (file:///projects/panic) + Finished dev [unoptimized + debuginfo] target(s) in 0.27s + Running `target/debug/panic` +thread 'main' panicked at src/main.rs:4:6: +index out of bounds: the len is 3 but the index is 99 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +This error points at line 4 of our *main.rs* where we attempt to access index +`99` of the vector in `v`. + +The `note:` line tells us that we can set the `RUST_BACKTRACE` environment +variable to get a backtrace of exactly what happened to cause the error. A +*backtrace* is a list of all the functions that have been called to get to this +point. Backtraces in Rust work as they do in other languages: the key to +reading the backtrace is to start from the top and read until you see files you +wrote. That’s the spot where the problem originated. The lines above that spot +are code that your code has called; the lines below are code that called your +code. These before-and-after lines might include core Rust code, standard +library code, or crates that you’re using. Let’s try getting a backtrace by +setting the `RUST_BACKTRACE` environment variable to any value except `0`. +Listing 9-2 shows output similar to what you’ll see. + + + +``` +$ RUST_BACKTRACE=1 cargo run +thread 'main' panicked at src/main.rs:4:6: +index out of bounds: the len is 3 but the index is 99 +stack backtrace: + 0: rust_begin_unwind + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5 + 1: core::panicking::panic_fmt + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14 + 2: core::panicking::panic_bounds_check + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:208:5 + 3: >::index + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/index.rs:255:10 + 4: core::slice::index:: for [T]>::index + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/index.rs:18:9 + 5: as core::ops::index::Index>::index + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/mod.rs:2770:9 + 6: panic::main + at ./src/main.rs:4:6 + 7: core::ops::function::FnOnce::call_once + at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5 +note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. +``` + +Listing 9-2: The backtrace generated by a call to +`panic!` displayed when the environment variable `RUST_BACKTRACE` is set + +That’s a lot of output! The exact output you see might be different depending +on your operating system and Rust version. In order to get backtraces with this +information, debug symbols must be enabled. Debug symbols are enabled by +default when using `cargo build` or `cargo run` without the `--release` flag, +as we have here. + +In the output in Listing 9-2, line 6 of the backtrace points to the line in our +project that’s causing the problem: line 4 of *src/main.rs*. If we don’t want +our program to panic, we should start our investigation at the location pointed +to by the first line mentioning a file we wrote. In Listing 9-1, where we +deliberately wrote code that would panic, the way to fix the panic is to not +request an element beyond the range of the vector indexes. When your code +panics in the future, you’ll need to figure out what action the code is taking +with what values to cause the panic and what the code should do instead. + +We’ll come back to `panic!` and when we should and should not use `panic!` to +handle error conditions in the “To `panic!` or Not to +`panic!`” section later in this +chapter. Next, we’ll look at how to recover from an error using `Result`. + +## Recoverable Errors with `Result` + +Most errors aren’t serious enough to require the program to stop entirely. +Sometimes when a function fails it’s for a reason that you can easily interpret +and respond to. For example, if you try to open a file and that operation fails +because the file doesn’t exist, you might want to create the file instead of +terminating the process. + +Recall from “Handling Potential Failure with `Result`” in Chapter 2 that the `Result` enum is defined as having two +variants, `Ok` and `Err`, as follows: + +``` +enum Result { + Ok(T), + Err(E), +} +``` + +The `T` and `E` are generic type parameters: we’ll discuss generics in more +detail in Chapter 10. What you need to know right now is that `T` represents +the type of the value that will be returned in a success case within the `Ok` +variant, and `E` represents the type of the error that will be returned in a +failure case within the `Err` variant. Because `Result` has these generic type +parameters, we can use the `Result` type and the functions defined on it in +many different situations where the success value and error value we want to +return may differ. + +Let’s call a function that returns a `Result` value because the function could +fail. In Listing 9-3 we try to open a file. + +Filename: src/main.rs + +``` +use std::fs::File; + +fn main() { + let greeting_file_result = File::open("hello.txt"); +} +``` + +Listing 9-3: Opening a file + +The return type of `File::open` is a `Result`. The generic parameter `T` +has been filled in by the implementation of `File::open` with the type of the +success value, `std::fs::File`, which is a file handle. The type of `E` used in +the error value is `std::io::Error`. This return type means the call to +`File::open` might succeed and return a file handle that we can read from or +write to. The function call also might fail: for example, the file might not +exist, or we might not have permission to access the file. The `File::open` +function needs to have a way to tell us whether it succeeded or failed and at +the same time give us either the file handle or error information. This +information is exactly what the `Result` enum conveys. + +In the case where `File::open` succeeds, the value in the variable +`greeting_file_result` will be an instance of `Ok` that contains a file handle. +In the case where it fails, the value in `greeting_file_result` will be an +instance of `Err` that contains more information about the kind of error that +occurred. + +We need to add to the code in Listing 9-3 to take different actions depending +on the value `File::open` returns. Listing 9-4 shows one way to handle the +`Result` using a basic tool, the `match` expression that we discussed in +Chapter 6. + +Filename: src/main.rs + +``` +use std::fs::File; + +fn main() { + let greeting_file_result = File::open("hello.txt"); + + let greeting_file = match greeting_file_result { + Ok(file) => file, + Err(error) => panic!("Problem opening the file: {error:?}"), + }; +} +``` + +Listing 9-4: Using a `match` expression to handle the +`Result` variants that might be returned + +Note that, like the `Option` enum, the `Result` enum and its variants have been +brought into scope by the prelude, so we don’t need to specify `Result::` +before the `Ok` and `Err` variants in the `match` arms. + +When the result is `Ok`, this code will return the inner `file` value out of +the `Ok` variant, and we then assign that file handle value to the variable +`greeting_file`. After the `match`, we can use the file handle for reading or +writing. + +The other arm of the `match` handles the case where we get an `Err` value from +`File::open`. In this example, we’ve chosen to call the `panic!` macro. If +there’s no file named *hello.txt* in our current directory and we run this +code, we’ll see the following output from the `panic!` macro: + +``` +$ cargo run + Compiling error-handling v0.1.0 (file:///projects/error-handling) + Finished dev [unoptimized + debuginfo] target(s) in 0.73s + Running `target/debug/error-handling` +thread 'main' panicked at src/main.rs:8:23: +Problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" } +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +As usual, this output tells us exactly what has gone wrong. + +### Matching on Different Errors + +The code in Listing 9-4 will `panic!` no matter why `File::open` failed. +However, we want to take different actions for different failure reasons. If +`File::open` failed because the file doesn’t exist, we want to create the file +and return the handle to the new file. If `File::open` failed for any other +reason—for example, because we didn’t have permission to open the file—we still +want the code to `panic!` in the same way it did in Listing 9-4. For this, we +add an inner `match` expression, shown in Listing 9-5. + +Filename: src/main.rs + + + +``` +use std::fs::File; +use std::io::ErrorKind; + +fn main() { + let greeting_file_result = File::open("hello.txt"); + + let greeting_file = match greeting_file_result { + Ok(file) => file, + Err(error) => match error.kind() { + ErrorKind::NotFound => match File::create("hello.txt") { + Ok(fc) => fc, + Err(e) => panic!("Problem creating the file: {e:?}"), + }, + other_error => { + panic!("Problem opening the file: {other_error:?}"); + } + }, + }; +} +``` + +Listing 9-5: Handling different kinds of errors in +different ways + +The type of the value that `File::open` returns inside the `Err` variant is +`io::Error`, which is a struct provided by the standard library. This struct +has a method `kind` that we can call to get an `io::ErrorKind` value. The enum +`io::ErrorKind` is provided by the standard library and has variants +representing the different kinds of errors that might result from an `io` +operation. The variant we want to use is `ErrorKind::NotFound`, which indicates +the file we’re trying to open doesn’t exist yet. So we match on +`greeting_file_result`, but we also have an inner match on `error.kind()`. + +The condition we want to check in the inner match is whether the value returned +by `error.kind()` is the `NotFound` variant of the `ErrorKind` enum. If it is, +we try to create the file with `File::create`. However, because `File::create` +could also fail, we need a second arm in the inner `match` expression. When the +file can’t be created, a different error message is printed. The second arm of +the outer `match` stays the same, so the program panics on any error besides +the missing file error. + +> #### Alternatives to Using `match` with `Result` +> +> That’s a lot of `match`! The `match` expression is very useful but also very +> much a primitive. In Chapter 13, you’ll learn about closures, which are used +> with many of the methods defined on `Result`. These methods can be more +> concise than using `match` when handling `Result` values in your code. +> +> For example, here’s another way to write the same logic as shown in Listing +> 9-5, this time using closures and the `unwrap_or_else` method: +> +> +> +> ```rust,ignore +> use std::fs::File; +> use std::io::ErrorKind; +> +> fn main() { +> let greeting_file = File::open("hello.txt").unwrap_or_else(|error| { +> if error.kind() == ErrorKind::NotFound { +> File::create("hello.txt").unwrap_or_else(|error| { +> panic!("Problem creating the file: {error:?}"); +> }) +> } else { +> panic!("Problem opening the file: {error:?}"); +> } +> }); +> } +> ``` +> +> Although this code has the same behavior as Listing 9-5, it doesn’t contain +> any `match` expressions and is cleaner to read. Come back to this example +> after you’ve read Chapter 13, and look up the `unwrap_or_else` method in the +> standard library documentation. Many more of these methods can clean up huge +> nested `match` expressions when you’re dealing with errors. + +#### Shortcuts for Panic on Error: `unwrap` and `expect` + +Using `match` works well enough, but it can be a bit verbose and doesn’t always +communicate intent well. The `Result` type has many helper methods +defined on it to do various, more specific tasks. The `unwrap` method is a +shortcut method implemented just like the `match` expression we wrote in +Listing 9-4. If the `Result` value is the `Ok` variant, `unwrap` will return +the value inside the `Ok`. If the `Result` is the `Err` variant, `unwrap` will +call the `panic!` macro for us. Here is an example of `unwrap` in action: + +Filename: src/main.rs + +``` +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt").unwrap(); +} +``` + +If we run this code without a *hello.txt* file, we’ll see an error message from +the `panic!` call that the `unwrap` method makes: + + + +``` +thread 'main' panicked at src/main.rs:4:49: +called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" } +``` + +Similarly, the `expect` method lets us also choose the `panic!` error message. +Using `expect` instead of `unwrap` and providing good error messages can convey +your intent and make tracking down the source of a panic easier. The syntax of +`expect` looks like this: + +Filename: src/main.rs + +``` +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt") + .expect("hello.txt should be included in this project"); +} +``` + +We use `expect` in the same way as `unwrap`: to return the file handle or call +the `panic!` macro. The error message used by `expect` in its call to `panic!` +will be the parameter that we pass to `expect`, rather than the default +`panic!` message that `unwrap` uses. Here’s what it looks like: + + + +``` +thread 'main' panicked at src/main.rs:5:10: +hello.txt should be included in this project: Os { code: 2, kind: NotFound, message: "No such file or directory" } +``` + +In production-quality code, most Rustaceans choose `expect` rather than +`unwrap` and give more context about why the operation is expected to always +succeed. That way, if your assumptions are ever proven wrong, you have more +information to use in debugging. + +### Propagating Errors + +When a function’s implementation calls something that might fail, instead of +handling the error within the function itself you can return the error to the +calling code so that it can decide what to do. This is known as *propagating* +the error and gives more control to the calling code, where there might be more +information or logic that dictates how the error should be handled than what +you have available in the context of your code. + +For example, Listing 9-6 shows a function that reads a username from a file. If +the file doesn’t exist or can’t be read, this function will return those errors +to the code that called the function. + +Filename: src/main.rs + + + +``` +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let username_file_result = File::open("hello.txt"); + + let mut username_file = match username_file_result { + Ok(file) => file, + Err(e) => return Err(e), + }; + + let mut username = String::new(); + + match username_file.read_to_string(&mut username) { + Ok(_) => Ok(username), + Err(e) => Err(e), + } +} +``` + +Listing 9-6: A function that returns errors to the +calling code using `match` + +This function can be written in a much shorter way, but we’re going to start by +doing a lot of it manually in order to explore error handling; at the end, +we’ll show the shorter way. Let’s look at the return type of the function +first: `Result`. This means the function is returning a +value of the type `Result`, where the generic parameter `T` has been +filled in with the concrete type `String` and the generic type `E` has been +filled in with the concrete type `io::Error`. + +If this function succeeds without any problems, the code that calls this +function will receive an `Ok` value that holds a `String`—the `username` that +this function read from the file. If this function encounters any problems, the +calling code will receive an `Err` value that holds an instance of `io::Error` +that contains more information about what the problems were. We chose +`io::Error` as the return type of this function because that happens to be the +type of the error value returned from both of the operations we’re calling in +this function’s body that might fail: the `File::open` function and the +`read_to_string` method. + +The body of the function starts by calling the `File::open` function. Then we +handle the `Result` value with a `match` similar to the `match` in Listing 9-4. +If `File::open` succeeds, the file handle in the pattern variable `file` +becomes the value in the mutable variable `username_file` and the function +continues. In the `Err` case, instead of calling `panic!`, we use the `return` +keyword to return early out of the function entirely and pass the error value +from `File::open`, now in the pattern variable `e`, back to the calling code as +this function’s error value. + +So, if we have a file handle in `username_file`, the function then creates a +new `String` in variable `username` and calls the `read_to_string` method on +the file handle in `username_file` to read the contents of the file into +`username`. The `read_to_string` method also returns a `Result` because it +might fail, even though `File::open` succeeded. So we need another `match` to +handle that `Result`: if `read_to_string` succeeds, then our function has +succeeded, and we return the username from the file that’s now in `username` +wrapped in an `Ok`. If `read_to_string` fails, we return the error value in the +same way that we returned the error value in the `match` that handled the +return value of `File::open`. However, we don’t need to explicitly say +`return`, because this is the last expression in the function. + +The code that calls this code will then handle getting either an `Ok` value +that contains a username or an `Err` value that contains an `io::Error`. It’s +up to the calling code to decide what to do with those values. If the calling +code gets an `Err` value, it could call `panic!` and crash the program, use a +default username, or look up the username from somewhere other than a file, for +example. We don’t have enough information on what the calling code is actually +trying to do, so we propagate all the success or error information upward for +it to handle appropriately. + +This pattern of propagating errors is so common in Rust that Rust provides the +question mark operator `?` to make this easier. + +#### A Shortcut for Propagating Errors: the `?` Operator + +Listing 9-7 shows an implementation of `read_username_from_file` that has the +same functionality as in Listing 9-6, but this implementation uses the `?` +operator. + +Filename: src/main.rs + + + +``` +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let mut username_file = File::open("hello.txt")?; + let mut username = String::new(); + username_file.read_to_string(&mut username)?; + Ok(username) +} +``` + +Listing 9-7: A function that returns errors to the +calling code using the `?` operator + +The `?` placed after a `Result` value is defined to work in almost the same way +as the `match` expressions we defined to handle the `Result` values in Listing +9-6. 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. + +There is a difference between what the `match` expression from Listing 9-6 does +and what the `?` operator does: error values that have the `?` operator called +on them go through the `from` function, defined in the `From` trait in the +standard library, which is used to convert values from one type into another. +When the `?` operator calls the `from` function, the error type received is +converted into the error type defined in the return type of the current +function. This is useful when a function returns one error type to represent +all the ways a function might fail, even if parts might fail for many different +reasons. + +For example, we could change the `read_username_from_file` function in Listing +9-7 to return a custom error type named `OurError` that we define. If we also +define `impl From for OurError` to construct an instance of +`OurError` from an `io::Error`, then the `?` operator calls in the body of +`read_username_from_file` will call `from` and convert the error types without +needing to add any more code to the function. + +In the context of Listing 9-7, the `?` at the end of the `File::open` call will +return the value inside an `Ok` to the variable `username_file`. If an error +occurs, the `?` operator will return early out of the whole function and give +any `Err` value to the calling code. The same thing applies to the `?` at the +end of the `read_to_string` call. + +The `?` operator eliminates a lot of boilerplate and makes this function’s +implementation simpler. We could even shorten this code further by chaining +method calls immediately after the `?`, as shown in Listing 9-8. + +Filename: src/main.rs + + + +``` +use std::fs::File; +use std::io::{self, Read}; + +fn read_username_from_file() -> Result { + let mut username = String::new(); + + File::open("hello.txt")?.read_to_string(&mut username)?; + + Ok(username) +} +``` + +Listing 9-8: Chaining method calls after the `?` +operator + +We’ve moved the creation of the new `String` in `username` to the beginning of +the function; that part hasn’t changed. Instead of creating a variable +`username_file`, we’ve chained the call to `read_to_string` directly onto the +result of `File::open("hello.txt")?`. We still have a `?` at the end of the +`read_to_string` call, and we still return an `Ok` value containing `username` +when both `File::open` and `read_to_string` succeed rather than returning +errors. The functionality is again the same as in Listing 9-6 and Listing 9-7; +this is just a different, more ergonomic way to write it. + +Listing 9-9 shows a way to make this even shorter using `fs::read_to_string`. + +Filename: src/main.rs + + + +``` +use std::fs; +use std::io; + +fn read_username_from_file() -> Result { + fs::read_to_string("hello.txt") +} +``` + +Listing 9-9: Using `fs::read_to_string` instead of +opening and then reading the file + +Reading a file into a string is a fairly common operation, so the standard +library provides the convenient `fs::read_to_string` function that opens the +file, creates a new `String`, reads the contents of the file, puts the contents +into that `String`, and returns it. Of course, using `fs::read_to_string` +doesn’t give us the opportunity to explain all the error handling, so we did it +the longer way first. + +#### Where The `?` Operator Can Be Used + +The `?` operator can only be used in functions whose return type is compatible +with the value the `?` is used on. This is because the `?` operator is defined +to perform an early return of a value out of the function, in the same manner +as the `match` expression we defined in Listing 9-6. In Listing 9-6, the +`match` was using a `Result` value, and the early return arm returned an +`Err(e)` value. The return type of the function has to be a `Result` so that +it’s compatible with this `return`. + +In Listing 9-10, let’s look at the error we’ll get if we use the `?` operator +in a `main` function with a return type that is incompatible with the type of +the value we use `?` on. + +Filename: src/main.rs + +``` +use std::fs::File; + +fn main() { + let greeting_file = File::open("hello.txt")?; +} +``` + +Listing 9-10: Attempting to use the `?` in the `main` +function that returns `()` won’t compile. + +This code opens a file, which might fail. The `?` operator follows the `Result` +value returned by `File::open`, but this `main` function has the return type of +`()`, not `Result`. When we compile this code, we get the following error +message: + +``` +$ cargo run + Compiling error-handling v0.1.0 (file:///projects/error-handling) +error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) + --> src/main.rs:4:48 + | +3 | fn main() { + | --------- this function should return `Result` or `Option` to accept `?` +4 | let greeting_file = File::open("hello.txt")?; + | ^ cannot use the `?` operator in a function that returns `()` + | + = help: the trait `FromResidual>` is not implemented for `()` + +For more information about this error, try `rustc --explain E0277`. +error: could not compile `error-handling` (bin "error-handling") due to 1 previous error +``` + +This error points out that we’re only allowed to use the `?` operator in a +function that returns `Result`, `Option`, or another type that implements +`FromResidual`. + +To fix the error, you have two choices. One choice is to change the return type +of your function to be compatible with the value you’re using the `?` operator +on as long as you have no restrictions preventing that. The other choice is to +use a `match` or one of the `Result` methods to handle the `Result` +in whatever way is appropriate. + +The error message also mentioned that `?` can be used with `Option` values +as well. As with using `?` on `Result`, you can only use `?` on `Option` in a +function that returns an `Option`. The behavior of the `?` operator when called +on an `Option` is similar to its behavior when called on a `Result`: +if the value is `None`, the `None` will be returned early from the function at +that point. If the value is `Some`, the value inside the `Some` is the +resultant value of the expression, and the function continues. Listing 9-11 has +an example of a function that finds the last character of the first line in the +given text. + +``` +fn last_char_of_first_line(text: &str) -> Option { + text.lines().next()?.chars().last() +} +``` + +Listing 9-11: Using the `?` operator on an `Option` +value + +This function returns `Option` because it’s possible that there is a +character there, but it’s also possible that there isn’t. This code takes the +`text` string slice argument and calls the `lines` method on it, which returns +an iterator over the lines in the string. Because this function wants to +examine the first line, it calls `next` on the iterator to get the first value +from the iterator. If `text` is the empty string, this call to `next` will +return `None`, in which case we use `?` to stop and return `None` from +`last_char_of_first_line`. If `text` is not the empty string, `next` will +return a `Some` value containing a string slice of the first line in `text`. + +The `?` extracts the string slice, and we can call `chars` on that string slice +to get an iterator of its characters. We’re interested in the last character in +this first line, so we call `last` to return the last item in the iterator. +This is an `Option` because it’s possible that the first line is the empty +string; for example, if `text` starts with a blank line but has characters on +other lines, as in `"\nhi"`. However, if there is a last character on the first +line, it will be returned in the `Some` variant. The `?` operator in the middle +gives us a concise way to express this logic, allowing us to implement the +function in one line. If we couldn’t use the `?` operator on `Option`, we’d +have to implement this logic using more method calls or a `match` expression. + +Note that you can use the `?` operator on a `Result` in a function that returns +`Result`, and you can use the `?` operator on an `Option` in a function that +returns `Option`, but you can’t mix and match. The `?` operator won’t +automatically convert a `Result` to an `Option` or vice versa; in those cases, +you can use methods like the `ok` method on `Result` or the `ok_or` method on +`Option` to do the conversion explicitly. + +So far, all the `main` functions we’ve used return `()`. The `main` function is +special because it’s the entry point and exit point of an executable program, +and there are restrictions on what its return type can be for the program to +behave as expected. + +Luckily, `main` can also return a `Result<(), E>`. Listing 9-12 has the code +from Listing 9-10, but we’ve changed the return type of `main` to be +`Result<(), Box>` and added a return value `Ok(())` to the end. This +code will now compile. + +Filename: src/main.rs + +``` +use std::error::Error; +use std::fs::File; + +fn main() -> Result<(), Box> { + let greeting_file = File::open("hello.txt")?; + + Ok(()) +} +``` + +Listing 9-12: Changing `main` to return `Result<(), E>` +allows the use of the `?` operator on `Result` values. + +The `Box` type is a *trait object*, which we’ll talk about in the +“Using Trait Objects that Allow for Values of Different +Types” section in Chapter 17. For now, you can +read `Box` to mean “any kind of error.” Using `?` on a `Result` +value in a `main` function with the error type `Box` is allowed +because it allows any `Err` value to be returned early. Even though the body of +this `main` function will only ever return errors of type `std::io::Error`, by +specifying `Box`, this signature will continue to be correct even if +more code that returns other errors is added to the body of `main`. + +When a `main` function returns a `Result<(), E>`, the executable will exit with +a value of `0` if `main` returns `Ok(())` and will exit with a nonzero value if +`main` returns an `Err` value. Executables written in C return integers when +they exit: programs that exit successfully return the integer `0`, and programs +that error return some integer other than `0`. Rust also returns integers from +executables to be compatible with this convention. + +The `main` function may return any types that implement the +`std::process::Termination` trait, which contains +a function `report` that returns an `ExitCode`. Consult the standard library +documentation for more information on implementing the `Termination` trait for +your own types. + +Now that we’ve discussed the details of calling `panic!` or returning `Result`, +let’s return to the topic of how to decide which is appropriate to use in which +cases. + +## To `panic!` or Not to `panic!` + +So how do you decide when you should call `panic!` and when you should return +`Result`? When code panics, there’s no way to recover. You could call `panic!` +for any error situation, whether there’s a possible way to recover or not, but +then you’re making the decision that a situation is unrecoverable on behalf of +the calling code. When you choose to return a `Result` value, you give the +calling code options. The calling code could choose to attempt to recover in a +way that’s appropriate for its situation, or it could decide that an `Err` +value in this case is unrecoverable, so it can call `panic!` and turn your +recoverable error into an unrecoverable one. Therefore, returning `Result` is a +good default choice when you’re defining a function that might fail. + +In situations such as examples, prototype code, and tests, it’s more +appropriate to write code that panics instead of returning a `Result`. Let’s +explore why, then discuss situations in which the compiler can’t tell that +failure is impossible, but you as a human can. The chapter will conclude with +some general guidelines on how to decide whether to panic in library code. + +### Examples, Prototype Code, and Tests + +When you’re writing an example to illustrate some concept, also including +robust error-handling code can make the example less clear. In examples, it’s +understood that a call to a method like `unwrap` that could panic is meant as a +placeholder for the way you’d want your application to handle errors, which can +differ based on what the rest of your code is doing. + +Similarly, the `unwrap` and `expect` methods are very handy when prototyping, +before you’re ready to decide how to handle errors. They leave clear markers in +your code for when you’re ready to make your program more robust. + +If a method call fails in a test, you’d want the whole test to fail, even if +that method isn’t the functionality under test. Because `panic!` is how a test +is marked as a failure, calling `unwrap` or `expect` is exactly what should +happen. + +### Cases in Which You Have More Information Than the Compiler + +It would also be appropriate to call `unwrap` or `expect` when you have some +other logic that ensures the `Result` will have an `Ok` value, but the logic +isn’t something the compiler understands. You’ll still have a `Result` value +that you need to handle: whatever operation you’re calling still has the +possibility of failing in general, even though it’s logically impossible in +your particular situation. If you can ensure by manually inspecting the code +that you’ll never have an `Err` variant, it’s perfectly acceptable to call +`unwrap`, and even better to document the reason you think you’ll never have an +`Err` variant in the `expect` text. Here’s an example: + +``` + use std::net::IpAddr; + + let home: IpAddr = "127.0.0.1" + .parse() + .expect("Hardcoded IP address should be valid"); +``` + +We’re creating an `IpAddr` instance by parsing a hardcoded string. We can see +that `127.0.0.1` is a valid IP address, so it’s acceptable to use `expect` +here. However, having a hardcoded, valid string doesn’t change the return type +of the `parse` method: we still get a `Result` value, and the compiler will +still make us handle the `Result` as if the `Err` variant is a possibility +because the compiler isn’t smart enough to see that this string is always a +valid IP address. If the IP address string came from a user rather than being +hardcoded into the program and therefore *did* have a possibility of failure, +we’d definitely want to handle the `Result` in a more robust way instead. +Mentioning the assumption that this IP address is hardcoded will prompt us to +change `expect` to better error-handling code if, in the future, we need to get +the IP address from some other source instead. + +### Guidelines for Error Handling + +It’s advisable to have your code panic when it’s possible that your code could +end up in a bad state. In this context, a *bad state* is when some assumption, +guarantee, contract, or invariant has been broken, such as when invalid values, +contradictory values, or missing values are passed to your code—plus one or +more of the following: + +* The bad state is something that is unexpected, as opposed to something that + will likely happen occasionally, like a user entering data in the wrong + format. +* Your code after this point needs to rely on not being in this bad state, + rather than checking for the problem at every step. +* There’s not a good way to encode this information in the types you use. We’ll + work through an example of what we mean in the “Encoding States and Behavior + as Types” section of Chapter 17. + +If someone calls your code and passes in values that don’t make sense, it’s +best to return an error if you can so the user of the library can decide what +they want to do in that case. However, in cases where continuing could be +insecure or harmful, the best choice might be to call `panic!` and alert the +person using your library to the bug in their code so they can fix it during +development. Similarly, `panic!` is often appropriate if you’re calling +external code that is out of your control and it returns an invalid state that +you have no way of fixing. + +However, when failure is expected, it’s more appropriate to return a `Result` +than to make a `panic!` call. Examples include a parser being given malformed +data or an HTTP request returning a status that indicates you have hit a rate +limit. In these cases, returning a `Result` indicates that failure is an +expected possibility that the calling code must decide how to handle. + +When your code performs an operation that could put a user at risk if it’s +called using invalid values, your code should verify the values are valid first +and panic if the values aren’t valid. This is mostly for safety reasons: +attempting to operate on invalid data can expose your code to vulnerabilities. +This is the main reason the standard library will call `panic!` if you attempt +an out-of-bounds memory access: trying to access memory that doesn’t belong to +the current data structure is a common security problem. Functions often have +*contracts*: their behavior is only guaranteed if the inputs meet particular +requirements. Panicking when the contract is violated makes sense because a +contract violation always indicates a caller-side bug, and it’s not a kind of +error you want the calling code to have to explicitly handle. In fact, there’s +no reasonable way for calling code to recover; the calling *programmers* need +to fix the code. Contracts for a function, especially when a violation will +cause a panic, should be explained in the API documentation for the function. + +However, having lots of error checks in all of your functions would be verbose +and annoying. Fortunately, you can use Rust’s type system (and thus the type +checking done by the compiler) to do many of the checks for you. If your +function has a particular type as a parameter, you can proceed with your code’s +logic knowing that the compiler has already ensured you have a valid value. For +example, if you have a type rather than an `Option`, your program expects to +have *something* rather than *nothing*. Your code then doesn’t have to handle +two cases for the `Some` and `None` variants: it will only have one case for +definitely having a value. Code trying to pass nothing to your function won’t +even compile, so your function doesn’t have to check for that case at runtime. +Another example is using an unsigned integer type such as `u32`, which ensures +the parameter is never negative. + +### Creating Custom Types for Validation + +Let’s take the idea of using Rust’s type system to ensure we have a valid value +one step further and look at creating a custom type for validation. Recall the +guessing game in Chapter 2 in which our code asked the user to guess a number +between 1 and 100. We never validated that the user’s guess was between those +numbers before checking it against our secret number; we only validated that +the guess was positive. In this case, the consequences were not very dire: our +output of “Too high” or “Too low” would still be correct. But it would be a +useful enhancement to guide the user toward valid guesses and have different +behavior when the user guesses a number that’s out of range versus when the +user types, for example, letters instead. + +One way to do this would be to parse the guess as an `i32` instead of only a +`u32` to allow potentially negative numbers, and then add a check for the +number being in range, like so: + +Filename: src/main.rs + +``` + loop { + // --snip-- + + let guess: i32 = match guess.trim().parse() { + Ok(num) => num, + Err(_) => continue, + }; + + if guess < 1 || guess > 100 { + println!("The secret number will be between 1 and 100."); + continue; + } + + match guess.cmp(&secret_number) { + // --snip-- + } +``` + +The `if` expression checks whether our value is out of range, tells the user +about the problem, and calls `continue` to start the next iteration of the loop +and ask for another guess. After the `if` expression, we can proceed with the +comparisons between `guess` and the secret number knowing that `guess` is +between 1 and 100. + +However, this is not an ideal solution: if it were absolutely critical that the +program only operated on values between 1 and 100, and it had many functions +with this requirement, having a check like this in every function would be +tedious (and might impact performance). + +Instead, we can make a new type and put the validations in a function to create +an instance of the type rather than repeating the validations everywhere. That +way, it’s safe for functions to use the new type in their signatures and +confidently use the values they receive. Listing 9-13 shows one way to define a +`Guess` type that will only create an instance of `Guess` if the `new` function +receives a value between 1 and 100. + +Filename: src/lib.rs + +``` +pub struct Guess { + value: i32, +} + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 || value > 100 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } + + pub fn value(&self) -> i32 { + self.value + } +} +``` + +Listing 9-13: A `Guess` type that will only continue with +values between 1 and 100 + +First we define a struct named `Guess` that has a field named `value` that +holds an `i32`. This is where the number will be stored. + +Then we implement an associated function named `new` on `Guess` that creates +instances of `Guess` values. The `new` function is defined to have one +parameter named `value` of type `i32` and to return a `Guess`. The code in the +body of the `new` function tests `value` to make sure it’s between 1 and 100. +If `value` doesn’t pass this test, we make a `panic!` call, which will alert +the programmer who is writing the calling code that they have a bug they need +to fix, because creating a `Guess` with a `value` outside this range would +violate the contract that `Guess::new` is relying on. The conditions in which +`Guess::new` might panic should be discussed in its public-facing API +documentation; we’ll cover documentation conventions indicating the possibility +of a `panic!` in the API documentation that you create in Chapter 14. If +`value` does pass the test, we create a new `Guess` with its `value` field set +to the `value` parameter and return the `Guess`. + +Next, we implement a method named `value` that borrows `self`, doesn’t have any +other parameters, and returns an `i32`. This kind of method is sometimes called +a *getter* because its purpose is to get some data from its fields and return +it. This public method is necessary because the `value` field of the `Guess` +struct is private. It’s important that the `value` field be private so code +using the `Guess` struct is not allowed to set `value` directly: code outside +the module *must* use the `Guess::new` function to create an instance of +`Guess`, thereby ensuring there’s no way for a `Guess` to have a `value` that +hasn’t been checked by the conditions in the `Guess::new` function. + +A function that has a parameter or returns only numbers between 1 and 100 could +then declare in its signature that it takes or returns a `Guess` rather than an +`i32` and wouldn’t need to do any additional checks in its body. + +## Summary + +Rust’s error-handling features are designed to help you write more robust code. +The `panic!` macro signals that your program is in a state it can’t handle and +lets you tell the process to stop instead of trying to proceed with invalid or +incorrect values. The `Result` enum uses Rust’s type system to indicate that +operations might fail in a way that your code could recover from. You can use +`Result` to tell code that calls your code that it needs to handle potential +success or failure as well. Using `panic!` and `Result` in the appropriate +situations will make your code more reliable in the face of inevitable problems. + +Now that you’ve seen useful ways that the standard library uses generics with +the `Option` and `Result` enums, we’ll talk about how generics work and how you +can use them in your code. diff --git a/rustbook-ru/nostarch/chapter10.md b/rustbook-ru/nostarch/chapter10.md new file mode 100644 index 000000000..bc315d12c --- /dev/null +++ b/rustbook-ru/nostarch/chapter10.md @@ -0,0 +1,1961 @@ + + +[TOC] + +# Generic Types, Traits, and Lifetimes + +Every programming language has tools for effectively handling the duplication +of concepts. In Rust, one such tool is *generics*: abstract stand-ins for +concrete types or other properties. We can express the behavior of generics or +how they relate to other generics without knowing what will be in their place +when compiling and running the code. + +Functions can take parameters of some generic type, instead of a concrete type +like `i32` or `String`, in the same way they take parameters with unknown +values to run the same code on multiple concrete values. In fact, we’ve already +used generics in Chapter 6 with `Option`, in Chapter 8 with `Vec` and +`HashMap`, and in Chapter 9 with `Result`. In this chapter, you’ll +explore how to define your own types, functions, and methods with generics! + +First we’ll review how to extract a function to reduce code duplication. We’ll +then use the same technique to make a generic function from two functions that +differ only in the types of their parameters. We’ll also explain how to use +generic types in struct and enum definitions. + +Then you’ll learn how to use *traits* to define behavior in a generic way. You +can combine traits with generic types to constrain a generic type to accept +only those types that have a particular behavior, as opposed to just any type. + +Finally, we’ll discuss *lifetimes*: a variety of generics that give the +compiler information about how references relate to each other. Lifetimes allow +us to give the compiler enough information about borrowed values so that it can +ensure references will be valid in more situations than it could without our +help. + +## Removing Duplication by Extracting a Function + +Generics allow us to replace specific types with a placeholder that represents +multiple types to remove code duplication. Before diving into generics syntax, +let’s first look at how to remove duplication in a way that doesn’t involve +generic types by extracting a function that replaces specific values with a +placeholder that represents multiple values. Then we’ll apply the same +technique to extract a generic function! By looking at how to recognize +duplicated code you can extract into a function, you’ll start to recognize +duplicated code that can use generics. + +We’ll begin with the short program in Listing 10-1 that finds the largest +number in a list. + +Filename: src/main.rs + +``` +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); +} +``` + +Listing 10-1: Finding the largest number in a list of +numbers + +We store a list of integers in the variable `number_list` and place a reference +to the first number in the list in a variable named `largest`. We then iterate +through all the numbers in the list, and if the current number is greater than +the number stored in `largest`, we replace the reference in that variable. +However, if the current number is less than or equal to the largest number seen +so far, the variable doesn’t change, and the code moves on to the next number +in the list. After considering all the numbers in the list, `largest` should +refer to the largest number, which in this case is 100. + +We’ve now been tasked with finding the largest number in two different lists of +numbers. To do so, we can choose to duplicate the code in Listing 10-1 and use +the same logic at two different places in the program, as shown in Listing 10-2. + +Filename: src/main.rs + +``` +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); + + let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8]; + + let mut largest = &number_list[0]; + + for number in &number_list { + if number > largest { + largest = number; + } + } + + println!("The largest number is {largest}"); +} +``` + +Listing 10-2: Code to find the largest number in *two* +lists of numbers + +Although this code works, duplicating code is tedious and error prone. We also +have to remember to update the code in multiple places when we want to change +it. + +To eliminate this duplication, we’ll create an abstraction by defining a +function that operates on any list of integers passed in a parameter. This +solution makes our code clearer and lets us express the concept of finding the +largest number in a list abstractly. + +In Listing 10-3, we extract the code that finds the largest number into a +function named `largest`. Then we call the function to find the largest number +in the two lists from Listing 10-2. We could also use the function on any other +list of `i32` values we might have in the future. + +Filename: src/main.rs + +``` +fn largest(list: &[i32]) -> &i32 { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest(&number_list); + println!("The largest number is {result}"); + + let number_list = vec![102, 34, 6000, 89, 54, 2, 43, 8]; + + let result = largest(&number_list); + println!("The largest number is {result}"); +} +``` + +Listing 10-3: Abstracted code to find the largest number +in two lists + +The `largest` function has a parameter called `list`, which represents any +concrete slice of `i32` values we might pass into the function. As a result, +when we call the function, the code runs on the specific values that we pass +in. + +In summary, here are the steps we took to change the code from Listing 10-2 to +Listing 10-3: + +1. Identify duplicate code. +1. Extract the duplicate code into the body of the function, and specify the + inputs and return values of that code in the function signature. +1. Update the two instances of duplicated code to call the function instead. + +Next, we’ll use these same steps with generics to reduce code duplication. In +the same way that the function body can operate on an abstract `list` instead +of specific values, generics allow code to operate on abstract types. + +For example, say we had two functions: one that finds the largest item in a +slice of `i32` values and one that finds the largest item in a slice of `char` +values. How would we eliminate that duplication? Let’s find out! + +## Generic Data Types + +We use generics to create definitions for items like function signatures or +structs, which we can then use with many different concrete data types. Let’s +first look at how to define functions, structs, enums, and methods using +generics. Then we’ll discuss how generics affect code performance. + +### In Function Definitions + +When defining a function that uses generics, we place the generics in the +signature of the function where we would usually specify the data types of the +parameters and return value. Doing so makes our code more flexible and provides +more functionality to callers of our function while preventing code duplication. + +Continuing with our `largest` function, Listing 10-4 shows two functions that +both find the largest value in a slice. We’ll then combine these into a single +function that uses generics. + +Filename: src/main.rs + +``` +fn largest_i32(list: &[i32]) -> &i32 { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn largest_char(list: &[char]) -> &char { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest_i32(&number_list); + println!("The largest number is {result}"); + + let char_list = vec!['y', 'm', 'a', 'q']; + + let result = largest_char(&char_list); + println!("The largest char is {result}"); +} +``` + +Listing 10-4: Two functions that differ only in their +names and in the types in their signatures + +The `largest_i32` function is the one we extracted in Listing 10-3 that finds +the largest `i32` in a slice. The `largest_char` function finds the largest +`char` in a slice. The function bodies have the same code, so let’s eliminate +the duplication by introducing a generic type parameter in a single function. + +To parameterize the types in a new single function, we need to name the type +parameter, just as we do for the value parameters to a function. You can use +any identifier as a type parameter name. But we’ll use `T` because, by +convention, type parameter names in Rust are short, often just one letter, and +Rust’s type-naming convention is UpperCamelCase. Short for *type*, `T` is the +default choice of most Rust programmers. + +When we use a parameter in the body of the function, we have to declare the +parameter name in the signature so the compiler knows what that name means. +Similarly, when we use a type parameter name in a function signature, we have +to declare the type parameter name before we use it. To define the generic +`largest` function, we place type name declarations inside angle brackets, +`<>`, between the name of the function and the parameter list, like this: + +``` +fn largest(list: &[T]) -> &T { +``` + +We read this definition as: the function `largest` is generic over some type +`T`. This function has one parameter named `list`, which is a slice of values +of type `T`. The `largest` function will return a reference to a value of the +same type `T`. + +Listing 10-5 shows the combined `largest` function definition using the generic +data type in its signature. The listing also shows how we can call the function +with either a slice of `i32` values or `char` values. Note that this code won’t +compile yet, but we’ll fix it later in this chapter. + +Filename: src/main.rs + +``` +fn largest(list: &[T]) -> &T { + let mut largest = &list[0]; + + for item in list { + if item > largest { + largest = item; + } + } + + largest +} + +fn main() { + let number_list = vec![34, 50, 25, 100, 65]; + + let result = largest(&number_list); + println!("The largest number is {result}"); + + let char_list = vec!['y', 'm', 'a', 'q']; + + let result = largest(&char_list); + println!("The largest char is {result}"); +} +``` + +Listing 10-5: The `largest` function using generic type +parameters; this doesn’t compile yet + +If we compile this code right now, we’ll get this error: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0369]: binary operation `>` cannot be applied to type `&T` + --> src/main.rs:5:17 + | +5 | if item > largest { + | ---- ^ ------- &T + | | + | &T + | +help: consider restricting type parameter `T` + | +1 | fn largest(list: &[T]) -> &T { + | ++++++++++++++++++++++ + +For more information about this error, try `rustc --explain E0369`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +The help text mentions `std::cmp::PartialOrd`, which is a *trait*, and we’re +going to talk about traits in the next section. For now, know that this error +states that the body of `largest` won’t work for all possible types that `T` +could be. Because we want to compare values of type `T` in the body, we can +only use types whose values can be ordered. To enable comparisons, the standard +library has the `std::cmp::PartialOrd` trait that you can implement on types +(see Appendix C for more on this trait). By following the help text’s +suggestion, we restrict the types valid for `T` to only those that implement +`PartialOrd` and this example will compile, because the standard library +implements `PartialOrd` on both `i32` and `char`. + +### In Struct Definitions + +We can also define structs to use a generic type parameter in one or more +fields using the `<>` syntax. Listing 10-6 defines a `Point` struct to hold +`x` and `y` coordinate values of any type. + +Filename: src/main.rs + +``` +struct Point { + x: T, + y: T, +} + +fn main() { + let integer = Point { x: 5, y: 10 }; + let float = Point { x: 1.0, y: 4.0 }; +} +``` + +Listing 10-6: A `Point` struct that holds `x` and `y` +values of type `T` + +The syntax for using generics in struct definitions is similar to that used in +function definitions. First we declare the name of the type parameter inside +angle brackets just after the name of the struct. Then we use the generic +type in the struct definition where we would otherwise specify concrete data +types. + +Note that because we’ve used only one generic type to define `Point`, this +definition says that the `Point` struct is generic over some type `T`, and +the fields `x` and `y` are *both* that same type, whatever that type may be. If +we create an instance of a `Point` that has values of different types, as in +Listing 10-7, our code won’t compile. + +Filename: src/main.rs + +``` +struct Point { + x: T, + y: T, +} + +fn main() { + let wont_work = Point { x: 5, y: 4.0 }; +} +``` + +Listing 10-7: The fields `x` and `y` must be the same +type because both have the same generic data type `T`. + +In this example, when we assign the integer value `5` to `x`, we let the +compiler know that the generic type `T` will be an integer for this instance of +`Point`. Then when we specify `4.0` for `y`, which we’ve defined to have the +same type as `x`, we’ll get a type mismatch error like this: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0308]: mismatched types + --> src/main.rs:7:38 + | +7 | let wont_work = Point { x: 5, y: 4.0 }; + | ^^^ expected integer, found floating-point number + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +To define a `Point` struct where `x` and `y` are both generics but could have +different types, we can use multiple generic type parameters. For example, in +Listing 10-8, we change the definition of `Point` to be generic over types `T` +and `U` where `x` is of type `T` and `y` is of type `U`. + +Filename: src/main.rs + +``` +struct Point { + x: T, + y: U, +} + +fn main() { + let both_integer = Point { x: 5, y: 10 }; + let both_float = Point { x: 1.0, y: 4.0 }; + let integer_and_float = Point { x: 5, y: 4.0 }; +} +``` + +Listing 10-8: A `Point` generic over two types so +that `x` and `y` can be values of different types + +Now all the instances of `Point` shown are allowed! You can use as many generic +type parameters in a definition as you want, but using more than a few makes +your code hard to read. If you’re finding you need lots of generic types in +your code, it could indicate that your code needs restructuring into smaller +pieces. + +### In Enum Definitions + +As we did with structs, we can define enums to hold generic data types in their +variants. Let’s take another look at the `Option` enum that the standard +library provides, which we used in Chapter 6: + +``` +enum Option { + Some(T), + None, +} +``` + +This definition should now make more sense to you. As you can see, the +`Option` enum is generic over type `T` and has two variants: `Some`, which +holds one value of type `T`, and a `None` variant that doesn’t hold any value. +By using the `Option` enum, we can express the abstract concept of an +optional value, and because `Option` is generic, we can use this abstraction +no matter what the type of the optional value is. + +Enums can use multiple generic types as well. The definition of the `Result` +enum that we used in Chapter 9 is one example: + +``` +enum Result { + Ok(T), + Err(E), +} +``` + +The `Result` enum is generic over two types, `T` and `E`, and has two variants: +`Ok`, which holds a value of type `T`, and `Err`, which holds a value of type +`E`. This definition makes it convenient to use the `Result` enum anywhere we +have an operation that might succeed (return a value of some type `T`) or fail +(return an error of some type `E`). In fact, this is what we used to open a +file in Listing 9-3, where `T` was filled in with the type `std::fs::File` when +the file was opened successfully and `E` was filled in with the type +`std::io::Error` when there were problems opening the file. + +When you recognize situations in your code with multiple struct or enum +definitions that differ only in the types of the values they hold, you can +avoid duplication by using generic types instead. + +### In Method Definitions + +We can implement methods on structs and enums (as we did in Chapter 5) and use +generic types in their definitions too. Listing 10-9 shows the `Point` +struct we defined in Listing 10-6 with a method named `x` implemented on it. + +Filename: src/main.rs + +``` +struct Point { + x: T, + y: T, +} + +impl Point { + fn x(&self) -> &T { + &self.x + } +} + +fn main() { + let p = Point { x: 5, y: 10 }; + + println!("p.x = {}", p.x()); +} +``` + +Listing 10-9: Implementing a method named `x` on the +`Point` struct that will return a reference to the `x` field of type +`T` + +Here, we’ve defined a method named `x` on `Point` that returns a reference +to the data in the field `x`. + +Note that we have to declare `T` just after `impl` so we can use `T` to specify +that we’re implementing methods on the type `Point`. By declaring `T` as a +generic type after `impl`, Rust can identify that the type in the angle +brackets in `Point` is a generic type rather than a concrete type. We could +have chosen a different name for this generic parameter than the generic +parameter declared in the struct definition, but using the same name is +conventional. Methods written within an `impl` that declares the generic type +will be defined on any instance of the type, no matter what concrete type ends +up substituting for the generic type. + +We can also specify constraints on generic types when defining methods on the +type. We could, for example, implement methods only on `Point` instances +rather than on `Point` instances with any generic type. In Listing 10-10 we +use the concrete type `f32`, meaning we don’t declare any types after `impl`. + +Filename: src/main.rs + +``` +impl Point { + fn distance_from_origin(&self) -> f32 { + (self.x.powi(2) + self.y.powi(2)).sqrt() + } +} +``` + +Listing 10-10: An `impl` block that only applies to a +struct with a particular concrete type for the generic type parameter `T` + +This code means the type `Point` will have a `distance_from_origin` +method; other instances of `Point` where `T` is not of type `f32` will not +have this method defined. The method measures how far our point is from the +point at coordinates (0.0, 0.0) and uses mathematical operations that are +available only for floating-point types. + +Generic type parameters in a struct definition aren’t always the same as those +you use in that same struct’s method signatures. Listing 10-11 uses the generic +types `X1` and `Y1` for the `Point` struct and `X2` `Y2` for the `mixup` method +signature to make the example clearer. The method creates a new `Point` +instance with the `x` value from the `self` `Point` (of type `X1`) and the `y` +value from the passed-in `Point` (of type `Y2`). + +Filename: src/main.rs + +``` +struct Point { + x: X1, + y: Y1, +} + +impl Point { + fn mixup(self, other: Point) -> Point { + Point { + x: self.x, + y: other.y, + } + } +} + +fn main() { + let p1 = Point { x: 5, y: 10.4 }; + let p2 = Point { x: "Hello", y: 'c' }; + + let p3 = p1.mixup(p2); + + println!("p3.x = {}, p3.y = {}", p3.x, p3.y); +} +``` + +Listing 10-11: A method that uses generic types different +from its struct’s definition + +In `main`, we’ve defined a `Point` that has an `i32` for `x` (with value `5`) +and an `f64` for `y` (with value `10.4`). The `p2` variable is a `Point` struct +that has a string slice for `x` (with value `"Hello"`) and a `char` for `y` +(with value `c`). Calling `mixup` on `p1` with the argument `p2` gives us `p3`, +which will have an `i32` for `x` because `x` came from `p1`. The `p3` variable +will have a `char` for `y` because `y` came from `p2`. The `println!` macro +call will print `p3.x = 5, p3.y = c`. + +The purpose of this example is to demonstrate a situation in which some generic +parameters are declared with `impl` and some are declared with the method +definition. Here, the generic parameters `X1` and `Y1` are declared after +`impl` because they go with the struct definition. The generic parameters `X2` +and `Y2` are declared after `fn mixup` because they’re only relevant to the +method. + +### Performance of Code Using Generics + +You might be wondering whether there is a runtime cost when using generic type +parameters. The good news is that using generic types won’t make your program +run any slower than it would with concrete types. + +Rust accomplishes this by performing monomorphization of the code using +generics at compile time. *Monomorphization* is the process of turning generic +code into specific code by filling in the concrete types that are used when +compiled. In this process, the compiler does the opposite of the steps we used +to create the generic function in Listing 10-5: the compiler looks at all the +places where generic code is called and generates code for the concrete types +the generic code is called with. + +Let’s look at how this works by using the standard library’s generic +`Option` enum: + +``` +let integer = Some(5); +let float = Some(5.0); +``` + +When Rust compiles this code, it performs monomorphization. During that +process, the compiler reads the values that have been used in `Option` +instances and identifies two kinds of `Option`: one is `i32` and the other +is `f64`. As such, it expands the generic definition of `Option` into two +definitions specialized to `i32` and `f64`, thereby replacing the generic +definition with the specific ones. + +The monomorphized version of the code looks similar to the following (the +compiler uses different names than what we’re using here for illustration): + +Filename: src/main.rs + +``` +enum Option_i32 { + Some(i32), + None, +} + +enum Option_f64 { + Some(f64), + None, +} + +fn main() { + let integer = Option_i32::Some(5); + let float = Option_f64::Some(5.0); +} +``` + +The generic `Option` is replaced with the specific definitions created by +the compiler. Because Rust compiles generic code into code that specifies the +type in each instance, we pay no runtime cost for using generics. When the code +runs, it performs just as it would if we had duplicated each definition by +hand. The process of monomorphization makes Rust’s generics extremely efficient +at runtime. + +## Traits: Defining Shared Behavior + +A *trait* defines the functionality a particular type has and can share with +other types. We can use traits to define shared behavior in an abstract way. We +can use *trait bounds* to specify that a generic type can be any type that has +certain behavior. + +> Note: Traits are similar to a feature often called *interfaces* in other +> languages, although with some differences. + +### Defining a Trait + +A type’s behavior consists of the methods we can call on that type. Different +types share the same behavior if we can call the same methods on all of those +types. Trait definitions are a way to group method signatures together to +define a set of behaviors necessary to accomplish some purpose. + +For example, let’s say we have multiple structs that hold various kinds and +amounts of text: a `NewsArticle` struct that holds a news story filed in a +particular location and a `Tweet` that can have, at most, 280 characters along +with metadata that indicates whether it was a new tweet, a retweet, or a reply +to another tweet. + +We want to make a media aggregator library crate named `aggregator` that can +display summaries of data that might be stored in a `NewsArticle` or `Tweet` +instance. To do this, we need a summary from each type, and we’ll request that +summary by calling a `summarize` method on an instance. Listing 10-12 shows the +definition of a public `Summary` trait that expresses this behavior. + +Filename: src/lib.rs + +``` +pub trait Summary { + fn summarize(&self) -> String; +} +``` + +Listing 10-12: A `Summary` trait that consists of the +behavior provided by a `summarize` method + +Here, we declare a trait using the `trait` keyword and then the trait’s name, +which is `Summary` in this case. We also declare the trait as `pub` so that +crates depending on this crate can make use of this trait too, as we’ll see in +a few examples. Inside the curly brackets, we declare the method signatures +that describe the behaviors of the types that implement this trait, which in +this case is `fn summarize(&self) -> String`. + +After the method signature, instead of providing an implementation within curly +brackets, we use a semicolon. Each type implementing this trait must provide +its own custom behavior for the body of the method. The compiler will enforce +that any type that has the `Summary` trait will have the method `summarize` +defined with this signature exactly. + +A trait can have multiple methods in its body: the method signatures are listed +one per line, and each line ends in a semicolon. + +### Implementing a Trait on a Type + +Now that we’ve defined the desired signatures of the `Summary` trait’s methods, +we can implement it on the types in our media aggregator. Listing 10-13 shows +an implementation of the `Summary` trait on the `NewsArticle` struct that uses +the headline, the author, and the location to create the return value of +`summarize`. For the `Tweet` struct, we define `summarize` as the username +followed by the entire text of the tweet, assuming that the tweet content is +already limited to 280 characters. + +Filename: src/lib.rs + +``` +pub struct NewsArticle { + pub headline: String, + pub location: String, + pub author: String, + pub content: String, +} + +impl Summary for NewsArticle { + fn summarize(&self) -> String { + format!("{}, by {} ({})", self.headline, self.author, self.location) + } +} + +pub struct Tweet { + pub username: String, + pub content: String, + pub reply: bool, + pub retweet: bool, +} + +impl Summary for Tweet { + fn summarize(&self) -> String { + format!("{}: {}", self.username, self.content) + } +} +``` + +Listing 10-13: Implementing the `Summary` trait on the +`NewsArticle` and `Tweet` types + +Implementing a trait on a type is similar to implementing regular methods. The +difference is that after `impl`, we put the trait name we want to implement, +then use the `for` keyword, and then specify the name of the type we want to +implement the trait for. Within the `impl` block, we put the method signatures +that the trait definition has defined. Instead of adding a semicolon after each +signature, we use curly brackets and fill in the method body with the specific +behavior that we want the methods of the trait to have for the particular type. + +Now that the library has implemented the `Summary` trait on `NewsArticle` and +`Tweet`, users of the crate can call the trait methods on instances of +`NewsArticle` and `Tweet` in the same way we call regular methods. The only +difference is that the user must bring the trait into scope as well as the +types. Here’s an example of how a binary crate could use our `aggregator` +library crate: + +``` +use aggregator::{Summary, Tweet}; + +fn main() { + let tweet = Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + }; + + println!("1 new tweet: {}", tweet.summarize()); +} +``` + +This code prints `1 new tweet: horse_ebooks: of course, as you probably already +know, people`. + +Other crates that depend on the `aggregator` crate can also bring the `Summary` +trait into scope to implement `Summary` on their own types. One restriction to +note is that we can implement a trait on a type only if either the trait or the +type, or both, are local to our crate. For example, we can implement standard +library traits like `Display` on a custom type like `Tweet` as part of our +`aggregator` crate functionality because the type `Tweet` is local to our +`aggregator` crate. We can also implement `Summary` on `Vec` in our +`aggregator` crate because the trait `Summary` is local to our `aggregator` +crate. + +But we can’t implement external traits on external types. For example, we can’t +implement the `Display` trait on `Vec` within our `aggregator` crate because +`Display` and `Vec` are both defined in the standard library and aren’t +local to our `aggregator` crate. This restriction is part of a property called +*coherence*, and more specifically the *orphan rule*, so named because the +parent type is not present. This rule ensures that other people’s code can’t +break your code and vice versa. Without the rule, two crates could implement +the same trait for the same type, and Rust wouldn’t know which implementation +to use. + +### Default Implementations + +Sometimes it’s useful to have default behavior for some or all of the methods +in a trait instead of requiring implementations for all methods on every type. +Then, as we implement the trait on a particular type, we can keep or override +each method’s default behavior. + +In Listing 10-14, we specify a default string for the `summarize` method of the +`Summary` trait instead of only defining the method signature, as we did in +Listing 10-12. + +Filename: src/lib.rs + +``` +pub trait Summary { + fn summarize(&self) -> String { + String::from("(Read more...)") + } +} +``` + +Listing 10-14: Defining a `Summary` trait with a default +implementation of the `summarize` method + +To use a default implementation to summarize instances of `NewsArticle`, we +specify an empty `impl` block with `impl Summary for NewsArticle {}`. + +Even though we’re no longer defining the `summarize` method on `NewsArticle` +directly, we’ve provided a default implementation and specified that +`NewsArticle` implements the `Summary` trait. As a result, we can still call +the `summarize` method on an instance of `NewsArticle`, like this: + +``` + let article = NewsArticle { + headline: String::from("Penguins win the Stanley Cup Championship!"), + location: String::from("Pittsburgh, PA, USA"), + author: String::from("Iceburgh"), + content: String::from( + "The Pittsburgh Penguins once again are the best \ + hockey team in the NHL.", + ), + }; + + println!("New article available! {}", article.summarize()); +``` + +This code prints `New article available! (Read more...)`. + +Creating a default implementation doesn’t require us to change anything about +the implementation of `Summary` on `Tweet` in Listing 10-13. The reason is that +the syntax for overriding a default implementation is the same as the syntax +for implementing a trait method that doesn’t have a default implementation. + +Default implementations can call other methods in the same trait, even if those +other methods don’t have a default implementation. In this way, a trait can +provide a lot of useful functionality and only require implementors to specify +a small part of it. For example, we could define the `Summary` trait to have a +`summarize_author` method whose implementation is required, and then define a +`summarize` method that has a default implementation that calls the +`summarize_author` method: + +``` +pub trait Summary { + fn summarize_author(&self) -> String; + + fn summarize(&self) -> String { + format!("(Read more from {}...)", self.summarize_author()) + } +} +``` + +To use this version of `Summary`, we only need to define `summarize_author` +when we implement the trait on a type: + +``` +impl Summary for Tweet { + fn summarize_author(&self) -> String { + format!("@{}", self.username) + } +} +``` + +After we define `summarize_author`, we can call `summarize` on instances of the +`Tweet` struct, and the default implementation of `summarize` will call the +definition of `summarize_author` that we’ve provided. Because we’ve implemented +`summarize_author`, the `Summary` trait has given us the behavior of the +`summarize` method without requiring us to write any more code. Here’s what +that looks like: + +``` + let tweet = Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + }; + + println!("1 new tweet: {}", tweet.summarize()); +``` + +This code prints `1 new tweet: (Read more from @horse_ebooks...)`. + +Note that it isn’t possible to call the default implementation from an +overriding implementation of that same method. + +### Traits as Parameters + +Now that you know how to define and implement traits, we can explore how to use +traits to define functions that accept many different types. We’ll use the +`Summary` trait we implemented on the `NewsArticle` and `Tweet` types in +Listing 10-13 to define a `notify` function that calls the `summarize` method +on its `item` parameter, which is of some type that implements the `Summary` +trait. To do this, we use the `impl Trait` syntax, like this: + +``` +pub fn notify(item: &impl Summary) { + println!("Breaking news! {}", item.summarize()); +} +``` + +Instead of a concrete type for the `item` parameter, we specify the `impl` +keyword and the trait name. This parameter accepts any type that implements the +specified trait. In the body of `notify`, we can call any methods on `item` +that come from the `Summary` trait, such as `summarize`. We can call `notify` +and pass in any instance of `NewsArticle` or `Tweet`. Code that calls the +function with any other type, such as a `String` or an `i32`, won’t compile +because those types don’t implement `Summary`. + + + + +#### Trait Bound Syntax + +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: + +``` +pub fn notify(item: &T) { + println!("Breaking news! {}", item.summarize()); +} +``` + +This longer form is equivalent to the example in the previous section but is +more verbose. We place trait bounds with the declaration of the generic type +parameter after a colon and inside angle brackets. + +The `impl Trait` syntax is convenient and makes for more concise code in simple +cases, while the fuller trait bound syntax can express more complexity in other +cases. For example, we can have two parameters that implement `Summary`. Doing +so with the `impl Trait` syntax looks like this: + +``` +pub fn notify(item1: &impl Summary, item2: &impl Summary) { +``` + +Using `impl Trait` is appropriate if we want this function to allow `item1` and +`item2` to have different types (as long as both types implement `Summary`). If +we want to force both parameters to have the same type, however, we must use a +trait bound, like this: + +``` +pub fn notify(item1: &T, item2: &T) { +``` + +The generic type `T` specified as the type of the `item1` and `item2` +parameters constrains the function such that the concrete type of the value +passed as an argument for `item1` and `item2` must be the same. + +#### Specifying Multiple Trait Bounds with the `+` Syntax + +We can also specify more than one trait bound. Say we wanted `notify` to use +display formatting as well as `summarize` on `item`: we specify in the `notify` +definition that `item` must implement both `Display` and `Summary`. We can do +so using the `+` syntax: + +``` +pub fn notify(item: &(impl Summary + Display)) { +``` + +The `+` syntax is also valid with trait bounds on generic types: + +``` +pub fn notify(item: &T) { +``` + +With the two trait bounds specified, the body of `notify` can call `summarize` +and use `{}` to format `item`. + +#### Clearer Trait Bounds with `where` Clauses + +Using too many trait bounds has its downsides. Each generic has its own trait +bounds, so functions with multiple generic type parameters can contain lots of +trait bound information between the function’s name and its parameter list, +making the function signature hard to read. For this reason, Rust has alternate +syntax for specifying trait bounds inside a `where` clause after the function +signature. So, instead of writing this: + +``` +fn some_function(t: &T, u: &U) -> i32 { +``` + +we can use a `where` clause, like this: + +``` +fn some_function(t: &T, u: &U) -> i32 +where + T: Display + Clone, + U: Clone + Debug, +{ +``` + +This function’s signature is less cluttered: the function name, parameter list, +and return type are close together, similar to a function without lots of trait +bounds. + +### Returning Types That Implement Traits + +We can also use the `impl Trait` syntax in the return position to return a +value of some type that implements a trait, as shown here: + +``` +fn returns_summarizable() -> impl Summary { + Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + } +} +``` + +By using `impl Summary` for the return type, we specify that the +`returns_summarizable` function returns some type that implements the `Summary` +trait without naming the concrete type. In this case, `returns_summarizable` +returns a `Tweet`, but the code calling this function doesn’t need to know that. + +The ability to specify a return type only by the trait it implements is +especially useful in the context of closures and iterators, which we cover in +Chapter 13. Closures and iterators create types that only the compiler knows or +types that are very long to specify. The `impl Trait` syntax lets you concisely +specify that a function returns some type that implements the `Iterator` trait +without needing to write out a very long type. + +However, you can only use `impl Trait` if you’re returning a single type. For +example, this code that returns either a `NewsArticle` or a `Tweet` with the +return type specified as `impl Summary` wouldn’t work: + +``` +fn returns_summarizable(switch: bool) -> impl Summary { + if switch { + NewsArticle { + headline: String::from( + "Penguins win the Stanley Cup Championship!", + ), + location: String::from("Pittsburgh, PA, USA"), + author: String::from("Iceburgh"), + content: String::from( + "The Pittsburgh Penguins once again are the best \ + hockey team in the NHL.", + ), + } + } else { + Tweet { + username: String::from("horse_ebooks"), + content: String::from( + "of course, as you probably already know, people", + ), + reply: false, + retweet: false, + } + } +} +``` + +Returning either a `NewsArticle` or a `Tweet` isn’t allowed due to restrictions +around how the `impl Trait` syntax is implemented in the compiler. We’ll cover +how to write a function with this behavior in the “Using Trait Objects That +Allow for Values of Different +Types” section of Chapter 17. + +### Using Trait Bounds to Conditionally Implement Methods + +By using a trait bound with an `impl` block that uses generic type parameters, +we can implement methods conditionally for types that implement the specified +traits. For example, the type `Pair` in Listing 10-15 always implements the +`new` function to return a new instance of `Pair` (recall from the +“Defining Methods” section of Chapter 5 that `Self` +is a type alias for the type of the `impl` block, which in this case is +`Pair`). But in the next `impl` block, `Pair` only implements the +`cmp_display` method if its inner type `T` implements the `PartialOrd` trait +that enables comparison *and* the `Display` trait that enables printing. + +Filename: src/lib.rs + +``` +use std::fmt::Display; + +struct Pair { + x: T, + y: T, +} + +impl Pair { + fn new(x: T, y: T) -> Self { + Self { x, y } + } +} + +impl Pair { + fn cmp_display(&self) { + if self.x >= self.y { + println!("The largest member is x = {}", self.x); + } else { + println!("The largest member is y = {}", self.y); + } + } +} +``` + +Listing 10-15: Conditionally implementing methods on a +generic type depending on trait bounds + +We can also conditionally implement a trait for any type that implements +another trait. Implementations of a trait on any type that satisfies the trait +bounds are called *blanket implementations* and are used extensively in the +Rust standard library. For example, the standard library implements the +`ToString` trait on any type that implements the `Display` trait. The `impl` +block in the standard library looks similar to this code: + +``` +impl ToString for T { + // --snip-- +} +``` + +Because the standard library has this blanket implementation, we can call the +`to_string` method defined by the `ToString` trait on any type that implements +the `Display` trait. For example, we can turn integers into their corresponding +`String` values like this because integers implement `Display`: + +``` +let s = 3.to_string(); +``` + +Blanket implementations appear in the documentation for the trait in the +“Implementors” section. + +Traits and trait bounds let us write code that uses generic type parameters to +reduce duplication but also specify to the compiler that we want the generic +type to have particular behavior. The compiler can then use the trait bound +information to check that all the concrete types used with our code provide the +correct behavior. In dynamically typed languages, we would get an error at +runtime if we called a method on a type which didn’t define the method. But +Rust moves these errors to compile time so we’re forced to fix the problems +before our code is even able to run. Additionally, we don’t have to write code +that checks for behavior at runtime because we’ve already checked at compile +time. Doing so improves performance without having to give up the flexibility +of generics. + +## Validating References with Lifetimes + +Lifetimes are another kind of generic that we’ve already been using. Rather +than ensuring that a type has the behavior we want, lifetimes ensure that +references are valid as long as we need them to be. + +One detail we didn’t discuss in the “References and +Borrowing” section in Chapter 4 is +that every reference in Rust has a *lifetime*, which is the scope for which +that reference is valid. Most of the time, lifetimes are implicit and inferred, +just like most of the time, types are inferred. We must annotate types only +when multiple types are possible. In a similar way, we must annotate lifetimes +when the lifetimes of references could be related in a few different ways. Rust +requires us to annotate the relationships using generic lifetime parameters to +ensure the actual references used at runtime will definitely be valid. + +Annotating lifetimes is not a concept most other programming languages have, so +this is going to feel unfamiliar. Although we won’t cover lifetimes in their +entirety in this chapter, we’ll discuss common ways you might encounter +lifetime syntax so you can get comfortable with the concept. + +### Preventing Dangling References with Lifetimes + +The main aim of lifetimes is to prevent *dangling references*, which cause a +program to reference data other than the data it’s intended to reference. +Consider the program in Listing 10-16, which has an outer scope and an inner +scope. + +``` +fn main() { + let r; + + { + let x = 5; + r = &x; + } + + println!("r: {r}"); +} +``` + +Listing 10-16: An attempt to use a reference whose value +has gone out of scope + +> Note: The examples in Listing 10-16, 10-17, and 10-23 declare variables +> without giving them an initial value, so the variable name exists in the outer +> scope. At first glance, this might appear to be in conflict with Rust’s having +> no null values. However, if we try to use a variable before giving it a value, +> we’ll get a compile-time error, which shows that Rust indeed does not allow +> null values. + +The outer scope declares a variable named `r` with no initial value, and the +inner scope declares a variable named `x` with the initial value of `5`. Inside +the inner scope, we attempt to set the value of `r` as a reference to `x`. Then +the inner scope ends, and we attempt to print the value in `r`. This code won’t +compile because the value that `r` is referring to has gone out of scope before +we try to use it. Here is the error message: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0597]: `x` does not live long enough + --> src/main.rs:6:13 + | +5 | let x = 5; + | - binding `x` declared here +6 | r = &x; + | ^^ borrowed value does not live long enough +7 | } + | - `x` dropped here while still borrowed +8 | +9 | println!("r: {}", r); + | - borrow later used here + +For more information about this error, try `rustc --explain E0597`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +The error message says that the variable `x` “does not live long enough.” The +reason is that `x` will be out of scope when the inner scope ends on line 7. +But `r` is still valid for the outer scope; because its scope is larger, we say +that it “lives longer.” If Rust allowed this code to work, `r` would be +referencing memory that was deallocated when `x` went out of scope, and +anything we tried to do with `r` wouldn’t work correctly. So how does Rust +determine that this code is invalid? It uses a borrow checker. + +### The Borrow Checker + +The Rust compiler has a *borrow checker* that compares scopes to determine +whether all borrows are valid. Listing 10-17 shows the same code as Listing +10-16 but with annotations showing the lifetimes of the variables. + +``` +fn main() { + let r; // ---------+-- 'a + // | + { // | + let x = 5; // -+-- 'b | + r = &x; // | | + } // -+ | + // | + println!("r: {r}"); // | +} // ---------+ +``` + +Listing 10-17: Annotations of the lifetimes of `r` and +`x`, named `'a` and `'b`, respectively + +Here, we’ve annotated the lifetime of `r` with `'a` and the lifetime of `x` +with `'b`. As you can see, the inner `'b` block is much smaller than the outer +`'a` lifetime block. At compile time, Rust compares the size of the two +lifetimes and sees that `r` has a lifetime of `'a` but that it refers to memory +with a lifetime of `'b`. The program is rejected because `'b` is shorter than +`'a`: the subject of the reference doesn’t live as long as the reference. + +Listing 10-18 fixes the code so it doesn’t have a dangling reference and it +compiles without any errors. + +``` +fn main() { + let x = 5; // ----------+-- 'b + // | + let r = &x; // --+-- 'a | + // | | + println!("r: {r}"); // | | + // --+ | +} // ----------+ +``` + +Listing 10-18: A valid reference because the data has a +longer lifetime than the reference + +Here, `x` has the lifetime `'b`, which in this case is larger than `'a`. This +means `r` can reference `x` because Rust knows that the reference in `r` will +always be valid while `x` is valid. + +Now that you know what the lifetimes of references are and how Rust analyzes +lifetimes to ensure references will always be valid, let’s explore generic +lifetimes of parameters and return values in the context of functions. + +### Generic Lifetimes in Functions + +We’ll write a function that returns the longer of two string slices. This +function will take two string slices and return a single string slice. After +we’ve implemented the `longest` function, the code in Listing 10-19 should +print `The longest string is abcd`. + +Filename: src/main.rs + +``` +fn main() { + let string1 = String::from("abcd"); + let string2 = "xyz"; + + let result = longest(string1.as_str(), string2); + println!("The longest string is {result}"); +} +``` + +Listing 10-19: A `main` function that calls the `longest` +function to find the longer of two string slices + +Note that we want the function to take string slices, which are references, +rather than strings, because we don’t want the `longest` function to take +ownership of its parameters. Refer to the “String Slices as +Parameters” section in Chapter 4 +for more discussion about why the parameters we use in Listing 10-19 are the +ones we want. + +If we try to implement the `longest` function as shown in Listing 10-20, it +won’t compile. + +Filename: src/main.rs + +``` +fn longest(x: &str, y: &str) -> &str { + if x.len() > y.len() { + x + } else { + y + } +} +``` + +Listing 10-20: An implementation of the `longest` +function that returns the longer of two string slices but does not yet +compile + +Instead, we get the following error that talks about lifetimes: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0106]: missing lifetime specifier + --> src/main.rs:9:33 + | +9 | fn longest(x: &str, y: &str) -> &str { + | ---- ---- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y` +help: consider introducing a named lifetime parameter + | +9 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + | ++++ ++ ++ ++ + +For more information about this error, try `rustc --explain E0106`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +The help text reveals that the return type needs a generic lifetime parameter +on it because Rust can’t tell whether the reference being returned refers to +`x` or `y`. Actually, we don’t know either, because the `if` block in the body +of this function returns a reference to `x` and the `else` block returns a +reference to `y`! + +When we’re defining this function, we don’t know the concrete values that will +be passed into this function, so we don’t know whether the `if` case or the +`else` case will execute. We also don’t know the concrete lifetimes of the +references that will be passed in, so we can’t look at the scopes as we did in +Listings 10-17 and 10-18 to determine whether the reference we return will +always be valid. The borrow checker can’t determine this either, because it +doesn’t know how the lifetimes of `x` and `y` relate to the lifetime of the +return value. To fix this error, we’ll add generic lifetime parameters that +define the relationship between the references so the borrow checker can +perform its analysis. + +### Lifetime Annotation Syntax + +Lifetime annotations don’t change how long any of the references live. Rather, +they describe the relationships of the lifetimes of multiple references to each +other without affecting the lifetimes. Just as functions can accept any type +when the signature specifies a generic type parameter, functions can accept +references with any lifetime by specifying a generic lifetime parameter. + +Lifetime annotations have a slightly unusual syntax: the names of lifetime +parameters must start with an apostrophe (`'`) and are usually all lowercase +and very short, like generic types. Most people use the name `'a` for the first +lifetime annotation. We place lifetime parameter annotations after the `&` of a +reference, using a space to separate the annotation from the reference’s type. + +Here are some examples: a reference to an `i32` without a lifetime parameter, a +reference to an `i32` that has a lifetime parameter named `'a`, and a mutable +reference to an `i32` that also has the lifetime `'a`. + +``` +&i32 // a reference +&'a i32 // a reference with an explicit lifetime +&'a mut i32 // a mutable reference with an explicit lifetime +``` + +One lifetime annotation by itself doesn’t have much meaning because the +annotations are meant to tell Rust how generic lifetime parameters of multiple +references relate to each other. Let’s examine how the lifetime annotations +relate to each other in the context of the `longest` function. + +### Lifetime Annotations in Function Signatures + +To use lifetime annotations in function signatures, we need to declare the +generic *lifetime* parameters inside angle brackets between the function name +and the parameter list, just as we did with generic *type* parameters. + +We want the signature to express the following constraint: the returned +reference will be valid as long as both the parameters are valid. This is the +relationship between lifetimes of the parameters and the return value. We’ll +name the lifetime `'a` and then add it to each reference, as shown in Listing +10-21. + +Filename: src/main.rs + +``` +fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { + if x.len() > y.len() { + x + } else { + y + } +} +``` + +Listing 10-21: The `longest` function definition +specifying that all the references in the signature must have the same lifetime +`'a` + +This code should compile and produce the result we want when we use it with the +`main` function in Listing 10-19. + +The function signature now tells Rust that for some lifetime `'a`, the function +takes two parameters, both of which are string slices that live at least as +long as lifetime `'a`. The function signature also tells Rust that the string +slice returned from the function will live at least as long as lifetime `'a`. +In practice, it means that the lifetime of the reference returned by the +`longest` function is the same as the smaller of the lifetimes of the values +referred to by the function arguments. These relationships are what we want +Rust to use when analyzing this code. + +Remember, when we specify the lifetime parameters in this function signature, +we’re not changing the lifetimes of any values passed in or returned. Rather, +we’re specifying that the borrow checker should reject any values that don’t +adhere to these constraints. Note that the `longest` function doesn’t need to +know exactly how long `x` and `y` will live, only that some scope can be +substituted for `'a` that will satisfy this signature. + +When annotating lifetimes in functions, the annotations go in the function +signature, not in the function body. The lifetime annotations become part of +the contract of the function, much like the types in the signature. Having +function signatures contain the lifetime contract means the analysis the Rust +compiler does can be simpler. If there’s a problem with the way a function is +annotated or the way it is called, the compiler errors can point to the part of +our code and the constraints more precisely. If, instead, the Rust compiler +made more inferences about what we intended the relationships of the lifetimes +to be, the compiler might only be able to point to a use of our code many steps +away from the cause of the problem. + +When we pass concrete references to `longest`, the concrete lifetime that is +substituted for `'a` is the part of the scope of `x` that overlaps with the +scope of `y`. In other words, the generic lifetime `'a` will get the concrete +lifetime that is equal to the smaller of the lifetimes of `x` and `y`. Because +we’ve annotated the returned reference with the same lifetime parameter `'a`, +the returned reference will also be valid for the length of the smaller of the +lifetimes of `x` and `y`. + +Let’s look at how the lifetime annotations restrict the `longest` function by +passing in references that have different concrete lifetimes. Listing 10-22 is +a straightforward example. + +Filename: src/main.rs + +``` +fn main() { + let string1 = String::from("long string is long"); + + { + let string2 = String::from("xyz"); + let result = longest(string1.as_str(), string2.as_str()); + println!("The longest string is {result}"); + } +} +``` + +Listing 10-22: Using the `longest` function with +references to `String` values that have different concrete lifetimes + +In this example, `string1` is valid until the end of the outer scope, `string2` +is valid until the end of the inner scope, and `result` references something +that is valid until the end of the inner scope. Run this code and you’ll see +that the borrow checker approves; it will compile and print `The longest string +is long string is long`. + +Next, let’s try an example that shows that the lifetime of the reference in +`result` must be the smaller lifetime of the two arguments. We’ll move the +declaration of the `result` variable outside the inner scope but leave the +assignment of the value to the `result` variable inside the scope with +`string2`. Then we’ll move the `println!` that uses `result` to outside the +inner scope, after the inner scope has ended. The code in Listing 10-23 will +not compile. + +Filename: src/main.rs + +``` +fn main() { + let string1 = String::from("long string is long"); + let result; + { + let string2 = String::from("xyz"); + result = longest(string1.as_str(), string2.as_str()); + } + println!("The longest string is {result}"); +} +``` + +Listing 10-23: Attempting to use `result` after `string2` +has gone out of scope + +When we try to compile this code, we get this error: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0597]: `string2` does not live long enough + --> src/main.rs:6:44 + | +5 | let string2 = String::from("xyz"); + | ------- binding `string2` declared here +6 | result = longest(string1.as_str(), string2.as_str()); + | ^^^^^^^ borrowed value does not live long enough +7 | } + | - `string2` dropped here while still borrowed +8 | println!("The longest string is {result}"); + | ------ borrow later used here + +For more information about this error, try `rustc --explain E0597`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +The error shows that for `result` to be valid for the `println!` statement, +`string2` would need to be valid until the end of the outer scope. Rust knows +this because we annotated the lifetimes of the function parameters and return +values using the same lifetime parameter `'a`. + +As humans, we can look at this code and see that `string1` is longer than +`string2`, and therefore, `result` will contain a reference to `string1`. +Because `string1` has not gone out of scope yet, a reference to `string1` will +still be valid for the `println!` statement. However, the compiler can’t see +that the reference is valid in this case. We’ve told Rust that the lifetime of +the reference returned by the `longest` function is the same as the smaller of +the lifetimes of the references passed in. Therefore, the borrow checker +disallows the code in Listing 10-23 as possibly having an invalid reference. + +Try designing more experiments that vary the values and lifetimes of the +references passed in to the `longest` function and how the returned reference +is used. Make hypotheses about whether or not your experiments will pass the +borrow checker before you compile; then check to see if you’re right! + +### Thinking in Terms of Lifetimes + +The way in which you need to specify lifetime parameters depends on what your +function is doing. For example, if we changed the implementation of the +`longest` function to always return the first parameter rather than the longest +string slice, we wouldn’t need to specify a lifetime on the `y` parameter. The +following code will compile: + +Filename: src/main.rs + +``` +fn longest<'a>(x: &'a str, y: &str) -> &'a str { + x +} +``` + +We’ve specified a lifetime parameter `'a` for the parameter `x` and the return +type, but not for the parameter `y`, because the lifetime of `y` does not have +any relationship with the lifetime of `x` or the return value. + +When returning a reference from a function, the lifetime parameter for the +return type needs to match the lifetime parameter for one of the parameters. If +the reference returned does *not* refer to one of the parameters, it must refer +to a value created within this function. However, this would be a dangling +reference because the value will go out of scope at the end of the function. +Consider this attempted implementation of the `longest` function that won’t +compile: + +Filename: src/main.rs + +``` +fn longest<'a>(x: &str, y: &str) -> &'a str { + let result = String::from("really long string"); + result.as_str() +} +``` + +Here, even though we’ve specified a lifetime parameter `'a` for the return +type, this implementation will fail to compile because the return value +lifetime is not related to the lifetime of the parameters at all. Here is the +error message we get: + +``` +$ cargo run + Compiling chapter10 v0.1.0 (file:///projects/chapter10) +error[E0515]: cannot return value referencing local variable `result` + --> src/main.rs:11:5 + | +11 | result.as_str() + | ------^^^^^^^^^ + | | + | returns a value referencing data owned by the current function + | `result` is borrowed here + +For more information about this error, try `rustc --explain E0515`. +error: could not compile `chapter10` (bin "chapter10") due to 1 previous error +``` + +The problem is that `result` goes out of scope and gets cleaned up at the end +of the `longest` function. We’re also trying to return a reference to `result` +from the function. There is no way we can specify lifetime parameters that +would change the dangling reference, and Rust won’t let us create a dangling +reference. In this case, the best fix would be to return an owned data type +rather than a reference so the calling function is then responsible for +cleaning up the value. + +Ultimately, lifetime syntax is about connecting the lifetimes of various +parameters and return values of functions. Once they’re connected, Rust has +enough information to allow memory-safe operations and disallow operations that +would create dangling pointers or otherwise violate memory safety. + +### Lifetime Annotations in Struct Definitions + +So far, the structs we’ve defined all hold owned types. We can define structs +to hold references, but in that case we would need to add a lifetime annotation +on every reference in the struct’s definition. Listing 10-24 has a struct named +`ImportantExcerpt` that holds a string slice. + +Filename: src/main.rs + +``` +struct ImportantExcerpt<'a> { + part: &'a str, +} + +fn main() { + let novel = String::from("Call me Ishmael. Some years ago..."); + let first_sentence = novel.split('.').next().expect("Could not find a '.'"); + let i = ImportantExcerpt { + part: first_sentence, + }; +} +``` + +Listing 10-24: A struct that holds a reference, requiring +a lifetime annotation + +This struct has the single field `part` that holds a string slice, which is a +reference. As with generic data types, we declare the name of the generic +lifetime parameter inside angle brackets after the name of the struct so we can +use the lifetime parameter in the body of the struct definition. This +annotation means an instance of `ImportantExcerpt` can’t outlive the reference +it holds in its `part` field. + +The `main` function here creates an instance of the `ImportantExcerpt` struct +that holds a reference to the first sentence of the `String` owned by the +variable `novel`. The data in `novel` exists before the `ImportantExcerpt` +instance is created. In addition, `novel` doesn’t go out of scope until after +the `ImportantExcerpt` goes out of scope, so the reference in the +`ImportantExcerpt` instance is valid. + +### Lifetime Elision + +You’ve learned that every reference has a lifetime and that you need to specify +lifetime parameters for functions or structs that use references. However, we +had a function in Listing 4-9, shown again in Listing 10-25, that compiled +without lifetime annotations. + +Filename: src/lib.rs + +``` +fn first_word(s: &str) -> &str { + let bytes = s.as_bytes(); + + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' { + return &s[0..i]; + } + } + + &s[..] +} +``` + +Listing 10-25: A function we defined in Listing 4-9 that +compiled without lifetime annotations, even though the parameter and return +type are references + +The reason this function compiles without lifetime annotations is historical: +in early versions (pre-1.0) of Rust, this code wouldn’t have compiled because +every reference needed an explicit lifetime. At that time, the function +signature would have been written like this: + +``` +fn first_word<'a>(s: &'a str) -> &'a str { +``` + +After writing a lot of Rust code, the Rust team found that Rust programmers +were entering the same lifetime annotations over and over in particular +situations. These situations were predictable and followed a few deterministic +patterns. The developers programmed these patterns into the compiler’s code so +the borrow checker could infer the lifetimes in these situations and wouldn’t +need explicit annotations. + +This piece of Rust history is relevant because it’s possible that more +deterministic patterns will emerge and be added to the compiler. In the future, +even fewer lifetime annotations might be required. + +The patterns programmed into Rust’s analysis of references are called the +*lifetime elision rules*. These aren’t rules for programmers to follow; they’re +a set of particular cases that the compiler will consider, and if your code +fits these cases, you don’t need to write the lifetimes explicitly. + +The elision rules don’t provide full inference. If Rust deterministically +applies the rules but there is still ambiguity as to what lifetimes the +references have, the compiler won’t guess what the lifetime of the remaining +references should be. Instead of guessing, the compiler will give you an error +that you can resolve by adding the lifetime annotations. + +Lifetimes on function or method parameters are called *input lifetimes*, and +lifetimes on return values are called *output lifetimes*. + +The compiler uses three rules to figure out the lifetimes of the references +when there aren’t explicit annotations. The first rule applies to input +lifetimes, and the second and third rules apply to output lifetimes. If the +compiler gets to the end of the three rules and there are still references for +which it can’t figure out lifetimes, the compiler will stop with an error. +These rules apply to `fn` definitions as well as `impl` blocks. + +The first rule is that the compiler assigns a lifetime parameter to each +parameter that’s a reference. In other words, a function with one parameter +gets one lifetime parameter: `fn foo<'a>(x: &'a i32)`; a function with two +parameters gets two separate lifetime parameters: `fn foo<'a, 'b>(x: &'a i32, +y: &'b i32)`; and so on. + +The second rule is that, if there is exactly one input lifetime parameter, that +lifetime is assigned to all output lifetime parameters: `fn foo<'a>(x: &'a i32) +-> &'a i32`. + +The third rule is that, if there are multiple input lifetime parameters, but +one of them is `&self` or `&mut self` because this is a method, the lifetime of +`self` is assigned to all output lifetime parameters. This third rule makes +methods much nicer to read and write because fewer symbols are necessary. + +Let’s pretend we’re the compiler. We’ll apply these rules to figure out the +lifetimes of the references in the signature of the `first_word` function in +Listing 10-25. The signature starts without any lifetimes associated with the +references: + +``` +fn first_word(s: &str) -> &str { +``` + +Then the compiler applies the first rule, which specifies that each parameter +gets its own lifetime. We’ll call it `'a` as usual, so now the signature is +this: + +``` +fn first_word<'a>(s: &'a str) -> &str { +``` + +The second rule applies because there is exactly one input lifetime. The second +rule specifies that the lifetime of the one input parameter gets assigned to +the output lifetime, so the signature is now this: + +``` +fn first_word<'a>(s: &'a str) -> &'a str { +``` + +Now all the references in this function signature have lifetimes, and the +compiler can continue its analysis without needing the programmer to annotate +the lifetimes in this function signature. + +Let’s look at another example, this time using the `longest` function that had +no lifetime parameters when we started working with it in Listing 10-20: + +``` +fn longest(x: &str, y: &str) -> &str { +``` + +Let’s apply the first rule: each parameter gets its own lifetime. This time we +have two parameters instead of one, so we have two lifetimes: + +``` +fn longest<'a, 'b>(x: &'a str, y: &'b str) -> &str { +``` + +You can see that the second rule doesn’t apply because there is more than one +input lifetime. The third rule doesn’t apply either, because `longest` is a +function rather than a method, so none of the parameters are `self`. After +working through all three rules, we still haven’t figured out what the return +type’s lifetime is. This is why we got an error trying to compile the code in +Listing 10-20: the compiler worked through the lifetime elision rules but still +couldn’t figure out all the lifetimes of the references in the signature. + +Because the third rule really only applies in method signatures, we’ll look at +lifetimes in that context next to see why the third rule means we don’t have to +annotate lifetimes in method signatures very often. + +### Lifetime Annotations in Method Definitions + +When we implement methods on a struct with lifetimes, we use the same syntax as +that of generic type parameters shown in Listing 10-11. Where we declare and +use the lifetime parameters depends on whether they’re related to the struct +fields or the method parameters and return values. + +Lifetime names for struct fields always need to be declared after the `impl` +keyword and then used after the struct’s name because those lifetimes are part +of the struct’s type. + +In method signatures inside the `impl` block, references might be tied to the +lifetime of references in the struct’s fields, or they might be independent. In +addition, the lifetime elision rules often make it so that lifetime annotations +aren’t necessary in method signatures. Let’s look at some examples using the +struct named `ImportantExcerpt` that we defined in Listing 10-24. + +First we’ll use a method named `level` whose only parameter is a reference to +`self` and whose return value is an `i32`, which is not a reference to anything: + +``` +impl<'a> ImportantExcerpt<'a> { + fn level(&self) -> i32 { + 3 + } +} +``` + +The lifetime parameter declaration after `impl` and its use after the type name +are required, but we’re not required to annotate the lifetime of the reference +to `self` because of the first elision rule. + +Here is an example where the third lifetime elision rule applies: + +``` +impl<'a> ImportantExcerpt<'a> { + fn announce_and_return_part(&self, announcement: &str) -> &str { + println!("Attention please: {announcement}"); + self.part + } +} +``` + +There are two input lifetimes, so Rust applies the first lifetime elision rule +and gives both `&self` and `announcement` their own lifetimes. Then, because +one of the parameters is `&self`, the return type gets the lifetime of `&self`, +and all lifetimes have been accounted for. + +### The Static Lifetime + +One special lifetime we need to discuss is `'static`, which denotes that the +affected reference *can* live for the entire duration of the program. All +string literals have the `'static` lifetime, which we can annotate as follows: + +``` +let s: &'static str = "I have a static lifetime."; +``` + +The text of this string is stored directly in the program’s binary, which is +always available. Therefore, the lifetime of all string literals is `'static`. + +You might see suggestions to use the `'static` lifetime in error messages. But +before specifying `'static` as the lifetime for a reference, think about +whether the reference you have actually lives the entire lifetime of your +program or not, and whether you want it to. Most of the time, an error message +suggesting the `'static` lifetime results from attempting to create a dangling +reference or a mismatch of the available lifetimes. In such cases, the solution +is to fix those problems, not to specify the `'static` lifetime. + +## Generic Type Parameters, Trait Bounds, and Lifetimes Together + +Let’s briefly look at the syntax of specifying generic type parameters, trait +bounds, and lifetimes all in one function! + +``` +use std::fmt::Display; + +fn longest_with_an_announcement<'a, T>( + x: &'a str, + y: &'a str, + ann: T, +) -> &'a str +where + T: Display, +{ + println!("Announcement! {ann}"); + if x.len() > y.len() { + x + } else { + y + } +} +``` + +This is the `longest` function from Listing 10-21 that returns the longer of +two string slices. But now it has an extra parameter named `ann` of the generic +type `T`, which can be filled in by any type that implements the `Display` +trait as specified by the `where` clause. This extra parameter will be printed +using `{}`, which is why the `Display` trait bound is necessary. Because +lifetimes are a type of generic, the declarations of the lifetime parameter +`'a` and the generic type parameter `T` go in the same list inside the angle +brackets after the function name. + +## Summary + +We covered a lot in this chapter! Now that you know about generic type +parameters, traits and trait bounds, and generic lifetime parameters, you’re +ready to write code without repetition that works in many different situations. +Generic type parameters let you apply the code to different types. Traits and +trait bounds ensure that even though the types are generic, they’ll have the +behavior the code needs. You learned how to use lifetime annotations to ensure +that this flexible code won’t have any dangling references. And all of this +analysis happens at compile time, which doesn’t affect runtime performance! + +Believe it or not, there is much more to learn on the topics we discussed in +this chapter: Chapter 17 discusses trait objects, which are another way to use +traits. There are also more complex scenarios involving lifetime annotations +that you will only need in very advanced scenarios; for those, you should read +the Rust Reference at *../reference/index.html*. But next, you’ll learn how to write tests in +Rust so you can make sure your code is working the way it should. diff --git a/rustbook-ru/nostarch/chapter11.md b/rustbook-ru/nostarch/chapter11.md new file mode 100644 index 000000000..d44a50149 --- /dev/null +++ b/rustbook-ru/nostarch/chapter11.md @@ -0,0 +1,1760 @@ + + +[TOC] + +# Writing Automated Tests + +In his 1972 essay “The Humble Programmer,” Edsger W. Dijkstra said that +“Program testing can be a very effective way to show the presence of bugs, but +it is hopelessly inadequate for showing their absence.” That doesn’t mean we +shouldn’t try to test as much as we can! + +Correctness in our programs is the extent to which our code does what we intend +it to do. Rust is designed with a high degree of concern about the correctness +of programs, but correctness is complex and not easy to prove. Rust’s type +system shoulders a huge part of this burden, but the type system cannot catch +everything. As such, Rust includes support for writing automated software tests. + +Say we write a function `add_two` that adds 2 to whatever number is passed to +it. This function’s signature accepts an integer as a parameter and returns an +integer as a result. When we implement and compile that function, Rust does all +the type checking and borrow checking that you’ve learned so far to ensure +that, for instance, we aren’t passing a `String` value or an invalid reference +to this function. But Rust *can’t* check that this function will do precisely +what we intend, which is return the parameter plus 2 rather than, say, the +parameter plus 10 or the parameter minus 50! That’s where tests come in. + +We can write tests that assert, for example, that when we pass `3` to the +`add_two` function, the returned value is `5`. We can run these tests whenever +we make changes to our code to make sure any existing correct behavior has not +changed. + +Testing is a complex skill: although we can’t cover in one chapter every detail +about how to write good tests, in this chapter we will discuss the mechanics of +Rust’s testing facilities. We’ll talk about the annotations and macros +available to you when writing your tests, the default behavior and options +provided for running your tests, and how to organize tests into unit tests and +integration tests. + +## How to Write Tests + +Tests are Rust functions that verify that the non-test code is functioning in +the expected manner. The bodies of test functions typically perform these three +actions: + +* Set up any needed data or state. +* Run the code you want to test. +* Assert that the results are what you expect. + +Let’s look at the features Rust provides specifically for writing tests that +take these actions, which include the `test` attribute, a few macros, and the +`should_panic` attribute. + +### The Anatomy of a Test Function + +At its simplest, a test in Rust is a function that’s annotated with the `test` +attribute. Attributes are metadata about pieces of Rust code; one example is +the `derive` attribute we used with structs in Chapter 5. To change a function +into a test function, add `#[test]` on the line before `fn`. When you run your +tests with the `cargo test` command, Rust builds a test runner binary that runs +the annotated functions and reports on whether each test function passes or +fails. + +Whenever we make a new library project with Cargo, a test module with a test +function in it is automatically generated for us. This module gives you a +template for writing your tests so you don’t have to look up the exact +structure and syntax every time you start a new project. You can add as many +additional test functions and as many test modules as you want! + +We’ll explore some aspects of how tests work by experimenting with the template +test before we actually test any code. Then we’ll write some real-world tests +that call some code that we’ve written and assert that its behavior is correct. + +Let’s create a new library project called `adder` that will add two numbers: + +``` +$ cargo new adder --lib + Created library `adder` project +$ cd adder +``` + +The contents of the *src/lib.rs* file in your `adder` library should look like +Listing 11-1. + + +Filename: src/lib.rs + + + +``` +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} +``` + +Listing 11-1: The code generated automatically by cargo new + +For now, let’s focus solely on the `it_works` function. Note the `#[test]` +annotation: this attribute indicates this is a test function, so the test +runner knows to treat this function as a test. We might also have non-test +functions in the `tests` module to help set up common scenarios or perform +common operations, so we always need to indicate which functions are tests. + +The example function body uses the `assert_eq!` macro to assert that `result`, +which contains the result of adding 2 and 2, equals 4. This assertion serves as +an example of the format for a typical test. Let’s run it to see that this test +passes. + +The `cargo test` command runs all tests in our project, as shown in Listing +11-2. + + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.57s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Listing 11-2: The output from running the automatically generated test + +Cargo compiled and ran the test. We see the line `running 1 test`. The next +line shows the name of the generated test function, called `tests::it_works`, +and that the result of running that test is `ok`. The overall summary `test result: ok.` means that all the tests passed, and the portion that reads `1 passed; 0 failed` totals the number of tests that passed or failed. + +It’s possible to mark a test as ignored so it doesn’t run in a particular +instance; we’ll cover that in the “Ignoring Some Tests Unless Specifically +Requested” section later in this chapter. Because we +haven’t done that here, the summary shows `0 ignored`. + +The `0 measured` statistic is for benchmark tests that measure performance. +Benchmark tests are, as of this writing, only available in nightly Rust. See +the documentation about benchmark tests at *../unstable-book/library-features/test.html* to learn more. + +We can pass an argument to the `cargo test` command to run only tests whose +name matches a string; this is called *filtering* and we’ll cover that in the +“Running a Subset of Tests by Name” section. Here we +haven’t filtered the tests being run, so the end of the summary shows `0 filtered out`. + +The next part of the test output starting at `Doc-tests adder` is for the +results of any documentation tests. We don’t have any documentation tests yet, +but Rust can compile any code examples that appear in our API documentation. +This feature helps keep your docs and your code in sync! We’ll discuss how to +write documentation tests in the “Documentation Comments as +Tests” section of Chapter 14. For now, we’ll +ignore the `Doc-tests` output. + +Let’s start to customize the test to our own needs. First, change the name of +the `it_works` function to a different name, such as `exploration`, like so: + +Filename: src/lib.rs + +``` +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn exploration() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} +``` + +Then run `cargo test` again. The output now shows `exploration` instead of +`it_works`: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.59s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::exploration ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Now we’ll add another test, but this time we’ll make a test that fails! Tests +fail when something in the test function panics. Each test is run in a new +thread, and when the main thread sees that a test thread has died, the test is +marked as failed. In Chapter 9, we talked about how the simplest way to panic +is to call the `panic!` macro. Enter the new test as a function named +`another`, so your *src/lib.rs* file looks like Listing 11-3. + + +Filename: src/lib.rs + +``` +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn exploration() { + let result = add(2, 2); + assert_eq!(result, 4); + } + + #[test] + fn another() { + panic!("Make this test fail"); + } +} +``` + +Listing 11-3: Adding a second test that will fail because we call the panic! macro + +Run the tests again using `cargo test`. The output should look like Listing +11-4, which shows that our `exploration` test passed and `another` failed. + + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.72s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::another ... FAILED +test tests::exploration ... ok + +failures: + +---- tests::another stdout ---- +thread 'tests::another' panicked at src/lib.rs:17:9: +Make this test fail +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::another + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +Listing 11-4: Test results when one test passes and one test fails + + + +Instead of `ok`, the line `test tests::another` shows `FAILED`. Two new +sections appear between the individual results and the summary: the first +displays the detailed reason for each test failure. In this case, we get the +details that `another` failed because it `panicked at 'Make this test fail'` on +line 17 in the *src/lib.rs* file. The next section lists just the names of all +the failing tests, which is useful when there are lots of tests and lots of +detailed failing test output. We can use the name of a failing test to run just +that test to more easily debug it; we’ll talk more about ways to run tests in +the “Controlling How Tests Are Run” section. + +The summary line displays at the end: overall, our test result is `FAILED`. We +had one test pass and one test fail. + +Now that you’ve seen what the test results look like in different scenarios, +let’s look at some macros other than `panic!` that are useful in tests. + +### Checking Results with the `assert!` Macro + +The `assert!` macro, provided by the standard library, is useful when you want +to ensure that some condition in a test evaluates to `true`. We give the +`assert!` macro an argument that evaluates to a Boolean. If the value is +`true`, nothing happens and the test passes. If the value is `false`, the +`assert!` macro calls `panic!` to cause the test to fail. Using the `assert!` +macro helps us check that our code is functioning in the way we intend. + +In Chapter 5, Listing 5-15, we used a `Rectangle` struct and a `can_hold` +method, which are repeated here in Listing 11-5. Let’s put this code in the +*src/lib.rs* file, then write some tests for it using the `assert!` macro. + + +Filename: src/lib.rs + +``` +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width > other.width && self.height > other.height + } +} +``` + +Listing 11-5: The Rectangle struct and its can_hold method from Chapter 5 + +The `can_hold` method returns a Boolean, which means it’s a perfect use case +for the `assert!` macro. In Listing 11-6, we write a test that exercises the +`can_hold` method by creating a `Rectangle` instance that has a width of 8 and +a height of 7 and asserting that it can hold another `Rectangle` instance that +has a width of 5 and a height of 1. + + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn larger_can_hold_smaller() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(larger.can_hold(&smaller)); + } +} +``` + +Listing 11-6: A test for can_hold that checks whether a larger rectangle can indeed hold a smaller rectangle + +Note the `use super::*;` line inside the `tests` module. The `tests` module is +a regular module that follows the usual visibility rules we covered in Chapter +7 in the “Paths for Referring to an Item in the Module +Tree” +section. Because the `tests` module is an inner module, we need to bring the +code under test in the outer module into the scope of the inner module. We use +a glob here, so anything we define in the outer module is available to this +`tests` module. + +We’ve named our test `larger_can_hold_smaller`, and we’ve created the two +`Rectangle` instances that we need. Then we called the `assert!` macro and +passed it the result of calling `larger.can_hold(&smaller)`. This expression is +supposed to return `true`, so our test should pass. Let’s find out! + +``` +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 1 test +test tests::larger_can_hold_smaller ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests rectangle + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +It does pass! Let’s add another test, this time asserting that a smaller +rectangle cannot hold a larger rectangle: + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn larger_can_hold_smaller() { + // --snip-- + } + + #[test] + fn smaller_cannot_hold_larger() { + let larger = Rectangle { + width: 8, + height: 7, + }; + let smaller = Rectangle { + width: 5, + height: 1, + }; + + assert!(!smaller.can_hold(&larger)); + } +} +``` + +Because the correct result of the `can_hold` function in this case is `false`, +we need to negate that result before we pass it to the `assert!` macro. As a +result, our test will pass if `can_hold` returns `false`: + +``` +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 2 tests +test tests::larger_can_hold_smaller ... ok +test tests::smaller_cannot_hold_larger ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests rectangle + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Two tests that pass! Now let’s see what happens to our test results when we +introduce a bug in our code. We’ll change the implementation of the `can_hold` +method by replacing the greater-than sign with a less-than sign when it +compares the widths: + +``` +// --snip-- +impl Rectangle { + fn can_hold(&self, other: &Rectangle) -> bool { + self.width < other.width && self.height > other.height + } +} +``` + +Running the tests now produces the following: + +``` +$ cargo test + Compiling rectangle v0.1.0 (file:///projects/rectangle) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/rectangle-6584c4561e48942e) + +running 2 tests +test tests::larger_can_hold_smaller ... FAILED +test tests::smaller_cannot_hold_larger ... ok + +failures: + +---- tests::larger_can_hold_smaller stdout ---- +thread 'tests::larger_can_hold_smaller' panicked at src/lib.rs:28:9: +assertion failed: larger.can_hold(&smaller) +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::larger_can_hold_smaller + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +Our tests caught the bug! Because `larger.width` is `8` and `smaller.width` is +`5`, the comparison of the widths in `can_hold` now returns `false`: 8 is not +less than 5. + +### Testing Equality with the `assert_eq!` and `assert_ne!` Macros + +A common way to verify functionality is to test for equality between the result +of the code under test and the value you expect the code to return. You could +do this by using the `assert!` macro and passing it an expression using the +`==` operator. However, this is such a common test that the standard library +provides a pair of macros—`assert_eq!` and `assert_ne!`—to perform this test +more conveniently. These macros compare two arguments for equality or +inequality, respectively. They’ll also print the two values if the assertion +fails, which makes it easier to see *why* the test failed; conversely, the +`assert!` macro only indicates that it got a `false` value for the `==` +expression, without printing the values that led to the `false` value. + +In Listing 11-7, we write a function named `add_two` that adds `2` to its +parameter, then we test this function using the `assert_eq!` macro. + + +Filename: src/lib.rs + +``` +pub fn add_two(a: usize) -> usize { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); + } +} +``` + +Listing 11-7: Testing the function add_two using the assert_eq! macro + +Let’s check that it passes! + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +We create a variable named `result` that holds the result of calling +`add_two(2)`. Then we pass `result` and `4` as the arguments to `assert_eq!`. +The output line for this test is `test tests::it_adds_two ... ok`, and the `ok` +text indicates that our test passed! + +Let’s introduce a bug into our code to see what `assert_eq!` looks like when it +fails. Change the implementation of the `add_two` function to instead add `3`: + +``` +pub fn add_two(a: usize) -> usize { + a + 3 +} +``` + +Run the tests again: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::it_adds_two ... FAILED + +failures: + +---- tests::it_adds_two stdout ---- +thread 'tests::it_adds_two' panicked at src/lib.rs:12:9: +assertion `left == right` failed + left: 5 + right: 4 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::it_adds_two + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +Our test caught the bug! The `it_adds_two` test failed, and the message tells +us ``assertion `left == right` failed`` and what the `left` and `right` values +are. This message helps us start debugging: the `left` argument, where we had +the result of calling `add_two(2)`, was `5` but the `right` argument was `4`. +You can imagine that this would be especially helpful when we have a lot of +tests going on. + +Note that in some languages and test frameworks, the parameters to equality +assertion functions are called `expected` and `actual`, and the order in which +we specify the arguments matters. However, in Rust, they’re called `left` and +`right`, and the order in which we specify the value we expect and the value +the code produces doesn’t matter. We could write the assertion in this test as +`assert_eq!(4, result)`, which would produce the same failure message +that displays `` assertion failed: `(left == right)` ``. + +The `assert_ne!` macro will pass if the two values we give it are not equal and +fail if they’re equal. This macro is most useful for cases when we’re not sure +what a value *will* be, but we know what the value definitely *shouldn’t* be. +For example, if we’re testing a function that is guaranteed to change its input +in some way, but the way in which the input is changed depends on the day of +the week that we run our tests, the best thing to assert might be that the +output of the function is not equal to the input. + +Under the surface, the `assert_eq!` and `assert_ne!` macros use the operators +`==` and `!=`, respectively. When the assertions fail, these macros print their +arguments using debug formatting, which means the values being compared must +implement the `PartialEq` and `Debug` traits. All primitive types and most of +the standard library types implement these traits. For structs and enums that +you define yourself, you’ll need to implement `PartialEq` to assert equality of +those types. You’ll also need to implement `Debug` to print the values when the +assertion fails. Because both traits are derivable traits, as mentioned in +Listing 5-12 in Chapter 5, this is usually as straightforward as adding the +`#[derive(PartialEq, Debug)]` annotation to your struct or enum definition. See +Appendix C, “Derivable Traits,” for more +details about these and other derivable traits. + +### Adding Custom Failure Messages + +You can also add a custom message to be printed with the failure message as +optional arguments to the `assert!`, `assert_eq!`, and `assert_ne!` macros. Any +arguments specified after the required arguments are passed along to the +`format!` macro (discussed in Chapter 8 in the “Concatenation with the `+` +Operator or the `format!` +Macro” +section), so you can pass a format string that contains `{}` placeholders and +values to go in those placeholders. Custom messages are useful for documenting +what an assertion means; when a test fails, you’ll have a better idea of what +the problem is with the code. + +For example, let’s say we have a function that greets people by name and we +want to test that the name we pass into the function appears in the output: + +Filename: src/lib.rs + +``` +pub fn greeting(name: &str) -> String { + format!("Hello {name}!") +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn greeting_contains_name() { + let result = greeting("Carol"); + assert!(result.contains("Carol")); + } +} +``` + +The requirements for this program haven’t been agreed upon yet, and we’re +pretty sure the `Hello` text at the beginning of the greeting will change. We +decided we don’t want to have to update the test when the requirements change, +so instead of checking for exact equality to the value returned from the +`greeting` function, we’ll just assert that the output contains the text of the +input parameter. + +Now let’s introduce a bug into this code by changing `greeting` to exclude +`name` to see what the default test failure looks like: + +``` +pub fn greeting(name: &str) -> String { + String::from("Hello!") +} +``` + +Running this test produces the following: + +``` +$ cargo test + Compiling greeter v0.1.0 (file:///projects/greeter) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.91s + Running unittests src/lib.rs (target/debug/deps/greeter-170b942eb5bf5e3a) + +running 1 test +test tests::greeting_contains_name ... FAILED + +failures: + +---- tests::greeting_contains_name stdout ---- +thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: +assertion failed: result.contains("Carol") +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::greeting_contains_name + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +This result just indicates that the assertion failed and which line the +assertion is on. A more useful failure message would print the value from the +`greeting` function. Let’s add a custom failure message composed of a format +string with a placeholder filled in with the actual value we got from the +`greeting` function: + +``` + #[test] + fn greeting_contains_name() { + let result = greeting("Carol"); + assert!( + result.contains("Carol"), + "Greeting did not contain name, value was `{result}`" + ); + } +``` + +Now when we run the test, we’ll get a more informative error message: + +``` +$ cargo test + Compiling greeter v0.1.0 (file:///projects/greeter) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.93s + Running unittests src/lib.rs (target/debug/deps/greeter-170b942eb5bf5e3a) + +running 1 test +test tests::greeting_contains_name ... FAILED + +failures: + +---- tests::greeting_contains_name stdout ---- +thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: +Greeting did not contain name, value was `Hello!` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::greeting_contains_name + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +We can see the value we actually got in the test output, which would help us +debug what happened instead of what we were expecting to happen. + +### Checking for Panics with `should_panic` + +In addition to checking return values, it’s important to check that our code +handles error conditions as we expect. For example, consider the `Guess` type +that we created in Chapter 9, Listing 9-13. Other code that uses `Guess` +depends on the guarantee that `Guess` instances will contain only values +between 1 and 100. We can write a test that ensures that attempting to create a +`Guess` instance with a value outside that range panics. + +We do this by adding the attribute `should_panic` to our test function. The +test passes if the code inside the function panics; the test fails if the code +inside the function doesn’t panic. + +Listing 11-8 shows a test that checks that the error conditions of `Guess::new` +happen when we expect them to. + + +Filename: src/lib.rs + +``` +pub struct Guess { + value: i32, +} + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 || value > 100 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic] + fn greater_than_100() { + Guess::new(200); + } +} +``` + +Listing 11-8: Testing that a condition will cause a panic! + +We place the `#[should_panic]` attribute after the `#[test]` attribute and +before the test function it applies to. Let’s look at the result when this test +passes: + +``` +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests guessing_game + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Looks good! Now let’s introduce a bug in our code by removing the condition +that the `new` function will panic if the value is greater than 100: + +``` +// --snip-- +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 { + panic!("Guess value must be between 1 and 100, got {value}."); + } + + Guess { value } + } +} +``` + +When we run the test in Listing 11-8, it will fail: + +``` +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.62s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... FAILED + +failures: + +---- tests::greater_than_100 stdout ---- +note: test did not panic as expected + +failures: + tests::greater_than_100 + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +We don’t get a very helpful message in this case, but when we look at the test +function, we see that it’s annotated with `#[should_panic]`. The failure we got +means that the code in the test function did not cause a panic. + +Tests that use `should_panic` can be imprecise. A `should_panic` test would +pass even if the test panics for a different reason from the one we were +expecting. To make `should_panic` tests more precise, we can add an optional +`expected` parameter to the `should_panic` attribute. The test harness will +make sure that the failure message contains the provided text. For example, +consider the modified code for `Guess` in Listing 11-9 where the `new` function +panics with different messages depending on whether the value is too small or +too large. + + +Filename: src/lib.rs + +``` +// --snip-- + +impl Guess { + pub fn new(value: i32) -> Guess { + if value < 1 { + panic!( + "Guess value must be greater than or equal to 1, got {value}." + ); + } else if value > 100 { + panic!( + "Guess value must be less than or equal to 100, got {value}." + ); + } + + Guess { value } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[should_panic(expected = "less than or equal to 100")] + fn greater_than_100() { + Guess::new(200); + } +} +``` + +Listing 11-9: Testing for a panic! with a panic message containing a specified substring + +This test will pass because the value we put in the `should_panic` attribute’s +`expected` parameter is a substring of the message that the `Guess::new` +function panics with. We could have specified the entire panic message that we +expect, which in this case would be `Guess value must be less than or equal to 100, got 200`. What you choose to specify depends on how much of the panic +message is unique or dynamic and how precise you want your test to be. In this +case, a substring of the panic message is enough to ensure that the code in the +test function executes the `else if value > 100` case. + +To see what happens when a `should_panic` test with an `expected` message +fails, let’s again introduce a bug into our code by swapping the bodies of the +`if value < 1` and the `else if value > 100` blocks: + +``` + if value < 1 { + panic!( + "Guess value must be less than or equal to 100, got {value}." + ); + } else if value > 100 { + panic!( + "Guess value must be greater than or equal to 1, got {value}." + ); + } +``` + +This time when we run the `should_panic` test, it will fail: + +``` +$ cargo test + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s + Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d) + +running 1 test +test tests::greater_than_100 - should panic ... FAILED + +failures: + +---- tests::greater_than_100 stdout ---- +thread 'tests::greater_than_100' panicked at src/lib.rs:12:13: +Guess value must be greater than or equal to 1, got 200. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +note: panic did not contain expected string + panic message: `"Guess value must be greater than or equal to 1, got 200."`, + expected substring: `"less than or equal to 100"` + +failures: + tests::greater_than_100 + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +The failure message indicates that this test did indeed panic as we expected, +but the panic message did not include the expected string `less than or equal to 100`. The panic message that we did get in this case was `Guess value must be greater than or equal to 1, got 200.` Now we can start figuring out where +our bug is! + +### Using `Result` in Tests + +Our tests so far all panic when they fail. We can also write tests that use +`Result`! Here’s the test from Listing 11-1, rewritten to use `Result` and return an `Err` instead of panicking: + +``` + #[test] + fn it_works() -> Result<(), String> { + let result = add(2, 2); + + if result == 4 { + Ok(()) + } else { + Err(String::from("two plus two does not equal four")) + } + } +``` + +The `it_works` function now has the `Result<(), String>` return type. In the +body of the function, rather than calling the `assert_eq!` macro, we return +`Ok(())` when the test passes and an `Err` with a `String` inside when the test +fails. + +Writing tests so they return a `Result` enables you to use the question +mark operator in the body of tests, which can be a convenient way to write +tests that should fail if any operation within them returns an `Err` variant. + +You can’t use the `#[should_panic]` annotation on tests that use `Result`. To assert that an operation returns an `Err` variant, *don’t* use the +question mark operator on the `Result` value. Instead, use +`assert!(value.is_err())`. + +Now that you know several ways to write tests, let’s look at what is happening +when we run our tests and explore the different options we can use with `cargo test`. + +## Controlling How Tests Are Run + +Just as `cargo run` compiles your code and then runs the resultant binary, +`cargo test` compiles your code in test mode and runs the resultant test +binary. The default behavior of the binary produced by `cargo test` is to run +all the tests in parallel and capture output generated during test runs, +preventing the output from being displayed and making it easier to read the +output related to the test results. You can, however, specify command line +options to change this default behavior. + +Some command line options go to `cargo test`, and some go to the resultant test +binary. To separate these two types of arguments, you list the arguments that +go to `cargo test` followed by the separator `--` and then the ones that go to +the test binary. Running `cargo test --help` displays the options you can use +with `cargo test`, and running `cargo test -- --help` displays the options you +can use after the separator. + +### Running Tests in Parallel or Consecutively + +When you run multiple tests, by default they run in parallel using threads, +meaning they finish running faster and you get feedback quicker. Because the +tests are running at the same time, you must make sure your tests don’t depend +on each other or on any shared state, including a shared environment, such as +the current working directory or environment variables. + +For example, say each of your tests runs some code that creates a file on disk +named *test-output.txt* and writes some data to that file. Then each test reads +the data in that file and asserts that the file contains a particular value, +which is different in each test. Because the tests run at the same time, one +test might overwrite the file in the time between another test writing and +reading the file. The second test will then fail, not because the code is +incorrect but because the tests have interfered with each other while running +in parallel. One solution is to make sure each test writes to a different file; +another solution is to run the tests one at a time. + +If you don’t want to run the tests in parallel or if you want more fine-grained +control over the number of threads used, you can send the `--test-threads` flag +and the number of threads you want to use to the test binary. Take a look at +the following example: + +``` +$ cargo test -- --test-threads=1 +``` + +We set the number of test threads to `1`, telling the program not to use any +parallelism. Running the tests using one thread will take longer than running +them in parallel, but the tests won’t interfere with each other if they share +state. + +### Showing Function Output + +By default, if a test passes, Rust’s test library captures anything printed to +standard output. For example, if we call `println!` in a test and the test +passes, we won’t see the `println!` output in the terminal; we’ll see only the +line that indicates the test passed. If a test fails, we’ll see whatever was +printed to standard output with the rest of the failure message. + +As an example, Listing 11-10 has a silly function that prints the value of its +parameter and returns 10, as well as a test that passes and a test that fails. + + +Filename: src/lib.rs + +``` +fn prints_and_returns_10(a: i32) -> i32 { + println!("I got the value {a}"); + 10 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn this_test_will_pass() { + let value = prints_and_returns_10(4); + assert_eq!(value, 10); + } + + #[test] + fn this_test_will_fail() { + let value = prints_and_returns_10(8); + assert_eq!(value, 5); + } +} +``` + +Listing 11-10: Tests for a function that calls println! + +When we run these tests with `cargo test`, we’ll see the following output: + +``` +$ cargo test + Compiling silly-function v0.1.0 (file:///projects/silly-function) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.58s + Running unittests src/lib.rs (target/debug/deps/silly_function-160869f38cff9166) + +running 2 tests +test tests::this_test_will_fail ... FAILED +test tests::this_test_will_pass ... ok + +failures: + +---- tests::this_test_will_fail stdout ---- +I got the value 8 +thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: +assertion `left == right` failed + left: 10 + right: 5 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::this_test_will_fail + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +Note that nowhere in this output do we see `I got the value 4`, which is +printed when the test that passes runs. That output has been captured. The +output from the test that failed, `I got the value 8`, appears in the section +of the test summary output, which also shows the cause of the test failure. + +If we want to see printed values for passing tests as well, we can tell Rust to +also show the output of successful tests with `--show-output`: + +``` +$ cargo test -- --show-output +``` + +When we run the tests in Listing 11-10 again with the `--show-output` flag, we +see the following output: + +``` +$ cargo test -- --show-output + Compiling silly-function v0.1.0 (file:///projects/silly-function) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.60s + Running unittests src/lib.rs (target/debug/deps/silly_function-160869f38cff9166) + +running 2 tests +test tests::this_test_will_fail ... FAILED +test tests::this_test_will_pass ... ok + +successes: + +---- tests::this_test_will_pass stdout ---- +I got the value 4 + + +successes: + tests::this_test_will_pass + +failures: + +---- tests::this_test_will_fail stdout ---- +I got the value 8 +thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: +assertion `left == right` failed + left: 5 + right: 10 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::this_test_will_fail + +test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +### Running a Subset of Tests by Name + +Sometimes, running a full test suite can take a long time. If you’re working on +code in a particular area, you might want to run only the tests pertaining to +that code. You can choose which tests to run by passing `cargo test` the name +or names of the test(s) you want to run as an argument. + +To demonstrate how to run a subset of tests, we’ll first create three tests for +our `add_two` function, as shown in Listing 11-11, and choose which ones to run. + + +Filename: src/lib.rs + +``` +pub fn add_two(a: usize) -> usize { + a + 2 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn add_two_and_two() { + let result = add_two(2); + assert_eq!(result, 4); + } + + #[test] + fn add_three_and_two() { + let result = add_two(3); + assert_eq!(result, 5); + } + + #[test] + fn one_hundred() { + let result = add_two(100); + assert_eq!(result, 102); + } +} +``` + +Listing 11-11: Three tests with three different names + +If we run the tests without passing any arguments, as we saw earlier, all the +tests will run in parallel: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.62s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 3 tests +test tests::add_three_and_two ... ok +test tests::add_two_and_two ... ok +test tests::one_hundred ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +#### Running Single Tests + +We can pass the name of any test function to `cargo test` to run only that test: + +``` +$ cargo test one_hundred + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.69s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::one_hundred ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s + +``` + +Only the test with the name `one_hundred` ran; the other two tests didn’t match +that name. The test output lets us know we had more tests that didn’t run by +displaying `2 filtered out` at the end. + +We can’t specify the names of multiple tests in this way; only the first value +given to `cargo test` will be used. But there is a way to run multiple tests. + +#### Filtering to Run Multiple Tests + +We can specify part of a test name, and any test whose name matches that value +will be run. For example, because two of our tests’ names contain `add`, we can +run those two by running `cargo test add`: + +``` +$ cargo test add + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::add_three_and_two ... ok +test tests::add_two_and_two ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s + +``` + +This command ran all tests with `add` in the name and filtered out the test +named `one_hundred`. Also note that the module in which a test appears becomes +part of the test’s name, so we can run all the tests in a module by filtering +on the module’s name. + +### Ignoring Some Tests Unless Specifically Requested + +Sometimes a few specific tests can be very time-consuming to execute, so you +might want to exclude them during most runs of `cargo test`. Rather than +listing as arguments all tests you do want to run, you can instead annotate the +time-consuming tests using the `ignore` attribute to exclude them, as shown +here: + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } + + #[test] + #[ignore] + fn expensive_test() { + // code that takes an hour to run + } +} +``` + +After `#[test]`, we add the `#[ignore]` line to the test we want to exclude. +Now when we run our tests, `it_works` runs, but `expensive_test` doesn’t: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.60s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 2 tests +test tests::expensive_test ... ignored +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +The `expensive_test` function is listed as `ignored`. If we want to run only +the ignored tests, we can use `cargo test -- --ignored`: + +``` +$ cargo test -- --ignored + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.61s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test expensive_test ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +By controlling which tests run, you can make sure your `cargo test` results +will be returned quickly. When you’re at a point where it makes sense to check +the results of the `ignored` tests and you have time to wait for the results, +you can run `cargo test -- --ignored` instead. If you want to run all tests +whether they’re ignored or not, you can run `cargo test -- --include-ignored`. + +## Test Organization + +As mentioned at the start of the chapter, testing is a complex discipline, and +different people use different terminology and organization. The Rust community +thinks about tests in terms of two main categories: unit tests and integration +tests. *Unit tests* are small and more focused, testing one module in isolation +at a time, and can test private interfaces. *Integration tests* are entirely +external to your library and use your code in the same way any other external +code would, using only the public interface and potentially exercising multiple +modules per test. + +Writing both kinds of tests is important to ensure that the pieces of your +library are doing what you expect them to, separately and together. + +### Unit Tests + +The purpose of unit tests is to test each unit of code in isolation from the +rest of the code to quickly pinpoint where code is and isn’t working as +expected. You’ll put unit tests in the *src* directory in each file with the +code that they’re testing. The convention is to create a module named `tests` +in each file to contain the test functions and to annotate the module with +`cfg(test)`. + +#### The Tests Module and `#[cfg(test)]` + +The `#[cfg(test)]` annotation on the `tests` module tells Rust to compile and +run the test code only when you run `cargo test`, not when you run `cargo build`. This saves compile time when you only want to build the library and +saves space in the resultant compiled artifact because the tests are not +included. You’ll see that because integration tests go in a different +directory, they don’t need the `#[cfg(test)]` annotation. However, because unit +tests go in the same files as the code, you’ll use `#[cfg(test)]` to specify +that they shouldn’t be included in the compiled result. + +Recall that when we generated the new `adder` project in the first section of +this chapter, Cargo generated this code for us: + +Filename: src/lib.rs + +``` +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} +``` + +On the automatically generated `tests` module, the attribute `cfg` stands for +*configuration* and tells Rust that the following item should only be included +given a certain configuration option. In this case, the configuration option is +`test`, which is provided by Rust for compiling and running tests. By using the +`cfg` attribute, Cargo compiles our test code only if we actively run the tests +with `cargo test`. This includes any helper functions that might be within this +module, in addition to the functions annotated with `#[test]`. + +#### Testing Private Functions + +There’s debate within the testing community about whether or not private +functions should be tested directly, and other languages make it difficult or +impossible to test private functions. Regardless of which testing ideology you +adhere to, Rust’s privacy rules do allow you to test private functions. +Consider the code in Listing 11-12 with the private function `internal_adder`. + + +Filename: src/lib.rs + +``` +pub fn add_two(a: usize) -> usize { + internal_adder(a, 2) +} + +fn internal_adder(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn internal() { + let result = internal_adder(2, 2); + assert_eq!(result, 4); + } +} +``` + +Listing 11-12: Testing a private function + +Note that the `internal_adder` function is not marked as `pub`. Tests are just +Rust code, and the `tests` module is just another module. As we discussed in +the “Paths for Referring to an Item in the Module Tree” +section, items in child modules can use the items in their ancestor modules. In +this test, we bring all of the `tests` module’s parent’s items into scope with +`use super::*`, and then the test can call `internal_adder`. If you don’t think +private functions should be tested, there’s nothing in Rust that will compel +you to do so. + +### Integration Tests + +In Rust, integration tests are entirely external to your library. They use your +library in the same way any other code would, which means they can only call +functions that are part of your library’s public API. Their purpose is to test +whether many parts of your library work together correctly. Units of code that +work correctly on their own could have problems when integrated, so test +coverage of the integrated code is important as well. To create integration +tests, you first need a *tests* directory. + +#### The *tests* Directory + +We create a *tests* directory at the top level of our project directory, next +to *src*. Cargo knows to look for integration test files in this directory. We +can then make as many test files as we want, and Cargo will compile each of the +files as an individual crate. + +Let’s create an integration test. With the code in Listing 11-12 still in the +*src/lib.rs* file, make a *tests* directory, and create a new file named +*tests/integration_test.rs*. Your directory structure should look like this: + +``` +adder +├── Cargo.lock +├── Cargo.toml +├── src +│   └── lib.rs +└── tests + └── integration_test.rs +``` + +Enter the code in Listing 11-13 into the *tests/integration_test.rs* file. + + +Filename: tests/integration_test.rs + +``` +use adder::add_two; + +#[test] +fn it_adds_two() { + let result = add_two(2); + assert_eq!(result, 4); +} +``` + +Listing 11-13: An integration test of a function in the adder crate + +Each file in the *tests* directory is a separate crate, so we need to bring our +library into each test crate’s scope. For that reason we add `use adder::add_two;` at the top of the code, which we didn’t need in the unit tests. + +We don’t need to annotate any code in *tests/integration_test.rs* with +`#[cfg(test)]`. Cargo treats the *tests* directory specially and compiles files +in this directory only when we run `cargo test`. Run `cargo test` now: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.31s + Running unittests src/lib.rs (target/debug/deps/adder-1082c4b063a8fbe6) + +running 1 test +test tests::internal ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/integration_test.rs (target/debug/deps/integration_test-1082c4b063a8fbe6) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +The three sections of output include the unit tests, the integration test, and +the doc tests. Note that if any test in a section fails, the following sections +will not be run. For example, if a unit test fails, there won’t be any output +for integration and doc tests because those tests will only be run if all unit +tests are passing. + +The first section for the unit tests is the same as we’ve been seeing: one line +for each unit test (one named `internal` that we added in Listing 11-12) and +then a summary line for the unit tests. + +The integration tests section starts with the line `Running tests/integration_test.rs`. Next, there is a line for each test function in +that integration test and a summary line for the results of the integration +test just before the `Doc-tests adder` section starts. + +Each integration test file has its own section, so if we add more files in the +*tests* directory, there will be more integration test sections. + +We can still run a particular integration test function by specifying the test +function’s name as an argument to `cargo test`. To run all the tests in a +particular integration test file, use the `--test` argument of `cargo test` +followed by the name of the file: + +``` +$ cargo test --test integration_test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.64s + Running tests/integration_test.rs (target/debug/deps/integration_test-82e7799c1bc62298) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +This command runs only the tests in the *tests/integration_test.rs* file. + +#### Submodules in Integration Tests + +As you add more integration tests, you might want to make more files in the +*tests* directory to help organize them; for example, you can group the test +functions by the functionality they’re testing. As mentioned earlier, each file +in the *tests* directory is compiled as its own separate crate, which is useful +for creating separate scopes to more closely imitate the way end users will be +using your crate. However, this means files in the *tests* directory don’t +share the same behavior as files in *src* do, as you learned in Chapter 7 +regarding how to separate code into modules and files. + +The different behavior of *tests* directory files is most noticeable when you +have a set of helper functions to use in multiple integration test files and +you try to follow the steps in the “Separating Modules into Different +Files” section of Chapter 7 to +extract them into a common module. For example, if we create *tests/common.rs* +and place a function named `setup` in it, we can add some code to `setup` that +we want to call from multiple test functions in multiple test files: + +Filename: tests/common.rs + +``` +pub fn setup() { + // setup code specific to your library's tests would go here +} +``` + +When we run the tests again, we’ll see a new section in the test output for the +*common.rs* file, even though this file doesn’t contain any test functions nor +did we call the `setup` function from anywhere: + +``` +$ cargo test + Compiling adder v0.1.0 (file:///projects/adder) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.89s + Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4) + +running 1 test +test tests::internal ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/common.rs (target/debug/deps/common-92948b65e88960b4) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/integration_test.rs (target/debug/deps/integration_test-92948b65e88960b4) + +running 1 test +test it_adds_two ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests adder + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Having `common` appear in the test results with `running 0 tests` displayed for +it is not what we wanted. We just wanted to share some code with the other +integration test files. To avoid having `common` appear in the test output, +instead of creating *tests/common.rs*, we’ll create *tests/common/mod.rs*. The +project directory now looks like this: + +``` +├── Cargo.lock +├── Cargo.toml +├── src +│   └── lib.rs +└── tests + ├── common + │   └── mod.rs + └── integration_test.rs +``` + +This is the older naming convention that Rust also understands that we +mentioned in the “Alternate File Paths” section of +Chapter 7. Naming the file this way tells Rust not to treat the `common` module +as an integration test file. When we move the `setup` function code into +*tests/common/mod.rs* and delete the *tests/common.rs* file, the section in the +test output will no longer appear. Files in subdirectories of the *tests* +directory don’t get compiled as separate crates or have sections in the test +output. + +After we’ve created *tests/common/mod.rs*, we can use it from any of the +integration test files as a module. Here’s an example of calling the `setup` +function from the `it_adds_two` test in *tests/integration_test.rs*: + +Filename: tests/integration_test.rs + +``` +use adder::add_two; + +mod common; + +#[test] +fn it_adds_two() { + common::setup(); + + let result = add_two(2); + assert_eq!(result, 4); +} +``` + +Note that the `mod common;` declaration is the same as the module declaration +we demonstrated in Listing 7-21. Then, in the test function, we can call the +`common::setup()` function. + +#### Integration Tests for Binary Crates + +If our project is a binary crate that only contains a *src/main.rs* file and +doesn’t have a *src/lib.rs* file, we can’t create integration tests in the +*tests* directory and bring functions defined in the *src/main.rs* file into +scope with a `use` statement. Only library crates expose functions that other +crates can use; binary crates are meant to be run on their own. + +This is one of the reasons Rust projects that provide a binary have a +straightforward *src/main.rs* file that calls logic that lives in the +*src/lib.rs* file. Using that structure, integration tests *can* test the +library crate with `use` to make the important functionality available. If the +important functionality works, the small amount of code in the *src/main.rs* +file will work as well, and that small amount of code doesn’t need to be tested. + +## Summary + +Rust’s testing features provide a way to specify how code should function to +ensure it continues to work as you expect, even as you make changes. Unit tests +exercise different parts of a library separately and can test private +implementation details. Integration tests check that many parts of the library +work together correctly, and they use the library’s public API to test the code +in the same way external code will use it. Even though Rust’s type system and +ownership rules help prevent some kinds of bugs, tests are still important to +reduce logic bugs having to do with how your code is expected to behave. + +Let’s combine the knowledge you learned in this chapter and in previous +chapters to work on a project! diff --git a/rustbook-ru/nostarch/chapter12.md b/rustbook-ru/nostarch/chapter12.md new file mode 100644 index 000000000..3ce134974 --- /dev/null +++ b/rustbook-ru/nostarch/chapter12.md @@ -0,0 +1,1787 @@ + + +[TOC] + +# An I/O Project: Building a Command Line Program + +This chapter is a recap of the many skills you’ve learned so far and an +exploration of a few more standard library features. We’ll build a command line +tool that interacts with file and command line input/output to practice some of +the Rust concepts you now have under your belt. + +Rust’s speed, safety, single binary output, and cross-platform support make it +an ideal language for creating command line tools, so for our project, we’ll +make our own version of the classic command line search tool `grep` +(**g**lobally search a **r**egular **e**xpression and **p**rint). In the +simplest use case, `grep` searches a specified file for a specified string. To +do so, `grep` takes as its arguments a file path and a string. Then it reads +the file, finds lines in that file that contain the string argument, and prints +those lines. + +Along the way, we’ll show how to make our command line tool use the terminal +features that many other command line tools use. We’ll read the value of an +environment variable to allow the user to configure the behavior of our tool. +We’ll also print error messages to the standard error console stream (`stderr`) +instead of standard output (`stdout`) so that, for example, the user can +redirect successful output to a file while still seeing error messages onscreen. + +One Rust community member, Andrew Gallant, has already created a fully +featured, very fast version of `grep`, called `ripgrep`. By comparison, our +version will be fairly simple, but this chapter will give you some of the +background knowledge you need to understand a real-world project such as +`ripgrep`. + +Our `grep` project will combine a number of concepts you’ve learned so far: + +* Organizing code (Chapter 7) +* Using vectors and strings (Chapter 8) +* Handling errors (Chapter 9) +* Using traits and lifetimes where appropriate (Chapter 10) +* Writing tests (Chapter 11) + +We’ll also briefly introduce closures, iterators, and trait objects, which +Chapter 13 and Chapter 17 will +cover in detail. + +## Accepting Command Line Arguments + +Let’s create a new project with, as always, `cargo new`. We’ll call our project +`minigrep` to distinguish it from the `grep` tool that you might already have +on your system. + +``` +$ cargo new minigrep + Created binary (application) `minigrep` project +$ cd minigrep +``` + +The first task is to make `minigrep` accept its two command line arguments: the +file path and a string to search for. That is, we want to be able to run our +program with `cargo run`, two hyphens to indicate the following arguments are +for our program rather than for `cargo`, a string to search for, and a path to +a file to search in, like so: + +``` +$ cargo run -- searchstring example-filename.txt +``` + +Right now, the program generated by `cargo new` cannot process arguments we +give it. Some existing libraries on crates.io at *https://crates.io/* can help +with writing a program that accepts command line arguments, but because you’re +just learning this concept, let’s implement this capability ourselves. + +### Reading the Argument Values + +To enable `minigrep` to read the values of command line arguments we pass to +it, we’ll need the `std::env::args` function provided in Rust’s standard +library. This function returns an iterator of the command line arguments passed +to `minigrep`. We’ll cover iterators fully in Chapter 13. For now, you only need to know two details about iterators: iterators +produce a series of values, and we can call the `collect` method on an iterator +to turn it into a collection, such as a vector, that contains all the elements +the iterator produces. + +The code in Listing 12-1 allows your `minigrep` program to read any command +line arguments passed to it, and then collect the values into a vector. + + +Filename: src/main.rs + +``` +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + dbg!(args); +} +``` + +Listing 12-1: Collecting the command line arguments into a vector and printing them + +First we bring the `std::env` module into scope with a `use` statement so we +can use its `args` function. Notice that the `std::env::args` function is +nested in two levels of modules. As we discussed in Chapter +7, in cases where the desired function is +nested in more than one module, we’ve chosen to bring the parent module into +scope rather than the function. By doing so, we can easily use other functions +from `std::env`. It’s also less ambiguous than adding `use std::env::args` and +then calling the function with just `args`, because `args` might easily be +mistaken for a function that’s defined in the current module. + + > + > ### The `args` Function and Invalid Unicode + > + > Note that `std::env::args` will panic if any argument contains invalid + > Unicode. If your program needs to accept arguments containing invalid + > Unicode, use `std::env::args_os` instead. That function returns an iterator + > that produces `OsString` values instead of `String` values. We’ve chosen to + > use `std::env::args` here for simplicity because `OsString` values differ per + > platform and are more complex to work with than `String` values. + +On the first line of `main`, we call `env::args`, and we immediately use +`collect` to turn the iterator into a vector containing all the values produced +by the iterator. We can use the `collect` function to create many kinds of +collections, so we explicitly annotate the type of `args` to specify that we +want a vector of strings. Although you very rarely need to annotate types in +Rust, `collect` is one function you do often need to annotate because Rust +isn’t able to infer the kind of collection you want. + +Finally, we print the vector using the debug macro. Let’s try running the code +first with no arguments and then with two arguments: + +``` +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.61s + Running `target/debug/minigrep` +[src/main.rs:5:5] args = [ + "target/debug/minigrep", +] +``` + +``` +$ cargo run -- needle haystack + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.57s + Running `target/debug/minigrep needle haystack` +[src/main.rs:5:5] args = [ + "target/debug/minigrep", + "needle", + "haystack", +] +``` + +Notice that the first value in the vector is `"target/debug/minigrep"`, which +is the name of our binary. This matches the behavior of the arguments list in +C, letting programs use the name by which they were invoked in their execution. +It’s often convenient to have access to the program name in case you want to +print it in messages or change the behavior of the program based on what +command line alias was used to invoke the program. But for the purposes of this +chapter, we’ll ignore it and save only the two arguments we need. + +### Saving the Argument Values in Variables + +The program is currently able to access the values specified as command line +arguments. Now we need to save the values of the two arguments in variables so +we can use the values throughout the rest of the program. We do that in Listing +12-2. + + +Filename: src/main.rs + +``` +use std::env; + +fn main() { + let args: Vec = env::args().collect(); + + let query = &args[1]; + let file_path = &args[2]; + + println!("Searching for {query}"); + println!("In file {file_path}"); +} +``` + +Listing 12-2: Creating variables to hold the query argument and file path argument + +As we saw when we printed the vector, the program’s name takes up the first +value in the vector at `args[0]`, so we’re starting arguments at index 1. The +first argument `minigrep` takes is the string we’re searching for, so we put a +reference to the first argument in the variable `query`. The second argument +will be the file path, so we put a reference to the second argument in the +variable `file_path`. + +We temporarily print the values of these variables to prove that the code is +working as we intend. Let’s run this program again with the arguments `test` +and `sample.txt`: + +``` +$ cargo run -- test sample.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep test sample.txt` +Searching for test +In file sample.txt +``` + +Great, the program is working! The values of the arguments we need are being +saved into the right variables. Later we’ll add some error handling to deal +with certain potential erroneous situations, such as when the user provides no +arguments; for now, we’ll ignore that situation and work on adding file-reading +capabilities instead. + +## Reading a File + +Now we’ll add functionality to read the file specified in the `file_path` +argument. First we need a sample file to test it with: we’ll use a file with a +small amount of text over multiple lines with some repeated words. Listing 12-3 +has an Emily Dickinson poem that will work well! Create a file called +*poem.txt* at the root level of your project, and enter the poem “I’m Nobody! +Who are you?” + + +Filename: poem.txt + +``` +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! +``` + +Listing 12-3: A poem by Emily Dickinson makes a good test case. + +With the text in place, edit *src/main.rs* and add code to read the file, as +shown in Listing 12-4. + + +Filename: src/main.rs + +``` +use std::env; +use std::fs; + +fn main() { + // --snip-- + println!("In file {file_path}"); + + let contents = fs::read_to_string(file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} +``` + +Listing 12-4: Reading the contents of the file specified by the second argument + +First we bring in a relevant part of the standard library with a `use` +statement: we need `std::fs` to handle files. + +In `main`, the new statement `fs::read_to_string` takes the `file_path`, opens +that file, and returns a value of type `std::io::Result` that contains +the file’s contents. + +After that, we again add a temporary `println!` statement that prints the value +of `contents` after the file is read, so we can check that the program is +working so far. + +Let’s run this code with any string as the first command line argument (because +we haven’t implemented the searching part yet) and the *poem.txt* file as the +second argument: + +``` +$ cargo run -- the poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep the poem.txt` +Searching for the +In file poem.txt +With text: +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! + +``` + +Great! The code read and then printed the contents of the file. But the code +has a few flaws. At the moment, the `main` function has multiple +responsibilities: generally, functions are clearer and easier to maintain if +each function is responsible for only one idea. The other problem is that we’re +not handling errors as well as we could. The program is still small, so these +flaws aren’t a big problem, but as the program grows, it will be harder to fix +them cleanly. It’s a good practice to begin refactoring early on when +developing a program because it’s much easier to refactor smaller amounts of +code. We’ll do that next. + +## Refactoring to Improve Modularity and Error Handling + +To improve our program, we’ll fix four problems that have to do with the +program’s structure and how it’s handling potential errors. First, our `main` +function now performs two tasks: it parses arguments and reads files. As our +program grows, the number of separate tasks the `main` function handles will +increase. As a function gains responsibilities, it becomes more difficult to +reason about, harder to test, and harder to change without breaking one of its +parts. It’s best to separate functionality so each function is responsible for +one task. + +This issue also ties into the second problem: although `query` and `file_path` +are configuration variables to our program, variables like `contents` are used +to perform the program’s logic. The longer `main` becomes, the more variables +we’ll need to bring into scope; the more variables we have in scope, the harder +it will be to keep track of the purpose of each. It’s best to group the +configuration variables into one structure to make their purpose clear. + +The third problem is that we’ve used `expect` to print an error message when +reading the file fails, but the error message just prints `Should have been able to read the file`. Reading a file can fail in a number of ways: for +example, the file could be missing, or we might not have permission to open it. +Right now, regardless of the situation, we’d print the same error message for +everything, which wouldn’t give the user any information! + +Fourth, we use `expect` to handle an error, and if the user runs our program +without specifying enough arguments, they’ll get an `index out of bounds` error +from Rust that doesn’t clearly explain the problem. It would be best if all the +error-handling code were in one place so future maintainers had only one place +to consult the code if the error-handling logic needed to change. Having all the +error-handling code in one place will also ensure that we’re printing messages +that will be meaningful to our end users. + +Let’s address these four problems by refactoring our project. + +### Separation of Concerns for Binary Projects + +The organizational problem of allocating responsibility for multiple tasks to +the `main` function is common to many binary projects. As a result, the Rust +community has developed guidelines for splitting the separate concerns of a +binary program when `main` starts getting large. This process has the following +steps: + +* Split your program into a *main.rs* file and a *lib.rs* file and move your + program’s logic to *lib.rs*. +* As long as your command line parsing logic is small, it can remain in + *main.rs*. +* When the command line parsing logic starts getting complicated, extract it + from *main.rs* and move it to *lib.rs*. + +The responsibilities that remain in the `main` function after this process +should be limited to the following: + +* Calling the command line parsing logic with the argument values +* Setting up any other configuration +* Calling a `run` function in *lib.rs* +* Handling the error if `run` returns an error + +This pattern is about separating concerns: *main.rs* handles running the +program and *lib.rs* handles all the logic of the task at hand. Because you +can’t test the `main` function directly, this structure lets you test all of +your program’s logic by moving it into functions in *lib.rs*. The code that +remains in *main.rs* will be small enough to verify its correctness by reading +it. Let’s rework our program by following this process. + +#### Extracting the Argument Parser + +We’ll extract the functionality for parsing arguments into a function that +`main` will call to prepare for moving the command line parsing logic to +*src/lib.rs*. Listing 12-5 shows the new start of `main` that calls a new +function `parse_config`, which we’ll define in *src/main.rs* for the moment. + + +Filename: src/main.rs + +``` +fn main() { + let args: Vec = env::args().collect(); + + let (query, file_path) = parse_config(&args); + + // --snip-- +} + +fn parse_config(args: &[String]) -> (&str, &str) { + let query = &args[1]; + let file_path = &args[2]; + + (query, file_path) +} +``` + +Listing 12-5: Extracting a parse_config function from main + +We’re still collecting the command line arguments into a vector, but instead of +assigning the argument value at index 1 to the variable `query` and the +argument value at index 2 to the variable `file_path` within the `main` +function, we pass the whole vector to the `parse_config` function. The +`parse_config` function then holds the logic that determines which argument +goes in which variable and passes the values back to `main`. We still create +the `query` and `file_path` variables in `main`, but `main` no longer has the +responsibility of determining how the command line arguments and variables +correspond. + +This rework may seem like overkill for our small program, but we’re refactoring +in small, incremental steps. After making this change, run the program again to +verify that the argument parsing still works. It’s good to check your progress +often, to help identify the cause of problems when they occur. + +#### Grouping Configuration Values + +We can take another small step to improve the `parse_config` function further. +At the moment, we’re returning a tuple, but then we immediately break that +tuple into individual parts again. This is a sign that perhaps we don’t have +the right abstraction yet. + +Another indicator that shows there’s room for improvement is the `config` part +of `parse_config`, which implies that the two values we return are related and +are both part of one configuration value. We’re not currently conveying this +meaning in the structure of the data other than by grouping the two values into +a tuple; we’ll instead put the two values into one struct and give each of the +struct fields a meaningful name. Doing so will make it easier for future +maintainers of this code to understand how the different values relate to each +other and what their purpose is. + +Listing 12-6 shows the improvements to the `parse_config` function. + + +Filename: src/main.rs + +``` +fn main() { + let args: Vec = env::args().collect(); + + let config = parse_config(&args); + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + // --snip-- +} + +struct Config { + query: String, + file_path: String, +} + +fn parse_config(args: &[String]) -> Config { + let query = args[1].clone(); + let file_path = args[2].clone(); + + Config { query, file_path } +} +``` + +Listing 12-6: Refactoring parse_config to return an instance of a Config struct + +We’ve added a struct named `Config` defined to have fields named `query` and +`file_path`. The signature of `parse_config` now indicates that it returns a +`Config` value. In the body of `parse_config`, where we used to return +string slices that reference `String` values in `args`, we now define `Config` +to contain owned `String` values. The `args` variable in `main` is the owner of +the argument values and is only letting the `parse_config` function borrow +them, which means we’d violate Rust’s borrowing rules if `Config` tried to take +ownership of the values in `args`. + +There are a number of ways we could manage the `String` data; the easiest, +though somewhat inefficient, route is to call the `clone` method on the values. +This will make a full copy of the data for the `Config` instance to own, which +takes more time and memory than storing a reference to the string data. +However, cloning the data also makes our code very straightforward because we +don’t have to manage the lifetimes of the references; in this circumstance, +giving up a little performance to gain simplicity is a worthwhile trade-off. + + > + > ### The Trade-Offs of Using `clone` + > + > There’s a tendency among many Rustaceans to avoid using `clone` to fix + > ownership problems because of its runtime cost. In + > Chapter 13, you’ll learn how to use more efficient + > methods in this type of situation. But for now, it’s okay to copy a few + > strings to continue making progress because you’ll make these copies only + > once and your file path and query string are very small. It’s better to have + > a working program that’s a bit inefficient than to try to hyperoptimize code + > on your first pass. As you become more experienced with Rust, it’ll be + > easier to start with the most efficient solution, but for now, it’s + > perfectly acceptable to call `clone`. + +We’ve updated `main` so it places the instance of `Config` returned by +`parse_config` into a variable named `config`, and we updated the code that +previously used the separate `query` and `file_path` variables so it now uses +the fields on the `Config` struct instead. + +Now our code more clearly conveys that `query` and `file_path` are related and +that their purpose is to configure how the program will work. Any code that +uses these values knows to find them in the `config` instance in the fields +named for their purpose. + +#### Creating a Constructor for `Config` + +So far, we’ve extracted the logic responsible for parsing the command line +arguments from `main` and placed it in the `parse_config` function. Doing so +helped us see that the `query` and `file_path` values were related, and that +relationship should be conveyed in our code. We then added a `Config` struct to +name the related purpose of `query` and `file_path` and to be able to return the +values’ names as struct field names from the `parse_config` function. + +So now that the purpose of the `parse_config` function is to create a `Config` +instance, we can change `parse_config` from a plain function to a function +named `new` that is associated with the `Config` struct. Making this change +will make the code more idiomatic. We can create instances of types in the +standard library, such as `String`, by calling `String::new`. Similarly, by +changing `parse_config` into a `new` function associated with `Config`, we’ll +be able to create instances of `Config` by calling `Config::new`. Listing 12-7 +shows the changes we need to make. + + +Filename: src/main.rs + +``` +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::new(&args); + + // --snip-- +} + +// --snip-- + +impl Config { + fn new(args: &[String]) -> Config { + let query = args[1].clone(); + let file_path = args[2].clone(); + + Config { query, file_path } + } +} +``` + +Listing 12-7: Changing parse_config into Config::new + +We’ve updated `main` where we were calling `parse_config` to instead call +`Config::new`. We’ve changed the name of `parse_config` to `new` and moved it +within an `impl` block, which associates the `new` function with `Config`. Try +compiling this code again to make sure it works. + +### Fixing the Error Handling + +Now we’ll work on fixing our error handling. Recall that attempting to access +the values in the `args` vector at index 1 or index 2 will cause the program to +panic if the vector contains fewer than three items. Try running the program +without any arguments; it will look like this: + +``` +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep` +thread 'main' panicked at src/main.rs:27:21: +index out of bounds: the len is 1 but the index is 1 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +The line `index out of bounds: the len is 1 but the index is 1` is an error +message intended for programmers. It won’t help our end users understand what +they should do instead. Let’s fix that now. + +#### Improving the Error Message + +In Listing 12-8, we add a check in the `new` function that will verify that the +slice is long enough before accessing index 1 and index 2. If the slice isn’t +long enough, the program panics and displays a better error message. + + +Filename: src/main.rs + +``` + // --snip-- + fn new(args: &[String]) -> Config { + if args.len() < 3 { + panic!("not enough arguments"); + } + // --snip-- +``` + +Listing 12-8: Adding a check for the number of arguments + +This code is similar to the `Guess::new` function we wrote in Listing +9-13, where we called `panic!` when the +`value` argument was out of the range of valid values. Instead of checking for +a range of values here, we’re checking that the length of `args` is at least +`3` and the rest of the function can operate under the assumption that this +condition has been met. If `args` has fewer than three items, this condition +will be `true`, and we call the `panic!` macro to end the program immediately. + +With these extra few lines of code in `new`, let’s run the program without any +arguments again to see what the error looks like now: + +``` +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep` +thread 'main' panicked at src/main.rs:26:13: +not enough arguments +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +This output is better: we now have a reasonable error message. However, we also +have extraneous information we don’t want to give to our users. Perhaps the +technique we used in Listing 9-13 isn’t the best one to use here: a call to +`panic!` is more appropriate for a programming problem than a usage problem, +as discussed in Chapter 9. Instead, +we’ll use the other technique you learned about in Chapter 9—returning a +`Result` that indicates either success or an error. + + + + + +#### Returning a `Result` Instead of Calling `panic!` + +We can instead return a `Result` value that will contain a `Config` instance in +the successful case and will describe the problem in the error case. We’re also +going to change the function name from `new` to `build` because many +programmers expect `new` functions to never fail. When `Config::build` is +communicating to `main`, we can use the `Result` type to signal there was a +problem. Then we can change `main` to convert an `Err` variant into a more +practical error for our users without the surrounding text about `thread 'main'` and `RUST_BACKTRACE` that a call to `panic!` causes. + +Listing 12-9 shows the changes we need to make to the return value of the +function we’re now calling `Config::build` and the body of the function needed +to return a `Result`. Note that this won’t compile until we update `main` as +well, which we’ll do in the next listing. + + +Filename: src/main.rs + +``` +impl Config { + fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + Ok(Config { query, file_path }) + } +} +``` + +Listing 12-9: Returning a Result from Config::build + +Our `build` function returns a `Result` with a `Config` instance in the success +case and a string literal in the error case. Our error values will always be +string literals that have the `'static` lifetime. + +We’ve made two changes in the body of the function: instead of calling `panic!` +when the user doesn’t pass enough arguments, we now return an `Err` value, and +we’ve wrapped the `Config` return value in an `Ok`. These changes make the +function conform to its new type signature. + +Returning an `Err` value from `Config::build` allows the `main` function to +handle the `Result` value returned from the `build` function and exit the +process more cleanly in the error case. + + + + + +#### Calling `Config::build` and Handling Errors + +To handle the error case and print a user-friendly message, we need to update +`main` to handle the `Result` being returned by `Config::build`, as shown in +Listing 12-10. We’ll also take the responsibility of exiting the command line +tool with a nonzero error code away from `panic!` and instead implement it by +hand. A nonzero exit status is a convention to signal to the process that +called our program that the program exited with an error state. + + +Filename: src/main.rs + +``` +use std::process; + +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + println!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + // --snip-- +``` + +Listing 12-10: Exiting with an error code if building a Config fails + +In this listing, we’ve used a method we haven’t covered in detail yet: +`unwrap_or_else`, which is defined on `Result` by the standard library. +Using `unwrap_or_else` allows us to define some custom, non-`panic!` error +handling. If the `Result` is an `Ok` value, this method’s behavior is similar +to `unwrap`: it returns the inner value that `Ok` is wrapping. However, if the +value is an `Err` value, this method calls the code in the *closure*, which is +an anonymous function we define and pass as an argument to `unwrap_or_else`. +We’ll cover closures in more detail in Chapter 13. For +now, you just need to know that `unwrap_or_else` will pass the inner value of +the `Err`, which in this case is the static string `"not enough arguments"` +that we added in Listing 12-9, to our closure in the argument `err` that +appears between the vertical pipes. The code in the closure can then use the +`err` value when it runs. + +We’ve added a new `use` line to bring `process` from the standard library into +scope. The code in the closure that will be run in the error case is only two +lines: we print the `err` value and then call `process::exit`. The +`process::exit` function will stop the program immediately and return the +number that was passed as the exit status code. This is similar to the +`panic!`-based handling we used in Listing 12-8, but we no longer get all the +extra output. Let’s try it: + +``` +$ cargo run + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s + Running `target/debug/minigrep` +Problem parsing arguments: not enough arguments +``` + +Great! This output is much friendlier for our users. + +### Extracting Logic from `main` + +Now that we’ve finished refactoring the configuration parsing, let’s turn to +the program’s logic. As we stated in “Separation of Concerns for Binary +Projects”, we’ll +extract a function named `run` that will hold all the logic currently in the +`main` function that isn’t involved with setting up configuration or handling +errors. When we’re done, `main` will be concise and easy to verify by +inspection, and we’ll be able to write tests for all the other logic. + +Listing 12-11 shows the extracted `run` function. For now, we’re just making +the small, incremental improvement of extracting the function. We’re still +defining the function in *src/main.rs*. + + +Filename: src/main.rs + +``` +fn main() { + // --snip-- + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + run(config); +} + +fn run(config: Config) { + let contents = fs::read_to_string(config.file_path) + .expect("Should have been able to read the file"); + + println!("With text:\n{contents}"); +} + +// --snip-- +``` + +Listing 12-11: Extracting a run function containing the rest of the program logic + +The `run` function now contains all the remaining logic from `main`, starting +from reading the file. The `run` function takes the `Config` instance as an +argument. + +#### Returning Errors from the `run` Function + +With the remaining program logic separated into the `run` function, we can +improve the error handling, as we did with `Config::build` in Listing 12-9. +Instead of allowing the program to panic by calling `expect`, the `run` +function will return a `Result` when something goes wrong. This will let +us further consolidate the logic around handling errors into `main` in a +user-friendly way. Listing 12-12 shows the changes we need to make to the +signature and body of `run`. + + +Filename: src/main.rs + +``` +use std::error::Error; + +// --snip-- + +fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + println!("With text:\n{contents}"); + + Ok(()) +} +``` + +Listing 12-12: Changing the run function to return Result + +We’ve made three significant changes here. First, we changed the return type of +the `run` function to `Result<(), Box>`. This function previously +returned the unit type, `()`, and we keep that as the value returned in the +`Ok` case. + +For the error type, we used the *trait object* `Box` (and we’ve +brought `std::error::Error` into scope with a `use` statement at the top). +We’ll cover trait objects in Chapter 17. For now, just +know that `Box` means the function will return a type that +implements the `Error` trait, but we don’t have to specify what particular type +the return value will be. This gives us flexibility to return error values that +may be of different types in different error cases. The `dyn` keyword is short +for *dynamic*. + +Second, we’ve removed the call to `expect` in favor of the `?` operator, as we +talked about in Chapter 9. Rather than +`panic!` on an error, `?` will return the error value from the current function +for the caller to handle. + +Third, the `run` function now returns an `Ok` value in the success case. +We’ve declared the `run` function’s success type as `()` in the signature, +which means we need to wrap the unit type value in the `Ok` value. This +`Ok(())` syntax might look a bit strange at first, but using `()` like this is +the idiomatic way to indicate that we’re calling `run` for its side effects +only; it doesn’t return a value we need. + +When you run this code, it will compile but will display a warning: + +``` +$ cargo run -- the poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) +warning: unused `Result` that must be used + --> src/main.rs:19:5 + | +19 | run(config); + | ^^^^^^^^^^^ + | + = note: this `Result` may be an `Err` variant, which should be handled + = note: `#[warn(unused_must_use)]` on by default +help: use `let _ = ...` to ignore the resulting value + | +19 | let _ = run(config); + | +++++++ + +warning: `minigrep` (bin "minigrep") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71s + Running `target/debug/minigrep the poem.txt` +Searching for the +In file poem.txt +With text: +I'm nobody! Who are you? +Are you nobody, too? +Then there's a pair of us - don't tell! +They'd banish us, you know. + +How dreary to be somebody! +How public, like a frog +To tell your name the livelong day +To an admiring bog! + +``` + +Rust tells us that our code ignored the `Result` value and the `Result` value +might indicate that an error occurred. But we’re not checking to see whether or +not there was an error, and the compiler reminds us that we probably meant to +have some error-handling code here! Let’s rectify that problem now. + +#### Handling Errors Returned from `run` in `main` + +We’ll check for errors and handle them using a technique similar to one we used +with `Config::build` in Listing 12-10, but with a slight difference: + +Filename: src/main.rs + +``` +fn main() { + // --snip-- + + println!("Searching for {}", config.query); + println!("In file {}", config.file_path); + + if let Err(e) = run(config) { + println!("Application error: {e}"); + process::exit(1); + } +} +``` + +We use `if let` rather than `unwrap_or_else` to check whether `run` returns an +`Err` value and to call `process::exit(1)` if it does. The `run` function +doesn’t return a value that we want to `unwrap` in the same way that +`Config::build` returns the `Config` instance. Because `run` returns `()` in +the success case, we only care about detecting an error, so we don’t need +`unwrap_or_else` to return the unwrapped value, which would only be `()`. + +The bodies of the `if let` and the `unwrap_or_else` functions are the same in +both cases: we print the error and exit. + +### Splitting Code into a Library Crate + +Our `minigrep` project is looking good so far! Now we’ll split the +*src/main.rs* file and put some code into the *src/lib.rs* file. That way, we +can test the code and have a *src/main.rs* file with fewer responsibilities. + +Let’s move all the code that isn’t in the `main` function from *src/main.rs* to +*src/lib.rs*: + +* The `run` function definition +* The relevant `use` statements +* The definition of `Config` +* The `Config::build` function definition + +The contents of *src/lib.rs* should have the signatures shown in Listing 12-13 +(we’ve omitted the bodies of the functions for brevity). Note that this won’t +compile until we modify *src/main.rs* in Listing 12-14. + + +Filename: src/lib.rs + +``` +use std::error::Error; +use std::fs; + +pub struct Config { + pub query: String, + pub file_path: String, +} + +impl Config { + pub fn build(args: &[String]) -> Result { + // --snip-- + } +} + +pub fn run(config: Config) -> Result<(), Box> { + // --snip-- +} +``` + +Listing 12-13: Moving Config and run into src/lib.rs + +We’ve made liberal use of the `pub` keyword: on `Config`, on its fields and its +`build` method, and on the `run` function. We now have a library crate that has +a public API we can test! + +Now we need to bring the code we moved to *src/lib.rs* into the scope of the +binary crate in *src/main.rs*, as shown in Listing 12-14. + + +Filename: src/main.rs + +``` +use std::env; +use std::process; + +use minigrep::Config; + +fn main() { + // --snip-- + if let Err(e) = minigrep::run(config) { + // --snip-- + } +} +``` + +Listing 12-14: Using the minigrep library crate in src/main.rs + +We add a `use minigrep::Config` line to bring the `Config` type from the +library crate into the binary crate’s scope, and we prefix the `run` function +with our crate name. Now all the functionality should be connected and should +work. Run the program with `cargo run` and make sure everything works correctly. + +Whew! That was a lot of work, but we’ve set ourselves up for success in the +future. Now it’s much easier to handle errors, and we’ve made the code more +modular. Almost all of our work will be done in *src/lib.rs* from here on out. + +Let’s take advantage of this newfound modularity by doing something that would +have been difficult with the old code but is easy with the new code: we’ll +write some tests! + +## Developing the Library’s Functionality with Test-Driven Development + +Now that we’ve extracted the logic into *src/lib.rs* and left the argument +collecting and error handling in *src/main.rs*, it’s much easier to write tests +for the core functionality of our code. We can call functions directly with +various arguments and check return values without having to call our binary +from the command line. + +In this section, we’ll add the searching logic to the `minigrep` program using +the test-driven development (TDD) process with the following steps: + +1. Write a test that fails and run it to make sure it fails for the reason you + expect. +1. Write or modify just enough code to make the new test pass. +1. Refactor the code you just added or changed and make sure the tests continue + to pass. +1. Repeat from step 1! + +Though it’s just one of many ways to write software, TDD can help drive code +design. Writing the test before you write the code that makes the test pass +helps to maintain high test coverage throughout the process. + +We’ll test-drive the implementation of the functionality that will actually do +the searching for the query string in the file contents and produce a list of +lines that match the query. We’ll add this functionality in a function called +`search`. + +### Writing a Failing Test + +Because we don’t need them anymore, let’s remove the `println!` statements from +*src/lib.rs* and *src/main.rs* that we used to check the program’s behavior. +Then, in *src/lib.rs*, we’ll add a `tests` module with a test function, as we +did in Chapter 11. The test function specifies +the behavior we want the `search` function to have: it will take a query and +the text to search, and it will return only the lines from the text that +contain the query. Listing 12-15 shows this test, which won’t compile yet. + + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn one_result() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } +} +``` + +Listing 12-15: Creating a failing test for the search function we wish we had + +This test searches for the string `"duct"`. The text we’re searching is three +lines, only one of which contains `"duct"` (note that the backslash after the +opening double quote tells Rust not to put a newline character at the beginning +of the contents of this string literal). We assert that the value returned from +the `search` function contains only the line we expect. + +We aren’t yet able to run this test and watch it fail because the test doesn’t +even compile: the `search` function doesn’t exist yet! In accordance with TDD +principles, we’ll add just enough code to get the test to compile and run by +adding a definition of the `search` function that always returns an empty +vector, as shown in Listing 12-16. Then the test should compile and fail +because an empty vector doesn’t match a vector containing the line `"safe, fast, productive."` + + +Filename: src/lib.rs + +``` +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + vec![] +} +``` + +Listing 12-16: Defining just enough of the search function so our test will compile + +Notice that we need to define an explicit lifetime `'a` in the signature of +`search` and use that lifetime with the `contents` argument and the return +value. Recall in Chapter 10 that the lifetime +parameters specify which argument lifetime is connected to the lifetime of the +return value. In this case, we indicate that the returned vector should contain +string slices that reference slices of the argument `contents` (rather than the +argument `query`). + +In other words, we tell Rust that the data returned by the `search` function +will live as long as the data passed into the `search` function in the +`contents` argument. This is important! The data referenced *by* a slice needs +to be valid for the reference to be valid; if the compiler assumes we’re making +string slices of `query` rather than `contents`, it will do its safety checking +incorrectly. + +If we forget the lifetime annotations and try to compile this function, we’ll +get this error: + +``` +$ cargo build + Compiling minigrep v0.1.0 (file:///projects/minigrep) +error[E0106]: missing lifetime specifier + --> src/lib.rs:28:51 + | +28 | pub fn search(query: &str, contents: &str) -> Vec<&str> { + | ---- ---- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `query` or `contents` +help: consider introducing a named lifetime parameter + | +28 | pub fn search<'a>(query: &'a str, contents: &'a str) -> Vec<&'a str> { + | ++++ ++ ++ ++ + +For more information about this error, try `rustc --explain E0106`. +error: could not compile `minigrep` (lib) due to 1 previous error +``` + +Rust can’t possibly know which of the two arguments we need, so we need to tell +it explicitly. Because `contents` is the argument that contains all of our text +and we want to return the parts of that text that match, we know `contents` is +the argument that should be connected to the return value using the lifetime +syntax. + +Other programming languages don’t require you to connect arguments to return +values in the signature, but this practice will get easier over time. You might +want to compare this example with the examples in the “Validating References +with Lifetimes” section +in Chapter 10. + +Now let’s run the test: + +``` +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.97s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 1 test +test tests::one_result ... FAILED + +failures: + +---- tests::one_result stdout ---- +thread 'tests::one_result' panicked at src/lib.rs:44:9: +assertion `left == right` failed + left: ["safe, fast, productive."] + right: [] +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + + +failures: + tests::one_result + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +error: test failed, to rerun pass `--lib` +``` + +Great, the test fails, exactly as we expected. Let’s get the test to pass! + +### Writing Code to Pass the Test + +Currently, our test is failing because we always return an empty vector. To fix +that and implement `search`, our program needs to follow these steps: + +1. Iterate through each line of the contents. +1. Check whether the line contains our query string. +1. If it does, add it to the list of values we’re returning. +1. If it doesn’t, do nothing. +1. Return the list of results that match. + +Let’s work through each step, starting with iterating through lines. + +#### Iterating Through Lines with the `lines` Method + +Rust has a helpful method to handle line-by-line iteration of strings, +conveniently named `lines`, that works as shown in Listing 12-17. Note that +this won’t compile yet. + + +Filename: src/lib.rs + +``` +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + for line in contents.lines() { + // do something with line + } +} +``` + +Listing 12-17: Iterating through each line in contents + +The `lines` method returns an iterator. We’ll talk about iterators in depth in +Chapter 13, but recall that you saw this way +of using an iterator in Listing 3-5, where we used a +`for` loop with an iterator to run some code on each item in a collection. + +#### Searching Each Line for the Query + +Next, we’ll check whether the current line contains our query string. +Fortunately, strings have a helpful method named `contains` that does this for +us! Add a call to the `contains` method in the `search` function, as shown in +Listing 12-18. Note that this still won’t compile yet. + + +Filename: src/lib.rs + +``` +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + for line in contents.lines() { + if line.contains(query) { + // do something with line + } + } +} +``` + +Listing 12-18: Adding functionality to see whether the line contains the string in query + +At the moment, we’re building up functionality. To get the code to compile, we +need to return a value from the body as we indicated we would in the function +signature. + +#### Storing Matching Lines + +To finish this function, we need a way to store the matching lines that we want +to return. For that, we can make a mutable vector before the `for` loop and +call the `push` method to store a `line` in the vector. After the `for` loop, +we return the vector, as shown in Listing 12-19. + + +Filename: src/lib.rs + +``` +pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} +``` + +Listing 12-19: Storing the lines that match so we can return them + +Now the `search` function should return only the lines that contain `query`, +and our test should pass. Let’s run the test: + +``` +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.22s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 1 test +test tests::one_result ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests minigrep + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Our test passed, so we know it works! + +At this point, we could consider opportunities for refactoring the +implementation of the search function while keeping the tests passing to +maintain the same functionality. The code in the search function isn’t too bad, +but it doesn’t take advantage of some useful features of iterators. We’ll +return to this example in Chapter 13, where +we’ll explore iterators in detail, and look at how to improve it. + +#### Using the `search` Function in the `run` Function + +Now that the `search` function is working and tested, we need to call `search` +from our `run` function. We need to pass the `config.query` value and the +`contents` that `run` reads from the file to the `search` function. Then `run` +will print each line returned from `search`: + +Filename: src/lib.rs + +``` +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + for line in search(&config.query, &contents) { + println!("{line}"); + } + + Ok(()) +} +``` + +We’re still using a `for` loop to return each line from `search` and print it. + +Now the entire program should work! Let’s try it out, first with a word that +should return exactly one line from the Emily Dickinson poem: *frog*. + +``` +$ cargo run -- frog poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s + Running `target/debug/minigrep frog poem.txt` +How public, like a frog +``` + +Cool! Now let’s try a word that will match multiple lines, like *body*: + +``` +$ cargo run -- body poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep body poem.txt` +I'm nobody! Who are you? +Are you nobody, too? +How dreary to be somebody! +``` + +And finally, let’s make sure that we don’t get any lines when we search for a +word that isn’t anywhere in the poem, such as *monomorphization*: + +``` +$ cargo run -- monomorphization poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep monomorphization poem.txt` +``` + +Excellent! We’ve built our own mini version of a classic tool and learned a lot +about how to structure applications. We’ve also learned a bit about file input +and output, lifetimes, testing, and command line parsing. + +To round out this project, we’ll briefly demonstrate how to work with +environment variables and how to print to standard error, both of which are +useful when you’re writing command line programs. + +## Working with Environment Variables + +We’ll improve `minigrep` by adding an extra feature: an option for +case-insensitive searching that the user can turn on via an environment +variable. We could make this feature a command line option and require that +users enter it each time they want it to apply, but by instead making it an +environment variable, we allow our users to set the environment variable once +and have all their searches be case insensitive in that terminal session. + +### Writing a Failing Test for the Case-Insensitive `search` Function + +We first add a new `search_case_insensitive` function that will be called when +the environment variable has a value. We’ll continue to follow the TDD process, +so the first step is again to write a failing test. We’ll add a new test for +the new `search_case_insensitive` function and rename our old test from +`one_result` to `case_sensitive` to clarify the differences between the two +tests, as shown in Listing 12-20. + + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn case_sensitive() { + let query = "duct"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Duct tape."; + + assert_eq!(vec!["safe, fast, productive."], search(query, contents)); + } + + #[test] + fn case_insensitive() { + let query = "rUsT"; + let contents = "\ +Rust: +safe, fast, productive. +Pick three. +Trust me."; + + assert_eq!( + vec!["Rust:", "Trust me."], + search_case_insensitive(query, contents) + ); + } +} +``` + +Listing 12-20: Adding a new failing test for the case-insensitive function we’re about to add + +Note that we’ve edited the old test’s `contents` too. We’ve added a new line +with the text `"Duct tape."` using a capital *D* that shouldn’t match the query +`"duct"` when we’re searching in a case-sensitive manner. Changing the old test +in this way helps ensure that we don’t accidentally break the case-sensitive +search functionality that we’ve already implemented. This test should pass now +and should continue to pass as we work on the case-insensitive search. + +The new test for the case-*insensitive* search uses `"rUsT"` as its query. In +the `search_case_insensitive` function we’re about to add, the query `"rUsT"` +should match the line containing `"Rust:"` with a capital *R* and match the +line `"Trust me."` even though both have different casing from the query. This +is our failing test, and it will fail to compile because we haven’t yet defined +the `search_case_insensitive` function. Feel free to add a skeleton +implementation that always returns an empty vector, similar to the way we did +for the `search` function in Listing 12-16 to see the test compile and fail. + +### Implementing the `search_case_insensitive` Function + +The `search_case_insensitive` function, shown in Listing 12-21, will be almost +the same as the `search` function. The only difference is that we’ll lowercase +the `query` and each `line` so that whatever the case of the input arguments, +they’ll be the same case when we check whether the line contains the query. + + +Filename: src/lib.rs + +``` +pub fn search_case_insensitive<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let query = query.to_lowercase(); + let mut results = Vec::new(); + + for line in contents.lines() { + if line.to_lowercase().contains(&query) { + results.push(line); + } + } + + results +} +``` + +Listing 12-21: Defining the search_case_insensitive function to lowercase the query and the line before comparing them + +First we lowercase the `query` string and store it in a shadowed variable with +the same name. Calling `to_lowercase` on the query is necessary so that no +matter whether the user’s query is `"rust"`, `"RUST"`, `"Rust"`, or `"rUsT"`, +we’ll treat the query as if it were `"rust"` and be insensitive to the case. +While `to_lowercase` will handle basic Unicode, it won’t be 100% accurate. If +we were writing a real application, we’d want to do a bit more work here, but +this section is about environment variables, not Unicode, so we’ll leave it at +that here. + +Note that `query` is now a `String` rather than a string slice because calling +`to_lowercase` creates new data rather than referencing existing data. Say the +query is `"rUsT"`, as an example: that string slice doesn’t contain a lowercase +`u` or `t` for us to use, so we have to allocate a new `String` containing +`"rust"`. When we pass `query` as an argument to the `contains` method now, we +need to add an ampersand because the signature of `contains` is defined to take +a string slice. + +Next, we add a call to `to_lowercase` on each `line` to lowercase all +characters. Now that we’ve converted `line` and `query` to lowercase, we’ll +find matches no matter what the case of the query is. + +Let’s see if this implementation passes the tests: + +``` +$ cargo test + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `test` profile [unoptimized + debuginfo] target(s) in 1.33s + Running unittests src/lib.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 2 tests +test tests::case_insensitive ... ok +test tests::case_sensitive ... ok + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/minigrep-9cd200e5fac0fc94) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests minigrep + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + +``` + +Great! They passed. Now, let’s call the new `search_case_insensitive` function +from the `run` function. First we’ll add a configuration option to the `Config` +struct to switch between case-sensitive and case-insensitive search. Adding +this field will cause compiler errors because we aren’t initializing this field +anywhere yet: + +Filename: src/lib.rs + +``` +pub struct Config { + pub query: String, + pub file_path: String, + pub ignore_case: bool, +} +``` + +We added the `ignore_case` field that holds a Boolean. Next, we need the `run` +function to check the `ignore_case` field’s value and use that to decide +whether to call the `search` function or the `search_case_insensitive` +function, as shown in Listing 12-22. This still won’t compile yet. + + +Filename: src/lib.rs + +``` +pub fn run(config: Config) -> Result<(), Box> { + let contents = fs::read_to_string(config.file_path)?; + + let results = if config.ignore_case { + search_case_insensitive(&config.query, &contents) + } else { + search(&config.query, &contents) + }; + + for line in results { + println!("{line}"); + } + + Ok(()) +} +``` + +Listing 12-22: Calling either search or search_case_insensitive based on the value in config.ignore_case + +Finally, we need to check for the environment variable. The functions for +working with environment variables are in the `env` module in the standard +library, so we bring that module into scope at the top of *src/lib.rs*. Then +we’ll use the `var` function from the `env` module to check to see if any value +has been set for an environment variable named `IGNORE_CASE`, as shown in +Listing 12-23. + + +Filename: src/lib.rs + +``` +use std::env; +// --snip-- + +impl Config { + pub fn build(args: &[String]) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +``` + +Listing 12-23: Checking for any value in an environment variable named IGNORE_CASE + +Here, we create a new variable, `ignore_case`. To set its value, we call the +`env::var` function and pass it the name of the `IGNORE_CASE` environment +variable. The `env::var` function returns a `Result` that will be the +successful `Ok` variant that contains the value of the environment variable if +the environment variable is set to any value. It will return the `Err` variant +if the environment variable is not set. + +We’re using the `is_ok` method on the `Result` to check whether the environment +variable is set, which means the program should do a case-insensitive search. +If the `IGNORE_CASE` environment variable isn’t set to anything, `is_ok` will +return `false` and the program will perform a case-sensitive search. We don’t +care about the *value* of the environment variable, just whether it’s set or +unset, so we’re checking `is_ok` rather than using `unwrap`, `expect`, or any +of the other methods we’ve seen on `Result`. + +We pass the value in the `ignore_case` variable to the `Config` instance so the +`run` function can read that value and decide whether to call +`search_case_insensitive` or `search`, as we implemented in Listing 12-22. + +Let’s give it a try! First we’ll run our program without the environment +variable set and with the query `to`, which should match any line that contains +the word *to* in all lowercase: + +``` +$ cargo run -- to poem.txt + Compiling minigrep v0.1.0 (file:///projects/minigrep) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/minigrep to poem.txt` +Are you nobody, too? +How dreary to be somebody! +``` + +Looks like that still works! Now let’s run the program with `IGNORE_CASE` set +to `1` but with the same query *to*: + +``` +$ IGNORE_CASE=1 cargo run -- to poem.txt +``` + +If you’re using PowerShell, you will need to set the environment variable and +run the program as separate commands: + +``` +PS> $Env:IGNORE_CASE=1; cargo run -- to poem.txt +``` + +This will make `IGNORE_CASE` persist for the remainder of your shell session. +It can be unset with the `Remove-Item` cmdlet: + +``` +PS> Remove-Item Env:IGNORE_CASE +``` + +We should get lines that contain *to* that might have uppercase letters: + + + +``` +Are you nobody, too? +How dreary to be somebody! +To tell your name the livelong day +To an admiring bog! +``` + +Excellent, we also got lines containing *To*! Our `minigrep` program can now do +case-insensitive searching controlled by an environment variable. Now you know +how to manage options set using either command line arguments or environment +variables. + +Some programs allow arguments *and* environment variables for the same +configuration. In those cases, the programs decide that one or the other takes +precedence. For another exercise on your own, try controlling case sensitivity +through either a command line argument or an environment variable. Decide +whether the command line argument or the environment variable should take +precedence if the program is run with one set to case sensitive and one set to +ignore case. + +The `std::env` module contains many more useful features for dealing with +environment variables: check out its documentation to see what is available. + +## Writing Error Messages to Standard Error Instead of Standard Output + +At the moment, we’re writing all of our output to the terminal using the +`println!` macro. In most terminals, there are two kinds of output: *standard +output* (`stdout`) for general information and *standard error* (`stderr`) for +error messages. This distinction enables users to choose to direct the +successful output of a program to a file but still print error messages to the +screen. + +The `println!` macro is only capable of printing to standard output, so we have +to use something else to print to standard error. + +### Checking Where Errors Are Written + +First let’s observe how the content printed by `minigrep` is currently being +written to standard output, including any error messages we want to write to +standard error instead. We’ll do that by redirecting the standard output stream +to a file while intentionally causing an error. We won’t redirect the standard +error stream, so any content sent to standard error will continue to display on +the screen. + +Command line programs are expected to send error messages to the standard error +stream so we can still see error messages on the screen even if we redirect the +standard output stream to a file. Our program is not currently well behaved: +we’re about to see that it saves the error message output to a file instead! + +To demonstrate this behavior, we’ll run the program with `>` and the file path, +*output.txt*, that we want to redirect the standard output stream to. We won’t +pass any arguments, which should cause an error: + +``` +$ cargo run > output.txt +``` + +The `>` syntax tells the shell to write the contents of standard output to +*output.txt* instead of the screen. We didn’t see the error message we were +expecting printed to the screen, so that means it must have ended up in the +file. This is what *output.txt* contains: + +``` +Problem parsing arguments: not enough arguments +``` + +Yup, our error message is being printed to standard output. It’s much more +useful for error messages like this to be printed to standard error so only +data from a successful run ends up in the file. We’ll change that. + +### Printing Errors to Standard Error + +We’ll use the code in Listing 12-24 to change how error messages are printed. +Because of the refactoring we did earlier in this chapter, all the code that +prints error messages is in one function, `main`. The standard library provides +the `eprintln!` macro that prints to the standard error stream, so let’s change +the two places we were calling `println!` to print errors to use `eprintln!` +instead. + + +Filename: src/main.rs + +``` +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + if let Err(e) = minigrep::run(config) { + eprintln!("Application error: {e}"); + process::exit(1); + } +} +``` + +Listing 12-24: Writing error messages to standard error instead of standard output using eprintln! + +Let’s now run the program again in the same way, without any arguments and +redirecting standard output with `>`: + +``` +$ cargo run > output.txt +Problem parsing arguments: not enough arguments +``` + +Now we see the error onscreen and *output.txt* contains nothing, which is the +behavior we expect of command line programs. + +Let’s run the program again with arguments that don’t cause an error but still +redirect standard output to a file, like so: + +``` +$ cargo run -- to poem.txt > output.txt +``` + +We won’t see any output to the terminal, and *output.txt* will contain our +results: + +Filename: output.txt + +``` +Are you nobody, too? +How dreary to be somebody! +``` + +This demonstrates that we’re now using standard output for successful output +and standard error for error output as appropriate. + +## Summary + +This chapter recapped some of the major concepts you’ve learned so far and +covered how to perform common I/O operations in Rust. By using command line +arguments, files, environment variables, and the `eprintln!` macro for printing +errors, you’re now prepared to write command line applications. Combined with +the concepts in previous chapters, your code will be well organized, store data +effectively in the appropriate data structures, handle errors nicely, and be +well tested. + +Next, we’ll explore some Rust features that were influenced by functional +languages: closures and iterators. diff --git a/rustbook-ru/nostarch/chapter13.md b/rustbook-ru/nostarch/chapter13.md new file mode 100644 index 000000000..52c1f5f97 --- /dev/null +++ b/rustbook-ru/nostarch/chapter13.md @@ -0,0 +1,1273 @@ + + +[TOC] + +# Functional Language Features: Iterators and Closures + +Rust’s design has taken inspiration from many existing languages and +techniques, and one significant influence is *functional programming*. +Programming in a functional style often includes using functions as values by +passing them in arguments, returning them from other functions, assigning them +to variables for later execution, and so forth. + +In this chapter, we won’t debate the issue of what functional programming is or +isn’t but will instead discuss some features of Rust that are similar to +features in many languages often referred to as functional. + +More specifically, we’ll cover: + +* *Closures*, a function-like construct you can store in a variable +* *Iterators*, a way of processing a series of elements +* How to use closures and iterators to improve the I/O project in Chapter 12 +* The performance of closures and iterators (spoiler alert: they’re faster than +you might think!) + +We’ve already covered some other Rust features, such as pattern matching and +enums, that are also influenced by the functional style. Because mastering +closures and iterators is an important part of writing idiomatic, fast Rust +code, we’ll devote this entire chapter to them. + +## Closures: Anonymous Functions That Capture Their Environment + +Rust’s closures are anonymous functions you can save in a variable or pass as +arguments to other functions. You can create the closure in one place and then +call the closure elsewhere to evaluate it in a different context. Unlike +functions, closures can capture values from the scope in which they’re defined. +We’ll demonstrate how these closure features allow for code reuse and behavior +customization. + +### Capturing the Environment with Closures + +We’ll first examine how we can use closures to capture values from the +environment they’re defined in for later use. Here’s the scenario: every so +often, our T-shirt company gives away an exclusive, limited-edition shirt to +someone on our mailing list as a promotion. People on the mailing list can +optionally add their favorite color to their profile. If the person chosen for +a free shirt has their favorite color set, they get that color shirt. If the +person hasn’t specified a favorite color, they get whatever color the company +currently has the most of. + +There are many ways to implement this. For this example, we’re going to use an +enum called `ShirtColor` that has the variants `Red` and `Blue` (limiting the +number of colors available for simplicity). We represent the company’s +inventory with an `Inventory` struct that has a field named `shirts` that +contains a `Vec` representing the shirt colors currently in stock. +The method `giveaway` defined on `Inventory` gets the optional shirt color +preference of the free-shirt winner, and returns the shirt color the person +will get. This setup is shown in Listing 13-1. + +Filename: src/main.rs + +``` +#[derive(Debug, PartialEq, Copy, Clone)] +enum ShirtColor { + Red, + Blue, +} + +struct Inventory { + shirts: Vec, +} + +impl Inventory { + fn giveaway( + &self, + user_preference: Option, + ) -> ShirtColor { + 1 user_preference.unwrap_or_else(|| self.most_stocked()) + } + + fn most_stocked(&self) -> ShirtColor { + let mut num_red = 0; + let mut num_blue = 0; + + for color in &self.shirts { + match color { + ShirtColor::Red => num_red += 1, + ShirtColor::Blue => num_blue += 1, + } + } + if num_red > num_blue { + ShirtColor::Red + } else { + ShirtColor::Blue + } + } +} + +fn main() { + let store = Inventory { + 2 shirts: vec![ + ShirtColor::Blue, + ShirtColor::Red, + ShirtColor::Blue, + ], + }; + + let user_pref1 = Some(ShirtColor::Red); + 3 let giveaway1 = store.giveaway(user_pref1); + println!( + "The user with preference {:?} gets {:?}", + user_pref1, giveaway1 + ); + + let user_pref2 = None; + 4 let giveaway2 = store.giveaway(user_pref2); + println!( + "The user with preference {:?} gets {:?}", + user_pref2, giveaway2 + ); +} +``` + +Listing 13-1: Shirt company giveaway situation + +The `store` defined in `main` has two blue shirts and one red shirt remaining +to distribute for this limited-edition promotion [2]. We call the `giveaway` +method for a user with a preference for a red shirt [3] and a user without any +preference [4]. + +Again, this code could be implemented in many ways, and here, to focus on +closures, we’ve stuck to concepts you’ve already learned, except for the body +of the `giveaway` method that uses a closure. In the `giveaway` method, we get +the user preference as a parameter of type `Option` and call the +`unwrap_or_else` method on `user_preference` [1]. The `unwrap_or_else` method +on `Option` is defined by the standard library. It takes one argument: a +closure without any arguments that returns a value `T` (the same type stored in +the `Some` variant of the `Option`, in this case `ShirtColor`). If the +`Option` is the `Some` variant, `unwrap_or_else` returns the value from +within the `Some`. If the `Option` is the `None` variant, `unwrap_or_else` +calls the closure and returns the value returned by the closure. + +We specify the closure expression `|| self.most_stocked()` as the argument to +`unwrap_or_else`. This is a closure that takes no parameters itself (if the +closure had parameters, they would appear between the two vertical pipes). The +body of the closure calls `self.most_stocked()`. We’re defining the closure +here, and the implementation of `unwrap_or_else` will evaluate the closure +later if the result is needed. + +Running this code prints the following: + +``` +The user with preference Some(Red) gets Red +The user with preference None gets Blue +``` + +One interesting aspect here is that we’ve passed a closure that calls +`self.most_stocked()` on the current `Inventory` instance. The standard library +didn’t need to know anything about the `Inventory` or `ShirtColor` types we +defined, or the logic we want to use in this scenario. The closure captures an +immutable reference to the `self` `Inventory` instance and passes it with the +code we specify to the `unwrap_or_else` method. Functions, on the other hand, +are not able to capture their environment in this way. + +### Closure Type Inference and Annotation + +There are more differences between functions and closures. Closures don’t +usually require you to annotate the types of the parameters or the return value +like `fn` functions do. Type annotations are required on functions because the +types are part of an explicit interface exposed to your users. Defining this +interface rigidly is important for ensuring that everyone agrees on what types +of values a function uses and returns. Closures, on the other hand, aren’t used +in an exposed interface like this: they’re stored in variables and used without +naming them and exposing them to users of our library. + +Closures are typically short and relevant only within a narrow context rather +than in any arbitrary scenario. Within these limited contexts, the compiler can +infer the types of the parameters and the return type, similar to how it’s able +to infer the types of most variables (there are rare cases where the compiler +needs closure type annotations too). + +As with variables, we can add type annotations if we want to increase +explicitness and clarity at the cost of being more verbose than is strictly +necessary. Annotating the types for a closure would look like the definition +shown in Listing 13-2. In this example, we’re defining a closure and storing it +in a variable rather than defining the closure in the spot we pass it as an +argument, as we did in Listing 13-1. + +Filename: src/main.rs + +``` +let expensive_closure = |num: u32| -> u32 { + println!("calculating slowly..."); + thread::sleep(Duration::from_secs(2)); + num +}; +``` + +Listing 13-2: Adding optional type annotations of the parameter and return +value types in the closure + +With type annotations added, the syntax of closures looks more similar to the +syntax of functions. Here, we define a function that adds 1 to its parameter +and a closure that has the same behavior, for comparison. We’ve added some +spaces to line up the relevant parts. This illustrates how closure syntax is +similar to function syntax except for the use of pipes and the amount of syntax +that is optional: + +``` +fn add_one_v1 (x: u32) -> u32 { x + 1 } +let add_one_v2 = |x: u32| -> u32 { x + 1 }; +let add_one_v3 = |x| { x + 1 }; +let add_one_v4 = |x| x + 1 ; +``` + +The first line shows a function definition and the second line shows a fully +annotated closure definition. In the third line, we remove the type annotations +from the closure definition. In the fourth line, we remove the curly brackets, +which are optional because the closure body has only one expression. These are +all valid definitions that will produce the same behavior when they’re called. +The `add_one_v3` and `add_one_v4` lines require the closures to be evaluated to +be able to compile because the types will be inferred from their usage. This is +similar to `let v = Vec::new();` needing either type annotations or values of +some type to be inserted into the `Vec` for Rust to be able to infer the type. + +For closure definitions, the compiler will infer one concrete type for each of +their parameters and for their return value. For instance, Listing 13-3 shows +the definition of a short closure that just returns the value it receives as a +parameter. This closure isn’t very useful except for the purposes of this +example. Note that we haven’t added any type annotations to the definition. +Because there are no type annotations, we can call the closure with any type, +which we’ve done here with `String` the first time. If we then try to call +`example_closure` with an integer, we’ll get an error. + +Filename: src/main.rs + +``` +let example_closure = |x| x; + +let s = example_closure(String::from("hello")); +let n = example_closure(5); +``` + +Listing 13-3: Attempting to call a closure whose types are inferred with two +different types + +The compiler gives us this error: + +``` +error[E0308]: mismatched types + --> src/main.rs:5:29 + | +5 | let n = example_closure(5); + | ^- help: try using a conversion method: +`.to_string()` + | | + | expected struct `String`, found integer +``` + +The first time we call `example_closure` with the `String` value, the compiler +infers the type of `x` and the return type of the closure to be `String`. Those +types are then locked into the closure in `example_closure`, and we get a type +error when we next try to use a different type with the same closure. + +### Capturing References or Moving Ownership + +Closures can capture values from their environment in three ways, which +directly map to the three ways a function can take a parameter: borrowing +immutably, borrowing mutably, and taking ownership. The closure will decide +which of these to use based on what the body of the function does with the +captured values. + +In Listing 13-4, we define a closure that captures an immutable reference to +the vector named `list` because it only needs an immutable reference to print +the value. + +Filename: src/main.rs + +``` +fn main() { + let list = vec![1, 2, 3]; + println!("Before defining closure: {:?}", list); + + 1 let only_borrows = || println!("From closure: {:?}", list); + + println!("Before calling closure: {:?}", list); + 2 only_borrows(); + println!("After calling closure: {:?}", list); +} +``` + +Listing 13-4: Defining and calling a closure that captures an immutable +reference + +This example also illustrates that a variable can bind to a closure definition +[1], and we can later call the closure by using the variable name and +parentheses as if the variable name were a function name [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. This code compiles, runs, and prints: + +``` +Before defining closure: [1, 2, 3] +Before calling closure: [1, 2, 3] +From closure: [1, 2, 3] +After calling closure: [1, 2, 3] +``` + +Next, in Listing 13-5, we change the closure body so that it adds an element to +the `list` vector. The closure now captures a mutable reference. + +Filename: src/main.rs + +``` +fn main() { + let mut list = vec![1, 2, 3]; + println!("Before defining closure: {:?}", list); + + let mut borrows_mutably = || list.push(7); + + borrows_mutably(); + println!("After calling closure: {:?}", list); +} +``` + +Listing 13-5: Defining and calling a closure that captures a mutable reference + +This code compiles, runs, and prints: + +``` +Before defining closure: [1, 2, 3] +After calling closure: [1, 2, 3, 7] +``` + +Note that there’s no longer a `println!` between the definition and the call of +the `borrows_mutably` closure: when `borrows_mutably` is defined, it captures a +mutable reference to `list`. We don’t use the closure again after the closure +is called, so the mutable borrow ends. Between the closure definition and the +closure call, an immutable borrow to print isn’t allowed because no other +borrows are allowed when there’s a mutable borrow. Try adding a `println!` +there to see what error message you get! + +If you want to force the closure to take ownership of the values it uses in the +environment even though the body of the closure doesn’t strictly need +ownership, you can use the `move` keyword before the parameter list. + +This technique is mostly useful when passing a closure to a new thread to move +the data so that it’s owned by the new thread. We’ll discuss threads and why +you would want to use them in detail in Chapter 16 when we talk about +concurrency, but for now, let’s briefly explore spawning a new thread using a +closure that needs the `move` keyword. Listing 13-6 shows Listing 13-4 modified +to print the vector in a new thread rather than in the main thread. + +Filename: src/main.rs + +``` +use std::thread; + +fn main() { + let list = vec![1, 2, 3]; + println!("Before defining closure: {:?}", list); + + 1 thread::spawn(move || { + 2 println!("From thread: {:?}", list) + }).join().unwrap(); +} +``` + +Listing 13-6: Using `move` to force the closure for the thread to take +ownership of `list` + +We spawn a new thread, giving the thread a closure to run as an argument. The +closure body prints out the list. In Listing 13-4, the closure only captured +`list` using an immutable reference because that’s the least amount of access +to `list` needed to print it. In this example, even though the closure body +still only needs an immutable reference [2], we need to specify that `list` +should be moved into the closure by putting the `move` keyword [1] at the +beginning of the closure definition. The new thread might finish before the +rest of the main thread finishes, or the main thread might finish first. If the +main thread maintains ownership of `list` but ends before the new thread and +drops `list`, the immutable reference in the thread would be invalid. +Therefore, the compiler requires that `list` be moved into the closure given to +the new thread so the reference will be valid. Try removing the `move` keyword +or using `list` in the main thread after the closure is defined to see what +compiler errors you get! + +### Moving Captured Values Out of Closures and the Fn Traits + +Once a closure has captured a reference or captured ownership of a value from +the environment where the closure is defined (thus affecting what, if anything, +is moved *into* the closure), the code in the body of the closure defines what +happens to the references or values when the closure is evaluated later (thus +affecting what, if anything, is moved *out of* the closure). + +A closure body can do any of the following: move a captured value out of the +closure, mutate the captured value, neither move nor mutate the value, or +capture nothing from the environment to begin with. + +The way a closure captures and handles values from the environment affects +which traits the closure implements, and traits are how functions and structs +can specify what kinds of closures they can use. Closures will automatically +implement one, two, or all three of these `Fn` traits, in an additive fashion, +depending on how the closure’s body handles the values: + +* `FnOnce` applies to closures that can be called once. All closures implement +at least this trait because all closures can be called. A closure that moves +captured values out of its body will only implement `FnOnce` and none of the +other `Fn` traits because it can only be called once. +* `FnMut` applies to closures that don’t move captured values out of their +body, but that might mutate the captured values. These closures can be called +more than once. +* `Fn` applies to closures that don’t move captured values out of their body +and that don’t mutate captured values, as well as closures that capture nothing +from their environment. These closures can be called more than once without +mutating their environment, which is important in cases such as calling a +closure multiple times concurrently. + +Let’s look at the definition of the `unwrap_or_else` method on `Option` that +we used in Listing 13-1: + +``` +impl Option { + pub fn unwrap_or_else(self, f: F) -> T + where + F: FnOnce() -> T + { + match self { + Some(x) => x, + None => f(), + } + } +} +``` + +Recall that `T` is the generic type representing the type of the value in the +`Some` variant of an `Option`. That type `T` is also the return type of the +`unwrap_or_else` function: code that calls `unwrap_or_else` on an +`Option`, for example, will get a `String`. + +Next, notice that the `unwrap_or_else` function has the additional generic type +parameter `F`. The `F` type is the type of the parameter named `f`, which is +the closure we provide when calling `unwrap_or_else`. + +The trait bound specified on the generic type `F` is `FnOnce() -> T`, which +means `F` must be able to be called once, take no arguments, and return a `T`. +Using `FnOnce` in the trait bound expresses the constraint that +`unwrap_or_else` is only going to call `f` one time, at most. In the body of +`unwrap_or_else`, we can see that if the `Option` is `Some`, `f` won’t be +called. If the `Option` is `None`, `f` will be called once. Because all +closures implement `FnOnce`, `unwrap_or_else` accepts the largest variety of +closures and is as flexible as it can be. + +> Note: Functions can implement all three of the `Fn` traits too. If what we +want to do doesn’t require capturing a value from the environment, we can use +the name of a function rather than a closure where we need something that +implements one of the `Fn` traits. For example, on an `Option>` value, +we could call `unwrap_or_else(Vec::new)` to get a new, empty vector if the +value is `None`. + +Now let’s look at the standard library method `sort_by_key`, defined on slices, +to see how that differs from `unwrap_or_else` and why `sort_by_key` uses +`FnMut` instead of `FnOnce` for the trait bound. The closure gets one argument +in the form of a reference to the current item in the slice being considered, +and returns a value of type `K` that can be ordered. This function is useful +when you want to sort a slice by a particular attribute of each item. In +Listing 13-7, we have a list of `Rectangle` instances and we use `sort_by_key` +to order them by their `width` attribute from low to high. + +Filename: src/main.rs + +``` +#[derive(Debug)] +struct Rectangle { + width: u32, + height: u32, +} + +fn main() { + let mut list = [ + Rectangle { width: 10, height: 1 }, + Rectangle { width: 3, height: 5 }, + Rectangle { width: 7, height: 12 }, + ]; + + list.sort_by_key(|r| r.width); + println!("{:#?}", list); +} +``` + +Listing 13-7: Using `sort_by_key` to order rectangles by width + +This code prints: + +``` +[ + Rectangle { + width: 3, + height: 5, + }, + Rectangle { + width: 7, + height: 12, + }, + Rectangle { + width: 10, + height: 1, + }, +] +``` + +The reason `sort_by_key` is defined to take an `FnMut` closure is that it calls +the closure multiple times: once for each item in the slice. The closure `|r| +r.width` doesn’t capture, mutate, or move anything out from its environment, so +it meets the trait bound requirements. + +In contrast, Listing 13-8 shows an example of a closure that implements just +the `FnOnce` trait, because it moves a value out of the environment. The +compiler won’t let us use this closure with `sort_by_key`. + +Filename: src/main.rs + +``` +--snip-- + +fn main() { + let mut list = [ + Rectangle { width: 10, height: 1 }, + Rectangle { width: 3, height: 5 }, + Rectangle { width: 7, height: 12 }, + ]; + + let mut sort_operations = vec![]; + let value = String::from("by key called"); + + list.sort_by_key(|r| { + sort_operations.push(value); + r.width + }); + println!("{:#?}", list); +} +``` + +Listing 13-8: Attempting to use an `FnOnce` closure with `sort_by_key` + +This is a contrived, convoluted way (that doesn’t work) to try and count the +number of times `sort_by_key` gets called when sorting `list`. This code +attempts to do this counting by pushing `value`—a `String` from the closure’s +environment—into the `sort_operations` vector. The closure captures `value` and +then moves `value` out of the closure by transferring ownership of `value` to +the `sort_operations` vector. This closure can be called once; trying to call +it a second time wouldn’t work because `value` would no longer be in the +environment to be pushed into `sort_operations` again! Therefore, this closure +only implements `FnOnce`. When we try to compile this code, we get this error +that `value` can’t be moved out of the closure because the closure must +implement `FnMut`: + +``` +error[E0507]: cannot move out of `value`, a captured variable in an `FnMut` +closure + --> src/main.rs:18:30 + | +15 | let value = String::from("by key called"); + | ----- captured outer variable +16 | +17 | list.sort_by_key(|r| { + | ______________________- +18 | | sort_operations.push(value); + | | ^^^^^ move occurs because `value` has +type `String`, which does not implement the `Copy` trait +19 | | r.width +20 | | }); + | |_____- captured by this `FnMut` closure +``` + +The error points to the line in the closure body that moves `value` out of the +environment. To fix this, we need to change the closure body so that it doesn’t +move values out of the environment. Keeping a counter in the environment and +incrementing its value in the closure body is a more straightforward way to +count the number of times `sort_by_key` is called. The closure in Listing 13-9 +works with `sort_by_key` because it is only capturing a mutable reference to +the `num_sort_operations` counter and can therefore be called more than once. + +Filename: src/main.rs + +``` +--snip-- + +fn main() { + --snip-- + + let mut num_sort_operations = 0; + list.sort_by_key(|r| { + num_sort_operations += 1; + r.width + }); + println!( + "{:#?}, sorted in {num_sort_operations} operations", + list + ); +} +``` + +Listing 13-9: Using an `FnMut` closure with `sort_by_key` is allowed. + +The `Fn` traits are important when defining or using functions or types that +make use of closures. In the next section, we’ll discuss iterators. Many +iterator methods take closure arguments, so keep these closure details in mind +as we continue! + +## Processing a Series of Items with Iterators + +The iterator pattern allows you to perform some task on a sequence of items in +turn. An iterator is responsible for the logic of iterating over each item and +determining when the sequence has finished. When you use iterators, you don’t +have to reimplement that logic yourself. + +In Rust, iterators are *lazy*, meaning they have no effect until you call +methods that consume the iterator to use it up. For example, the code in +Listing 13-10 creates an iterator over the items in the vector `v1` by calling +the `iter` method defined on `Vec`. This code by itself doesn’t do anything +useful. + +``` +let v1 = vec![1, 2, 3]; + +let v1_iter = v1.iter(); +``` + +Listing 13-10: Creating an iterator + +The iterator is stored in the `v1_iter` variable. Once we’ve created an +iterator, we can use it in a variety of ways. In Listing 3-5, we iterated over +an array using a `for` loop to execute some code on each of its items. Under +the hood, this implicitly created and then consumed an iterator, but we glossed +over how exactly that works until now. + +In the example in Listing 13-11, we separate the creation of the iterator from +the use of the iterator in the `for` loop. When the `for` loop is called using +the iterator in `v1_iter`, each element in the iterator is used in one +iteration of the loop, which prints out each value. + +``` +let v1 = vec![1, 2, 3]; + +let v1_iter = v1.iter(); + +for val in v1_iter { + println!("Got: {val}"); +} +``` + +Listing 13-11: Using an iterator in a `for` loop + +In languages that don’t have iterators provided by their standard libraries, +you would likely write this same functionality by starting a variable at index +0, using that variable to index into the vector to get a value, and +incrementing the variable value in a loop until it reached the total number of +items in the vector. + +Iterators handle all of that logic for you, cutting down on repetitive code you +could potentially mess up. Iterators give you more flexibility to use the same +logic with many different kinds of sequences, not just data structures you can +index into, like vectors. Let’s examine how iterators do that. + +### The Iterator Trait and the next Method + +All iterators implement a trait named `Iterator` that is defined in the +standard library. The definition of the trait looks like this: + +``` +pub trait Iterator { + type Item; + + fn next(&mut self) -> Option; + + // methods with default implementations elided +} +``` + +Notice that this definition uses some new syntax: `type Item` and `Self::Item`, +which are defining an *associated type* with this trait. We’ll talk about +associated types in depth in Chapter 19. For now, all you need to know is that +this code says implementing the `Iterator` trait requires that you also define +an `Item` type, and this `Item` type is used in the return type of the `next` +method. In other words, the `Item` type will be the type returned from the +iterator. + +The `Iterator` trait only requires implementors to define one method: the +`next` method, which returns one item of the iterator at a time, wrapped in +`Some`, and, when iteration is over, returns `None`. + +We can call the `next` method on iterators directly; Listing 13-12 demonstrates +what values are returned from repeated calls to `next` on the iterator created +from the vector. + +Filename: src/lib.rs + +``` +#[test] +fn iterator_demonstration() { + let v1 = vec![1, 2, 3]; + + let mut v1_iter = v1.iter(); + + assert_eq!(v1_iter.next(), Some(&1)); + assert_eq!(v1_iter.next(), Some(&2)); + assert_eq!(v1_iter.next(), Some(&3)); + assert_eq!(v1_iter.next(), None); +} +``` + +Listing 13-12: Calling the `next` method on an iterator + +Note that we needed to make `v1_iter` mutable: calling the `next` method on an +iterator changes internal state that the iterator uses to keep track of where +it is in the sequence. In other words, this code *consumes*, or uses up, the +iterator. Each call to `next` eats up an item from the iterator. We didn’t need +to make `v1_iter` mutable when we used a `for` loop because the loop took +ownership of `v1_iter` and made it mutable behind the scenes. + +Also note that the values we get from the calls to `next` are immutable +references to the values in the vector. The `iter` method produces an iterator +over immutable references. If we want to create an iterator that takes +ownership of `v1` and returns owned values, we can call `into_iter` instead of +`iter`. Similarly, if we want to iterate over mutable references, we can call +`iter_mut` instead of `iter`. + +### Methods That Consume the Iterator + +The `Iterator` trait has a number of different methods with default +implementations provided by the standard library; you can find out about these +methods by looking in the standard library API documentation for the `Iterator` +trait. Some of these methods call the `next` method in their definition, which +is why you’re required to implement the `next` method when implementing the +`Iterator` trait. + +Methods that call `next` are called *consuming adapters* because calling them +uses up the iterator. One example is the `sum` method, which takes ownership of +the iterator and iterates through the items by repeatedly calling `next`, thus +consuming the iterator. As it iterates through, it adds each item to a running +total and returns the total when iteration is complete. Listing 13-13 has a +test illustrating a use of the `sum` method. + +Filename: src/lib.rs + +``` +#[test] +fn iterator_sum() { + let v1 = vec![1, 2, 3]; + + let v1_iter = v1.iter(); + + let total: i32 = v1_iter.sum(); + + assert_eq!(total, 6); +} +``` + +Listing 13-13: Calling the `sum` method to get the total of all items in the +iterator + +We aren’t allowed to use `v1_iter` after the call to `sum` because `sum` takes +ownership of the iterator we call it on. + +### Methods That Produce Other Iterators + +*Iterator adapters* are methods defined on the `Iterator` trait that don’t +consume the iterator. Instead, they produce different iterators by changing +some aspect of the original iterator. + +Listing 13-14 shows an example of calling the iterator adapter method `map`, +which takes a closure to call on each item as the items are iterated through. +The `map` method returns a new iterator that produces the modified items. The +closure here creates a new iterator in which each item from the vector will be +incremented by 1. + +Filename: src/main.rs + +``` +let v1: Vec = vec![1, 2, 3]; + +v1.iter().map(|x| x + 1); +``` + +Listing 13-14: Calling the iterator adapter `map` to create a new iterator + +However, this code produces a warning: + +``` +warning: unused `Map` that must be used + --> src/main.rs:4:5 + | +4 | v1.iter().map(|x| x + 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_must_use)]` on by default + = note: iterators are lazy and do nothing unless consumed +``` + +The code in Listing 13-14 doesn’t do anything; the closure we’ve specified +never gets called. The warning reminds us why: iterator adapters are lazy, and +we need to consume the iterator here. + +To fix this warning and consume the iterator, we’ll use the `collect` method, +which we used with `env::args` in Listing 12-1. This method consumes the +iterator and collects the resultant values into a collection data type. + +In Listing 13-15, we collect into a vector the results of iterating over the +iterator that’s returned from the call to `map`. This vector will end up +containing each item from the original vector, incremented by 1. + +Filename: src/main.rs + +``` +let v1: Vec = vec![1, 2, 3]; + +let v2: Vec<_> = v1.iter().map(|x| x + 1).collect(); + +assert_eq!(v2, vec![2, 3, 4]); +``` + +Listing 13-15: Calling the `map` method to create a new iterator, and then +calling the `collect` method to consume the new iterator and create a vector + +Because `map` takes a closure, we can specify any operation we want to perform +on each item. This is a great example of how closures let you customize some +behavior while reusing the iteration behavior that the `Iterator` trait +provides. + +You can chain multiple calls to iterator adapters to perform complex actions in +a readable way. But because all iterators are lazy, you have to call one of the +consuming adapter methods to get results from calls to iterator adapters. + +### Using Closures That Capture Their Environment + +Many iterator adapters take closures as arguments, and commonly the closures +we’ll specify as arguments to iterator adapters will be closures that capture +their environment. + +For this example, we’ll use the `filter` method that takes a closure. The +closure gets an item from the iterator and returns a `bool`. If the closure +returns `true`, the value will be included in the iteration produced by +`filter`. If the closure returns `false`, the value won’t be included. + +In Listing 13-16, we use `filter` with a closure that captures the `shoe_size` +variable from its environment to iterate over a collection of `Shoe` struct +instances. It will return only shoes that are the specified size. + +Filename: src/lib.rs + +``` +#[derive(PartialEq, Debug)] +struct Shoe { + size: u32, + style: String, +} + +fn shoes_in_size(shoes: Vec, shoe_size: u32) -> Vec { + shoes.into_iter().filter(|s| s.size == shoe_size).collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn filters_by_size() { + let shoes = vec![ + Shoe { + size: 10, + style: String::from("sneaker"), + }, + Shoe { + size: 13, + style: String::from("sandal"), + }, + Shoe { + size: 10, + style: String::from("boot"), + }, + ]; + + let in_my_size = shoes_in_size(shoes, 10); + + assert_eq!( + in_my_size, + vec![ + Shoe { + size: 10, + style: String::from("sneaker") + }, + Shoe { + size: 10, + style: String::from("boot") + }, + ] + ); + } +} +``` + +Listing 13-16: Using the `filter` method with a closure that captures +`shoe_size` + +The `shoes_in_size` function takes ownership of a vector of shoes and a shoe +size as parameters. It returns a vector containing only shoes of the specified +size. + +In the body of `shoes_in_size`, we call `into_iter` to create an iterator that +takes ownership of the vector. Then we call `filter` to adapt that iterator +into a new iterator that only contains elements for which the closure returns +`true`. + +The closure captures the `shoe_size` parameter from the environment and +compares the value with each shoe’s size, keeping only shoes of the size +specified. Finally, calling `collect` gathers the values returned by the +adapted iterator into a vector that’s returned by the function. + +The test shows that when we call `shoes_in_size`, we get back only shoes that +have the same size as the value we specified. + +## Improving Our I/O Project + +With this new knowledge about iterators, we can improve the I/O project in +Chapter 12 by using iterators to make places in the code clearer and more +concise. Let’s look at how iterators can improve our implementation of the +`Config::build` function and the `search` function. + +### Removing a clone Using an Iterator + +In Listing 12-6, we added code that took a slice of `String` values and created +an instance of the `Config` struct by indexing into the slice and cloning the +values, allowing the `Config` struct to own those values. In Listing 13-17, +we’ve reproduced the implementation of the `Config::build` function as it was +in Listing 12-23. + +Filename: src/lib.rs + +``` +impl Config { + pub fn build( + args: &[String] + ) -> Result { + if args.len() < 3 { + return Err("not enough arguments"); + } + + let query = args[1].clone(); + let file_path = args[2].clone(); + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +``` + +Listing 13-17: Reproduction of the `Config::build` function from Listing 12-23 + +At the time, we said not to worry about the inefficient `clone` calls because +we would remove them in the future. Well, that time is now! + +We needed `clone` here because we have a slice with `String` elements in the +parameter `args`, but the `build` function doesn’t own `args`. To return +ownership of a `Config` instance, we had to clone the values from the `query` +and `filename` fields of `Config` so the `Config` instance can own its values. + +With our new knowledge about iterators, we can change the `build` function to +take ownership of an iterator as its argument instead of borrowing a slice. +We’ll use the iterator functionality instead of the code that checks the length +of the slice and indexes into specific locations. This will clarify what the +`Config::build` function is doing because the iterator will access the values. + +Once `Config::build` takes ownership of the iterator and stops using indexing +operations that borrow, we can move the `String` values from the iterator into +`Config` rather than calling `clone` and making a new allocation. + +#### Using the Returned Iterator Directly + +Open your I/O project’s *src/main.rs* file, which should look like this: + +Filename: src/main.rs + +``` +fn main() { + let args: Vec = env::args().collect(); + + let config = Config::build(&args).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + --snip-- +} +``` + +We’ll first change the start of the `main` function that we had in Listing +12-24 to the code in Listing 13-18, which this time uses an iterator. This +won’t compile until we update `Config::build` as well. + +Filename: src/main.rs + +``` +fn main() { + let config = + Config::build(env::args()).unwrap_or_else(|err| { + eprintln!("Problem parsing arguments: {err}"); + process::exit(1); + }); + + --snip-- +} +``` + +Listing 13-18: Passing the return value of `env::args` to `Config::build` + +The `env::args` function returns an iterator! Rather than collecting the +iterator values into a vector and then passing a slice to `Config::build`, now +we’re passing ownership of the iterator returned from `env::args` to +`Config::build` directly. + +Next, we need to update the definition of `Config::build`. In your I/O +project’s *src/lib.rs* file, let’s change the signature of `Config::build` to +look like Listing 13-19. This still won’t compile, because we need to update +the function body. + +Filename: src/lib.rs + +``` +impl Config { + pub fn build( + mut args: impl Iterator, + ) -> Result { + --snip-- +``` + +Listing 13-19: Updating the signature of `Config::build` to expect an iterator + +The standard library documentation for the `env::args` function shows that the +type of the iterator it returns is `std::env::Args`, and that type implements +the `Iterator` trait and returns `String` values. + +We’ve updated the signature of the `Config::build` function so the parameter +`args` has a generic type with the trait bounds `impl Iterator` +instead of `&[String]`. This usage of the `impl Trait` syntax we discussed in +“Traits as Parameters” on page XX means that `args` can be any type that +implements the `Iterator` type and returns `String` items. + +Because we’re taking ownership of `args` and we’ll be mutating `args` by +iterating over it, we can add the `mut` keyword into the specification of the +`args` parameter to make it mutable. + +#### Using Iterator Trait Methods Instead of Indexing + +Next, we’ll fix the body of `Config::build`. Because `args` implements the +`Iterator` trait, we know we can call the `next` method on it! Listing 13-20 +updates the code from Listing 12-23 to use the `next` method. + +Filename: src/lib.rs + +``` +impl Config { + pub fn build( + mut args: impl Iterator, + ) -> Result { + args.next(); + + let query = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a query string"), + }; + + let file_path = match args.next() { + Some(arg) => arg, + None => return Err("Didn't get a file path"), + }; + + let ignore_case = env::var("IGNORE_CASE").is_ok(); + + Ok(Config { + query, + file_path, + ignore_case, + }) + } +} +``` + +Listing 13-20: Changing the body of `Config::build` to use iterator methods + +Remember that the first value in the return value of `env::args` is the name of +the program. We want to ignore that and get to the next value, so first we call +`next` and do nothing with the return value. Then we call `next` to get the +value we want to put in the `query` field of `Config`. If `next` returns +`Some`, we use a `match` to extract the value. If it returns `None`, it means +not enough arguments were given and we return early with an `Err` value. We do +the same thing for the `filename` value. + +### Making Code Clearer with Iterator Adapters + +We can also take advantage of iterators in the `search` function in our I/O +project, which is reproduced here in Listing 13-21 as it was in Listing 12-19. + +Filename: src/lib.rs + +``` +pub fn search<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + let mut results = Vec::new(); + + for line in contents.lines() { + if line.contains(query) { + results.push(line); + } + } + + results +} +``` + +Listing 13-21: The implementation of the `search` function from Listing 12-19 + +We can write this code in a more concise way using iterator adapter methods. +Doing so also lets us avoid having a mutable intermediate `results` vector. The +functional programming style prefers to minimize the amount of mutable state to +make code clearer. Removing the mutable state might enable a future enhancement +to make searching happen in parallel because we wouldn’t have to manage +concurrent access to the `results` vector. Listing 13-22 shows this change. + +Filename: src/lib.rs + +``` +pub fn search<'a>( + query: &str, + contents: &'a str, +) -> Vec<&'a str> { + contents + .lines() + .filter(|line| line.contains(query)) + .collect() +} +``` + +Listing 13-22: Using iterator adapter methods in the implementation of the +`search` function + +Recall that the purpose of the `search` function is to return all lines in +`contents` that contain the `query`. Similar to the `filter` example in Listing +13-16, this code uses the `filter` adapter to keep only the lines for which +`line.contains(query)` returns `true`. We then collect the matching lines into +another vector with `collect`. Much simpler! Feel free to make the same change +to use iterator methods in the `search_case_insensitive` function as well. + +### Choosing Between Loops and Iterators + +The next logical question is which style you should choose in your own code and +why: the original implementation in Listing 13-21 or the version using +iterators in Listing 13-22. Most Rust programmers prefer to use the iterator +style. It’s a bit tougher to get the hang of at first, but once you get a feel +for the various iterator adapters and what they do, iterators can be easier to +understand. Instead of fiddling with the various bits of looping and building +new vectors, the code focuses on the high-level objective of the loop. This +abstracts away some of the commonplace code so it’s easier to see the concepts +that are unique to this code, such as the filtering condition each element in +the iterator must pass. + +But are the two implementations truly equivalent? The intuitive assumption +might be that the lower-level loop will be faster. Let’s talk about performance. + +## Comparing Performance: Loops vs. Iterators + +To determine whether to use loops or iterators, you need to know which +implementation is faster: the version of the `search` function with an explicit +`for` loop or the version with iterators. + +We ran a benchmark by loading the entire contents of *The Adventures of +Sherlock Holmes* by Sir Arthur Conan Doyle into a `String` and looking for the +word *the* in the contents. Here are the results of the benchmark on the +version of `search` using the `for` loop and the version using iterators: + +``` +test bench_search_for ... bench: 19,620,300 ns/iter (+/- 915,700) +test bench_search_iter ... bench: 19,234,900 ns/iter (+/- 657,200) +``` + +The iterator version was slightly faster! We won’t explain the benchmark code +here because the point is not to prove that the two versions are equivalent but +to get a general sense of how these two implementations compare +performance-wise. + +For a more comprehensive benchmark, you should check using various texts of +various sizes as the `contents`, different words and words of different lengths +as the `query`, and all kinds of other variations. The point is this: +iterators, although a high-level abstraction, get compiled down to roughly the +same code as if you’d written the lower-level code yourself. Iterators are one +of Rust’s *zero-cost abstractions*, by which we mean that using the abstraction +imposes no additional runtime overhead. This is analogous to how Bjarne +Stroustrup, the original designer and implementor of C++, defines +*zero-overhead* in “Foundations of C++” (2012): + +> In general, C++ implementations obey the zero-overhead principle: What you +don’t use, you don’t pay for. And further: What you do use, you couldn’t hand +code any better.As another example, the following code is taken from an audio +decoder. The decoding algorithm uses the linear prediction mathematical +operation to estimate future values based on a linear function of the previous +samples. This code uses an iterator chain to do some math on three variables in +scope: a `buffer` slice of data, an array of 12 `coefficients`, and an amount +by which to shift data in `qlp_shift`. We’ve declared the variables within this +example but not given them any values; although this code doesn’t have much +meaning outside of its context, it’s still a concise, real-world example of how +Rust translates high-level ideas to low-level code. + +``` +let buffer: &mut [i32]; +let coefficients: [i64; 12]; +let qlp_shift: i16; + +for i in 12..buffer.len() { + let prediction = coefficients.iter() + .zip(&buffer[i - 12..i]) + .map(|(&c, &s)| c * s as i64) + .sum::() >> qlp_shift; + let delta = buffer[i]; + buffer[i] = prediction as i32 + delta; +} +``` + +To calculate the value of `prediction`, this code iterates through each of the +12 values in `coefficients` and uses the `zip` method to pair the coefficient +values with the previous 12 values in `buffer`. Then, for each pair, it +multiplies the values together, sums all the results, and shifts the bits in +the sum `qlp_shift` bits to the right. + +Calculations in applications like audio decoders often prioritize performance +most highly. Here, we’re creating an iterator, using two adapters, and then +consuming the value. What assembly code would this Rust code compile to? Well, +as of this writing, it compiles down to the same assembly you’d write by hand. +There’s no loop at all corresponding to the iteration over the values in +`coefficients`: Rust knows that there are 12 iterations, so it “unrolls” the +loop. *Unrolling* is an optimization that removes the overhead of the loop +controlling code and instead generates repetitive code for each iteration of +the loop. + +All of the coefficients get stored in registers, which means accessing the +values is very fast. There are no bounds checks on the array access at runtime. +All of these optimizations that Rust is able to apply make the resultant code +extremely efficient. Now that you know this, you can use iterators and closures +without fear! They make code seem like it’s higher level but don’t impose a +runtime performance penalty for doing so. + +## Summary + +Closures and iterators are Rust features inspired by functional programming +language ideas. They contribute to Rust’s capability to clearly express +high-level ideas at low-level performance. The implementations of closures and +iterators are such that runtime performance is not affected. This is part of +Rust’s goal to strive to provide zero-cost abstractions. + +Now that we’ve improved the expressiveness of our I/O project, let’s look at +some more features of `cargo` that will help us share the project with the +world. + diff --git a/rustbook-ru/nostarch/chapter14.md b/rustbook-ru/nostarch/chapter14.md new file mode 100644 index 000000000..f5f2be719 --- /dev/null +++ b/rustbook-ru/nostarch/chapter14.md @@ -0,0 +1,999 @@ + + +[TOC] + +# More About Cargo and Crates.io + +So far, we’ve used only the most basic features of Cargo to build, run, and +test our code, but it can do a lot more. In this chapter, we’ll discuss some of +its other, more advanced features to show you how to do the following: + +* Customize your build through release profiles. +* Publish libraries on *https://crates.i**o*. +* Organize large projects with workspaces. +* Install binaries from *https://crates.io*. +* Extend Cargo using custom commands. + +Cargo can do even more than the functionality we cover in this chapter, so for +a full explanation of all its features, see its documentation at +*https://doc.rust-lang.org/cargo*. + +## Customizing Builds with Release Profiles + +In Rust, *release profiles* are predefined and customizable profiles with +different configurations that allow a programmer to have more control over +various options for compiling code. Each profile is configured independently of +the others. + +Cargo has two main profiles: the `dev` profile Cargo uses when you run `cargo +build`, and the `release` profile Cargo uses when you run `cargo build +--release`. The `dev` profile is defined with good defaults for development, +and the `release` profile has good defaults for release builds. + +These profile names might be familiar from the output of your builds: + +``` +$ cargo build + Finished dev [unoptimized + debuginfo] target(s) in 0.0s +$ cargo build --release + Finished release [optimized] target(s) in 0.0s +``` + +The `dev` and `release` are these different profiles used by the compiler. + +Cargo has default settings for each of the profiles that apply when you haven’t +explicitly added any `[profile.*]` sections in the project’s *Cargo.toml* file. +By adding `[profile.*]` sections for any profile you want to customize, you +override any subset of the default settings. For example, here are the default +values for the `opt-level` setting for the `dev` and `release` profiles: + +Filename: Cargo.toml + +``` +[profile.dev] +opt-level = 0 + +[profile.release] +opt-level = 3 +``` + +The `opt-level` setting controls the number of optimizations Rust will apply to +your code, with a range of 0 to 3. Applying more optimizations extends +compiling time, so if you’re in development and compiling your code often, +you’ll want fewer optimizations to compile faster even if the resultant code +runs slower. The default `opt-level` for `dev` is therefore `0`. When you’re +ready to release your code, it’s best to spend more time compiling. You’ll only +compile in release mode once, but you’ll run the compiled program many times, +so release mode trades longer compile time for code that runs faster. That is +why the default `opt-level` for the `release` profile is `3`. + +You can override a default setting by adding a different value for it in +*Cargo.toml*. For example, if we want to use optimization level 1 in the +development profile, we can add these two lines to our project’s *Cargo.toml* +file: + +Filename: Cargo.toml + +``` +[profile.dev] +opt-level = 1 +``` + +This code overrides the default setting of `0`. Now when we run `cargo build`, +Cargo will use the defaults for the `dev` profile plus our customization to +`opt-level`. Because we set `opt-level` to `1`, Cargo will apply more +optimizations than the default, but not as many as in a release build. + +For the full list of configuration options and defaults for each profile, see +Cargo’s documentation at +*https://doc.rust-lang.org/cargo/reference/profiles.html*. + +## Publishing a Crate to Crates.io + +We’ve used packages from *https://crates.io* as dependencies of our project, +but you can also share your code with other people by publishing your own +packages. The crate registry at *https://crates.io* distributes the source code +of your packages, so it primarily hosts code that is open source. + +Rust and Cargo have features that make your published package easier for people +to find and use. We’ll talk about some of these features next and then explain +how to publish a package. + +### Making Useful Documentation Comments + +Accurately documenting your packages will help other users know how and when to +use them, so it’s worth investing the time to write documentation. In Chapter +3, we discussed how to comment Rust code using two slashes, `//`. Rust also has +a particular kind of comment for documentation, known conveniently as a +*documentation comment*, that will generate HTML documentation. The HTML +displays the contents of documentation comments for public API items intended +for programmers interested in knowing how to *use* your crate as opposed to how +your crate is *implemented*. + +Documentation comments use three slashes, `///`, instead of two and support +Markdown notation for formatting the text. Place documentation comments just +before the item they’re documenting. Listing 14-1 shows documentation comments +for an `add_one` function in a crate named `my_crate`. + +Filename: src/lib.rs + +``` +/// Adds one to the number given. +/// +/// # Examples +/// +/// ``` +/// let arg = 5; +/// let answer = my_crate::add_one(arg); +/// +/// assert_eq!(6, answer); +/// ``` +pub fn add_one(x: i32) -> i32 { + x + 1 +} +``` + +Listing 14-1: A documentation comment for a function + +Here, we give a description of what the `add_one` function does, start a +section with the heading `Examples`, and then provide code that demonstrates +how to use the `add_one` function. We can generate the HTML documentation from +this documentation comment by running `cargo doc`. This command runs the +`rustdoc` tool distributed with Rust and puts the generated HTML documentation +in the *target/doc* directory. + +For convenience, running `cargo doc --open` will build the HTML for your +current crate’s documentation (as well as the documentation for all of your +crate’s dependencies) and open the result in a web browser. Navigate to the +`add_one` function and you’ll see how the text in the documentation comments is +rendered, as shown in Figure 14-1. + +Figure 14-1: HTML documentation for the `add_one` function + +#### Commonly Used Sections + +We used the `# Examples` Markdown heading in Listing 14-1 to create a section +in the HTML with the title “Examples.” Here are some other sections that crate +authors commonly use in their documentation: + +* **Panics**: The scenarios in which the function being documented could panic. +Callers of the function who don’t want their programs to panic should make sure +they don’t call the function in these situations. +* **Errors**: If the function returns a `Result`, describing the kinds of +errors that might occur and what conditions might cause those errors to be +returned can be helpful to callers so they can write code to handle the +different kinds of errors in different ways. +* **Safety**: If the function is `unsafe` to call (we discuss unsafety in +Chapter 19), there should be a section explaining why the function is unsafe +and covering the invariants that the function expects callers to uphold. + +Most documentation comments don’t need all of these sections, but this is a +good checklist to remind you of the aspects of your code users will be +interested in knowing about. + +#### Documentation Comments as Tests + +Adding example code blocks in your documentation comments can help demonstrate +how to use your library, and doing so has an additional bonus: running `cargo +test` will run the code examples in your documentation as tests! Nothing is +better than documentation with examples. But nothing is worse than examples +that don’t work because the code has changed since the documentation was +written. If we run `cargo test` with the documentation for the `add_one` +function from Listing 14-1, we will see a section in the test results that +looks like this: + +``` + Doc-tests my_crate + +running 1 test +test src/lib.rs - add_one (line 5) ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 +filtered out; finished in 0.27s +``` + +Now, if we change either the function or the example so the `assert_eq!` in the +example panics and run `cargo test` again, we’ll see that the doc tests catch +that the example and the code are out of sync with each other! + +#### Commenting Contained Items + +The doc comment `//!` adds documentation to the item that *contains* the +comments rather than to the items *following* the comments. We typically use +these doc comments inside the crate root file (*src/lib.rs* by convention) or +inside a module to document the crate or the module as a whole. + +For example, to add documentation that describes the purpose of the `my_crate` +crate that contains the `add_one` function, we add documentation comments that +start with `//!` to the beginning of the *src/lib.rs* file, as shown in Listing +14-2. + +Filename: src/lib.rs + +``` +//! # My Crate +//! +//! `my_crate` is a collection of utilities to make performing +//! certain calculations more convenient. + +/// Adds one to the number given. +--snip-- +``` + +Listing 14-2: Documentation for the `my_crate` crate as a whole + +Notice there isn’t any code after the last line that begins with `//!`. Because +we started the comments with `//!` instead of `///`, we’re documenting the item +that contains this comment rather than an item that follows this comment. In +this case, that item is the *src/lib.rs* file, which is the crate root. These +comments describe the entire crate. + +When we run `cargo doc --open`, these comments will display on the front page +of the documentation for `my_crate` above the list of public items in the +crate, as shown in Figure 14-2. + +Figure 14-2: Rendered documentation for `my_crate`, including the comment +describing the crate as a whole + +Documentation comments within items are useful for describing crates and +modules especially. Use them to explain the overall purpose of the container to +help your users understand the crate’s organization. + +### Exporting a Convenient Public API with pub use + +The structure of your public API is a major consideration when publishing a +crate. People who use your crate are less familiar with the structure than you +are and might have difficulty finding the pieces they want to use if your crate +has a large module hierarchy. + +In Chapter 7, we covered how to make items public using the `pub` keyword, and +how to bring items into a scope with the `use` keyword. However, the structure +that makes sense to you while you’re developing a crate might not be very +convenient for your users. You might want to organize your structs in a +hierarchy containing multiple levels, but then people who want to use a type +you’ve defined deep in the hierarchy might have trouble finding out that type +exists. They might also be annoyed at having to enter `use` +`my_crate::`some_module`::`another_module`::`UsefulType`;` rather than `use` +`my_crate::`UsefulType`;`. + +The good news is that if the structure *isn’t* convenient for others to use +from another library, you don’t have to rearrange your internal organization: +instead, you can re-export items to make a public structure that’s different +from your private structure by using `pub use`. *Re-exporting* takes a public +item in one location and makes it public in another location, as if it were +defined in the other location instead. + +For example, say we made a library named `art` for modeling artistic concepts. +Within this library are two modules: a `kinds` module containing two enums +named `PrimaryColor` and `SecondaryColor` and a `utils` module containing a +function named `mix`, as shown in Listing 14-3. + +Filename: src/lib.rs + +``` +//! # Art +//! +//! A library for modeling artistic concepts. + +pub mod kinds { + /// The primary colors according to the RYB color model. + pub enum PrimaryColor { + Red, + Yellow, + Blue, + } + + /// The secondary colors according to the RYB color model. + pub enum SecondaryColor { + Orange, + Green, + Purple, + } +} + +pub mod utils { + use crate::kinds::*; + + /// Combines two primary colors in equal amounts to create + /// a secondary color. + pub fn mix( + c1: PrimaryColor, + c2: PrimaryColor, + ) -> SecondaryColor { + --snip-- + } +} +``` + +Listing 14-3: An `art` library with items organized into `kinds` and `utils` +modules + +Figure 14-3 shows what the front page of the documentation for this crate +generated by `cargo doc` would look like. + +Figure 14-3: Front page of the documentation for `art` that lists the `kinds` +and `utils` modules + +Note that the `PrimaryColor` and `SecondaryColor` types aren’t listed on the +front page, nor is the `mix` function. We have to click `kinds` and `utils` to +see them. + +Another crate that depends on this library would need `use` statements that +bring the items from `art` into scope, specifying the module structure that’s +currently defined. Listing 14-4 shows an example of a crate that uses the +`PrimaryColor` and `mix` items from the `art` crate. + +Filename: src/main.rs + +``` +use art::kinds::PrimaryColor; +use art::utils::mix; + +fn main() { + let red = PrimaryColor::Red; + let yellow = PrimaryColor::Yellow; + mix(red, yellow); +} +``` + +Listing 14-4: A crate using the `art` crate’s items with its internal structure +exported + +The author of the code in Listing 14-4, which uses the `art` crate, had to +figure out that `PrimaryColor` is in the `kinds` module and `mix` is in the +`utils` module. The module structure of the `art` crate is more relevant to +developers working on the `art` crate than to those using it. The internal +structure doesn’t contain any useful information for someone trying to +understand how to use the `art` crate, but rather causes confusion because +developers who use it have to figure out where to look, and must specify the +module names in the `use` statements. + +To remove the internal organization from the public API, we can modify the +`art` crate code in Listing 14-3 to add `pub use` statements to re-export the +items at the top level, as shown in Listing 14-5. + +Filename: src/lib.rs + +``` +//! # Art +//! +//! A library for modeling artistic concepts. + +pub use self::kinds::PrimaryColor; +pub use self::kinds::SecondaryColor; +pub use self::utils::mix; + +pub mod kinds { + --snip-- +} + +pub mod utils { + --snip-- +} +``` + +Listing 14-5: Adding `pub use` statements to re-export items + +The API documentation that `cargo doc` generates for this crate will now list +and link re-exports on the front page, as shown in Figure 14-4, making the +`PrimaryColor` and `SecondaryColor` types and the `mix` function easier to find. + +Figure 14-4: The front page of the documentation for `art` that lists the +re-exports + +The `art` crate users can still see and use the internal structure from Listing +14-3 as demonstrated in Listing 14-4, or they can use the more convenient +structure in Listing 14-5, as shown in Listing 14-6. + +Filename: src/main.rs + +``` +use art::mix; +use art::PrimaryColor; + +fn main() { + --snip-- +} +``` + +Listing 14-6: A program using the re-exported items from the `art` crate + +In cases where there are many nested modules, re-exporting the types at the top +level with `pub use` can make a significant difference in the experience of +people who use the crate. Another common use of `pub use` is to re-export +definitions of a dependency in the current crate to make that crate’s +definitions part of your crate’s public API. + +Creating a useful public API structure is more of an art than a science, and +you can iterate to find the API that works best for your users. Choosing `pub +use` gives you flexibility in how you structure your crate internally and +decouples that internal structure from what you present to your users. Look at +some of the code of crates you’ve installed to see if their internal structure +differs from their public API. + +### Setting Up a Crates.io Account + +Before you can publish any crates, you need to create an account on +*https://crates.io* and get an API token. To do so, visit the home page at +*https://crates.io* and log in via a GitHub account. (The GitHub account is +currently a requirement, but the site might support other ways of creating an +account in the future.) Once you’re logged in, visit your account settings at +*https://crates.io/me* and retrieve your API key. Then run the `cargo login` +command with your API key, like this: + +``` +$ cargo login abcdefghijklmnopqrstuvwxyz012345 +``` + +This command will inform Cargo of your API token and store it locally in +*~/.cargo/credentials*. Note that this token is a *secret*: do not share it +with anyone else. If you do share it with anyone for any reason, you should +revoke it and generate a new token on *https://crates.io*. + +### Adding Metadata to a New Crate + +Let’s say you have a crate you want to publish. Before publishing, you’ll need +to add some metadata in the `[package]` section of the crate’s *Cargo.toml* +file. + +Your crate will need a unique name. While you’re working on a crate locally, +you can name a crate whatever you’d like. However, crate names on +*https://crates.io* are allocated on a first-come, first-served basis. Once a +crate name is taken, no one else can publish a crate with that name. Before +attempting to publish a crate, search for the name you want to use. If the name +has been used, you will need to find another name and edit the `name` field in +the *Cargo.toml* file under the `[package]` section to use the new name for +publishing, like so: + +Filename: Cargo.toml + +``` +[package] +name = "guessing_game" +``` + +Even if you’ve chosen a unique name, when you run `cargo publish` to publish +the crate at this point, you’ll get a warning and then an error: + +``` +$ cargo publish + Updating crates.io index +warning: manifest has no description, license, license-file, documentation, +homepage or repository. +See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata +for more info. +--snip-- +error: failed to publish to registry at https://crates.io + +Caused by: + the remote server responded with an error: missing or empty metadata fields: +description, license. Please see https://doc.rust- +lang.org/cargo/reference/manifest.html for how to upload metadata +``` + +This results in an error because you’re missing some crucial information: a +description and license are required so people will know what your crate does +and under what terms they can use it. In *Cargo.toml*, add a description that’s +just a sentence or two, because it will appear with your crate in search +results. For the `license` field, you need to give a *license identifier +value*. The Linux Foundation’s Software Package Data Exchange (SPDX) at +*http://spdx.org/licenses* lists the identifiers you can use for this value. +For example, to specify that you’ve licensed your crate using the MIT License, +add the `MIT` identifier: + +Filename: Cargo.toml + +``` +[package] +name = "guessing_game" +license = "MIT" +``` + +If you want to use a license that doesn’t appear in the SPDX, you need to place +the text of that license in a file, include the file in your project, and then +use `license-file` to specify the name of that file instead of using the +`license` key. + +Guidance on which license is appropriate for your project is beyond the scope +of this book. Many people in the Rust community license their projects in the +same way as Rust by using a dual license of `MIT OR Apache-2.0`. This practice +demonstrates that you can also specify multiple license identifiers separated +by `OR` to have multiple licenses for your project. + +With a unique name, the version, your description, and a license added, the +*Cargo.toml* file for a project that is ready to publish might look like this: + +Filename: Cargo.toml + +``` +[package] +name = "guessing_game" +version = "0.1.0" +edition = "2021" +description = "A fun game where you guess what number the +computer has chosen." +license = "MIT OR Apache-2.0" + +[dependencies] +``` + +Cargo’s documentation at *https://doc.rust-lang.org/cargo* describes other +metadata you can specify to ensure that others can discover and use your crate +more easily. + +### Publishing to Crates.io + +Now that you’ve created an account, saved your API token, chosen a name for +your crate, and specified the required metadata, you’re ready to publish! +Publishing a crate uploads a specific version to *https://crates.io* for others +to use. + +Be careful, because a publish is *permanent*. The version can never be +overwritten, and the code cannot be deleted. One major goal of Crates.io is to +act as a permanent archive of code so that builds of all projects that depend +on crates from *https://crates.io* will continue to work. Allowing version +deletions would make fulfilling that goal impossible. However, there is no +limit to the number of crate versions you can publish. + +Run the `cargo publish` command again. It should succeed now: + +``` +$ cargo publish + Updating crates.io index + Packaging guessing_game v0.1.0 (file:///projects/guessing_game) + Verifying guessing_game v0.1.0 (file:///projects/guessing_game) + Compiling guessing_game v0.1.0 +(file:///projects/guessing_game/target/package/guessing_game-0.1.0) + Finished dev [unoptimized + debuginfo] target(s) in 0.19s + Uploading guessing_game v0.1.0 (file:///projects/guessing_game) +``` + +Congratulations! You’ve now shared your code with the Rust community, and +anyone can easily add your crate as a dependency of their project. + +### Publishing a New Version of an Existing Crate + +When you’ve made changes to your crate and are ready to release a new version, +you change the `version` value specified in your *Cargo.toml* file and +republish. Use the Semantic Versioning rules at *http://semver.org* to decide +what an appropriate next version number is, based on the kinds of changes +you’ve made. Then run `cargo publish` to upload the new version. + +### Deprecating Versions from Crates.io with cargo yank + +Although you can’t remove previous versions of a crate, you can prevent any +future projects from adding them as a new dependency. This is useful when a +crate version is broken for one reason or another. In such situations, Cargo +supports yanking a crate version. + +*Yanking* a version prevents new projects from depending on that version while +allowing all existing projects that depend on it to continue. Essentially, a +yank means that all projects with a *Cargo.lock* will not break, and any future +*Cargo.lock* files generated will not use the yanked version. + +To yank a version of a crate, in the directory of the crate that you’ve +previously published, run `cargo yank` and specify which version you want to +yank. For example, if we’ve published a crate named `guessing_game` version +1.0.1 and we want to yank it, in the project directory for `guessing_game` we’d +run: + +``` +$ cargo yank --vers 1.0.1 + Updating crates.io index + Yank guessing_game@1.0.1 +``` + +By adding `--undo` to the command, you can also undo a yank and allow projects +to start depending on a version again: + +``` +$ cargo yank --vers 1.0.1 --undo + Updating crates.io index + Unyank guessing_game@1.0.1 +``` + +A yank *does not* delete any code. It cannot, for example, delete accidentally +uploaded secrets. If that happens, you must reset those secrets immediately. + +## Cargo Workspaces + +In Chapter 12, we built a package that included a binary crate and a library +crate. As your project develops, you might find that the library crate +continues to get bigger and you want to split your package further into +multiple library crates. Cargo offers a feature called *workspaces* that can +help manage multiple related packages that are developed in tandem. + +### Creating a Workspace + +A *workspace* is a set of packages that share the same *Cargo.lock* and output +directory. Let’s make a project using a workspace—we’ll use trivial code so we +can concentrate on the structure of the workspace. There are multiple ways to +structure a workspace, so we’ll just show one common way. We’ll have a +workspace containing a binary and two libraries. The binary, which will provide +the main functionality, will depend on the two libraries. One library will +provide an `add_one` function and the other library an `add_two` function. +These three crates will be part of the same workspace. We’ll start by creating +a new directory for the workspace: + +``` +$ mkdir add +$ cd add +``` + +Next, in the *add* directory, we create the *Cargo.toml* file that will +configure the entire workspace. This file won’t have a `[package]` section. +Instead, it will start with a `[workspace]` section that will allow us to add +members to the workspace by specifying the path to the package with our binary +crate; in this case, that path is *adder*: + +Filename: Cargo.toml + +``` +[workspace] + +members = [ + "adder", +] +``` + +Next, we’ll create the `adder` binary crate by running `cargo new` within the +*add* directory: + +``` +$ cargo new adder + Created binary (application) `adder` package +``` + +At this point, we can build the workspace by running `cargo build`. The files +in your *add* directory should look like this: + +``` +├── Cargo.lock +├── Cargo.toml +├── adder +│ ├── Cargo.toml +│ └── src +│ └── main.rs +└── target +``` + +The workspace has one *target* directory at the top level that the compiled +artifacts will be placed into; the `adder` package doesn’t have its own +*target* directory. Even if we were to run `cargo build` from inside the +*adder* directory, the compiled artifacts would still end up in *add/target* +rather than *add/adder/target*. Cargo structures the *target* directory in a +workspace like this because the crates in a workspace are meant to depend on +each other. If each crate had its own *target* directory, each crate would have +to recompile each of the other crates in the workspace to place the artifacts +in its own *target* directory. By sharing one *target* directory, the crates +can avoid unnecessary rebuilding. + +### Creating the Second Package in the Workspace + +Next, let’s create another member package in the workspace and call it +`add_one`. Change the top-level *Cargo.toml* to specify the *add_one* path in +the `members` list: + +Filename: Cargo.toml + +``` +[workspace] + +members = [ + "adder", + "add_one", +] +``` + +Then generate a new library crate named `add_one`: + +``` +$ cargo new add_one --lib + Created library `add_one` package +``` + +Your *add* directory should now have these directories and files: + +``` +├── Cargo.lock +├── Cargo.toml +├── add_one +│ ├── Cargo.toml +│ └── src +│ └── lib.rs +├── adder +│ ├── Cargo.toml +│ └── src +│ └── main.rs +└── target +``` + +In the *add_one/src/lib.rs* file, let’s add an `add_one` function: + +Filename: add_one/src/lib.rs + +``` +pub fn add_one(x: i32) -> i32 { + x + 1 +} +``` + +Now we can have the `adder` package with our binary depend on the `add_one` +package that has our library. First we’ll need to add a path dependency on +`add_one` to *adder/Cargo.toml*: + +Filename: adder/Cargo.toml + +``` +[dependencies] +add_one = { path = "../add_one" } +``` + +Cargo doesn’t assume that crates in a workspace will depend on each other, so +we need to be explicit about the dependency relationships. + +Next, let’s use the `add_one` function (from the `add_one` crate) in the +`adder` crate. Open the *adder/src/main.rs* file and add a `use` line at the +top to bring the new `add_one` library crate into scope. Then change the `main` +function to call the `add_one` function, as in Listing 14-7. + +Filename: adder/src/main.rs + +``` +use add_one; + +fn main() { + let num = 10; + println!( + "Hello, world! {num} plus one is {}!", + add_one::add_one(num) + ); +} +``` + +Listing 14-7: Using the `add_one` library crate from the `adder` crate + +Let’s build the workspace by running `cargo build` in the top-level *add* +directory! + +``` +$ cargo build + Compiling add_one v0.1.0 (file:///projects/add/add_one) + Compiling adder v0.1.0 (file:///projects/add/adder) + Finished dev [unoptimized + debuginfo] target(s) in 0.68s +``` + +To run the binary crate from the *add* directory, we can specify which package +in the workspace we want to run by using the `-p` argument and the package name +with `cargo run`: + +``` +$ cargo run -p adder + Finished dev [unoptimized + debuginfo] target(s) in 0.0s + Running `target/debug/adder` +Hello, world! 10 plus one is 11! +``` + +This runs the code in *adder/src/main.rs*, which depends on the `add_one` crate. + +#### Depending on an External Package in a Workspace + +Notice that the workspace has only one *Cargo.lock* file at the top level, +rather than having a *Cargo.lock* in each crate’s directory. This ensures that +all crates are using the same version of all dependencies. If we add the `rand` +package to the *adder/Cargo.toml* and *add_one/Cargo.toml* files, Cargo will +resolve both of those to one version of `rand` and record that in the one +*Cargo.lock*. Making all crates in the workspace use the same dependencies +means the crates will always be compatible with each other. Let’s add the +`rand` crate to the `[dependencies]` section in the *add_one/Cargo.toml* file +so we can use the `rand` crate in the `add_one` crate: + +Filename: add_one/Cargo.toml + +``` +[dependencies] +rand = "0.8.5" +``` + +We can now add `use rand;` to the *add_one/src/lib.rs* file, and building the +whole workspace by running `cargo build` in the *add* directory will bring in +and compile the `rand` crate. We will get one warning because we aren’t +referring to the `rand` we brought into scope: + +``` +$ cargo build + Updating crates.io index + Downloaded rand v0.8.5 + --snip-- + Compiling rand v0.8.5 + Compiling add_one v0.1.0 (file:///projects/add/add_one) + Compiling adder v0.1.0 (file:///projects/add/adder) + Finished dev [unoptimized + debuginfo] target(s) in 10.18s +``` + +The top-level *Cargo.lock* now contains information about the dependency of +`add_one` on `rand`. However, even though `rand` is used somewhere in the +workspace, we can’t use it in other crates in the workspace unless we add +`rand` to their *Cargo.toml* files as well. For example, if we add `use rand;` +to the *adder/src/main.rs* file for the `adder` package, we’ll get an error: + +``` +$ cargo build + --snip-- + Compiling adder v0.1.0 (file:///projects/add/adder) +error[E0432]: unresolved import `rand` + --> adder/src/main.rs:2:5 + | +2 | use rand; + | ^^^^ no external crate `rand` +``` + +To fix this, edit the *Cargo.toml* file for the `adder` package and indicate +that `rand` is a dependency for it as well. Building the `adder` package will +add `rand` to the list of dependencies for `adder` in *Cargo.lock*, but no +additional copies of `rand` will be downloaded. Cargo has ensured that every +crate in every package in the workspace using the `rand` package will be using +the same version, saving us space and ensuring that the crates in the workspace +will be compatible with each other. + +#### Adding a Test to a Workspace + +For another enhancement, let’s add a test of the `add_one::add_one` function +within the `add_one` crate: + +Filename: add_one/src/lib.rs + +``` +pub fn add_one(x: i32) -> i32 { + x + 1 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + assert_eq!(3, add_one(2)); + } +} +``` + +Now run `cargo test` in the top-level *add* directory. Running `cargo test` in +a workspace structured like this one will run the tests for all the crates in +the workspace: + +``` +$ cargo test + Compiling add_one v0.1.0 (file:///projects/add/add_one) + Compiling adder v0.1.0 (file:///projects/add/adder) + Finished test [unoptimized + debuginfo] target(s) in 0.27s + Running unittests src/lib.rs (target/debug/deps/add_one-f0253159197f7841) + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; +finished in 0.00s + + Running unittests src/main.rs (target/debug/deps/adder-49979ff40686fa8e) + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; +finished in 0.00s + + Doc-tests add_one + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; +finished in 0.00s +``` + +The first section of the output shows that the `it_works` test in the `add_one` +crate passed. The next section shows that zero tests were found in the `adder` +crate, and then the last section shows zero documentation tests were found in +the `add_one` crate. + +We can also run tests for one particular crate in a workspace from the +top-level directory by using the `-p` flag and specifying the name of the crate +we want to test: + +``` +$ cargo test -p add_one + Finished test [unoptimized + debuginfo] target(s) in 0.00s + Running unittests src/lib.rs (target/debug/deps/add_one-b3235fea9a156f74) + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; +finished in 0.00s + + Doc-tests add_one + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; +finished in 0.00s +``` + +This output shows `cargo test` only ran the tests for the `add_one` crate and +didn’t run the `adder` crate tests. + +If you publish the crates in the workspace to *https://crates.io*, each crate +in the workspace will need to be published separately. Like `cargo test`, we +can publish a particular crate in our workspace by using the `-p` flag and +specifying the name of the crate we want to publish. + +For additional practice, add an `add_two` crate to this workspace in a similar +way as the `add_one` crate! + +As your project grows, consider using a workspace: it provides +easier-to-understand, smaller, individual components than one big blob of code. +Furthermore, keeping the crates in a workspace can make coordination between +crates easier if they are often changed at the same time. + +## Installing Binaries with cargo install + +The `cargo install` command allows you to install and use binary crates +locally. This isn’t intended to replace system packages; it’s meant to be a +convenient way for Rust developers to install tools that others have shared on +*https://crates.io*. Note that you can only install packages that have binary +targets. A *binary target* is the runnable program that is created if the crate +has a *src/main.rs* file or another file specified as a binary, as opposed to a +library target that isn’t runnable on its own but is suitable for including +within other programs. Usually, crates have information in the *README* file +about whether a crate is a library, has a binary target, or both. + +All binaries installed with `cargo install` are stored in the installation +root’s *bin* folder. If you installed Rust using *rustup.rs* and don’t have any +custom configurations, this directory will be *$HOME/.cargo/bin*. Ensure that +directory is in your `$PATH` to be able to run programs you’ve installed with +`cargo install`. + +For example, in Chapter 12 we mentioned that there’s a Rust implementation of +the `grep` tool called `ripgrep` for searching files. To install `ripgrep`, we +can run the following: + +``` +$ cargo install ripgrep + Updating crates.io index + Downloaded ripgrep v13.0.0 + Downloaded 1 crate (243.3 KB) in 0.88s + Installing ripgrep v13.0.0 + --snip-- + Compiling ripgrep v13.0.0 + Finished release [optimized + debuginfo] target(s) in 3m 10s + Installing ~/.cargo/bin/rg + Installed package `ripgrep v13.0.0` (executable `rg`) +``` + +The second-to-last line of the output shows the location and the name of the +installed binary, which in the case of `ripgrep` is `rg`. As long as the +installation directory is in your `$PATH`, as mentioned previously, you can +then run `rg --help` and start using a faster, Rustier tool for searching files! + +## Extending Cargo with Custom Commands + +Cargo is designed so you can extend it with new subcommands without having to +modify it. If a binary in your `$PATH` is named `cargo-something`, you can run +it as if it were a Cargo subcommand by running `cargo something`. Custom +commands like this are also listed when you run `cargo --list`. Being able to +use `cargo install` to install extensions and then run them just like the +built-in Cargo tools is a super-convenient benefit of Cargo’s design! + +## Summary + +Sharing code with Cargo and *https://crates.io* is part of what makes the Rust +ecosystem useful for many different tasks. Rust’s standard library is small and +stable, but crates are easy to share, use, and improve on a timeline different +from that of the language. Don’t be shy about sharing code that’s useful to you +on *https://crates.io*; it’s likely that it will be useful to someone else as +well! + diff --git a/rustbook-ru/nostarch/chapter15.md b/rustbook-ru/nostarch/chapter15.md new file mode 100644 index 000000000..c0e847da1 --- /dev/null +++ b/rustbook-ru/nostarch/chapter15.md @@ -0,0 +1,2080 @@ + + +[TOC] + +# Smart Pointers + +A *pointer* is a general concept for a variable that contains an address in +memory. This address refers to, or “points at,” some other data. The most +common kind of pointer in Rust is a reference, which you learned about in +Chapter 4. References are indicated by the `&` symbol and borrow the value they +point to. They don’t have any special capabilities other than referring to +data, and they have no overhead. + +*Smart pointers*, on the other hand, are data structures that act like a +pointer but also have additional metadata and capabilities. The concept of +smart pointers isn’t unique to Rust: smart pointers originated in C++ and exist +in other languages as well. Rust has a variety of smart pointers defined in the +standard library that provide functionality beyond that provided by references. +To explore the general concept, we’ll look at a couple of different examples of +smart pointers, including a *reference counting* smart pointer type. This +pointer enables you to allow data to have multiple owners by keeping track of +the number of owners and, when no owners remain, cleaning up the data. + +Rust, with its concept of ownership and borrowing, has an additional difference +between references and smart pointers: while references only borrow data, in +many cases smart pointers *own* the data they point to. + +Though we didn’t call them as such at the time, we’ve already encountered a few +smart pointers in this book, including `String` and `Vec` in Chapter 8. Both +of these types count as smart pointers because they own some memory and allow +you to manipulate it. They also have metadata and extra capabilities or +guarantees. `String`, for example, stores its capacity as metadata and has the +extra ability to ensure its data will always be valid UTF-8. + +Smart pointers are usually implemented using structs. Unlike an ordinary +struct, smart pointers implement the `Deref` and `Drop` traits. The `Deref` +trait allows an instance of the smart pointer struct to behave like a reference +so you can write your code to work with either references or smart pointers. +The `Drop` trait allows you to customize the code that’s run when an instance +of the smart pointer goes out of scope. In this chapter, we’ll discuss both +traits and demonstrate why they’re important to smart pointers. + +Given that the smart pointer pattern is a general design pattern used +frequently in Rust, this chapter won’t cover every existing smart pointer. Many +libraries have their own smart pointers, and you can even write your own. We’ll +cover the most common smart pointers in the standard library: + +* `Box`, for allocating values on the heap +* `Rc`, a reference counting type that enables multiple ownership +* `Ref` and `RefMut`, accessed through `RefCell`, a type that enforces +the borrowing rules at runtime instead of compile time + +In addition, we’ll cover the *interior mutability* pattern where an immutable +type exposes an API for mutating an interior value. We’ll also discuss +*reference cycles*: how they can leak memory and how to prevent them. + +Let’s dive in! + +## Using Box to Point to Data on the Heap + +The most straightforward smart pointer is a *box*, whose type is written +`Box`. Boxes allow you to store data on the heap rather than the stack. What +remains on the stack is the pointer to the heap data. Refer to Chapter 4 to +review the difference between the stack and the heap. + +Boxes don’t have performance overhead, other than storing their data on the +heap instead of on the stack. But they don’t have many extra capabilities +either. You’ll use them most often in these situations: + +* When you have a type whose size can’t be known at compile time and you want +to use a value of that type in a context that requires an exact size +* When you have a large amount of data and you want to transfer ownership but +ensure the data won’t be copied when you do so +* When you want to own a value and you care only that it’s a type that +implements a particular trait rather than being of a specific type + +We’ll demonstrate the first situation in “Enabling Recursive Types with Boxes” +on page XX. In the second case, transferring ownership of a large amount of +data can take a long time because the data is copied around on the stack. To +improve performance in this situation, we can store the large amount of data on +the heap in a box. Then, only the small amount of pointer data is copied around +on the stack, while the data it references stays in one place on the heap. The +third case is known as a *trait object*, and “Using Trait Objects That Allow +for Values of Different Types” on page XX is devoted to that topic. So what you +learn here you’ll apply again in that section! + +### Using Box to Store Data on the Heap + +Before we discuss the heap storage use case for `Box`, we’ll cover the +syntax and how to interact with values stored within a `Box`. + +Listing 15-1 shows how to use a box to store an `i32` value on the heap. + +Filename: src/main.rs + +``` +fn main() { + let b = Box::new(5); + println!("b = {b}"); +} +``` + +Listing 15-1: Storing an `i32` value on the heap using a box + +We define the variable `b` to have the value of a `Box` that points to the +value `5`, which is allocated on the heap. This program will print `b = 5`; in +this case, we can access the data in the box similar to how we would if this +data were on the stack. Just like any owned value, when a box goes out of +scope, as `b` does at the end of `main`, it will be deallocated. The +deallocation happens both for the box (stored on the stack) and the data it +points to (stored on the heap). + +Putting a single value on the heap isn’t very useful, so you won’t use boxes by +themselves in this way very often. Having values like a single `i32` on the +stack, where they’re stored by default, is more appropriate in the majority of +situations. Let’s look at a case where boxes allow us to define types that we +wouldn’t be allowed to define if we didn’t have boxes. + +### Enabling Recursive Types with Boxes + +A value of a *recursive type* can have another value of the same type as part +of itself. Recursive types pose an issue because at compile time Rust needs to +know how much space a type takes up. However, the nesting of values of +recursive types could theoretically continue infinitely, so Rust can’t know how +much space the value needs. Because boxes have a known size, we can enable +recursive types by inserting a box in the recursive type definition. + +As an example of a recursive type, let’s explore the *cons list*. This is a +data type commonly found in functional programming languages. The cons list +type we’ll define is straightforward except for the recursion; therefore, the +concepts in the example we’ll work with will be useful any time you get into +more complex situations involving recursive types. + +#### More Information About the Cons List + +A *cons list* is a data structure that comes from the Lisp programming language +and its dialects, is made up of nested pairs, and is the Lisp version of a +linked list. Its name comes from the `cons` function (short for *construct +function*) in Lisp that constructs a new pair from its two arguments. By +calling `cons` on a pair consisting of a value and another pair, we can +construct cons lists made up of recursive pairs. + +For example, here’s a pseudocode representation of a cons list containing the +list `1, 2, 3` with each pair in parentheses: + +``` +(1, (2, (3, Nil))) +``` + +Each item in a cons list contains two elements: the value of the current item +and the next item. The last item in the list contains only a value called `Nil` +without a next item. A cons list is produced by recursively calling the `cons` +function. The canonical name to denote the base case of the recursion is `Nil`. +Note that this is not the same as the “null” or “nil” concept in Chapter 6, +which is an invalid or absent value. + +The cons list isn’t a commonly used data structure in Rust. Most of the time +when you have a list of items in Rust, `Vec` is a better choice to use. +Other, more complex recursive data types *are* useful in various situations, +but by starting with the cons list in this chapter, we can explore how boxes +let us define a recursive data type without much distraction. + +Listing 15-2 contains an enum definition for a cons list. Note that this code +won’t compile yet because the `List` type doesn’t have a known size, which +we’ll demonstrate. + +Filename: src/main.rs + +``` +enum List { + Cons(i32, List), + Nil, +} +``` + +Listing 15-2: The first attempt at defining an enum to represent a cons list +data structure of `i32` values + +> Note: We’re implementing a cons list that holds only `i32` values for the +purposes of this example. We could have implemented it using generics, as we +discussed in Chapter 10, to define a cons list type that could store values of +any type. + +Using the `List` type to store the list `1, 2, 3` would look like the code in +Listing 15-3. + +Filename: src/main.rs + +``` +--snip-- + +use crate::List::{Cons, Nil}; + +fn main() { + let list = Cons(1, Cons(2, Cons(3, Nil))); +} +``` + +Listing 15-3: Using the `List` enum to store the list `1, 2, 3` + +The first `Cons` value holds `1` and another `List` value. This `List` value is +another `Cons` value that holds `2` and another `List` value. This `List` value +is one more `Cons` value that holds `3` and a `List` value, which is finally +`Nil`, the non-recursive variant that signals the end of the list. + +If we try to compile the code in Listing 15-3, we get the error shown in +Listing 15-4. + +``` +error[E0072]: recursive type `List` has infinite size + --> src/main.rs:1:1 + | +1 | enum List { + | ^^^^^^^^^ recursive type has infinite size +2 | Cons(i32, List), + | ---- recursive without indirection + | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` +representable + | +2 | Cons(i32, Box), + | ++++ + +``` + +Listing 15-4: The error we get when attempting to define a recursive enum + +The error shows this type “has infinite size.” The reason is that we’ve defined +`List` with a variant that is recursive: it holds another value of itself +directly. As a result, Rust can’t figure out how much space it needs to store a +`List` value. Let’s break down why we get this error. First we’ll look at how +Rust decides how much space it needs to store a value of a non-recursive type. + +#### Computing the Size of a Non-Recursive Type + +Recall the `Message` enum we defined in Listing 6-2 when we discussed enum +definitions in Chapter 6: + +``` +enum Message { + Quit, + Move { x: i32, y: i32 }, + Write(String), + ChangeColor(i32, i32, i32), +} +``` + +To determine how much space to allocate for a `Message` value, Rust goes +through each of the variants to see which variant needs the most space. Rust +sees that `Message::Quit` doesn’t need any space, `Message::Move` needs enough +space to store two `i32` values, and so forth. Because only one variant will be +used, the most space a `Message` value will need is the space it would take to +store the largest of its variants. + +Contrast this with what happens when Rust tries to determine how much space a +recursive type like the `List` enum in Listing 15-2 needs. The compiler starts +by looking at the `Cons` variant, which holds a value of type `i32` and a value +of type `List`. Therefore, `Cons` needs an amount of space equal to the size of +an `i32` plus the size of a `List`. To figure out how much memory the `List` +type needs, the compiler looks at the variants, starting with the `Cons` +variant. The `Cons` variant holds a value of type `i32` and a value of type +`List`, and this process continues infinitely, as shown in Figure 15-1. + +Figure 15-1: An infinite `List` consisting of infinite `Cons` variants + +#### Using Box to Get a Recursive Type with a Known Size + +Because Rust can’t figure out how much space to allocate for recursively +defined types, the compiler gives an error with this helpful suggestion: + +``` +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` +representable + | +2 | Cons(i32, Box), + | ++++ + +``` + +In this suggestion, *indirection* means that instead of storing a value +directly, we should change the data structure to store the value indirectly by +storing a pointer to the value instead. + +Because a `Box` is a pointer, Rust always knows how much space a `Box` +needs: a pointer’s size doesn’t change based on the amount of data it’s +pointing to. This means we can put a `Box` inside the `Cons` variant instead +of another `List` value directly. The `Box` will point to the next `List` +value that will be on the heap rather than inside the `Cons` variant. +Conceptually, we still have a list, created with lists holding other lists, but +this implementation is now more like placing the items next to one another +rather than inside one another. + +We can change the definition of the `List` enum in Listing 15-2 and the usage +of the `List` in Listing 15-3 to the code in Listing 15-5, which will compile. + +Filename: src/main.rs + +``` +enum List { + Cons(i32, Box), + Nil, +} + +use crate::List::{Cons, Nil}; + +fn main() { + let list = Cons( + 1, + Box::new(Cons( + 2, + Box::new(Cons( + 3, + Box::new(Nil) + )) + )) + ); +} +``` + +Listing 15-5: Definition of `List` that uses `Box` in order to have a known +size + +The `Cons` variant needs the size of an `i32` plus the space to store the box’s +pointer data. The `Nil` variant stores no values, so it needs less space than +the `Cons` variant. We now know that any `List` value will take up the size of +an `i32` plus the size of a box’s pointer data. By using a box, we’ve broken +the infinite, recursive chain, so the compiler can figure out the size it needs +to store a `List` value. Figure 15-2 shows what the `Cons` variant looks like +now. + +Figure 15-2: A `List` that is not infinitely sized, because `Cons` holds a `Box` + +Boxes provide only the indirection and heap allocation; they don’t have any +other special capabilities, like those we’ll see with the other smart pointer +types. They also don’t have the performance overhead that these special +capabilities incur, so they can be useful in cases like the cons list where the +indirection is the only feature we need. We’ll look at more use cases for boxes +in Chapter 17. + +The `Box` type is a smart pointer because it implements the `Deref` trait, +which allows `Box` values to be treated like references. When a `Box` +value goes out of scope, the heap data that the box is pointing to is cleaned +up as well because of the `Drop` trait implementation. These two traits will be +even more important to the functionality provided by the other smart pointer +types we’ll discuss in the rest of this chapter. Let’s explore these two traits +in more detail. + +## Treating Smart Pointers Like Regular References with Deref + +Implementing the `Deref` trait allows you to customize the behavior of the +*dereference operator* `*` (not to be confused with the multiplication or glob +operator). By implementing `Deref` in such a way that a smart pointer can be +treated like a regular reference, you can write code that operates on +references and use that code with smart pointers too. + +Let’s first look at how the dereference operator works with regular references. +Then we’ll try to define a custom type that behaves like `Box`, and see why +the dereference operator doesn’t work like a reference on our newly defined +type. We’ll explore how implementing the `Deref` trait makes it possible for +smart pointers to work in ways similar to references. Then we’ll look at Rust’s +*deref coercion* feature and how it lets us work with either references or +smart pointers. + +> Note: There’s one big difference between the `MyBox` type we’re about to +build and the real `Box`: our version will not store its data on the heap. +We are focusing this example on `Deref`, so where the data is actually stored +is less important than the pointer-like behavior. + +### Following the Pointer to the Value + +A regular reference is a type of pointer, and one way to think of a pointer is +as an arrow to a value stored somewhere else. In Listing 15-6, we create a +reference to an `i32` value and then use the dereference operator to follow the +reference to the value. + +Filename: src/main.rs + +``` +fn main() { + 1 let x = 5; + 2 let y = &x; + + 3 assert_eq!(5, x); + 4 assert_eq!(5, *y); +} +``` + +Listing 15-6: Using the dereference operator to follow a reference to an `i32` +value + +The variable `x` holds an `i32` value `5` [1]. We set `y` equal to a reference +to `x` [2]. We can assert that `x` is equal to `5` [3]. However, if we want to +make an assertion about the value in `y`, we have to use `*y` to follow the +reference to the value it’s pointing to (hence *dereference*) so the compiler +can compare the actual value [4]. Once we dereference `y`, we have access to +the integer value `y` is pointing to that we can compare with `5`. + +If we tried to write `assert_eq!(5, y);` instead, we would get this compilation +error: + +``` +error[E0277]: can't compare `{integer}` with `&{integer}` + --> src/main.rs:6:5 + | +6 | assert_eq!(5, y); + | ^^^^^^^^^^^^^^^^ no implementation for `{integer} == +&{integer}` + | + = help: the trait `PartialEq<&{integer}>` is not implemented +for `{integer}` +``` + +Comparing a number and a reference to a number isn’t allowed because they’re +different types. We must use the dereference operator to follow the reference +to the value it’s pointing to. + +### Using Box Like a Reference + +We can rewrite the code in Listing 15-6 to use a `Box` instead of a +reference; the dereference operator used on the `Box` in Listing 15-7 +functions in the same way as the dereference operator used on the reference in +Listing 15-6. + +Filename: src/main.rs + +``` +fn main() { + let x = 5; + 1 let y = Box::new(x); + + assert_eq!(5, x); + 2 assert_eq!(5, *y); +} +``` + +Listing 15-7: Using the dereference operator on a `Box` + +The main difference between Listing 15-7 and Listing 15-6 is that here we set +`y` to be an instance of a box pointing to a copied value of `x` rather than a +reference pointing to the value of `x` [1]. In the last assertion [2], we can +use the dereference operator to follow the box’s pointer in the same way that +we did when `y` was a reference. Next, we’ll explore what is special about +`Box` that enables us to use the dereference operator by defining our own +box type. + +### Defining Our Own Smart Pointer + +Let’s build a smart pointer similar to the `Box` type provided by the +standard library to experience how smart pointers behave differently from +references by default. Then we’ll look at how to add the ability to use the +dereference operator. + +The `Box` type is ultimately defined as a tuple struct with one element, so +Listing 15-8 defines a `MyBox` type in the same way. We’ll also define a +`new` function to match the `new` function defined on `Box`. + +Filename: src/main.rs + +``` + 1 struct MyBox(T); + +impl MyBox { + 2 fn new(x: T) -> MyBox { + 3 MyBox(x) + } +} +``` + +Listing 15-8: Defining a `MyBox` type + +We define a struct named `MyBox` and declare a generic parameter `T` [1] +because we want our type to hold values of any type. The `MyBox` type is a +tuple struct with one element of type `T`. The `MyBox::new` function takes one +parameter of type `T` [2] and returns a `MyBox` instance that holds the value +passed in [3]. + +Let’s try adding the `main` function in Listing 15-7 to Listing 15-8 and +changing it to use the `MyBox` type we’ve defined instead of `Box`. The +code in Listing 15-9 won’t compile because Rust doesn’t know how to dereference +`MyBox`. + +Filename: src/main.rs + +``` +fn main() { + let x = 5; + let y = MyBox::new(x); + + assert_eq!(5, x); + assert_eq!(5, *y); +} +``` + +Listing 15-9: Attempting to use `MyBox` in the same way we used references +and `Box` + +Here’s the resultant compilation error: + +``` +error[E0614]: type `MyBox<{integer}>` cannot be dereferenced + --> src/main.rs:14:19 + | +14 | assert_eq!(5, *y); + | ^^ +``` + +Our `MyBox` type can’t be dereferenced because we haven’t implemented that +ability on our type. To enable dereferencing with the `*` operator, we +implement the `Deref` trait. + +### Implementing the Deref Trait + +As discussed in “Implementing a Trait on a Type” on page XX, to implement a +trait we need to provide implementations for the trait’s required methods. The +`Deref` trait, provided by the standard library, requires us to implement one +method named `deref` that borrows `self` and returns a reference to the inner +data. Listing 15-10 contains an implementation of `Deref` to add to the +definition of `MyBox```. + +Filename: src/main.rs + +``` +use std::ops::Deref; + +impl Deref for MyBox { + 1 type Target = T; + + fn deref(&self) -> &Self::Target { + 2 &self.0 + } +} +``` + +Listing 15-10: Implementing `Deref` on `MyBox` + +The `type Target = T;` syntax [1] defines an associated type for the `Deref` +trait to use. Associated types are a slightly different way of declaring a +generic parameter, but you don’t need to worry about them for now; we’ll cover +them in more detail in Chapter 19. + +We fill in the body of the `deref` method with `&self.0` so `deref` returns a +reference to the value we want to access with the `*` operator [2]; recall from +“Using Tuple Structs Without Named Fields to Create Different Types” on page XX +that `.0` accesses the first value in a tuple struct. The `main` function in +Listing 15-9 that calls `*` on the `MyBox` value now compiles, and the +assertions pass! + +Without the `Deref` trait, the compiler can only dereference `&` references. +The `deref` method gives the compiler the ability to take a value of any type +that implements `Deref` and call the `deref` method to get a `&` reference that +it knows how to dereference. + +When we entered `*y` in Listing 15-9, behind the scenes Rust actually ran this +code: + +``` +*(y.deref()) +``` + +Rust substitutes the `*` operator with a call to the `deref` method and then a +plain dereference so we don’t have to think about whether or not we need to +call the `deref` method. This Rust feature lets us write code that functions +identically whether we have a regular reference or a type that implements +`Deref`. + +The reason the `deref` method returns a reference to a value, and that the +plain dereference outside the parentheses in `*(y.deref())` is still necessary, +has to do with the ownership system. If the `deref` method returned the value +directly instead of a reference to the value, the value would be moved out of +`self`. We don’t want to take ownership of the inner value inside `MyBox` in +this case or in most cases where we use the dereference operator. + +Note that the `*` operator is replaced with a call to the `deref` method and +then a call to the `*` operator just once, each time we use a `*` in our code. +Because the substitution of the `*` operator does not recurse infinitely, we +end up with data of type `i32`, which matches the `5` in `assert_eq!` in +Listing 15-9. + +### Implicit Deref Coercions with Functions and Methods + +*Deref coercion* converts a reference to a type that implements the `Deref` +trait into a reference to another type. For example, deref coercion can convert +`&String` to `&str` because `String` implements the `Deref` trait such that it +returns `&str`. Deref coercion is a convenience Rust performs on arguments to +functions and methods, and works only on types that implement the `Deref` +trait. It happens automatically when we pass a reference to a particular type’s +value as an argument to a function or method that doesn’t match the parameter +type in the function or method definition. A sequence of calls to the `deref` +method converts the type we provided into the type the parameter needs. + +Deref coercion was added to Rust so that programmers writing function and +method calls don’t need to add as many explicit references and dereferences +with `&` and `*`. The deref coercion feature also lets us write more code that +can work for either references or smart pointers. + +To see deref coercion in action, let’s use the `MyBox` type we defined in +Listing 15-8 as well as the implementation of `Deref` that we added in Listing +15-10. Listing 15-11 shows the definition of a function that has a string slice +parameter. + +Filename: src/main.rs + +``` +fn hello(name: &str) { + println!("Hello, {name}!"); +} +``` + +Listing 15-11: A `hello` function that has the parameter `name` of type `&str` + +We can call the `hello` function with a string slice as an argument, such as +`hello("Rust");`, for example. Deref coercion makes it possible to call `hello` +with a reference to a value of type `MyBox`, as shown in Listing 15-12. + +Filename: src/main.rs + +``` +fn main() { + let m = MyBox::new(String::from("Rust")); + hello(&m); +} +``` + +Listing 15-12: Calling `hello` with a reference to a `MyBox` value, +which works because of deref coercion + +Here we’re calling the `hello` function with the argument `&m`, which is a +reference to a `MyBox` value. Because we implemented the `Deref` trait +on `MyBox` in Listing 15-10, Rust can turn `&MyBox` into `&String` +by calling `deref`. The standard library provides an implementation of `Deref` +on `String` that returns a string slice, and this is in the API documentation +for `Deref`. Rust calls `deref` again to turn the `&String` into `&str`, which +matches the `hello` function’s definition. + +If Rust didn’t implement deref coercion, we would have to write the code in +Listing 15-13 instead of the code in Listing 15-12 to call `hello` with a value +of type `&MyBox`. + +Filename: src/main.rs + +``` +fn main() { + let m = MyBox::new(String::from("Rust")); + hello(&(*m)[..]); +} +``` + +Listing 15-13: The code we would have to write if Rust didn’t have deref +coercion + +The `(*m)` dereferences the `MyBox` into a `String`. Then the `&` and +`[..]` take a string slice of the `String` that is equal to the whole string to +match the signature of `hello`. This code without deref coercions is harder to +read, write, and understand with all of these symbols involved. Deref coercion +allows Rust to handle these conversions for us automatically. + +When the `Deref` trait is defined for the types involved, Rust will analyze the +types and use `Deref::deref` as many times as necessary to get a reference to +match the parameter’s type. The number of times that `Deref::deref` needs to be +inserted is resolved at compile time, so there is no runtime penalty for taking +advantage of deref coercion! + +### How Deref Coercion Interacts with Mutability + +Similar to how you use the `Deref` trait to override the `*` operator on +immutable references, you can use the `DerefMut` trait to override the `*` +operator on mutable references. + +Rust does deref coercion when it finds types and trait implementations in three +cases: + +* From `&T` to `&U` when `T: Deref` +* From `&mut T` to `&mut U` when `T: DerefMut` +* From `&mut T` to `&U` when `T: Deref` + +The first two cases are the same except that the second implements mutability. +The first case states that if you have a `&T`, and `T` implements `Deref` to +some type `U`, you can get a `&U` transparently. The second case states that +the same deref coercion happens for mutable references. + +The third case is trickier: Rust will also coerce a mutable reference to an +immutable one. But the reverse is *not* possible: immutable references will +never coerce to mutable references. Because of the borrowing rules, if you have +a mutable reference, that mutable reference must be the only reference to that +data (otherwise, the program wouldn’t compile). Converting one mutable +reference to one immutable reference will never break the borrowing rules. +Converting an immutable reference to a mutable reference would require that the +initial immutable reference is the only immutable reference to that data, but +the borrowing rules don’t guarantee that. Therefore, Rust can’t make the +assumption that converting an immutable reference to a mutable reference is +possible. + +## Running Code on Cleanup with the Drop Trait + +The second trait important to the smart pointer pattern is `Drop`, which lets +you customize what happens when a value is about to go out of scope. You can +provide an implementation for the `Drop` trait on any type, and that code can +be used to release resources like files or network connections. + +We’re introducing `Drop` in the context of smart pointers because the +functionality of the `Drop` trait is almost always used when implementing a +smart pointer. For example, when a `Box` is dropped it will deallocate the +space on the heap that the box points to. + +In some languages, for some types, the programmer must call code to free memory +or resources every time they finish using an instance of those types. Examples +include file handles, sockets, and locks. If they forget, the system might +become overloaded and crash. In Rust, you can specify that a particular bit of +code be run whenever a value goes out of scope, and the compiler will insert +this code automatically. As a result, you don’t need to be careful about +placing cleanup code everywhere in a program that an instance of a particular +type is finished with—you still won’t leak resources! + +You specify the code to run when a value goes out of scope by implementing the +`Drop` trait. The `Drop` trait requires you to implement one method named +`drop` that takes a mutable reference to `self`. To see when Rust calls `drop`, +let’s implement `drop` with `println!` statements for now. + +Listing 15-14 shows a `CustomSmartPointer` struct whose only custom +functionality is that it will print `Dropping CustomSmartPointer!` when the +instance goes out of scope, to show when Rust runs the `drop` method. + +Filename: src/main.rs + +``` +struct CustomSmartPointer { + data: String, +} + +1 impl Drop for CustomSmartPointer { + fn drop(&mut self) { + 2 println!( + "Dropping CustomSmartPointer with data `{}`!", + self.data + ); + } +} + +fn main() { + 3 let c = CustomSmartPointer { + data: String::from("my stuff"), + }; + 4 let d = CustomSmartPointer { + data: String::from("other stuff"), + }; + 5 println!("CustomSmartPointers created."); +6 } +``` + +Listing 15-14: A `CustomSmartPointer` struct that implements the `Drop` trait +where we would put our cleanup code + +The `Drop` trait is included in the prelude, so we don’t need to bring it into +scope. We implement the `Drop` trait on `CustomSmartPointer` [1] and provide an +implementation for the `drop` method that calls `println!` [2]. The body of the +`drop` method is where you would place any logic that you wanted to run when an +instance of your type goes out of scope. We’re printing some text here to +demonstrate visually when Rust will call `drop`. + +In `main`, we create two instances of `CustomSmartPointer` at [3] and [4] and +then print `CustomSmartPointers created` [5]. At the end of `main` [6], our +instances of `CustomSmartPointer` will go out of scope, and Rust will call the +code we put in the `drop` method [2], printing our final message. Note that we +didn’t need to call the `drop` method explicitly. + +When we run this program, we’ll see the following output: + +``` +CustomSmartPointers created. +Dropping CustomSmartPointer with data `other stuff`! +Dropping CustomSmartPointer with data `my stuff`! +``` + +Rust automatically called `drop` for us when our instances went out of scope, +calling the code we specified. Variables are dropped in the reverse order of +their creation, so `d` was dropped before `c`. This example’s purpose is to +give you a visual guide to how the `drop` method works; usually you would +specify the cleanup code that your type needs to run rather than a print +message. + +Unfortunately, it’s not straightforward to disable the automatic `drop` +functionality. Disabling `drop` isn’t usually necessary; the whole point of the +`Drop` trait is that it’s taken care of automatically. Occasionally, however, +you might want to clean up a value early. One example is when using smart +pointers that manage locks: you might want to force the `drop` method that +releases the lock so that other code in the same scope can acquire the lock. +Rust doesn’t let you call the `Drop` trait’s `drop` method manually; instead, +you have to call the `std::mem::drop` function provided by the standard library +if you want to force a value to be dropped before the end of its scope. + +If we try to call the `Drop` trait’s `drop` method manually by modifying the +`main` function from Listing 15-14, as shown in Listing 15-15, we’ll get a +compiler error. + +Filename: src/main.rs + +``` +fn main() { + let c = CustomSmartPointer { + data: String::from("some data"), + }; + println!("CustomSmartPointer created."); + c.drop(); + println!( + "CustomSmartPointer dropped before the end of main." + ); +} +``` + +Listing 15-15: Attempting to call the `drop` method from the `Drop` trait +manually to clean up early + +When we try to compile this code, we’ll get this error: + +``` +error[E0040]: explicit use of destructor method + --> src/main.rs:16:7 + | +16 | c.drop(); + | --^^^^-- + | | | + | | explicit destructor calls not allowed + | help: consider using `drop` function: `drop(c)` +``` + +This error message states that we’re not allowed to explicitly call `drop`. The +error message uses the term *destructor*, which is the general programming term +for a function that cleans up an instance. A *destructor* is analogous to a +*constructor*, which creates an instance. The `drop` function in Rust is one +particular destructor. + +Rust doesn’t let us call `drop` explicitly because Rust would still +automatically call `drop` on the value at the end of `main`. This would cause a +*double free* error because Rust would be trying to clean up the same value +twice. + +We can’t disable the automatic insertion of `drop` when a value goes out of +scope, and we can’t call the `drop` method explicitly. So, if we need to force +a value to be cleaned up early, we use the `std::mem::drop` function. + +The `std::mem::drop` function is different from the `drop` method in the `Drop` +trait. We call it by passing as an argument the value we want to force-drop. +The function is in the prelude, so we can modify `main` in Listing 15-15 to +call the `drop` function, as shown in Listing 15-16. + +Filename: src/main.rs + +``` +fn main() { + let c = CustomSmartPointer { + data: String::from("some data"), + }; + println!("CustomSmartPointer created."); + drop(c); + println!( + "CustomSmartPointer dropped before the end of main." + ); +} +``` + +Listing 15-16: Calling `std::mem::drop` to explicitly drop a value before it +goes out of scope + +Running this code will print the following: + +``` +CustomSmartPointer created. +Dropping CustomSmartPointer with data `some data`! +CustomSmartPointer dropped before the end of main. +``` + +The text `Dropping CustomSmartPointer with data `some data`!` is printed +between the `CustomSmartPointer created.` and `CustomSmartPointer dropped +before the end of main.` text, showing that the `drop` method code is called to +drop `c` at that point. + +You can use code specified in a `Drop` trait implementation in many ways to +make cleanup convenient and safe: for instance, you could use it to create your +own memory allocator! With the `Drop` trait and Rust’s ownership system, you +don’t have to remember to clean up because Rust does it automatically. + +You also don’t have to worry about problems resulting from accidentally +cleaning up values still in use: the ownership system that makes sure +references are always valid also ensures that `drop` gets called only once when +the value is no longer being used. + +Now that we’ve examined `Box` and some of the characteristics of smart +pointers, let’s look at a few other smart pointers defined in the standard +library. + +## Rc, the Reference Counted Smart Pointer + +In the majority of cases, ownership is clear: you know exactly which variable +owns a given value. However, there are cases when a single value might have +multiple owners. For example, in graph data structures, multiple edges might +point to the same node, and that node is conceptually owned by all of the edges +that point to it. A node shouldn’t be cleaned up unless it doesn’t have any +edges pointing to it and so has no owners. + +You have to enable multiple ownership explicitly by using the Rust type +`Rc`, which is an abbreviation for *reference counting*. The `Rc` type +keeps track of the number of references to a value to determine whether or not +the value is still in use. If there are zero references to a value, the value +can be cleaned up without any references becoming invalid. + +Imagine `Rc` as a TV in a family room. When one person enters to watch TV, +they turn it on. Others can come into the room and watch the TV. When the last +person leaves the room, they turn off the TV because it’s no longer being used. +If someone turns off the TV while others are still watching it, there would be +an uproar from the remaining TV watchers! + +We use the `Rc` type when we want to allocate some data on the heap for +multiple parts of our program to read and we can’t determine at compile time +which part will finish using the data last. If we knew which part would finish +last, we could just make that part the data’s owner, and the normal ownership +rules enforced at compile time would take effect. + +Note that `Rc` is only for use in single-threaded scenarios. When we discuss +concurrency in Chapter 16, we’ll cover how to do reference counting in +multithreaded programs. + +### Using Rc to Share Data + +Let’s return to our cons list example in Listing 15-5. Recall that we defined +it using `Box`. This time, we’ll create two lists that both share ownership +of a third list. Conceptually, this looks similar to Figure 15-3. + +Figure 15-3: Two lists, `b` and `c`, sharing ownership of a third list, `a` + +We’ll create list `a` that contains `5` and then `10`. Then we’ll make two more +lists: `b` that starts with `3` and `c` that starts with `4`. Both `b` and `c` +lists will then continue on to the first `a` list containing `5` and `10`. In +other words, both lists will share the first list containing `5` and `10`. + +Trying to implement this scenario using our definition of `List` with `Box` +won’t work, as shown in Listing 15-17. + +Filename: src/main.rs + +``` +enum List { + Cons(i32, Box), + Nil, +} + +use crate::List::{Cons, Nil}; + +fn main() { + let a = Cons(5, Box::new(Cons(10, Box::new(Nil)))); + 1 let b = Cons(3, Box::new(a)); + 2 let c = Cons(4, Box::new(a)); +} +``` + +Listing 15-17: Demonstrating that we’re not allowed to have two lists using +`Box` that try to share ownership of a third list + +When we compile this code, we get this error: + +``` +error[E0382]: use of moved value: `a` + --> src/main.rs:11:30 + | +9 | let a = Cons(5, Box::new(Cons(10, Box::new(Nil)))); + | - move occurs because `a` has type `List`, which +does not implement the `Copy` trait +10 | let b = Cons(3, Box::new(a)); + | - value moved here +11 | let c = Cons(4, Box::new(a)); + | ^ value used here after move +``` + +The `Cons` variants own the data they hold, so when we create the `b` list [1], +`a` is moved into `b` and `b` owns `a`. Then, when we try to use `a` again when +creating `c` [2], we’re not allowed to because `a` has been moved. + +We could change the definition of `Cons` to hold references instead, but then +we would have to specify lifetime parameters. By specifying lifetime +parameters, we would be specifying that every element in the list will live at +least as long as the entire list. This is the case for the elements and lists +in Listing 15-17, but not in every scenario. + +Instead, we’ll change our definition of `List` to use `Rc` in place of +`Box`, as shown in Listing 15-18. Each `Cons` variant will now hold a value +and an `Rc` pointing to a `List`. When we create `b`, instead of taking +ownership of `a`, we’ll clone the `Rc` that `a` is holding, thereby +increasing the number of references from one to two and letting `a` and `b` +share ownership of the data in that `Rc`. We’ll also clone `a` when +creating `c`, increasing the number of references from two to three. Every time +we call `Rc::clone`, the reference count to the data within the `Rc` will +increase, and the data won’t be cleaned up unless there are zero references to +it. + +Filename: src/main.rs + +``` +enum List { + Cons(i32, Rc), + Nil, +} + +use crate::List::{Cons, Nil}; +1 use std::rc::Rc; + +fn main() { + 2 let a = Rc::new(Cons(5, Rc::new(Cons(10, Rc::new(Nil))))); + 3 let b = Cons(3, Rc::clone(&a)); + 4 let c = Cons(4, Rc::clone(&a)); +} +``` + +Listing 15-18: A definition of `List` that uses `Rc` + +We need to add a `use` statement to bring `Rc` into scope [1] because it’s +not in the prelude. In `main`, we create the list holding `5` and `10` and +store it in a new `Rc` in `a` [2]. Then, when we create `b` [3] and `c` +[4], we call the `Rc::clone` function and pass a reference to the `Rc` in +`a` as an argument. + +We could have called `a.clone()` rather than `Rc::clone(&a)`, but Rust’s +convention is to use `Rc::clone` in this case. The implementation of +`Rc::clone` doesn’t make a deep copy of all the data like most types’ +implementations of `clone` do. The call to `Rc::clone` only increments the +reference count, which doesn’t take much time. Deep copies of data can take a +lot of time. By using `Rc::clone` for reference counting, we can visually +distinguish between the deep-copy kinds of clones and the kinds of clones that +increase the reference count. When looking for performance problems in the +code, we only need to consider the deep-copy clones and can disregard calls to +`Rc::clone`. + +### Cloning an Rc Increases the Reference Count + +Let’s change our working example in Listing 15-18 so we can see the reference +counts changing as we create and drop references to the `Rc` in `a`. + +In Listing 15-19, we’ll change `main` so it has an inner scope around list `c`; +then we can see how the reference count changes when `c` goes out of scope. + +Filename: src/main.rs + +``` +--snip-- + +fn main() { + let a = Rc::new(Cons(5, Rc::new(Cons(10, Rc::new(Nil))))); + println!( + "count after creating a = {}", + Rc::strong_count(&a) + ); + let b = Cons(3, Rc::clone(&a)); + println!( + "count after creating b = {}", + Rc::strong_count(&a) + ); + { + let c = Cons(4, Rc::clone(&a)); + println!( + "count after creating c = {}", + Rc::strong_count(&a) + ); + } + println!( + "count after c goes out of scope = {}", + Rc::strong_count(&a) + ); +} +``` + +Listing 15-19: Printing the reference count + +At each point in the program where the reference count changes, we print the +reference count, which we get by calling the `Rc::strong_count` function. This +function is named `strong_count` rather than `count` because the `Rc` type +also has a `weak_count`; we’ll see what `weak_count` is used for in “Preventing +Reference Cycles Using Weak” on page XX. + +This code prints the following: + +``` +count after creating a = 1 +count after creating b = 2 +count after creating c = 3 +count after c goes out of scope = 2 +``` + +We can see that the `Rc` in `a` has an initial reference count of 1; then +each time we call `clone`, the count goes up by 1. When `c` goes out of scope, +the count goes down by 1. We don’t have to call a function to decrease the +reference count like we have to call `Rc::clone` to increase the reference +count: the implementation of the `Drop` trait decreases the reference count +automatically when an `Rc` value goes out of scope. + +What we can’t see in this example is that when `b` and then `a` go out of scope +at the end of `main`, the count is then 0, and the `Rc` is cleaned up +completely. Using `Rc` allows a single value to have multiple owners, and +the count ensures that the value remains valid as long as any of the owners +still exist. + +Via immutable references, `Rc` allows you to share data between multiple +parts of your program for reading only. If `Rc` allowed you to have multiple +mutable references too, you might violate one of the borrowing rules discussed +in Chapter 4: multiple mutable borrows to the same place can cause data races +and inconsistencies. But being able to mutate data is very useful! In the next +section, we’ll discuss the interior mutability pattern and the `RefCell` +type that you can use in conjunction with an `Rc` to work with this +immutability restriction. + +## RefCell and the Interior Mutability Pattern + +*Interior mutability* is a design pattern in Rust that allows you to mutate +data even when there are immutable references to that data; normally, this +action is disallowed by the borrowing rules. To mutate data, the pattern uses +`unsafe` code inside a data structure to bend Rust’s usual rules that govern +mutation and borrowing. Unsafe code indicates to the compiler that we’re +checking the rules manually instead of relying on the compiler to check them +for us; we will discuss unsafe code more in Chapter 19. + +We can use types that use the interior mutability pattern only when we can +ensure that the borrowing rules will be followed at runtime, even though the +compiler can’t guarantee that. The `unsafe` code involved is then wrapped in a +safe API, and the outer type is still immutable. + +Let’s explore this concept by looking at the `RefCell` type that follows the +interior mutability pattern. + +### Enforcing Borrowing Rules at Runtime with RefCell + +Unlike `Rc`, the `RefCell` type represents single ownership over the data +it holds. So what makes `RefCell` different from a type like `Box`? +Recall the borrowing rules you learned in Chapter 4: + +* At any given time, you can have *either* one mutable reference or any number +of immutable references (but not both). +* References must always be valid. + +With references and `Box`, the borrowing rules’ invariants are enforced at +compile time. With `RefCell`, these invariants are enforced *at runtime*. +With references, if you break these rules, you’ll get a compiler error. With +`RefCell`, if you break these rules, your program will panic and exit. + +The advantages of checking the borrowing rules at compile time are that errors +will be caught sooner in the development process, and there is no impact on +runtime performance because all the analysis is completed beforehand. For those +reasons, checking the borrowing rules at compile time is the best choice in the +majority of cases, which is why this is Rust’s default. + +The advantage of checking the borrowing rules at runtime instead is that +certain memory-safe scenarios are then allowed, where they would’ve been +disallowed by the compile-time checks. Static analysis, like the Rust compiler, +is inherently conservative. Some properties of code are impossible to detect by +analyzing the code: the most famous example is the Halting Problem, which is +beyond the scope of this book but is an interesting topic to research. + +Because some analysis is impossible, if the Rust compiler can’t be sure the +code complies with the ownership rules, it might reject a correct program; in +this way, it’s conservative. If Rust accepted an incorrect program, users +wouldn’t be able to trust in the guarantees Rust makes. However, if Rust +rejects a correct program, the programmer will be inconvenienced, but nothing +catastrophic can occur. The `RefCell` type is useful when you’re sure your +code follows the borrowing rules but the compiler is unable to understand and +guarantee that. + +Similar to `Rc`, `RefCell` is only for use in single-threaded scenarios +and will give you a compile-time error if you try using it in a multithreaded +context. We’ll talk about how to get the functionality of `RefCell` in a +multithreaded program in Chapter 16. + +Here is a recap of the reasons to choose `Box`, `Rc`, or `RefCell`: + +* `Rc` enables multiple owners of the same data; `Box` and `RefCell` +have single owners. +* `Box` allows immutable or mutable borrows checked at compile time; `Rc` +allows only immutable borrows checked at compile time; `RefCell` allows +immutable or mutable borrows checked at runtime. +* Because `RefCell` allows mutable borrows checked at runtime, you can +mutate the value inside the `RefCell` even when the `RefCell` is +immutable. + +Mutating the value inside an immutable value is the *interior mutability* +pattern. Let’s look at a situation in which interior mutability is useful and +examine how it’s possible. + +### Interior Mutability: A Mutable Borrow to an Immutable Value + +A consequence of the borrowing rules is that when you have an immutable value, +you can’t borrow it mutably. For example, this code won’t compile: + +Filename: src/main.rs + +``` +fn main() { + let x = 5; + let y = &mut x; +} +``` + +If you tried to compile this code, you’d get the following error: + +``` +error[E0596]: cannot borrow `x` as mutable, as it is not declared +as mutable + --> src/main.rs:3:13 + | +2 | let x = 5; + | - help: consider changing this to be mutable: `mut x` +3 | let y = &mut x; + | ^^^^^^ cannot borrow as mutable +``` + +However, there are situations in which it would be useful for a value to mutate +itself in its methods but appear immutable to other code. Code outside the +value’s methods would not be able to mutate the value. Using `RefCell` is +one way to get the ability to have interior mutability, but `RefCell` +doesn’t get around the borrowing rules completely: the borrow checker in the +compiler allows this interior mutability, and the borrowing rules are checked +at runtime instead. If you violate the rules, you’ll get a `panic!` instead of +a compiler error. + +Let’s work through a practical example where we can use `RefCell` to mutate +an immutable value and see why that is useful. + +#### A Use Case for Interior Mutability: Mock Objects + +Sometimes during testing a programmer will use a type in place of another type, +in order to observe particular behavior and assert that it’s implemented +correctly. This placeholder type is called a *test double*. Think of it in the +sense of a stunt double in filmmaking, where a person steps in and substitutes +for an actor to do a particularly tricky scene. Test doubles stand in for other +types when we’re running tests. *Mock objects* are specific types of test +doubles that record what happens during a test so you can assert that the +correct actions took place. + +Rust doesn’t have objects in the same sense as other languages have objects, +and Rust doesn’t have mock object functionality built into the standard library +as some other languages do. However, you can definitely create a struct that +will serve the same purposes as a mock object. + +Here’s the scenario we’ll test: we’ll create a library that tracks a value +against a maximum value and sends messages based on how close to the maximum +value the current value is. This library could be used to keep track of a +user’s quota for the number of API calls they’re allowed to make, for example. + +Our library will only provide the functionality of tracking how close to the +maximum a value is and what the messages should be at what times. Applications +that use our library will be expected to provide the mechanism for sending the +messages: the application could put a message in the application, send an +email, send a text message, or do something else. The library doesn’t need to +know that detail. All it needs is something that implements a trait we’ll +provide called `Messenger`. Listing 15-20 shows the library code. + +Filename: src/lib.rs + +``` +pub trait Messenger { + 1 fn send(&self, msg: &str); +} + +pub struct LimitTracker<'a, T: Messenger> { + messenger: &'a T, + value: usize, + max: usize, +} + +impl<'a, T> LimitTracker<'a, T> +where + T: Messenger, +{ + pub fn new( + messenger: &'a T, + max: usize + ) -> LimitTracker<'a, T> { + LimitTracker { + messenger, + value: 0, + max, + } + } + + 2 pub fn set_value(&mut self, value: usize) { + self.value = value; + + let percentage_of_max = + self.value as f64 / self.max as f64; + + if percentage_of_max >= 1.0 { + self.messenger + .send("Error: You are over your quota!"); + } else if percentage_of_max >= 0.9 { + self.messenger + .send("Urgent: You're at 90% of your quota!"); + } else if percentage_of_max >= 0.75 { + self.messenger + .send("Warning: You're at 75% of your quota!"); + } + } +} +``` + +Listing 15-20: A library to keep track of how close a value is to a maximum +value and warn when the value is at certain levels + +One important part of this code is that the `Messenger` trait has one method +called `send` that takes an immutable reference to `self` and the text of the +message [1]. This trait is the interface our mock object needs to implement so +that the mock can be used in the same way a real object is. The other important +part is that we want to test the behavior of the `set_value` method on the +`LimitTracker` [2]. We can change what we pass in for the `value` parameter, +but `set_value` doesn’t return anything for us to make assertions on. We want +to be able to say that if we create a `LimitTracker` with something that +implements the `Messenger` trait and a particular value for `max`, when we pass +different numbers for `value` the messenger is told to send the appropriate +messages. + +We need a mock object that, instead of sending an email or text message when we +call `send`, will only keep track of the messages it’s told to send. We can +create a new instance of the mock object, create a `LimitTracker` that uses the +mock object, call the `set_value` method on `LimitTracker`, and then check that +the mock object has the messages we expect. Listing 15-21 shows an attempt to +implement a mock object to do just that, but the borrow checker won’t allow it. + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + + 1 struct MockMessenger { + 2 sent_messages: Vec, + } + + impl MockMessenger { + 3 fn new() -> MockMessenger { + MockMessenger { + sent_messages: vec![], + } + } + } + + 4 impl Messenger for MockMessenger { + fn send(&self, message: &str) { + 5 self.sent_messages.push(String::from(message)); + } + } + + #[test] + 6 fn it_sends_an_over_75_percent_warning_message() { + let mock_messenger = MockMessenger::new(); + let mut limit_tracker = LimitTracker::new( + &mock_messenger, + 100 + ); + + limit_tracker.set_value(80); + + assert_eq!(mock_messenger.sent_messages.len(), 1); + } +} +``` + +Listing 15-21: An attempt to implement a `MockMessenger` that isn’t allowed by +the borrow checker + +This test code defines a `MockMessenger` struct [1] that has a `sent_messages` +field with a `Vec` of `String` values [2] to keep track of the messages it’s +told to send. We also define an associated function `new` [3] to make it +convenient to create new `MockMessenger` values that start with an empty list +of messages. We then implement the `Messenger` trait for `MockMessenger` [4] so +we can give a `MockMessenger` to a `LimitTracker`. In the definition of the +`send` method [5], we take the message passed in as a parameter and store it in +the `MockMessenger` list of `sent_messages`. + +In the test, we’re testing what happens when the `LimitTracker` is told to set +`value` to something that is more than 75 percent of the `max` value [6]. First +we create a new `MockMessenger`, which will start with an empty list of +messages. Then we create a new `LimitTracker` and give it a reference to the +new `MockMessenger` and a `max` value of `100`. We call the `set_value` method +on the `LimitTracker` with a value of `80`, which is more than 75 percent of +100. Then we assert that the list of messages that the `MockMessenger` is +keeping track of should now have one message in it. + +However, there’s one problem with this test, as shown here: + +``` +error[E0596]: cannot borrow `self.sent_messages` as mutable, as it is behind a +`&` reference + --> src/lib.rs:58:13 + | +2 | fn send(&self, msg: &str); + | ----- help: consider changing that to be a mutable reference: +`&mut self` +... +58 | self.sent_messages.push(String::from(message)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `self` is a +`&` reference, so the data it refers to cannot be borrowed as mutable +``` + +We can’t modify the `MockMessenger` to keep track of the messages because the +`send` method takes an immutable reference to `self`. We also can’t take the +suggestion from the error text to use `&mut self` instead because then the +signature of `send` wouldn’t match the signature in the `Messenger` trait +definition (feel free to try it and see what error message you get). + +This is a situation in which interior mutability can help! We’ll store the +`sent_messages` within a `RefCell`, and then the `send` method will be able +to modify `sent_messages` to store the messages we’ve seen. Listing 15-22 shows +what that looks like. + +Filename: src/lib.rs + +``` +#[cfg(test)] +mod tests { + use super::*; + use std::cell::RefCell; + + struct MockMessenger { + 1 sent_messages: RefCell>, + } + + impl MockMessenger { + fn new() -> MockMessenger { + MockMessenger { + 2 sent_messages: RefCell::new(vec![]), + } + } + } + + impl Messenger for MockMessenger { + fn send(&self, message: &str) { + self.sent_messages + 3 .borrow_mut() + .push(String::from(message)); + } + } + + #[test] + fn it_sends_an_over_75_percent_warning_message() { + --snip-- + + assert_eq!( + 4 mock_messenger.sent_messages.borrow().len(), + 1 + ); + } +} +``` + +Listing 15-22: Using `RefCell` to mutate an inner value while the outer +value is considered immutable + +The `sent_messages` field is now of type `RefCell>` [1] instead of +`Vec`. In the `new` function, we create a new `RefCell>` +instance around the empty vector [2]. + +For the implementation of the `send` method, the first parameter is still an +immutable borrow of `self`, which matches the trait definition. We call +`borrow_mut` on the `RefCell>` in `self.sent_messages` [3] to get a +mutable reference to the value inside the `RefCell>`, which is the +vector. Then we can call `push` on the mutable reference to the vector to keep +track of the messages sent during the test. + +The last change we have to make is in the assertion: to see how many items are +in the inner vector, we call `borrow` on the `RefCell>` to get an +immutable reference to the vector [4]. + +Now that you’ve seen how to use `RefCell`, let’s dig into how it works! + +#### Keeping Track of Borrows at Runtime with RefCell + +When creating immutable and mutable references, we use the `&` and `&mut` +syntax, respectively. With `RefCell`, we use the `borrow` and `borrow_mut` +methods, which are part of the safe API that belongs to `RefCell`. The +`borrow` method returns the smart pointer type `Ref`, and `borrow_mut` +returns the smart pointer type `RefMut`. Both types implement `Deref`, so we +can treat them like regular references. + +The `RefCell` keeps track of how many `Ref` and `RefMut` smart +pointers are currently active. Every time we call `borrow`, the `RefCell` +increases its count of how many immutable borrows are active. When a `Ref` +value goes out of scope, the count of immutable borrows goes down by 1. Just +like the compile-time borrowing rules, `RefCell` lets us have many immutable +borrows or one mutable borrow at any point in time. + +If we try to violate these rules, rather than getting a compiler error as we +would with references, the implementation of `RefCell` will panic at +runtime. Listing 15-23 shows a modification of the implementation of `send` in +Listing 15-22. We’re deliberately trying to create two mutable borrows active +for the same scope to illustrate that `RefCell` prevents us from doing this +at runtime. + +Filename: src/lib.rs + +``` +impl Messenger for MockMessenger { + fn send(&self, message: &str) { + let mut one_borrow = self.sent_messages.borrow_mut(); + let mut two_borrow = self.sent_messages.borrow_mut(); + + one_borrow.push(String::from(message)); + two_borrow.push(String::from(message)); + } +} +``` + +Listing 15-23: Creating two mutable references in the same scope to see that +`RefCell` will panic + +We create a variable `one_borrow` for the `RefMut` smart pointer returned +from `borrow_mut`. Then we create another mutable borrow in the same way in the +variable `two_borrow`. This makes two mutable references in the same scope, +which isn’t allowed. When we run the tests for our library, the code in Listing +15-23 will compile without any errors, but the test will fail: + +``` +---- tests::it_sends_an_over_75_percent_warning_message stdout ---- +thread 'main' panicked at 'already borrowed: BorrowMutError', src/lib.rs:60:53 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +``` + +Notice that the code panicked with the message `already borrowed: +BorrowMutError`. This is how `RefCell` handles violations of the borrowing +rules at runtime. + +Choosing to catch borrowing errors at runtime rather than compile time, as +we’ve done here, means you’d potentially be finding mistakes in your code later +in the development process: possibly not until your code was deployed to +production. Also, your code would incur a small runtime performance penalty as +a result of keeping track of the borrows at runtime rather than compile time. +However, using `RefCell` makes it possible to write a mock object that can +modify itself to keep track of the messages it has seen while you’re using it +in a context where only immutable values are allowed. You can use `RefCell` +despite its trade-offs to get more functionality than regular references +provide. + +### Allowing Multiple Owners of Mutable Data with Rc and RefCell + +A common way to use `RefCell` is in combination with `Rc`. Recall that +`Rc` lets you have multiple owners of some data, but it only gives immutable +access to that data. If you have an `Rc` that holds a `RefCell`, you can +get a value that can have multiple owners *and* that you can mutate! + +For example, recall the cons list example in Listing 15-18 where we used +`Rc` to allow multiple lists to share ownership of another list. Because +`Rc` holds only immutable values, we can’t change any of the values in the +list once we’ve created them. Let’s add in `RefCell` for its ability to +change the values in the lists. Listing 15-24 shows that by using a +`RefCell` in the `Cons` definition, we can modify the value stored in all +the lists. + +Filename: src/main.rs + +``` +#[derive(Debug)] +enum List { + Cons(Rc>, Rc), + Nil, +} + +use crate::List::{Cons, Nil}; +use std::cell::RefCell; +use std::rc::Rc; + +fn main() { + 1 let value = Rc::new(RefCell::new(5)); + + 2 let a = Rc::new(Cons(Rc::clone(&value), Rc::new(Nil))); + + let b = Cons(Rc::new(RefCell::new(3)), Rc::clone(&a)); + let c = Cons(Rc::new(RefCell::new(4)), Rc::clone(&a)); + + 3 *value.borrow_mut() += 10; + + println!("a after = {:?}", a); + println!("b after = {:?}", b); + println!("c after = {:?}", c); +} +``` + +Listing 15-24: Using `Rc>` to create a `List` that we can mutate + +We create a value that is an instance of `Rc>` and store it in a +variable named `value` [1] so we can access it directly later. Then we create a +`List` in `a` with a `Cons` variant that holds `value` [2]. We need to clone +`value` so both `a` and `value` have ownership of the inner `5` value rather +than transferring ownership from `value` to `a` or having `a` borrow from +`value`. + +We wrap the list `a` in an `Rc` so when we create lists `b` and `c`, they +can both refer to `a`, which is what we did in Listing 15-18. + +After we’ve created the lists in `a`, `b`, and `c`, we want to add 10 to the +value in `value` [3]. We do this by calling `borrow_mut` on `value`, which uses +the automatic dereferencing feature we discussed in “Where’s the -> Operator?” +on page XX to dereference the `Rc` to the inner `RefCell` value. The +`borrow_mut` method returns a `RefMut` smart pointer, and we use the +dereference operator on it and change the inner value. + +When we print `a`, `b`, and `c`, we can see that they all have the modified +value of `15` rather than `5`: + +``` +a after = Cons(RefCell { value: 15 }, Nil) +b after = Cons(RefCell { value: 3 }, Cons(RefCell { value: 15 }, Nil)) +c after = Cons(RefCell { value: 4 }, Cons(RefCell { value: 15 }, Nil)) +``` + +This technique is pretty neat! By using `RefCell`, we have an outwardly +immutable `List` value. But we can use the methods on `RefCell` that provide +access to its interior mutability so we can modify our data when we need to. +The runtime checks of the borrowing rules protect us from data races, and it’s +sometimes worth trading a bit of speed for this flexibility in our data +structures. Note that `RefCell` does not work for multithreaded code! +`Mutex` is the thread-safe version of `RefCell`, and we’ll discuss +`Mutex` in Chapter 16. + +## Reference Cycles Can Leak Memory + +Rust’s memory safety guarantees make it difficult, but not impossible, to +accidentally create memory that is never cleaned up (known as a *memory leak*). +Preventing memory leaks entirely is not one of Rust’s guarantees, meaning +memory leaks are memory safe in Rust. We can see that Rust allows memory leaks +by using `Rc` and `RefCell`: it’s possible to create references where +items refer to each other in a cycle. This creates memory leaks because the +reference count of each item in the cycle will never reach 0, and the values +will never be dropped. + +### Creating a Reference Cycle + +Let’s look at how a reference cycle might happen and how to prevent it, +starting with the definition of the `List` enum and a `tail` method in Listing +15-25. + +Filename: src/main.rs + +``` +use crate::List::{Cons, Nil}; +use std::cell::RefCell; +use std::rc::Rc; + +#[derive(Debug)] +enum List { + 1 Cons(i32, RefCell>), + Nil, +} + +impl List { + 2 fn tail(&self) -> Option<&RefCell>> { + match self { + Cons(_, item) => Some(item), + Nil => None, + } + } +} +``` + +Listing 15-25: A cons list definition that holds a `RefCell` so we can +modify what a `Cons` variant is referring to + +We’re using another variation of the `List` definition from Listing 15-5. The +second element in the `Cons` variant is now `RefCell>` [1], meaning +that instead of having the ability to modify the `i32` value as we did in +Listing 15-24, we want to modify the `List` value a `Cons` variant is pointing +to. We’re also adding a `tail` method [2] to make it convenient for us to +access the second item if we have a `Cons` variant. + +In Listing 15-26, we’re adding a `main` function that uses the definitions in +Listing 15-25. This code creates a list in `a` and a list in `b` that points to +the list in `a`. Then it modifies the list in `a` to point to `b`, creating a +reference cycle. There are `println!` statements along the way to show what the +reference counts are at various points in this process. + +Filename: src/main.rs + +``` +fn main() { + 1 let a = Rc::new(Cons(5, RefCell::new(Rc::new(Nil)))); + + println!("a initial rc count = {}", Rc::strong_count(&a)); + println!("a next item = {:?}", a.tail()); + + 2 let b = Rc::new(Cons(10, RefCell::new(Rc::clone(&a)))); + + println!( + "a rc count after b creation = {}", + Rc::strong_count(&a) + ); + println!("b initial rc count = {}", Rc::strong_count(&b)); + println!("b next item = {:?}", b.tail()); + + 3 if let Some(link) = a.tail() { + 4 *link.borrow_mut() = Rc::clone(&b); + } + + println!( + "b rc count after changing a = {}", + Rc::strong_count(&b) + ); + println!( + "a rc count after changing a = {}", + Rc::strong_count(&a) + ); + + // Uncomment the next line to see that we have a cycle; + // it will overflow the stack + // println!("a next item = {:?}", a.tail()); +} +``` + +Listing 15-26: Creating a reference cycle of two `List` values pointing to each +other + +We create an `Rc` instance holding a `List` value in the variable `a` +with an initial list of `5, Nil` [1]. We then create an `Rc` instance +holding another `List` value in the variable `b` that contains the value `10` +and points to the list in `a` [2]. + +We modify `a` so it points to `b` instead of `Nil`, creating a cycle. We do +that by using the `tail` method to get a reference to the `RefCell>` +in `a`, which we put in the variable `link` [3]. Then we use the `borrow_mut` +method on the `RefCell>` to change the value inside from an `Rc` +that holds a `Nil` value to the `Rc` in `b` [4]. + +When we run this code, keeping the last `println!` commented out for the +moment, we’ll get this output: + +``` +a initial rc count = 1 +a next item = Some(RefCell { value: Nil }) +a rc count after b creation = 2 +b initial rc count = 1 +b next item = Some(RefCell { value: Cons(5, RefCell { value: Nil }) }) +b rc count after changing a = 2 +a rc count after changing a = 2 +``` + +The reference count of the `Rc` instances in both `a` and `b` is 2 after +we change the list in `a` to point to `b`. At the end of `main`, Rust drops the +variable `b`, which decreases the reference count of the `b` `Rc` +instance from 2 to 1. The memory that `Rc` has on the heap won’t be +dropped at this point because its reference count is 1, not 0. Then Rust drops +`a`, which decreases the reference count of the `a` `Rc` instance from 2 +to 1 as well. This instance’s memory can’t be dropped either, because the other +`Rc` instance still refers to it. The memory allocated to the list will +remain uncollected forever. To visualize this reference cycle, we’ve created a +diagram in Figure 15-4. + +Figure 15-4: A reference cycle of lists `a` and `b` pointing to each other + +If you uncomment the last `println!` and run the program, Rust will try to +print this cycle with `a` pointing to `b` pointing to `a` and so forth until it +overflows the stack. + +Compared to a real-world program, the consequences of creating a reference +cycle in this example aren’t very dire: right after we create the reference +cycle, the program ends. However, if a more complex program allocated lots of +memory in a cycle and held onto it for a long time, the program would use more +memory than it needed and might overwhelm the system, causing it to run out of +available memory. + +Creating reference cycles is not easily done, but it’s not impossible either. +If you have `RefCell` values that contain `Rc` values or similar nested +combinations of types with interior mutability and reference counting, you must +ensure that you don’t create cycles; you can’t rely on Rust to catch them. +Creating a reference cycle would be a logic bug in your program that you should +use automated tests, code reviews, and other software development practices to +minimize. + +Another solution for avoiding reference cycles is reorganizing your data +structures so that some references express ownership and some references don’t. +As a result, you can have cycles made up of some ownership relationships and +some non-ownership relationships, and only the ownership relationships affect +whether or not a value can be dropped. In Listing 15-25, we always want `Cons` +variants to own their list, so reorganizing the data structure isn’t possible. +Let’s look at an example using graphs made up of parent nodes and child nodes +to see when non-ownership relationships are an appropriate way to prevent +reference cycles. + +### Preventing Reference Cycles Using Weak + +So far, we’ve demonstrated that calling `Rc::clone` increases the +`strong_count` of an `Rc` instance, and an `Rc` instance is only cleaned +up if its `strong_count` is 0. You can also create a *weak reference* to the +value within an `Rc` instance by calling `Rc::downgrade` and passing a +reference to the `Rc`. Strong references are how you can share ownership of +an `Rc` instance. Weak references don’t express an ownership relationship, +and their count doesn’t affect when an `Rc` instance is cleaned up. They +won’t cause a reference cycle because any cycle involving some weak references +will be broken once the strong reference count of values involved is 0. + +When you call `Rc::downgrade`, you get a smart pointer of type `Weak`. +Instead of increasing the `strong_count` in the `Rc` instance by 1, calling +`Rc::downgrade` increases the `weak_count` by 1. The `Rc` type uses +`weak_count` to keep track of how many `Weak` references exist, similar to +`strong_count`. The difference is the `weak_count` doesn’t need to be 0 for the +`Rc` instance to be cleaned up. + +Because the value that `Weak` references might have been dropped, to do +anything with the value that a `Weak` is pointing to you must make sure the +value still exists. Do this by calling the `upgrade` method on a `Weak` +instance, which will return an `Option>`. You’ll get a result of `Some` +if the `Rc` value has not been dropped yet and a result of `None` if the +`Rc` value has been dropped. Because `upgrade` returns an `Option>`, +Rust will ensure that the `Some` case and the `None` case are handled, and +there won’t be an invalid pointer. + +As an example, rather than using a list whose items know only about the next +item, we’ll create a tree whose items know about their children items *and* +their parent items. + +#### Creating a Tree Data Structure: A Node with Child Nodes + +To start, we’ll build a tree with nodes that know about their child nodes. +We’ll create a struct named `Node` that holds its own `i32` value as well as +references to its children `Node` values: + +Filename: src/main.rs + +``` +use std::cell::RefCell; +use std::rc::Rc; + +#[derive(Debug)] +struct Node { + value: i32, + children: RefCell>>, +} +``` + +We want a `Node` to own its children, and we want to share that ownership with +variables so we can access each `Node` in the tree directly. To do this, we +define the `Vec` items to be values of type `Rc`. We also want to +modify which nodes are children of another node, so we have a `RefCell` in +`children` around the `Vec>`. + +Next, we’ll use our struct definition and create one `Node` instance named +`leaf` with the value `3` and no children, and another instance named `branch` +with the value `5` and `leaf` as one of its children, as shown in Listing 15-27. + +Filename: src/main.rs + +``` +fn main() { + let leaf = Rc::new(Node { + value: 3, + children: RefCell::new(vec![]), + }); + + let branch = Rc::new(Node { + value: 5, + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); +} +``` + +Listing 15-27: Creating a `leaf` node with no children and a `branch` node with +`leaf` as one of its children + +We clone the `Rc` in `leaf` and store that in `branch`, meaning the +`Node` in `leaf` now has two owners: `leaf` and `branch`. We can get from +`branch` to `leaf` through `branch.children`, but there’s no way to get from +`leaf` to `branch`. The reason is that `leaf` has no reference to `branch` and +doesn’t know they’re related. We want `leaf` to know that `branch` is its +parent. We’ll do that next. + +#### Adding a Reference from a Child to Its Parent + +To make the child node aware of its parent, we need to add a `parent` field to +our `Node` struct definition. The trouble is in deciding what the type of +`parent` should be. We know it can’t contain an `Rc` because that would +create a reference cycle with `leaf.parent` pointing to `branch` and +`branch.children` pointing to `leaf`, which would cause their `strong_count` +values to never be 0. + +Thinking about the relationships another way, a parent node should own its +children: if a parent node is dropped, its child nodes should be dropped as +well. However, a child should not own its parent: if we drop a child node, the +parent should still exist. This is a case for weak references! + +So, instead of `Rc`, we’ll make the type of `parent` use `Weak`, +specifically a `RefCell>`. Now our `Node` struct definition looks +like this: + +Filename: src/main.rs + +``` +use std::cell::RefCell; +use std::rc::{Rc, Weak}; + +#[derive(Debug)] +struct Node { + value: i32, + parent: RefCell>, + children: RefCell>>, +} +``` + +A node will be able to refer to its parent node but doesn’t own its parent. In +Listing 15-28, we update `main` to use this new definition so the `leaf` node +will have a way to refer to its parent, `branch`. + +Filename: src/main.rs + +``` +fn main() { + let leaf = Rc::new(Node { + value: 3, + 1 parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![]), + }); + + 2 println!( + "leaf parent = {:?}", + leaf.parent.borrow().upgrade() + ); + + let branch = Rc::new(Node { + value: 5, + 3 parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); + + 4 *leaf.parent.borrow_mut() = Rc::downgrade(&branch); + + 5 println!( + "leaf parent = {:?}", + leaf.parent.borrow().upgrade() + ); +} +``` + +Listing 15-28: A `leaf` node with a weak reference to its parent node, `branch` + +Creating the `leaf` node looks similar to Listing 15-27 with the exception of +the `parent` field: `leaf` starts out without a parent, so we create a new, +empty `Weak` reference instance [1]. + +At this point, when we try to get a reference to the parent of `leaf` by using +the `upgrade` method, we get a `None` value. We see this in the output from the +first `println!` statement [2]: + +``` +leaf parent = None +``` + +When we create the `branch` node, it will also have a new `Weak` +reference in the `parent` field [3] because `branch` doesn’t have a parent +node. We still have `leaf` as one of the children of `branch`. Once we have the +`Node` instance in `branch`, we can modify `leaf` to give it a `Weak` +reference to its parent [4]. We use the `borrow_mut` method on the +`RefCell>` in the `parent` field of `leaf`, and then we use the +`Rc::downgrade` function to create a `Weak` reference to `branch` from +the `Rc` in `branch`. + +When we print the parent of `leaf` again [5], this time we’ll get a `Some` +variant holding `branch`: now `leaf` can access its parent! When we print +`leaf`, we also avoid the cycle that eventually ended in a stack overflow like +we had in Listing 15-26; the `Weak` references are printed as `(Weak)`: + +``` +leaf parent = Some(Node { value: 5, parent: RefCell { value: (Weak) }, +children: RefCell { value: [Node { value: 3, parent: RefCell { value: (Weak) }, +children: RefCell { value: [] } }] } }) +``` + +The lack of infinite output indicates that this code didn’t create a reference +cycle. We can also tell this by looking at the values we get from calling +`Rc::strong_count` and `Rc::weak_count`. + +#### Visualizing Changes to strong_count and weak_count + +Let’s look at how the `strong_count` and `weak_count` values of the `Rc` +instances change by creating a new inner scope and moving the creation of +`branch` into that scope. By doing so, we can see what happens when `branch` is +created and then dropped when it goes out of scope. The modifications are shown +in Listing 15-29. + +Filename: src/main.rs + +``` +fn main() { + let leaf = Rc::new(Node { + value: 3, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![]), + }); + + 1 println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); + + 2 { + let branch = Rc::new(Node { + value: 5, + parent: RefCell::new(Weak::new()), + children: RefCell::new(vec![Rc::clone(&leaf)]), + }); + + *leaf.parent.borrow_mut() = Rc::downgrade(&branch); + + 3 println!( + "branch strong = {}, weak = {}", + Rc::strong_count(&branch), + Rc::weak_count(&branch), + ); + + 4 println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); + 5 } + + 6 println!( + "leaf parent = {:?}", + leaf.parent.borrow().upgrade() + ); + 7 println!( + "leaf strong = {}, weak = {}", + Rc::strong_count(&leaf), + Rc::weak_count(&leaf), + ); +} +``` + +Listing 15-29: Creating `branch` in an inner scope and examining strong and +weak reference counts + +After `leaf` is created, its `Rc` has a strong count of 1 and a weak +count of 0 [1]. In the inner scope [2], we create `branch` and associate it +with `leaf`, at which point when we print the counts [3], the `Rc` in +`branch` will have a strong count of 1 and a weak count of 1 (for `leaf.parent` +pointing to `branch` with a `Weak`). When we print the counts in `leaf` +[4], we’ll see it will have a strong count of 2 because `branch` now has a +clone of the `Rc` of `leaf` stored in `branch.children`, but will still +have a weak count of 0. + +When the inner scope ends [5], `branch` goes out of scope and the strong count +of the `Rc` decreases to 0, so its `Node` is dropped. The weak count of 1 +from `leaf.parent` has no bearing on whether or not `Node` is dropped, so we +don’t get any memory leaks! + +If we try to access the parent of `leaf` after the end of the scope, we’ll get +`None` again [6]. At the end of the program [7], the `Rc` in `leaf` has a +strong count of 1 and a weak count of 0 because the variable `leaf` is now the +only reference to the `Rc` again. + +All of the logic that manages the counts and value dropping is built into +`Rc` and `Weak` and their implementations of the `Drop` trait. By +specifying that the relationship from a child to its parent should be a +`Weak` reference in the definition of `Node`, you’re able to have parent +nodes point to child nodes and vice versa without creating a reference cycle +and memory leaks. + +## Summary + +This chapter covered how to use smart pointers to make different guarantees and +trade-offs from those Rust makes by default with regular references. The +`Box` type has a known size and points to data allocated on the heap. The +`Rc` type keeps track of the number of references to data on the heap so +that data can have multiple owners. The `RefCell` type with its interior +mutability gives us a type that we can use when we need an immutable type but +need to change an inner value of that type; it also enforces the borrowing +rules at runtime instead of at compile time. + +Also discussed were the `Deref` and `Drop` traits, which enable a lot of the +functionality of smart pointers. We explored reference cycles that can cause +memory leaks and how to prevent them using `Weak`. + +If this chapter has piqued your interest and you want to implement your own +smart pointers, check out “The Rustonomicon” at +*https://doc.rust-lang.org/stable/nomicon* for more useful information. + +Next, we’ll talk about concurrency in Rust. You’ll even learn about a few new +smart pointers. + diff --git a/rustbook-ru/nostarch/chapter16.md b/rustbook-ru/nostarch/chapter16.md new file mode 100644 index 000000000..7c5389e4f --- /dev/null +++ b/rustbook-ru/nostarch/chapter16.md @@ -0,0 +1,1226 @@ + + +[TOC] + +# Fearless Concurrency + +Handling concurrent programming safely and efficiently is another of Rust’s +major goals. *Concurrent programming*, where different parts of a program +execute independently, and *parallel programming*, where different parts of a +program execute at the same time, are becoming increasingly important as more +computers take advantage of their multiple processors. Historically, +programming in these contexts has been difficult and error prone: Rust hopes to +change that. + +Initially, the Rust team thought that ensuring memory safety and preventing +concurrency problems were two separate challenges to be solved with different +methods. Over time, the team discovered that the ownership and type systems are +a powerful set of tools to help manage memory safety *and* concurrency +problems! By leveraging ownership and type checking, many concurrency errors +are compile-time errors in Rust rather than runtime errors. Therefore, rather +than making you spend lots of time trying to reproduce the exact circumstances +under which a runtime concurrency bug occurs, incorrect code will refuse to +compile and present an error explaining the problem. As a result, you can fix +your code while you’re working on it rather than potentially after it has been +shipped to production. We’ve nicknamed this aspect of Rust *fearless* +*concurrency*. Fearless concurrency allows you to write code that is free of +subtle bugs and is easy to refactor without introducing new bugs. + +> Note: For simplicity’s sake, we’ll refer to many of the problems as +*concurrent* rather than being more precise by saying *concurrent and/or +parallel*. If this book were about concurrency and/or parallelism, we’d be more +specific. For this chapter, please mentally substitute *concurrent and/or +parallel* whenever we use *concurrent*. + +Many languages are dogmatic about the solutions they offer for handling +concurrent problems. For example, Erlang has elegant functionality for +message-passing concurrency but has only obscure ways to share state between +threads. Supporting only a subset of possible solutions is a reasonable +strategy for higher-level languages because a higher-level language promises +benefits from giving up some control to gain abstractions. However, lower-level +languages are expected to provide the solution with the best performance in any +given situation and have fewer abstractions over the hardware. Therefore, Rust +offers a variety of tools for modeling problems in whatever way is appropriate +for your situation and requirements. + +Here are the topics we’ll cover in this chapter: + +* How to create threads to run multiple pieces of code at the same time +* *Message-passing* concurrency, where channels send messages between threads +* *Shared-state* concurrency, where multiple threads have access to some piece +of data +* The `Sync` and `Send` traits, which extend Rust’s concurrency guarantees to +user-defined types as well as types provided by the standard library + +## Using Threads to Run Code Simultaneously + +In most current operating systems, an executed program’s code is run in a +*process*, and the operating system will manage multiple processes at once. +Within a program, you can also have independent parts that run simultaneously. +The features that run these independent parts are called *threads*. For +example, a web server could have multiple threads so that it could respond to +more than one request at the same time. + +Splitting the computation in your program into multiple threads to run multiple +tasks at the same time can improve performance, but it also adds complexity. +Because threads can run simultaneously, there’s no inherent guarantee about the +order in which parts of your code on different threads will run. This can lead +to problems, such as: + +* Race conditions, where threads are accessing data or resources in an +inconsistent order +* Deadlocks, where two threads are waiting for each other, preventing both +threads from continuing +* Bugs that happen only in certain situations and are hard to reproduce and fix +reliably + +Rust attempts to mitigate the negative effects of using threads, but +programming in a multithreaded context still takes careful thought and requires +a code structure that is different from that in programs running in a single +thread. + +Programming languages implement threads in a few different ways, and many +operating systems provide an API the language can call for creating new +threads. The Rust standard library uses a *1:1* model of thread implementation, +whereby a program uses one operating system thread per one language thread. +There are crates that implement other models of threading that make different +trade-offs to the 1:1 model. + +### Creating a New Thread with spawn + +To create a new thread, we call the `thread::spawn` function and pass it a +closure (we talked about closures in Chapter 13) containing the code we want to +run in the new thread. The example in Listing 16-1 prints some text from a main +thread and other text from a new thread. + +Filename: src/main.rs + +``` +use std::thread; +use std::time::Duration; + +fn main() { + thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } +} +``` + +Listing 16-1: Creating a new thread to print one thing while the main thread +prints something else + +Note that when the main thread of a Rust program completes, all spawned threads +are shut down, whether or not they have finished running. The output from this +program might be a little different every time, but it will look similar to the +following: + +``` +hi number 1 from the main thread! +hi number 1 from the spawned thread! +hi number 2 from the main thread! +hi number 2 from the spawned thread! +hi number 3 from the main thread! +hi number 3 from the spawned thread! +hi number 4 from the main thread! +hi number 4 from the spawned thread! +hi number 5 from the spawned thread! +``` + +The calls to `thread::sleep` force a thread to stop its execution for a short +duration, allowing a different thread to run. The threads will probably take +turns, but that isn’t guaranteed: it depends on how your operating system +schedules the threads. In this run, the main thread printed first, even though +the print statement from the spawned thread appears first in the code. And even +though we told the spawned thread to print until `i` is 9, it only got to 5 +before the main thread shut down. + +If you run this code and only see output from the main thread, or don’t see any +overlap, try increasing the numbers in the ranges to create more opportunities +for the operating system to switch between the threads. + +### Waiting for All Threads to Finish Using join Handles + +The code in Listing 16-1 not only stops the spawned thread prematurely most of +the time due to the main thread ending, but because there is no guarantee on +the order in which threads run, we also can’t guarantee that the spawned thread +will get to run at all! + +We can fix the problem of the spawned thread not running or of it ending +prematurely by saving the return value of `thread::spawn` in a variable. The +return type of `thread::spawn` is `JoinHandle`. A `JoinHandle` is an +owned value that, when we call the `join` method on it, will wait for its +thread to finish. Listing 16-2 shows how to use the `JoinHandle` of the +thread we created in Listing 16-1 and call `join` to make sure the spawned +thread finishes before `main` exits. + +Filename: src/main.rs + +``` +use std::thread; +use std::time::Duration; + +fn main() { + let handle = thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } + + handle.join().unwrap(); +} +``` + +Listing 16-2: Saving a `JoinHandle` from `thread::spawn` to guarantee the +thread is run to completion + +Calling `join` on the handle blocks the thread currently running until the +thread represented by the handle terminates. *Blocking* a thread means that +thread is prevented from performing work or exiting. Because we’ve put the call +to `join` after the main thread’s `for` loop, running Listing 16-2 should +produce output similar to this: + +``` +hi number 1 from the main thread! +hi number 2 from the main thread! +hi number 1 from the spawned thread! +hi number 3 from the main thread! +hi number 2 from the spawned thread! +hi number 4 from the main thread! +hi number 3 from the spawned thread! +hi number 4 from the spawned thread! +hi number 5 from the spawned thread! +hi number 6 from the spawned thread! +hi number 7 from the spawned thread! +hi number 8 from the spawned thread! +hi number 9 from the spawned thread! +``` + +The two threads continue alternating, but the main thread waits because of the +call to `handle.join()` and does not end until the spawned thread is finished. + +But let’s see what happens when we instead move `handle.join()` before the +`for` loop in `main`, like this: + +Filename: src/main.rs + +``` +use std::thread; +use std::time::Duration; + +fn main() { + let handle = thread::spawn(|| { + for i in 1..10 { + println!("hi number {i} from the spawned thread!"); + thread::sleep(Duration::from_millis(1)); + } + }); + + handle.join().unwrap(); + + for i in 1..5 { + println!("hi number {i} from the main thread!"); + thread::sleep(Duration::from_millis(1)); + } +} +``` + +The main thread will wait for the spawned thread to finish and then run its +`for` loop, so the output won’t be interleaved anymore, as shown here: + +``` +hi number 1 from the spawned thread! +hi number 2 from the spawned thread! +hi number 3 from the spawned thread! +hi number 4 from the spawned thread! +hi number 5 from the spawned thread! +hi number 6 from the spawned thread! +hi number 7 from the spawned thread! +hi number 8 from the spawned thread! +hi number 9 from the spawned thread! +hi number 1 from the main thread! +hi number 2 from the main thread! +hi number 3 from the main thread! +hi number 4 from the main thread! +``` + +Small details, such as where `join` is called, can affect whether or not your +threads run at the same time. + +### Using move Closures with Threads + +We’ll often use the `move` keyword with closures passed to `thread::spawn` +because the closure will then take ownership of the values it uses from the +environment, thus transferring ownership of those values from one thread to +another. In “Capturing the Environment with Closures” on page XX, we discussed +`move` in the context of closures. Now we’ll concentrate more on the +interaction between `move` and `thread::spawn`. + +Notice in Listing 16-1 that the closure we pass to `thread::spawn` takes no +arguments: we’re not using any data from the main thread in the spawned +thread’s code. To use data from the main thread in the spawned thread, the +spawned thread’s closure must capture the values it needs. Listing 16-3 shows +an attempt to create a vector in the main thread and use it in the spawned +thread. However, this won’t work yet, as you’ll see in a moment. + +Filename: src/main.rs + +``` +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(|| { + println!("Here's a vector: {:?}", v); + }); + + handle.join().unwrap(); +} +``` + +Listing 16-3: Attempting to use a vector created by the main thread in another +thread + +The closure uses `v`, so it will capture `v` and make it part of the closure’s +environment. Because `thread::spawn` runs this closure in a new thread, we +should be able to access `v` inside that new thread. But when we compile this +example, we get the following error: + +``` +error[E0373]: closure may outlive the current function, but it borrows `v`, +which is owned by the current function + --> src/main.rs:6:32 + | +6 | let handle = thread::spawn(|| { + | ^^ may outlive borrowed value `v` +7 | println!("Here's a vector: {:?}", v); + | - `v` is borrowed here + | +note: function requires argument type to outlive `'static` + --> src/main.rs:6:18 + | +6 | let handle = thread::spawn(|| { + | __________________^ +7 | | println!("Here's a vector: {:?}", v); +8 | | }); + | |______^ +help: to force the closure to take ownership of `v` (and any other referenced +variables), use the `move` keyword + | +6 | let handle = thread::spawn(move || { + | ++++ +``` + +Rust *infers* how to capture `v`, and because `println!` only needs a reference +to `v`, the closure tries to borrow `v`. However, there’s a problem: Rust can’t +tell how long the spawned thread will run, so it doesn’t know whether the +reference to `v` will always be valid. + +Listing 16-4 provides a scenario that’s more likely to have a reference to `v` +that won’t be valid. + +Filename: src/main.rs + +``` +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(|| { + println!("Here's a vector: {:?}", v); + }); + + drop(v); // oh no! + + handle.join().unwrap(); +} +``` + +Listing 16-4: A thread with a closure that attempts to capture a reference to +`v` from a main thread that drops `v` + +If Rust allowed us to run this code, there’s a possibility that the spawned +thread would be immediately put in the background without running at all. The +spawned thread has a reference to `v` inside, but the main thread immediately +drops `v`, using the `drop` function we discussed in Chapter 15. Then, when the +spawned thread starts to execute, `v` is no longer valid, so a reference to it +is also invalid. Oh no! + +To fix the compiler error in Listing 16-3, we can use the error message’s +advice: + +``` +help: to force the closure to take ownership of `v` (and any other referenced +variables), use the `move` keyword + | +6 | let handle = thread::spawn(move || { + | ++++ +``` + +By adding the `move` keyword before the closure, we force the closure to take +ownership of the values it’s using rather than allowing Rust to infer that it +should borrow the values. The modification to Listing 16-3 shown in Listing +16-5 will compile and run as we intend. + +Filename: src/main.rs + +``` +use std::thread; + +fn main() { + let v = vec![1, 2, 3]; + + let handle = thread::spawn(move || { + println!("Here's a vector: {:?}", v); + }); + + handle.join().unwrap(); +} +``` + +Listing 16-5: Using the `move` keyword to force a closure to take ownership of +the values it uses + +We might be tempted to try the same thing to fix the code in Listing 16-4 where +the main thread called `drop` by using a `move` closure. However, this fix will +not work because what Listing 16-4 is trying to do is disallowed for a +different reason. If we added `move` to the closure, we would move `v` into the +closure’s environment, and we could no longer call `drop` on it in the main +thread. We would get this compiler error instead: + +``` +error[E0382]: use of moved value: `v` + --> src/main.rs:10:10 + | +4 | let v = vec![1, 2, 3]; + | - move occurs because `v` has type `Vec`, which does not +implement the `Copy` trait +5 | +6 | let handle = thread::spawn(move || { + | ------- value moved into closure here +7 | println!("Here's a vector: {:?}", v); + | - variable moved due to use in +closure +... +10 | drop(v); // oh no! + | ^ value used here after move +``` + +Rust’s ownership rules have saved us again! We got an error from the code in +Listing 16-3 because Rust was being conservative and only borrowing `v` for the +thread, which meant the main thread could theoretically invalidate the spawned +thread’s reference. By telling Rust to move ownership of `v` to the spawned +thread, we’re guaranteeing Rust that the main thread won’t use `v` anymore. If +we change Listing 16-4 in the same way, we’re then violating the ownership +rules when we try to use `v` in the main thread. The `move` keyword overrides +Rust’s conservative default of borrowing; it doesn’t let us violate the +ownership rules. + +Now that we’ve covered what threads are and the methods supplied by the thread +API, let’s look at some situations in which we can use threads. + +## Using Message Passing to Transfer Data Between Threads + +One increasingly popular approach to ensuring safe concurrency is *message +passing*, where threads or actors communicate by sending each other messages +containing data. Here’s the idea in a slogan from the Go language documentation +at *https://golang.org/doc/effective_go.html#concurrency*: “Do not communicate +by sharing memory; instead, share memory by communicating.” + +To accomplish message-sending concurrency, Rust’s standard library provides an +implementation of *channels*. A channel is a general programming concept by +which data is sent from one thread to another. + +You can imagine a channel in programming as being like a directional channel of +water, such as a stream or a river. If you put something like a rubber duck +into a river, it will travel downstream to the end of the waterway. + +A channel has two halves: a transmitter and a receiver. The transmitter half is +the upstream location where you put the rubber duck into the river, and the +receiver half is where the rubber duck ends up downstream. One part of your +code calls methods on the transmitter with the data you want to send, and +another part checks the receiving end for arriving messages. A channel is said +to be *closed* if either the transmitter or receiver half is dropped. + +Here, we’ll work up to a program that has one thread to generate values and +send them down a channel, and another thread that will receive the values and +print them out. We’ll be sending simple values between threads using a channel +to illustrate the feature. Once you’re familiar with the technique, you could +use channels for any threads that need to communicate with each other, such as +a chat system or a system where many threads perform parts of a calculation and +send the parts to one thread that aggregates the results. + +First, in Listing 16-6, we’ll create a channel but not do anything with it. +Note that this won’t compile yet because Rust can’t tell what type of values we +want to send over the channel. + +Filename: src/main.rs + +``` +use std::sync::mpsc; + +fn main() { + let (tx, rx) = mpsc::channel(); +} +``` + +Listing 16-6: Creating a channel and assigning the two halves to `tx` and `rx` + +We create a new channel using the `mpsc::channel` function; `mpsc` stands for +*multiple producer, single consumer*. In short, the way Rust’s standard library +implements channels means a channel can have multiple *sending* ends that +produce values but only one *receiving* end that consumes those values. Imagine +multiple streams flowing together into one big river: everything sent down any +of the streams will end up in one river at the end. We’ll start with a single +producer for now, but we’ll add multiple producers when we get this example +working. + +The `mpsc::channel` function returns a tuple, the first element of which is the +sending end—the transmitter—and the second element of which is the receiving +end—the receiver. The abbreviations `tx` and `rx` are traditionally used in +many fields for *transmitter* and *receiver*, respectively, so we name our +variables as such to indicate each end. We’re using a `let` statement with a +pattern that destructures the tuples; we’ll discuss the use of patterns in +`let` statements and destructuring in Chapter 18. For now, know that using a +`let` statement in this way is a convenient approach to extract the pieces of +the tuple returned by `mpsc::channel`. + +Let’s move the transmitting end into a spawned thread and have it send one +string so the spawned thread is communicating with the main thread, as shown in +Listing 16-7. This is like putting a rubber duck in the river upstream or +sending a chat message from one thread to another. + +Filename: src/main.rs + +``` +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + }); +} +``` + +Listing 16-7: Moving `tx` to a spawned thread and sending `"hi"` + +Again, we’re using `thread::spawn` to create a new thread and then using `move` +to move `tx` into the closure so the spawned thread owns `tx`. The spawned +thread needs to own the transmitter to be able to send messages through the +channel. + +The transmitter has a `send` method that takes the value we want to send. The +`send` method returns a `Result` type, so if the receiver has already +been dropped and there’s nowhere to send a value, the send operation will +return an error. In this example, we’re calling `unwrap` to panic in case of an +error. But in a real application, we would handle it properly: return to +Chapter 9 to review strategies for proper error handling. + +In Listing 16-8, we’ll get the value from the receiver in the main thread. This +is like retrieving the rubber duck from the water at the end of the river or +receiving a chat message. + +Filename: src/main.rs + +``` +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + }); + + let received = rx.recv().unwrap(); + println!("Got: {received}"); +} +``` + +Listing 16-8: Receiving the value `"hi"` in the main thread and printing it + +The receiver has two useful methods: `recv` and `try_recv`. We’re using `recv`, +short for *receive*, which will block the main thread’s execution and wait +until a value is sent down the channel. Once a value is sent, `recv` will +return it in a `Result`. When the transmitter closes, `recv` will return +an error to signal that no more values will be coming. + +The `try_recv` method doesn’t block, but will instead return a `Result` +immediately: an `Ok` value holding a message if one is available and an `Err` +value if there aren’t any messages this time. Using `try_recv` is useful if +this thread has other work to do while waiting for messages: we could write a +loop that calls `try_recv` every so often, handles a message if one is +available, and otherwise does other work for a little while until checking +again. + +We’ve used `recv` in this example for simplicity; we don’t have any other work +for the main thread to do other than wait for messages, so blocking the main +thread is appropriate. + +When we run the code in Listing 16-8, we’ll see the value printed from the main +thread: + +``` +Got: hi +``` + +Perfect! + +### Channels and Ownership Transference + +The ownership rules play a vital role in message sending because they help you +write safe, concurrent code. Preventing errors in concurrent programming is the +advantage of thinking about ownership throughout your Rust programs. Let’s do +an experiment to show how channels and ownership work together to prevent +problems: we’ll try to use a `val` value in the spawned thread *after* we’ve +sent it down the channel. Try compiling the code in Listing 16-9 to see why +this code isn’t allowed. + +Filename: src/main.rs + +``` +use std::sync::mpsc; +use std::thread; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let val = String::from("hi"); + tx.send(val).unwrap(); + println!("val is {val}"); + }); + + let received = rx.recv().unwrap(); + println!("Got: {received}"); +} +``` + +Listing 16-9: Attempting to use `val` after we’ve sent it down the channel + +Here, we try to print `val` after we’ve sent it down the channel via `tx.send`. +Allowing this would be a bad idea: once the value has been sent to another +thread, that thread could modify or drop it before we try to use the value +again. Potentially, the other thread’s modifications could cause errors or +unexpected results due to inconsistent or nonexistent data. However, Rust gives +us an error if we try to compile the code in Listing 16-9: + +``` +error[E0382]: borrow of moved value: `val` + --> src/main.rs:10:31 + | +8 | let val = String::from("hi"); + | --- move occurs because `val` has type `String`, which does +not implement the `Copy` trait +9 | tx.send(val).unwrap(); + | --- value moved here +10 | println!("val is {val}"); + | ^^^ value borrowed here after move +``` + +Our concurrency mistake has caused a compile-time error. The `send` function +takes ownership of its parameter, and when the value is moved the receiver +takes ownership of it. This stops us from accidentally using the value again +after sending it; the ownership system checks that everything is okay. + +### Sending Multiple Values and Seeing the Receiver Waiting + +The code in Listing 16-8 compiled and ran, but it didn’t clearly show us that +two separate threads were talking to each other over the channel. In Listing +16-10 we’ve made some modifications that will prove the code in Listing 16-8 is +running concurrently: the spawned thread will now send multiple messages and +pause for a second between each message. + +Filename: src/main.rs + +``` +use std::sync::mpsc; +use std::thread; +use std::time::Duration; + +fn main() { + let (tx, rx) = mpsc::channel(); + + thread::spawn(move || { + let vals = vec![ + String::from("hi"), + String::from("from"), + String::from("the"), + String::from("thread"), + ]; + + for val in vals { + tx.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } + }); + + for received in rx { + println!("Got: {received}"); + } +} +``` + +Listing 16-10: Sending multiple messages and pausing between each one + +This time, the spawned thread has a vector of strings that we want to send to +the main thread. We iterate over them, sending each individually, and pause +between each by calling the `thread::sleep` function with a `Duration` value of +one second. + +In the main thread, we’re not calling the `recv` function explicitly anymore: +instead, we’re treating `rx` as an iterator. For each value received, we’re +printing it. When the channel is closed, iteration will end. + +When running the code in Listing 16-10, you should see the following output +with a one-second pause in between each line: + +``` +Got: hi +Got: from +Got: the +Got: thread +``` + +Because we don’t have any code that pauses or delays in the `for` loop in the +main thread, we can tell that the main thread is waiting to receive values from +the spawned thread. + +### Creating Multiple Producers by Cloning the Transmitter + +Earlier we mentioned that `mpsc` was an acronym for *multiple producer, single +consumer*. Let’s put `mpsc` to use and expand the code in Listing 16-10 to +create multiple threads that all send values to the same receiver. We can do so +by cloning the transmitter, as shown in Listing 16-11. + +Filename: src/main.rs + +``` +--snip-- + +let (tx, rx) = mpsc::channel(); + +let tx1 = tx.clone(); +thread::spawn(move || { + let vals = vec![ + String::from("hi"), + String::from("from"), + String::from("the"), + String::from("thread"), + ]; + + for val in vals { + tx1.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } +}); + +thread::spawn(move || { + let vals = vec![ + String::from("more"), + String::from("messages"), + String::from("for"), + String::from("you"), + ]; + + for val in vals { + tx.send(val).unwrap(); + thread::sleep(Duration::from_secs(1)); + } +}); + +for received in rx { + println!("Got: {received}"); +} + +--snip-- +``` + +Listing 16-11: Sending multiple messages from multiple producers + +This time, before we create the first spawned thread, we call `clone` on the +transmitter. This will give us a new transmitter we can pass to the first +spawned thread. We pass the original transmitter to a second spawned thread. +This gives us two threads, each sending different messages to the one receiver. + +When you run the code, your output should look something like this: + +``` +Got: hi +Got: more +Got: from +Got: messages +Got: for +Got: the +Got: thread +Got: you +``` + +You might see the values in another order, depending on your system. This is +what makes concurrency interesting as well as difficult. If you experiment with +`thread::sleep`, giving it various values in the different threads, each run +will be more nondeterministic and create different output each time. + +Now that we’ve looked at how channels work, let’s look at a different method of +concurrency. + +## Shared-State Concurrency + +Message passing is a fine way to handle concurrency, but it’s not the only way. +Another method would be for multiple threads to access the same shared data. +Consider this part of the slogan from the Go language documentation again: “Do +not communicate by sharing memory.” + +What would communicating by sharing memory look like? In addition, why would +message-passing enthusiasts caution not to use memory sharing? + +In a way, channels in any programming language are similar to single ownership +because once you transfer a value down a channel, you should no longer use that +value. Shared-memory concurrency is like multiple ownership: multiple threads +can access the same memory location at the same time. As you saw in Chapter 15, +where smart pointers made multiple ownership possible, multiple ownership can +add complexity because these different owners need managing. Rust’s type system +and ownership rules greatly assist in getting this management correct. For an +example, let’s look at mutexes, one of the more common concurrency primitives +for shared memory. + +### Using Mutexes to Allow Access to Data from One Thread at a Time + +*Mutex* is an abbreviation for *mutual exclusion*, as in a mutex allows only +one thread to access some data at any given time. To access the data in a +mutex, a thread must first signal that it wants access by asking to acquire the +mutex’s *lock*. The lock is a data structure that is part of the mutex that +keeps track of who currently has exclusive access to the data. Therefore, the +mutex is described as *guarding* the data it holds via the locking system. + +Mutexes have a reputation for being difficult to use because you have to +remember two rules: + +1. You must attempt to acquire the lock before using the data. +1. When you’re done with the data that the mutex guards, you must unlock the +data so other threads can acquire the lock. + +For a real-world metaphor for a mutex, imagine a panel discussion at a +conference with only one microphone. Before a panelist can speak, they have to +ask or signal that they want to use the microphone. When they get the +microphone, they can talk for as long as they want to and then hand the +microphone to the next panelist who requests to speak. If a panelist forgets to +hand the microphone off when they’re finished with it, no one else is able to +speak. If management of the shared microphone goes wrong, the panel won’t work +as planned! + +Management of mutexes can be incredibly tricky to get right, which is why so +many people are enthusiastic about channels. However, thanks to Rust’s type +system and ownership rules, you can’t get locking and unlocking wrong. + +#### The API of Mutex + +As an example of how to use a mutex, let’s start by using a mutex in a +single-threaded context, as shown in Listing 16-12. + +Filename: src/main.rs + +``` +use std::sync::Mutex; + +fn main() { + 1 let m = Mutex::new(5); + + { + 2 let mut num = m.lock().unwrap(); + 3 *num = 6; + 4 } + + 5 println!("m = {:?}", m); +} +``` + +Listing 16-12: Exploring the API of `Mutex` in a single-threaded context for +simplicity + +As with many types, we create a `Mutex` using the associated function `new` +[1]. To access the data inside the mutex, we use the `lock` method to acquire +the lock [2]. This call will block the current thread so it can’t do any work +until it’s our turn to have the lock. + +The call to `lock` would fail if another thread holding the lock panicked. In +that case, no one would ever be able to get the lock, so we’ve chosen to +`unwrap` and have this thread panic if we’re in that situation. + +After we’ve acquired the lock, we can treat the return value, named `num` in +this case, as a mutable reference to the data inside. The type system ensures +that we acquire a lock before using the value in `m`. The type of `m` is +`Mutex`, not `i32`, so we *must* call `lock` to be able to use the `i32` +value. We can’t forget; the type system won’t let us access the inner `i32` +otherwise. + +As you might suspect, `Mutex` is a smart pointer. More accurately, the call +to `lock` *returns* a smart pointer called `MutexGuard`, wrapped in a +`LockResult` that we handled with the call to `unwrap`. The `MutexGuard` smart +pointer implements `Deref` to point at our inner data; the smart pointer also +has a `Drop` implementation that releases the lock automatically when a +`MutexGuard` goes out of scope, which happens at the end of the inner scope +[4]. As a result, we don’t risk forgetting to release the lock and blocking the +mutex from being used by other threads because the lock release happens +automatically. + +After dropping the lock, we can print the mutex value and see that we were able +to change the inner `i32` to `6` [5]. + +#### Sharing a Mutex Between Multiple Threads + +Now let’s try to share a value between multiple threads using `Mutex`. We’ll +spin up 10 threads and have them each increment a counter value by 1, so the +counter goes from 0 to 10. The example in Listing 16-13 will have a compiler +error, and we’ll use that error to learn more about using `Mutex` and how +Rust helps us use it correctly. + +Filename: src/main.rs + +``` +use std::sync::Mutex; +use std::thread; + +fn main() { + 1 let counter = Mutex::new(0); + let mut handles = vec![]; + + 2 for _ in 0..10 { + 3 let handle = thread::spawn(move || { + 4 let mut num = counter.lock().unwrap(); + + 5 *num += 1; + }); + 6 handles.push(handle); + } + + for handle in handles { + 7 handle.join().unwrap(); + } + + 8 println!("Result: {}", *counter.lock().unwrap()); +} +``` + +Listing 16-13: Ten threads, each incrementing a counter guarded by a `Mutex` + +We create a `counter` variable to hold an `i32` inside a `Mutex` [1], as we +did in Listing 16-12. Next, we create 10 threads by iterating over a range of +numbers [2]. We use `thread::spawn` and give all the threads the same closure: +one that moves the counter into the thread [3], acquires a lock on the +`Mutex` by calling the `lock` method [4], and then adds 1 to the value in +the mutex [5]. When a thread finishes running its closure, `num` will go out of +scope and release the lock so another thread can acquire it. + +In the main thread, we collect all the join handles [6]. Then, as we did in +Listing 16-2, we call `join` on each handle to make sure all the threads finish +[7]. At that point, the main thread will acquire the lock and print the result +of this program [8]. + +We hinted that this example wouldn’t compile. Now let’s find out why! + +``` +error[E0382]: use of moved value: `counter` + --> src/main.rs:9:36 + | +5 | let counter = Mutex::new(0); + | ------- move occurs because `counter` has type `Mutex`, which +does not implement the `Copy` trait +... +9 | let handle = thread::spawn(move || { + | ^^^^^^^ value moved into closure here, +in previous iteration of loop +10 | let mut num = counter.lock().unwrap(); + | ------- use occurs due to use in closure +``` + +The error message states that the `counter` value was moved in the previous +iteration of the loop. Rust is telling us that we can’t move the ownership of +lock `counter` into multiple threads. Let’s fix the compiler error with the +multiple-ownership method we discussed in Chapter 15. + +#### Multiple Ownership with Multiple Threads + +In Chapter 15, we gave a value to multiple owners by using the smart pointer +`Rc` to create a reference counted value. Let’s do the same here and see +what happens. We’ll wrap the `Mutex` in `Rc` in Listing 16-14 and clone +the `Rc` before moving ownership to the thread. + +Filename: src/main.rs + +``` +use std::rc::Rc; +use std::sync::Mutex; +use std::thread; + +fn main() { + let counter = Rc::new(Mutex::new(0)); + let mut handles = vec![]; + + for _ in 0..10 { + let counter = Rc::clone(&counter); + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + } + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} +``` + +Listing 16-14: Attempting to use `Rc` to allow multiple threads to own the +`Mutex` + +Once again, we compile and get… different errors! The compiler is teaching us a +lot. + +``` +error[E0277]: `Rc>` cannot be sent between threads safely 1 + --> src/main.rs:11:22 + | +11 | let handle = thread::spawn(move || { + | ______________________^^^^^^^^^^^^^_- + | | | + | | `Rc>` cannot be sent between threads +safely +12 | | let mut num = counter.lock().unwrap(); +13 | | +14 | | *num += 1; +15 | | }); + | |_________- within this `[closure@src/main.rs:11:36: 15:10]` + | += help: within `[closure@src/main.rs:11:36: 15:10]`, the trait `Send` is not +implemented for `Rc>` 2 + = note: required because it appears within the type +`[closure@src/main.rs:11:36: 15:10]` +note: required by a bound in `spawn` +``` + +Wow, that error message is very wordy! Here’s the important part to focus on: +``Rc>` cannot be sent between threads safely` [1]. The compiler is +also telling us the reason why: `the trait `Send` is not implemented for +`Rc>`` [2]. We’ll talk about `Send` in the next section: it’s one of +the traits that ensures the types we use with threads are meant for use in +concurrent situations. + +Unfortunately, `Rc` is not safe to share across threads. When `Rc` +manages the reference count, it adds to the count for each call to `clone` and +subtracts from the count when each clone is dropped. But it doesn’t use any +concurrency primitives to make sure that changes to the count can’t be +interrupted by another thread. This could lead to wrong counts—subtle bugs that +could in turn lead to memory leaks or a value being dropped before we’re done +with it. What we need is a type exactly like `Rc` but one that makes changes +to the reference count in a thread-safe way. + +#### Atomic Reference Counting with Arc + +Fortunately, `Arc` *is* a type like `Rc` that is safe to use in +concurrent situations. The *a* stands for *atomic*, meaning it’s an *atomically +reference counted* type. Atomics are an additional kind of concurrency +primitive that we won’t cover in detail here: see the standard library +documentation for `std::sync::atomic` for more details. At this point, you just +need to know that atomics work like primitive types but are safe to share +across threads. + +You might then wonder why all primitive types aren’t atomic and why standard +library types aren’t implemented to use `Arc` by default. The reason is that +thread safety comes with a performance penalty that you only want to pay when +you really need to. If you’re just performing operations on values within a +single thread, your code can run faster if it doesn’t have to enforce the +guarantees atomics provide. + +Let’s return to our example: `Arc` and `Rc` have the same API, so we fix +our program by changing the `use` line, the call to `new`, and the call to +`clone`. The code in Listing 16-15 will finally compile and run. + +Filename: src/main.rs + +``` +use std::sync::{Arc, Mutex}; +use std::thread; + +fn main() { + let counter = Arc::new(Mutex::new(0)); + let mut handles = vec![]; + + for _ in 0..10 { + let counter = Arc::clone(&counter); + let handle = thread::spawn(move || { + let mut num = counter.lock().unwrap(); + + *num += 1; + }); + handles.push(handle); + } + + for handle in handles { + handle.join().unwrap(); + } + + println!("Result: {}", *counter.lock().unwrap()); +} +``` + +Listing 16-15: Using an `Arc` to wrap the `Mutex` to be able to share +ownership across multiple threads + +This code will print the following: + +``` +Result: 10 +``` + +We did it! We counted from 0 to 10, which may not seem very impressive, but it +did teach us a lot about `Mutex` and thread safety. You could also use this +program’s structure to do more complicated operations than just incrementing a +counter. Using this strategy, you can divide a calculation into independent +parts, split those parts across threads, and then use a `Mutex` to have each +thread update the final result with its part. + +Note that if you are doing simple numerical operations, there are types simpler +than `Mutex` types provided by the `std::sync::atomic` module of the +standard library. These types provide safe, concurrent, atomic access to +primitive types. We chose to use `Mutex` with a primitive type for this +example so we could concentrate on how `Mutex` works. + +### Similarities Between RefCell/Rc and Mutex/Arc + +You might have noticed that `counter` is immutable but we could get a mutable +reference to the value inside it; this means `Mutex` provides interior +mutability, as the `Cell` family does. In the same way we used `RefCell` in +Chapter 15 to allow us to mutate contents inside an `Rc`, we use `Mutex` +to mutate contents inside an `Arc`. + +Another detail to note is that Rust can’t protect you from all kinds of logic +errors when you use `Mutex`. Recall in Chapter 15 that using `Rc` came +with the risk of creating reference cycles, where two `Rc` values refer to +each other, causing memory leaks. Similarly, `Mutex` comes with the risk of +creating *deadlocks*. These occur when an operation needs to lock two resources +and two threads have each acquired one of the locks, causing them to wait for +each other forever. If you’re interested in deadlocks, try creating a Rust +program that has a deadlock; then research deadlock mitigation strategies for +mutexes in any language and have a go at implementing them in Rust. The +standard library API documentation for `Mutex` and `MutexGuard` offers +useful information. + +We’ll round out this chapter by talking about the `Send` and `Sync` traits and +how we can use them with custom types. + +## Extensible Concurrency with the Send and Sync Traits + +Interestingly, the Rust language has *very* few concurrency features. Almost +every concurrency feature we’ve talked about so far in this chapter has been +part of the standard library, not the language. Your options for handling +concurrency are not limited to the language or the standard library; you can +write your own concurrency features or use those written by others. + +However, two concurrency concepts are embedded in the language: the +`std::marker` traits `Send` and `Sync` . + +### Allowing Transference of Ownership Between Threads with Send + +The `Send` marker trait indicates that ownership of values of the type +implementing `Send` can be transferred between threads. Almost every Rust type +is `Send`, but there are some exceptions, including `Rc`: this cannot be +`Send` because if you cloned an `Rc` value and tried to transfer ownership +of the clone to another thread, both threads might update the reference count +at the same time. For this reason, `Rc` is implemented for use in +single-threaded situations where you don’t want to pay the thread-safe +performance penalty. + +Therefore, Rust’s type system and trait bounds ensure that you can never +accidentally send an `Rc` value across threads unsafely. When we tried to do +this in Listing 16-14, we got the error `the trait `Send` is not implemented +for `Rc>``. When we switched to `Arc`, which is `Send`, the code +compiled. + +Any type composed entirely of `Send` types is automatically marked as `Send` as +well. Almost all primitive types are `Send`, aside from raw pointers, which +we’ll discuss in Chapter 19. + +### Allowing Access from Multiple Threads with Sync + +The `Sync` marker trait indicates that it is safe for the type implementing +`Sync` to be referenced from multiple threads. In other words, any type `T` is +`Sync` if `&T` (an immutable reference to `T`) is `Send`, meaning the reference +can be sent safely to another thread. Similar to `Send`, primitive types are +`Sync`, and types composed entirely of types that are `Sync` are also `Sync`. + +The smart pointer `Rc` is also not `Sync` for the same reasons that it’s not +`Send`. The `RefCell` type (which we talked about in Chapter 15) and the +family of related `Cell` types are not `Sync`. The implementation of borrow +checking that `RefCell` does at runtime is not thread-safe. The smart +pointer `Mutex` is `Sync` and can be used to share access with multiple +threads, as you saw in “Sharing a Mutex Between Multiple Threads” on page XX. + +### Implementing Send and Sync Manually Is Unsafe + +Because types that are made up of `Send` and `Sync` traits are automatically +also `Send` and `Sync`, we don’t have to implement those traits manually. As +marker traits, they don’t even have any methods to implement. They’re just +useful for enforcing invariants related to concurrency. + +Manually implementing these traits involves implementing unsafe Rust code. +We’ll talk about using unsafe Rust code in Chapter 19; for now, the important +information is that building new concurrent types not made up of `Send` and +`Sync` parts requires careful thought to uphold the safety guarantees. “The +Rustonomicon” at *https://doc.rust-lang.org/stable/nomicon* has more +information about these guarantees and how to uphold them. + +## Summary + +This isn’t the last you’ll see of concurrency in this book: the project in +Chapter 20 will use the concepts in this chapter in a more realistic situation +than the smaller examples discussed here. + +As mentioned earlier, because very little of how Rust handles concurrency is +part of the language, many concurrency solutions are implemented as crates. +These evolve more quickly than the standard library, so be sure to search +online for the current, state-of-the-art crates to use in multithreaded +situations. + +The Rust standard library provides channels for message passing and smart +pointer types, such as `Mutex` and `Arc`, that are safe to use in +concurrent contexts. The type system and the borrow checker ensure that the +code using these solutions won’t end up with data races or invalid references. +Once you get your code to compile, you can rest assured that it will happily +run on multiple threads without the kinds of hard-to-track-down bugs common in +other languages. Concurrent programming is no longer a concept to be afraid of: +go forth and make your programs concurrent, fearlessly! + +Next, we’ll talk about idiomatic ways to model problems and structure solutions +as your Rust programs get bigger. In addition, we’ll discuss how Rust’s idioms +relate to those you might be familiar with from object-oriented programming. + diff --git a/rustbook-ru/nostarch/chapter17.md b/rustbook-ru/nostarch/chapter17.md new file mode 100644 index 000000000..946d20a11 --- /dev/null +++ b/rustbook-ru/nostarch/chapter17.md @@ -0,0 +1,1233 @@ + + +[TOC] + +# Object-Oriented Programming Features + +Object-oriented programming (OOP) is a way of modeling programs. Objects as a +programmatic concept were introduced in the programming language Simula in the +1960s. Those objects influenced Alan Kay’s programming architecture in which +objects pass messages to each other. To describe this architecture, he coined +the term *object-oriented programming* in 1967. Many competing definitions +describe what OOP is, and by some of these definitions Rust is object oriented +but by others it is not. In this chapter, we’ll explore certain characteristics +that are commonly considered object oriented and how those characteristics +translate to idiomatic Rust. We’ll then show you how to implement an +object-oriented design pattern in Rust and discuss the trade-offs of doing so +versus implementing a solution using some of Rust’s strengths instead. + +## Characteristics of Object-Oriented Languages + +There is no consensus in the programming community about what features a +language must have to be considered object oriented. Rust is influenced by many +programming paradigms, including OOP; for example, we explored the features +that came from functional programming in Chapter 13. Arguably, OOP languages +share certain common characteristics, namely objects, encapsulation, and +inheritance. Let’s look at what each of those characteristics means and whether +Rust supports it. + +### Objects Contain Data and Behavior + +The book *Design Patterns: Elements of Reusable Object-Oriented Software* by +Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Addison-Wesley, +1994), colloquially referred to as *The Gang of Four* book, is a catalog of +object-oriented design patterns. It defines OOP in this way: + +Object-oriented programs are made up of objects. An *object* packages both data +and the procedures that operate on that data. The procedures are typically +called *methods* or *operations*. + +Using this definition, Rust is object oriented: structs and enums have data, +and `impl` blocks provide methods on structs and enums. Even though structs and +enums with methods aren’t *called* objects, they provide the same +functionality, according to the Gang of Four’s definition of objects. + +### Encapsulation That Hides Implementation Details + +Another aspect commonly associated with OOP is the idea of *encapsulation*, +which means that the implementation details of an object aren’t accessible to +code using that object. Therefore, the only way to interact with an object is +through its public API; code using the object shouldn’t be able to reach into +the object’s internals and change data or behavior directly. This enables the +programmer to change and refactor an object’s internals without needing to +change the code that uses the object. + +We discussed how to control encapsulation in Chapter 7: we can use the `pub` +keyword to decide which modules, types, functions, and methods in our code +should be public, and by default everything else is private. For example, we +can define a struct `AveragedCollection` that has a field containing a vector +of `i32` values. The struct can also have a field that contains the average of +the values in the vector, meaning the average doesn’t have to be computed on +demand whenever anyone needs it. In other words, `AveragedCollection` will +cache the calculated average for us. Listing 17-1 has the definition of the +`AveragedCollection` struct. + +Filename: src/lib.rs + +``` +pub struct AveragedCollection { + list: Vec, + average: f64, +} +``` + +Listing 17-1: An `AveragedCollection` struct that maintains a list of integers +and the average of the items in the collection + +The struct is marked `pub` so that other code can use it, but the fields within +the struct remain private. This is important in this case because we want to +ensure that whenever a value is added or removed from the list, the average is +also updated. We do this by implementing `add`, `remove`, and `average` methods +on the struct, as shown in Listing 17-2. + +Filename: src/lib.rs + +``` +impl AveragedCollection { + pub fn add(&mut self, value: i32) { + self.list.push(value); + self.update_average(); + } + + pub fn remove(&mut self) -> Option { + let result = self.list.pop(); + match result { + Some(value) => { + self.update_average(); + Some(value) + } + None => None, + } + } + + pub fn average(&self) -> f64 { + self.average + } + + fn update_average(&mut self) { + let total: i32 = self.list.iter().sum(); + self.average = total as f64 / self.list.len() as f64; + } +} +``` + +Listing 17-2: Implementations of the public methods `add`, `remove`, and +`average` on `AveragedCollection` + +The public methods `add`, `remove`, and `average` are the only ways to access +or modify data in an instance of `AveragedCollection`. When an item is added to +`list` using the `add` method or removed using the `remove` method, the +implementations of each call the private `update_average` method that handles +updating the `average` field as well. + +We leave the `list` and `average` fields private so there is no way for +external code to add or remove items to or from the `list` field directly; +otherwise, the `average` field might become out of sync when the `list` +changes. The `average` method returns the value in the `average` field, +allowing external code to read the `average` but not modify it. + +Because we’ve encapsulated the implementation details of the struct +`AveragedCollection`, we can easily change aspects, such as the data structure, +in the future. For instance, we could use a `HashSet` instead of a +`Vec` for the `list` field. As long as the signatures of the `add`, +`remove`, and `average` public methods stayed the same, code using +`AveragedCollection` wouldn’t need to change. If we made `list` public instead, +this wouldn’t necessarily be the case: `HashSet` and `Vec` have +different methods for adding and removing items, so the external code would +likely have to change if it were modifying `list` directly. + +If encapsulation is a required aspect for a language to be considered object +oriented, then Rust meets that requirement. The option to use `pub` or not for +different parts of code enables encapsulation of implementation details. + +### Inheritance as a Type System and as Code Sharing + +*Inheritance* is a mechanism whereby an object can inherit elements from +another object’s definition, thus gaining the parent object’s data and behavior +without you having to define them again. + +If a language must have inheritance to be object oriented, then Rust is not +such a language. There is no way to define a struct that inherits the parent +struct’s fields and method implementations without using a macro. + +However, if you’re used to having inheritance in your programming toolbox, you +can use other solutions in Rust, depending on your reason for reaching for +inheritance in the first place. + +You would choose inheritance for two main reasons. One is for reuse of code: +you can implement particular behavior for one type, and inheritance enables you +to reuse that implementation for a different type. You can do this in a limited +way in Rust code using default trait method implementations, which you saw in +Listing 10-14 when we added a default implementation of the `summarize` method +on the `Summary` trait. Any type implementing the `Summary` trait would have +the `summarize` method available on it without any further code. This is +similar to a parent class having an implementation of a method and an +inheriting child class also having the implementation of the method. We can +also override the default implementation of the `summarize` method when we +implement the `Summary` trait, which is similar to a child class overriding the +implementation of a method inherited from a parent class. + +The other reason to use inheritance relates to the type system: to enable a +child type to be used in the same places as the parent type. This is also +called *polymorphism*, which means that you can substitute multiple objects for +each other at runtime if they share certain characteristics. + +> ### Polymorphism +> +> To many people, polymorphism is synonymous with inheritance. But it’s +actually a more general concept that refers to code that can work with data of +multiple types. For inheritance, those types are generally subclasses. +> +> Rust instead uses generics to abstract over different possible types and +trait bounds to impose constraints on what those types must provide. This is +sometimes called *bounded parametric polymorphism*. + +Inheritance has recently fallen out of favor as a programming design solution +in many programming languages because it’s often at risk of sharing more code +than necessary. Subclasses shouldn’t always share all characteristics of their +parent class but will do so with inheritance. This can make a program’s design +less flexible. It also introduces the possibility of calling methods on +subclasses that don’t make sense or that cause errors because the methods don’t +apply to the subclass. In addition, some languages will only allow single +inheritance (meaning a subclass can only inherit from one class), further +restricting the flexibility of a program’s design. + +For these reasons, Rust takes the different approach of using trait objects +instead of inheritance. Let’s look at how trait objects enable polymorphism in +Rust. + +## Using Trait Objects That Allow for Values of Different Types + +In Chapter 8, we mentioned that one limitation of vectors is that they can +store elements of only one type. We created a workaround in Listing 8-9 where +we defined a `SpreadsheetCell` enum that had variants to hold integers, floats, +and text. This meant we could store different types of data in each cell and +still have a vector that represented a row of cells. This is a perfectly good +solution when our interchangeable items are a fixed set of types that we know +when our code is compiled. + +However, sometimes we want our library user to be able to extend the set of +types that are valid in a particular situation. To show how we might achieve +this, we’ll create an example graphical user interface (GUI) tool that iterates +through a list of items, calling a `draw` method on each one to draw it to the +screen—a common technique for GUI tools. We’ll create a library crate called +`gui` that contains the structure of a GUI library. This crate might include +some types for people to use, such as `Button` or `TextField`. In addition, +`gui` users will want to create their own types that can be drawn: for +instance, one programmer might add an `Image` and another might add a +`SelectBox`. + +We won’t implement a full-fledged GUI library for this example but will show +how the pieces would fit together. At the time of writing the library, we can’t +know and define all the types other programmers might want to create. But we do +know that `gui` needs to keep track of many values of different types, and it +needs to call a `draw` method on each of these differently typed values. It +doesn’t need to know exactly what will happen when we call the `draw` method, +just that the value will have that method available for us to call. + +To do this in a language with inheritance, we might define a class named +`Component` that has a method named `draw` on it. The other classes, such as +`Button`, `Image`, and `SelectBox`, would inherit from `Component` and thus +inherit the `draw` method. They could each override the `draw` method to define +their custom behavior, but the framework could treat all of the types as if +they were `Component` instances and call `draw` on them. But because Rust +doesn’t have inheritance, we need another way to structure the `gui` library to +allow users to extend it with new types. + +### Defining a Trait for Common Behavior + +To implement the behavior we want `gui` to have, we’ll define a trait named +`Draw` that will have one method named `draw`. Then we can define a vector that +takes a *trait object*. A trait object points to both an instance of a type +implementing our specified trait and a table used to look up trait methods on +that type at runtime. We create a trait object by specifying some sort of +pointer, such as a `&` reference or a `Box` smart pointer, then the `dyn` +keyword, and then specifying the relevant trait. (We’ll talk about the reason +trait objects must use a pointer in “Dynamically Sized Types and the Sized +Trait” on page XX.) We can use trait objects in place of a generic or concrete +type. Wherever we use a trait object, Rust’s type system will ensure at compile +time that any value used in that context will implement the trait object’s +trait. Consequently, we don’t need to know all the possible types at compile +time. + +We’ve mentioned that, in Rust, we refrain from calling structs and enums +“objects” to distinguish them from other languages’ objects. In a struct or +enum, the data in the struct fields and the behavior in `impl` blocks are +separated, whereas in other languages, the data and behavior combined into one +concept is often labeled an object. However, trait objects *are* more like +objects in other languages in the sense that they combine data and behavior. +But trait objects differ from traditional objects in that we can’t add data to +a trait object. Trait objects aren’t as generally useful as objects in other +languages: their specific purpose is to allow abstraction across common +behavior. + +Listing 17-3 shows how to define a trait named `Draw` with one method named +`draw`. + +Filename: src/lib.rs + +``` +pub trait Draw { + fn draw(&self); +} +``` + +Listing 17-3: Definition of the `Draw` trait + +This syntax should look familiar from our discussions on how to define traits +in Chapter 10. Next comes some new syntax: Listing 17-4 defines a struct named +`Screen` that holds a vector named `components`. This vector is of type +`Box`, which is a trait object; it’s a stand-in for any type inside a +`Box` that implements the `Draw` trait. + +Filename: src/lib.rs + +``` +pub struct Screen { + pub components: Vec>, +} +``` + +Listing 17-4: Definition of the `Screen` struct with a `components` field +holding a vector of trait objects that implement the `Draw` trait + +On the `Screen` struct, we’ll define a method named `run` that will call the +`draw` method on each of its `components`, as shown in Listing 17-5. + +Filename: src/lib.rs + +``` +impl Screen { + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} +``` + +Listing 17-5: A `run` method on `Screen` that calls the `draw` method on each +component + +This works differently from defining a struct that uses a generic type +parameter with trait bounds. A generic type parameter can only be substituted +with one concrete type at a time, whereas trait objects allow for multiple +concrete types to fill in for the trait object at runtime. For example, we +could have defined the `Screen` struct using a generic type and a trait bound, +as in Listing 17-6. + +Filename: src/lib.rs + +``` +pub struct Screen { + pub components: Vec, +} + +impl Screen +where + T: Draw, +{ + pub fn run(&self) { + for component in self.components.iter() { + component.draw(); + } + } +} +``` + +Listing 17-6: An alternate implementation of the `Screen` struct and its `run` +method using generics and trait bounds + +This restricts us to a `Screen` instance that has a list of components all of +type `Button` or all of type `TextField`. If you’ll only ever have homogeneous +collections, using generics and trait bounds is preferable because the +definitions will be monomorphized at compile time to use the concrete types. + +On the other hand, with the method using trait objects, one `Screen` instance +can hold a `Vec` that contains a `Box
", "") + } else { + String::from("") + }; + + match &self.current { + Some(listing) => { + let closing_event = match mode { + Mode::Default => { + let closing_html = listing.closing_html(&trailing); + Event::Html(closing_html.into()) + } + Mode::Simple => { + let closing_text = listing.closing_text(&trailing); + Event::Text(closing_text.into()) + } + }; + + self.current = None; + self.events.push(Ok(closing_event)); + } + None => { + self.events.push(Err(String::from( + "Closing `
` without opening tag.", + ))); + } + } + } +} + +#[derive(Debug)] +struct Listing { + number: Option, + caption: Option, + file_name: Option, +} + +impl Listing { + fn opening_html(&self) -> String { + let figure = String::from("
\n"); + + match self.file_name.as_ref() { + Some(file_name) => format!( + "{figure}Filename: {file_name}\n", + ), + None => figure, + } + } + + fn closing_html(&self, trailing: &str) -> String { + match (&self.number, &self.caption) { + (Some(number), Some(caption)) => format!( + r#"
Listing {number}: {caption}
+
{trailing}"# + ), + (None, Some(caption)) => format!( + r#"
{caption}
+{trailing}"# + ), + (Some(number), None) => format!( + r#"
Listing {number}
+{trailing}"# + ), + (None, None) => format!("{trailing}"), + } + } + + fn opening_text(&self) -> String { + self.file_name + .as_ref() + .map(|file_name| format!("\nFilename: {file_name}\n")) + .unwrap_or_default() + } + + fn closing_text(&self, trailing: &str) -> String { + match (&self.number, &self.caption) { + (Some(number), Some(caption)) => { + format!("Listing {number}: {caption}{trailing}") + } + (None, Some(caption)) => format!("{caption}{trailing}"), + (Some(number), None) => format!("Listing {number}{trailing}"), + (None, None) => trailing.into(), + } + } +} + +struct ListingBuilder { + number: Option, + caption: Option, + file_name: Option, +} + +impl ListingBuilder { + fn new() -> ListingBuilder { + ListingBuilder { + number: None, + caption: None, + file_name: None, + } + } + + fn with_number(mut self, value: String) -> Self { + self.number = Some(value); + self + } + + fn with_caption(mut self, value: String) -> Self { + self.caption = Some(value); + self + } + + fn with_file_name(mut self, value: String) -> Self { + self.file_name = Some(value); + self + } + + fn build(self) -> Listing { + let caption = self.caption.map(|caption_source| { + let events = new_cmark_parser(&caption_source, true); + let mut buf = String::with_capacity(caption_source.len() * 2); + html::push_html(&mut buf, events); + + // This is not particularly principled, but since the only + // place it is used is here, for caption source handling, it + // is “fine”. + buf.replace("

", "").replace("

", "").replace('\n', "") + }); + + Listing { + number: self.number.map(String::from), + caption, + file_name: self.file_name.map(String::from), + } + } +} + +#[cfg(test)] +mod tests; diff --git a/rustbook-ru/packages/mdbook-trpl-listing/src/main.rs b/rustbook-ru/packages/mdbook-trpl-listing/src/main.rs new file mode 100644 index 000000000..3792b46fa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/src/main.rs @@ -0,0 +1,37 @@ +use std::io; + +use clap::{self, Parser, Subcommand}; +use mdbook::preprocess::{CmdPreprocessor, Preprocessor}; + +use mdbook_trpl_listing::TrplListing; + +fn main() -> Result<(), String> { + let cli = Cli::parse(); + if let Some(Command::Supports { renderer }) = cli.command { + return if TrplListing.supports_renderer(&renderer) { + Ok(()) + } else { + Err(format!("Renderer '{renderer}' is unsupported")) + }; + } + + let (ctx, book) = CmdPreprocessor::parse_input(io::stdin()).map_err(|e| format!("{e}"))?; + let processed = TrplListing.run(&ctx, book).map_err(|e| format!("{e}"))?; + serde_json::to_writer(io::stdout(), &processed).map_err(|e| format!("{e}")) +} + +/// A simple preprocessor for semantic markup for code listings in _The Rust +/// Programming Language_. +#[derive(Parser, Debug)] +struct Cli { + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand, Debug)] +enum Command { + /// Is the renderer supported? + /// + /// All renderers are supported! This is the contract for mdBook. + Supports { renderer: String }, +} diff --git a/rustbook-ru/packages/mdbook-trpl-listing/src/tests/config.rs b/rustbook-ru/packages/mdbook-trpl-listing/src/tests/config.rs new file mode 100644 index 000000000..d44004b3e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/src/tests/config.rs @@ -0,0 +1,242 @@ +//! Check that the config options are correctly handled. +//! +//! Note: none of these tests particularly exercise the *wiring*. They just +//! assume that the config itself is done correctly. This is a small enough +//! chunk of code that it easy to verify by hand at present. If it becomes +//! more complex in the future, it would be good to revisit and integrate +//! the same kinds of tests as the unit tests above here. + +use super::*; + +// TODO: what *should* the behavior here be? I *think* it should error, +// in that there is a problem if it is invoked without that info. +#[test] +fn no_config() { + let input_json = r##"[ + { + "root": "/path/to/book", + "config": { + "book": { + "authors": ["AUTHOR"], + "language": "en", + "multilingual": false, + "src": "src", + "title": "TITLE" + }, + "preprocessor": {} + }, + "renderer": "html", + "mdbook_version": "0.4.21" + }, + { + "sections": [ + { + "Chapter": { + "name": "Chapter 1", + "content": "# Chapter 1\n", + "number": [1], + "sub_items": [], + "path": "chapter_1.md", + "source_path": "chapter_1.md", + "parent_names": [] + } + } + ], + "__non_exhaustive": null + } + ]"##; + let input_json = input_json.as_bytes(); + let (ctx, book) = + mdbook::preprocess::CmdPreprocessor::parse_input(input_json).unwrap(); + let result = TrplListing.run(&ctx, book); + assert!(result.is_err()); + let err = result.unwrap_err(); + assert_eq!(format!("{err}"), "No config for trpl-listing"); +} + +#[test] +fn empty_config() { + let input_json = r##"[ + { + "root": "/path/to/book", + "config": { + "book": { + "authors": ["AUTHOR"], + "language": "en", + "multilingual": false, + "src": "src", + "title": "TITLE" + }, + "preprocessor": { + "trpl-listing": {} + } + }, + "renderer": "html", + "mdbook_version": "0.4.21" + }, + { + "sections": [ + { + "Chapter": { + "name": "Chapter 1", + "content": "# Chapter 1\n", + "number": [1], + "sub_items": [], + "path": "chapter_1.md", + "source_path": "chapter_1.md", + "parent_names": [] + } + } + ], + "__non_exhaustive": null + } + ]"##; + let input_json = input_json.as_bytes(); + let (ctx, book) = + mdbook::preprocess::CmdPreprocessor::parse_input(input_json).unwrap(); + let result = TrplListing.run(&ctx, book); + assert!(result.is_ok()); +} + +#[test] +fn specify_default() { + let input_json = r##"[ + { + "root": "/path/to/book", + "config": { + "book": { + "authors": ["AUTHOR"], + "language": "en", + "multilingual": false, + "src": "src", + "title": "TITLE" + }, + "preprocessor": { + "trpl-listing": { + "output-mode": "default" + } + } + }, + "renderer": "html", + "mdbook_version": "0.4.21" + }, + { + "sections": [ + { + "Chapter": { + "name": "Chapter 1", + "content": "# Chapter 1\n", + "number": [1], + "sub_items": [], + "path": "chapter_1.md", + "source_path": "chapter_1.md", + "parent_names": [] + } + } + ], + "__non_exhaustive": null + } + ]"##; + let input_json = input_json.as_bytes(); + let (ctx, book) = + mdbook::preprocess::CmdPreprocessor::parse_input(input_json).unwrap(); + let result = TrplListing.run(&ctx, book); + assert!(result.is_ok()); +} + +#[test] +fn specify_simple() { + let input_json = r##"[ + { + "root": "/path/to/book", + "config": { + "book": { + "authors": ["AUTHOR"], + "language": "en", + "multilingual": false, + "src": "src", + "title": "TITLE" + }, + "preprocessor": { + "trpl-listing": { + "output-mode": "simple" + } + } + }, + "renderer": "html", + "mdbook_version": "0.4.21" + }, + { + "sections": [ + { + "Chapter": { + "name": "Chapter 1", + "content": "# Chapter 1\n", + "number": [1], + "sub_items": [], + "path": "chapter_1.md", + "source_path": "chapter_1.md", + "parent_names": [] + } + } + ], + "__non_exhaustive": null + } + ]"##; + let input_json = input_json.as_bytes(); + let (ctx, book) = + mdbook::preprocess::CmdPreprocessor::parse_input(input_json).unwrap(); + let result = TrplListing.run(&ctx, book); + assert!(result.is_ok()); +} + +#[test] +fn specify_invalid() { + let input_json = r##"[ + { + "root": "/path/to/book", + "config": { + "book": { + "authors": ["AUTHOR"], + "language": "en", + "multilingual": false, + "src": "src", + "title": "TITLE" + }, + "preprocessor": { + "trpl-listing": { + "output-mode": "nonsense" + } + } + }, + "renderer": "html", + "mdbook_version": "0.4.21" + }, + { + "sections": [ + { + "Chapter": { + "name": "Chapter 1", + "content": "# Chapter 1\n", + "number": [1], + "sub_items": [], + "path": "chapter_1.md", + "source_path": "chapter_1.md", + "parent_names": [] + } + } + ], + "__non_exhaustive": null + } + ]"##; + let input_json = input_json.as_bytes(); + let (ctx, book) = + mdbook::preprocess::CmdPreprocessor::parse_input(input_json).unwrap(); + let result = TrplListing.run(&ctx, book); + assert!(result.is_err()); + let err = result.unwrap_err(); + assert_eq!( + format!("{err}"), + "Bad config value '\"nonsense\"' for key 'output-mode'" + ); +} diff --git a/rustbook-ru/packages/mdbook-trpl-listing/src/tests/mod.rs b/rustbook-ru/packages/mdbook-trpl-listing/src/tests/mod.rs new file mode 100644 index 000000000..5ae5c8e96 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/src/tests/mod.rs @@ -0,0 +1,192 @@ +use super::*; + +/// Note: This inserts an additional backtick around the re-emitted code. +/// It is not clear *why*, but that seems to be an artifact of the rendering +/// done by the `pulldown_cmark_to_cmark` crate. +#[test] +fn default_mode_works() { + let result = rewrite_listing( + r#"+ +```rust +fn main() {} +``` + +"#, + Mode::Default, + ); + + assert_eq!( + &result.unwrap(), + r#"
+Filename: src/main.rs + +````rust +fn main() {} +```` + +
Listing 1-2: A write-up which might include inline Markdown like code etc.
+
"# + ); +} + +#[test] +fn simple_mode_works() { + let result = rewrite_listing( + r#"+ +```rust +fn main() {} +``` + +"#, + Mode::Simple, + ); + + assert_eq!( + &result.unwrap(), + r#" +Filename: src/main.rs + +````rust +fn main() {} +```` + +Listing 1-2: A write-up which might include inline Markdown like code etc."# + ); +} + +#[test] +fn listing_with_embedded_angle_brackets() { + let result = rewrite_listing( + r#"+ +```rust +fn get_a_box_of(t: T) -> Box { + Box::new(T) +} +``` + +"#, + Mode::Default, + ); + + assert_eq!( + &result.unwrap(), + r#"
+ +````rust +fn get_a_box_of(t: T) -> Box { + Box::new(T) +} +```` + +
Listing 34-5: This has a Box<T> in it.
+
"# + ); +} + +#[test] +fn actual_listing() { + let result = rewrite_listing( + r#"Now open the *main.rs* file you just created and enter the code in Listing 1-1. + ++ +```rust +fn main() { + println!("Hello, world!"); +} +``` + + + +Save the file and go back to your terminal window"#, + Mode::Default, + ); + + assert!(result.is_ok()); + assert_eq!( + result.unwrap(), + r#"Now open the *main.rs* file you just created and enter the code in Listing 1-1. + +
+Filename: main.rs + +````rust +fn main() { + println!("Hello, world!"); +} +```` + +
Listing 1-1: A program that prints Hello, world!
+
+ +Save the file and go back to your terminal window"# + ); +} + +#[test] +fn no_filename() { + let result = rewrite_listing( + r#"This is the opening. + ++ +```rust +fn main() {} +``` + + + +This is the closing."#, + Mode::Default, + ); + + assert!(result.is_ok()); + assert_eq!( + result.unwrap(), + r#"This is the opening. + +
+ +````rust +fn main() {} +```` + +
Listing 1-1: This is the caption
+
+ +This is the closing."# + ); +} + +#[test] +fn without_number() { + let result = rewrite_listing( + r#"+ +```rust +fn main() {} +``` + +"#, + Mode::Default, + ); + + assert!(result.is_ok()); + assert_eq!( + result.unwrap(), + r#"
+Filename: src/main.rs + +````rust +fn main() {} +```` + +
"# + ); +} + +#[cfg(test)] +mod config; diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/.rustc_info.json b/rustbook-ru/packages/mdbook-trpl-listing/target/.rustc_info.json new file mode 100644 index 000000000..e0698102a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":8894157253988407288,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.81.0 (eeb90cda1 2024-09-04)\nbinary: rustc\ncommit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c\ncommit-date: 2024-09-04\nhost: x86_64-pc-windows-msvc\nrelease: 1.81.0\nLLVM version: 18.1.7\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/CACHEDIR.TAG b/rustbook-ru/packages/mdbook-trpl-listing/target/CACHEDIR.TAG new file mode 100644 index 000000000..20d7c319c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.cargo-lock b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.cargo-lock new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick new file mode 100644 index 000000000..2bc124081 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick @@ -0,0 +1 @@ +ece26dbcaa3c7fc7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json new file mode 100644 index 000000000..807dac316 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"perf-literal\", \"std\"]","declared_features":"[\"default\", \"logging\", \"perf-literal\", \"std\"]","target":9771195463141993919,"profile":14620777910751233144,"path":315585277297123955,"deps":[[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\aho-corasick-9aecbe7599ed1c3c\\dep-lib-aho_corasick"}}],"rustflags":[],"metadata":13904389431191498124,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream new file mode 100644 index 000000000..cd39a7b1e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream @@ -0,0 +1 @@ +5c4ffed1ba25b194 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json new file mode 100644 index 000000000..222967723 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"auto\", \"default\", \"wincon\"]","declared_features":"[\"auto\", \"default\", \"test\", \"wincon\"]","target":14678495327963445937,"profile":995129404481031558,"path":10509098586486583087,"deps":[[586690293298905842,"anstyle_query",false,10953502178889718747],[1822318453936871207,"anstyle_wincon",false,8496636152828274502],[2294077528697419694,"utf8parse",false,16313337870937678466],[12423115053093093635,"is_terminal_polyfill",false,1553848363984580399],[15873833695005184023,"colorchoice",false,8645855937848871466],[16609132864249042075,"anstyle_parse",false,14894262068820411552],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstream-680ff811fd8a5ff2\\dep-lib-anstream"}}],"rustflags":[],"metadata":7500874485387469444,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle new file mode 100644 index 000000000..d7f4b3174 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle @@ -0,0 +1 @@ +335eef359e79d985 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json new file mode 100644 index 000000000..eff6b75d9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":7171498741014507518,"profile":995129404481031558,"path":13884029777877037710,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-546d425a429ba834\\dep-lib-anstyle"}}],"rustflags":[],"metadata":14064844656010464607,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse new file mode 100644 index 000000000..72502564b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse @@ -0,0 +1 @@ +a0849d3b700cb3ce \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json new file mode 100644 index 000000000..3bf482a19 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"utf8\"]","declared_features":"[\"core\", \"default\", \"utf8\"]","target":16532437263334685269,"profile":995129404481031558,"path":11524608868306533075,"deps":[[2294077528697419694,"utf8parse",false,16313337870937678466]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-parse-16a7ce764a60d6c5\\dep-lib-anstyle_parse"}}],"rustflags":[],"metadata":9799137552285937175,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query new file mode 100644 index 000000000..d96e21f7e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query @@ -0,0 +1 @@ +db5b309332a80298 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json new file mode 100644 index 000000000..1dc8c8b8d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":15444555938411509536,"profile":995129404481031558,"path":14674231680796983345,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-query-55471d262361d969\\dep-lib-anstyle_query"}}],"rustflags":[],"metadata":10674566383365303417,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon new file mode 100644 index 000000000..cbf2b440c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon @@ -0,0 +1 @@ +4627125b901dea75 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json new file mode 100644 index 000000000..aa59bfc44 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":14626972302400552205,"profile":995129404481031558,"path":1738858255770414673,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-wincon-16d1f280e2db68d2\\dep-lib-anstyle_wincon"}}],"rustflags":[],"metadata":10007381969299487346,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build new file mode 100644 index 000000000..2238afa34 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build @@ -0,0 +1 @@ +45d2461c994b6113 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json new file mode 100644 index 000000000..139c7fe53 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[16045357212464686133,"build_script_build",false,8182181152569577808]],"local":[{"RerunIfChanged":{"output":"release\\build\\anyhow-4d9c79b21dc2e4f4\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build new file mode 100644 index 000000000..5bd94dac0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build @@ -0,0 +1 @@ +5051ce3e68f28c71 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json new file mode 100644 index 000000000..ecf49d6f9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"backtrace\", \"default\", \"std\"]","target":13708040221295731214,"profile":15621230377962148654,"path":12949867758696785302,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anyhow-a7943f6b1836ace1\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":17154292783084528516,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow new file mode 100644 index 000000000..68dad1f1d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow @@ -0,0 +1 @@ +ad55b6dc07739bd9 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json new file mode 100644 index 000000000..19f6e0820 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"backtrace\", \"default\", \"std\"]","target":863081735331048100,"profile":14620777910751233144,"path":12659645468741012932,"deps":[[16045357212464686133,"build_script_build",false,1396480480438047301]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anyhow-b7b3f7fb9b7594ea\\dep-lib-anyhow"}}],"rustflags":[],"metadata":17154292783084528516,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg new file mode 100644 index 000000000..368434c67 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg @@ -0,0 +1 @@ +c108f32d54052f38 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json new file mode 100644 index 000000000..d8122f613 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9761386671650792958,"profile":15621230377962148654,"path":9726554179280314580,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\autocfg-ad0bff98703cb9e9\\dep-lib-autocfg"}}],"rustflags":[],"metadata":13102859075309379048,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags new file mode 100644 index 000000000..ed7527eaa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags @@ -0,0 +1 @@ +1d8f642de1798056 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json new file mode 100644 index 000000000..2fe8e44a7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"arbitrary\", \"bytemuck\", \"compiler_builtins\", \"core\", \"example_generated\", \"rustc-dep-of-std\", \"serde\", \"std\"]","target":14463131919016566876,"profile":14620777910751233144,"path":18276530296250666590,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\bitflags-11015e225f23efd0\\dep-lib-bitflags"}}],"rustflags":[],"metadata":14564035643000669268,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if new file mode 100644 index 000000000..08f9def4e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if @@ -0,0 +1 @@ +312c7a1e064b339d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json new file mode 100644 index 000000000..5931e006b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"compiler_builtins\", \"core\", \"rustc-dep-of-std\"]","target":11601024444410784892,"profile":14620777910751233144,"path":13471862296553709438,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\cfg-if-8767b834a7308c67\\dep-lib-cfg_if"}}],"rustflags":[],"metadata":8462187951337715540,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono new file mode 100644 index 000000000..af7956458 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono @@ -0,0 +1 @@ +0c86a452411c27b2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json new file mode 100644 index 000000000..23a512670 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"android-tzdata\", \"clock\", \"iana-time-zone\", \"now\", \"std\", \"winapi\", \"windows-targets\"]","declared_features":"[\"__internal_bench\", \"alloc\", \"android-tzdata\", \"arbitrary\", \"clock\", \"default\", \"iana-time-zone\", \"js-sys\", \"libc\", \"now\", \"oldtime\", \"pure-rust-locales\", \"rkyv\", \"rkyv-16\", \"rkyv-32\", \"rkyv-64\", \"rkyv-validation\", \"serde\", \"std\", \"unstable-locales\", \"wasm-bindgen\", \"wasmbind\", \"winapi\", \"windows-targets\"]","target":3643947551994703751,"profile":14620777910751233144,"path":7468534507969858669,"deps":[[9471768686618079862,"windows_targets",false,698127449752346759],[10448766010662481490,"num_traits",false,10793000490354472189]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\chrono-94fe39ff394230ed\\dep-lib-chrono"}}],"rustflags":[],"metadata":9803565982372010724,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap new file mode 100644 index 000000000..643ecd6bb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap @@ -0,0 +1 @@ +e0204bd3b8ad8fb7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json new file mode 100644 index 000000000..e9be15296 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"cargo\", \"color\", \"default\", \"derive\", \"error-context\", \"help\", \"std\", \"suggestions\", \"usage\", \"wrap_help\"]","declared_features":"[\"cargo\", \"color\", \"debug\", \"default\", \"deprecated\", \"derive\", \"env\", \"error-context\", \"help\", \"std\", \"string\", \"suggestions\", \"unicode\", \"unstable-doc\", \"unstable-styles\", \"unstable-v5\", \"usage\", \"wrap_help\"]","target":3867101554193434771,"profile":14620777910751233144,"path":9745555515622033310,"deps":[[8642186927319252504,"clap_builder",false,14471042115223297753],[14428068728819244653,"clap_derive",false,3345902488860417389]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap-9a0ba72745542e32\\dep-lib-clap"}}],"rustflags":[],"metadata":13636260659328210681,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder new file mode 100644 index 000000000..dedf9e082 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder @@ -0,0 +1 @@ +d91e9a072278d3c8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json new file mode 100644 index 000000000..fb874f2b4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"cargo\", \"color\", \"error-context\", \"help\", \"std\", \"suggestions\", \"usage\", \"wrap_help\"]","declared_features":"[\"cargo\", \"color\", \"debug\", \"default\", \"deprecated\", \"env\", \"error-context\", \"help\", \"std\", \"string\", \"suggestions\", \"unicode\", \"unstable-doc\", \"unstable-styles\", \"unstable-v5\", \"usage\", \"wrap_help\"]","target":4644856140729466895,"profile":14620777910751233144,"path":7106509597257098468,"deps":[[967775003968733193,"strsim",false,8320530356259103957],[8241424469277789533,"terminal_size",false,2815038329510585246],[10467672271736017538,"anstream",false,10714386472808370012],[12562571902142552798,"clap_lex",false,14831618001985906145],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_builder-6b89262c860f8a32\\dep-lib-clap_builder"}}],"rustflags":[],"metadata":13636260659328210681,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete new file mode 100644 index 000000000..0fe52f682 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete @@ -0,0 +1 @@ +56470e319de7b524 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json new file mode 100644 index 000000000..207a17958 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"debug\", \"default\", \"unstable-doc\", \"unstable-dynamic\"]","target":11987084266351445162,"profile":14620777910751233144,"path":17934022816917661757,"deps":[[9602749528789499273,"clap",false,13226981639940940000]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_complete-a7ad4f06481b96eb\\dep-lib-clap_complete"}}],"rustflags":[],"metadata":5048524194917773874,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive new file mode 100644 index 000000000..5d8f9f7c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive @@ -0,0 +1 @@ +6ddd9e1596086f2e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json new file mode 100644 index 000000000..24930251c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"debug\", \"default\", \"deprecated\", \"raw-deprecated\", \"unstable-v5\"]","target":9283944131990107227,"profile":15621230377962148654,"path":5852482638034792233,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380],[17175234422038868540,"heck",false,13614703808375705157]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_derive-928f3257cb5195d6\\dep-lib-clap_derive"}}],"rustflags":[],"metadata":751742508315986310,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex new file mode 100644 index 000000000..74f19c07a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex @@ -0,0 +1 @@ +e1a5a8d4fd7dd4cd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json new file mode 100644 index 000000000..91a218673 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":14633152357712548181,"profile":14620777910751233144,"path":3162528872785267419,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_lex-27c5293d8d8c133a\\dep-lib-clap_lex"}}],"rustflags":[],"metadata":10867457033190240412,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice new file mode 100644 index 000000000..6f221e0a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice @@ -0,0 +1 @@ +2a0aaff22a40fc77 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json new file mode 100644 index 000000000..4139416dc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":10647325813053673184,"profile":995129404481031558,"path":17128989343466695641,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\colorchoice-6846e899ff583e3a\\dep-lib-colorchoice"}}],"rustflags":[],"metadata":16033661185762923568,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build new file mode 100644 index 000000000..900d59aba --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build @@ -0,0 +1 @@ +047011e9d42436cb \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build.json new file mode 100644 index 000000000..3ffc5b8b0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no_core\", \"old_macros\"]","target":6423576478976419116,"profile":15621230377962148654,"path":5795697399329541922,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\doc-comment-8982444af1854533\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":2009847191618272438,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-8982444af1854533/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build new file mode 100644 index 000000000..286fdfcf2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build @@ -0,0 +1 @@ +e8b5f318290fb40c \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build.json new file mode 100644 index 000000000..e0d0d5fbe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-de79b3176dfc735f/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[3604316984868239912,"build_script_build",false,14642931735303647236]],"local":[{"Precalculated":"0.3.3"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/dep-lib-doc_comment b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/dep-lib-doc_comment new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/dep-lib-doc_comment differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment new file mode 100644 index 000000000..5b543970f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment @@ -0,0 +1 @@ +5754d5f72686ecad \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment.json new file mode 100644 index 000000000..bdd24c566 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/doc-comment-f13cfea23ab3da07/lib-doc_comment.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no_core\", \"old_macros\"]","target":15280559500495175145,"profile":14620777910751233144,"path":457939952481557406,"deps":[[3604316984868239912,"build_script_build",false,915373293449754088]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\doc-comment-f13cfea23ab3da07\\dep-lib-doc_comment"}}],"rustflags":[],"metadata":2009847191618272438,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter new file mode 100644 index 000000000..fb09b21bd --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter @@ -0,0 +1 @@ +13372c7d33f02d70 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json new file mode 100644 index 000000000..9a2f801b9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"regex\"]","declared_features":"[\"default\", \"regex\"]","target":15931849289142950406,"profile":14620777910751233144,"path":14719178554194305841,"deps":[[7667881417093566568,"regex",false,11717910061522356762],[10187828652899488954,"log",false,12598582175174921379]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\env_filter-e93210b2aeb1774d\\dep-lib-env_filter"}}],"rustflags":[],"metadata":10457561132037420740,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger new file mode 100644 index 000000000..b41bba417 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger @@ -0,0 +1 @@ +059b3821742e604b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json new file mode 100644 index 000000000..5d22a81c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"auto-color\", \"color\", \"default\", \"humantime\", \"regex\"]","declared_features":"[\"auto-color\", \"color\", \"default\", \"humantime\", \"regex\", \"unstable-kv\"]","target":7366343831621488814,"profile":14620777910751233144,"path":10642576440398364931,"deps":[[2355222013140718847,"env_filter",false,8083381010133956371],[10187828652899488954,"log",false,12598582175174921379],[10467672271736017538,"anstream",false,10714386472808370012],[13547796294171082677,"humantime",false,14784915955436352238],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\env_logger-1ad5f95231033016\\dep-lib-env_logger"}}],"rustflags":[],"metadata":16604235976610830136,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/dep-lib-equivalent b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/dep-lib-equivalent new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/dep-lib-equivalent differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent new file mode 100644 index 000000000..2d1fc54f5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent @@ -0,0 +1 @@ +60f98b8185227322 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent.json new file mode 100644 index 000000000..33b6d95c1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/equivalent-8dfdb0adfc2c5ec8/lib-equivalent.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":3435277167618958666,"profile":14620777910751233144,"path":8168941886383905777,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\equivalent-8dfdb0adfc2c5ec8\\dep-lib-equivalent"}}],"rustflags":[],"metadata":4899064301576391224,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand new file mode 100644 index 000000000..add19ad4d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand @@ -0,0 +1 @@ +fe6cc07651b1e5fe \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json new file mode 100644 index 000000000..526902db9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"getrandom\", \"js\", \"std\"]","target":13038976728470949040,"profile":14620777910751233144,"path":6376291730327509201,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\fastrand-857f7a2c79d6103e\\dep-lib-fastrand"}}],"rustflags":[],"metadata":10402231642546230285,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts new file mode 100644 index 000000000..4f7b78841 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts @@ -0,0 +1 @@ +bd893d62cac032a6 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json new file mode 100644 index 000000000..be6b085d0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"core\", \"rustc-dep-of-std\", \"std\"]","target":1977464407919124015,"profile":14620777910751233144,"path":10360612012968844872,"deps":[[11292725862571439900,"unicode_width",false,14325000934463337949]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\getopts-d5410df6c2bb16c4\\dep-lib-getopts"}}],"rustflags":[],"metadata":12800380490319660633,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars new file mode 100644 index 000000000..04458ca99 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars @@ -0,0 +1 @@ +b585a639cf20ebb4 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json new file mode 100644 index 000000000..2a298d4db --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"dir_source\", \"heck\", \"no_logging\", \"rhai\", \"rust-embed\", \"script_helper\", \"string_helpers\", \"walkdir\"]","target":10016905383071618913,"profile":14620777910751233144,"path":13187492646891310997,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[7781844590611205158,"pest_derive",false,11363071088690577505],[7898347539352098708,"serde_json",false,4512111603228297355],[8153797543571216910,"pest",false,9339805049955237317],[8725461231676817087,"serde",false,14256704062966727943],[10187828652899488954,"log",false,12598582175174921379]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\handlebars-4ecd7c29e70ab3a9\\dep-lib-handlebars"}}],"rustflags":[],"metadata":4366444519170567992,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/dep-lib-hashbrown b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/dep-lib-hashbrown new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/dep-lib-hashbrown differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown new file mode 100644 index 000000000..c032507c7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown @@ -0,0 +1 @@ +5096d01b21e273e9 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown.json new file mode 100644 index 000000000..1696909ee --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/hashbrown-b148a2d4fe531c77/lib-hashbrown.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"raw\"]","declared_features":"[\"ahash\", \"alloc\", \"allocator-api2\", \"compiler_builtins\", \"core\", \"default\", \"equivalent\", \"inline-more\", \"nightly\", \"raw\", \"rayon\", \"rkyv\", \"rustc-dep-of-std\", \"rustc-internal-api\", \"serde\"]","target":8830771204028428646,"profile":14620777910751233144,"path":3106236192577711822,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\hashbrown-b148a2d4fe531c77\\dep-lib-hashbrown"}}],"rustflags":[],"metadata":6228333144549390726,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck new file mode 100644 index 000000000..299796f61 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck @@ -0,0 +1 @@ +454e64dcfa24f1bc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json new file mode 100644 index 000000000..33f6e7504 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":835452791756564323,"profile":15621230377962148654,"path":7280437115999382909,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\heck-7178f53dab92b944\\dep-lib-heck"}}],"rustflags":[],"metadata":1438596273099979389,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/dep-lib-html_parser b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/dep-lib-html_parser new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/dep-lib-html_parser differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser new file mode 100644 index 000000000..87b685b73 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser @@ -0,0 +1 @@ +eab021f96201c95f \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser.json new file mode 100644 index 000000000..251705923 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/html_parser-dda0ef31ddac26ff/lib-html_parser.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":12965519953997161353,"profile":14620777910751233144,"path":8486995887799627352,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[3604316984868239912,"doc_comment",false,12532539364990080087],[7781844590611205158,"pest_derive",false,11363071088690577505],[7898347539352098708,"serde_json",false,4512111603228297355],[8153797543571216910,"pest",false,9339805049955237317],[8420555068261863417,"serde_derive",false,9979479887115832246],[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\html_parser-dda0ef31ddac26ff\\dep-lib-html_parser"}}],"rustflags":[],"metadata":6384216610872583071,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime new file mode 100644 index 000000000..ea08bd14c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime @@ -0,0 +1 @@ +eef2c945ba922ecd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json new file mode 100644 index 000000000..b9fcaced8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":3421103426456302212,"profile":14620777910751233144,"path":13678489989023312453,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\humantime-992fbb70b5bd7874\\dep-lib-humantime"}}],"rustflags":[],"metadata":16972751450777833143,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/dep-lib-indexmap b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/dep-lib-indexmap new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/dep-lib-indexmap differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap new file mode 100644 index 000000000..33937e7d9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap @@ -0,0 +1 @@ +625a7866d6ab94af \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap.json new file mode 100644 index 000000000..f8f845ed0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/indexmap-3d0fe27396cf6b7e/lib-indexmap.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"arbitrary\", \"borsh\", \"default\", \"quickcheck\", \"rayon\", \"rustc-rayon\", \"serde\", \"std\", \"test_debug\"]","target":11591081615636158202,"profile":18365783049043374052,"path":7072363449377455715,"deps":[[8480487335294508957,"hashbrown",false,16822037664987387472],[15758785351647784501,"equivalent",false,2482365776410704224]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\indexmap-3d0fe27396cf6b7e\\dep-lib-indexmap"}}],"rustflags":[],"metadata":9453022675325948987,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill new file mode 100644 index 000000000..4997b58f5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill @@ -0,0 +1 @@ +2f6f1fbada609015 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json new file mode 100644 index 000000000..97e5e1db3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\"]","target":17527010720891347357,"profile":4523493358069192447,"path":3116646572239039878,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\is_terminal_polyfill-e2c161c489984045\\dep-lib-is_terminal_polyfill"}}],"rustflags":[],"metadata":8562399766395157780,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa new file mode 100644 index 000000000..59c0af79b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa @@ -0,0 +1 @@ +0df19275f39de8f8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json new file mode 100644 index 000000000..37394bc9f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no-panic\"]","target":4403177153059382235,"profile":14620777910751233144,"path":8809167177894238621,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\itoa-32b3647f851aaeb2\\dep-lib-itoa"}}],"rustflags":[],"metadata":851671291587502216,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log new file mode 100644 index 000000000..2bfd78ed2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log @@ -0,0 +1 @@ +a38cdef8bc27d7ae \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json new file mode 100644 index 000000000..e922bf839 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"kv\", \"kv_serde\", \"kv_std\", \"kv_sval\", \"kv_unstable\", \"kv_unstable_serde\", \"kv_unstable_std\", \"kv_unstable_sval\", \"max_level_debug\", \"max_level_error\", \"max_level_info\", \"max_level_off\", \"max_level_trace\", \"max_level_warn\", \"release_max_level_debug\", \"release_max_level_error\", \"release_max_level_info\", \"release_max_level_off\", \"release_max_level_trace\", \"release_max_level_warn\", \"serde\", \"std\", \"sval\", \"sval_ref\", \"value-bag\"]","target":8820396181212955802,"profile":14620777910751233144,"path":10073275341893082220,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\log-df458d1cd0ebed3f\\dep-lib-log"}}],"rustflags":[],"metadata":179143468214550567,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook new file mode 100644 index 000000000..a9eb1fec1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook @@ -0,0 +1 @@ +be96334009dd990d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json new file mode 100644 index 000000000..f7b6a4000 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"search\", \"serve\", \"watch\"]","target":5638316641849725610,"profile":14620777910751233144,"path":17417807524590661292,"deps":[[1541909981555329547,"tempfile",false,11339437785692109554],[1995708430520600615,"env_logger",false,5431392226917260037],[4254328441789853856,"once_cell",false,9742840886364516168],[6554997584025100622,"toml",false,771776366773958882],[6835213927646743608,"opener",false,2096017043458066816],[7126841912348334847,"chrono",false,12837260329727854092],[7667881417093566568,"regex",false,11717910061522356762],[7898347539352098708,"serde_json",false,4512111603228297355],[7988379052066022850,"clap_complete",false,2645275018468935510],[8725461231676817087,"serde",false,14256704062966727943],[9602749528789499273,"clap",false,13226981639940940000],[10053317485738497124,"topological_sort",false,3303547146289878775],[10187828652899488954,"log",false,12598582175174921379],[15215384180442390425,"shlex",false,8132921206165260810],[15379124934976656778,"pulldown_cmark",false,6114961860516726794],[15818844694086178958,"memchr",false,15301846604188935865],[16045357212464686133,"anyhow",false,15680253005225416109],[17227095802678555946,"handlebars",false,13036549620751566261]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-9ae3392d0139d616\\dep-lib-mdbook"}}],"rustflags":[],"metadata":1587312970192705599,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/dep-lib-mdbook_trpl_listing b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/dep-lib-mdbook_trpl_listing new file mode 100644 index 000000000..5053a7fc0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/dep-lib-mdbook_trpl_listing differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing new file mode 100644 index 000000000..b7884b3d1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing @@ -0,0 +1 @@ +75392d65dcabe3c8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing.json new file mode 100644 index 000000000..4bddaa68d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-6e6284517de7cf86/lib-mdbook_trpl_listing.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":18104121492107613050,"profile":14620777910751233144,"path":17777289886553719987,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[2490412269847159966,"mdbook",false,980057425731360446],[7898347539352098708,"serde_json",false,4512111603228297355],[8344921790127479269,"pulldown_cmark_to_cmark",false,10644708328889187877],[9602749528789499273,"clap",false,13226981639940940000],[15379124934976656778,"pulldown_cmark",false,6114961860516726794],[16728810447790595364,"html_parser",false,6902049428520153322],[16867431332594367971,"toml",false,11390737468852187665]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-trpl-listing-6e6284517de7cf86\\dep-lib-mdbook_trpl_listing"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing new file mode 100644 index 000000000..49ba27171 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing @@ -0,0 +1 @@ +763bec8b452029a4 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing.json new file mode 100644 index 000000000..19132a2cb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/bin-mdbook-trpl-listing.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":17425998382700618268,"profile":14620777910751233144,"path":10602529704205407992,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[2490412269847159966,"mdbook",false,980057425731360446],[7898347539352098708,"serde_json",false,4512111603228297355],[8344921790127479269,"pulldown_cmark_to_cmark",false,10644708328889187877],[9602749528789499273,"clap",false,13226981639940940000],[15379124934976656778,"pulldown_cmark",false,6114961860516726794],[16728810447790595364,"html_parser",false,6902049428520153322],[16867431332594367971,"toml",false,11390737468852187665],[16902293043455023667,"mdbook_trpl_listing",false,14475602590377523573]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-trpl-listing-bf9a69f618dec991\\dep-bin-mdbook-trpl-listing"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/dep-bin-mdbook-trpl-listing b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/dep-bin-mdbook-trpl-listing new file mode 100644 index 000000000..17b9f6086 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/dep-bin-mdbook-trpl-listing differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/mdbook-trpl-listing-bf9a69f618dec991/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr new file mode 100644 index 000000000..ea5983d08 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr @@ -0,0 +1 @@ +b9e632f269145bd4 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json new file mode 100644 index 000000000..5aaf56209 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"compiler_builtins\", \"core\", \"default\", \"libc\", \"logging\", \"rustc-dep-of-std\", \"std\", \"use_std\"]","target":11224823532731451965,"profile":14620777910751233144,"path":11849873841126342966,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\memchr-45e54b823ffb518a\\dep-lib-memchr"}}],"rustflags":[],"metadata":7513296495906230968,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr new file mode 100644 index 000000000..ec8556510 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr @@ -0,0 +1 @@ +3b03d309e30095f0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json new file mode 100644 index 000000000..a54d157c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"compiler_builtins\", \"core\", \"default\", \"libc\", \"logging\", \"rustc-dep-of-std\", \"std\", \"use_std\"]","target":11224823532731451965,"profile":15621230377962148654,"path":11849873841126342966,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\memchr-cde140c03a14d1ce\\dep-lib-memchr"}}],"rustflags":[],"metadata":7513296495906230968,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath new file mode 100644 index 000000000..9d5a4cf8d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath @@ -0,0 +1 @@ +fe43a1c7ea71e35d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json new file mode 100644 index 000000000..c9940ab92 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"localization\", \"print_bytes\", \"serde\", \"uniquote\"]","target":1382406623815190553,"profile":14620777910751233144,"path":17189523945017309559,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\normpath-47b4ab670cf56a60\\dep-lib-normpath"}}],"rustflags":[],"metadata":14881282335678235538,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits new file mode 100644 index 000000000..a8e2f6e75 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits @@ -0,0 +1 @@ +fdf43120c370c895 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json new file mode 100644 index 000000000..0feee5664 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"i128\", \"libm\", \"std\"]","target":12477478524311379690,"profile":14620777910751233144,"path":6318628890682793046,"deps":[[10448766010662481490,"build_script_build",false,12300628192593037662]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\num-traits-2ab4e4646f31cfc5\\dep-lib-num_traits"}}],"rustflags":[],"metadata":14621636500951049976,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build new file mode 100644 index 000000000..8b862f329 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build @@ -0,0 +1 @@ +5ec9a96d2b9cb4aa \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json new file mode 100644 index 000000000..aca950f35 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[10448766010662481490,"build_script_build",false,16018969146381369568]],"local":[{"RerunIfChanged":{"output":"release\\build\\num-traits-3a779ab4385ffbfb\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build new file mode 100644 index 000000000..0c0a741da --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build @@ -0,0 +1 @@ +e000010691cf4ede \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json new file mode 100644 index 000000000..52b150fe6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"i128\", \"libm\", \"std\"]","target":9652763411108993936,"profile":15621230377962148654,"path":7440296701701900126,"deps":[[10438594093624915123,"autocfg",false,4048460449135659201]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\num-traits-bdb3ab51b4bf54af\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":14621636500951049976,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell new file mode 100644 index 000000000..ec0138f7f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell @@ -0,0 +1 @@ +48afe8962a863587 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json new file mode 100644 index 000000000..223e1d59b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"race\", \"std\"]","declared_features":"[\"alloc\", \"atomic-polyfill\", \"critical-section\", \"default\", \"parking_lot\", \"portable-atomic\", \"race\", \"std\", \"unstable\"]","target":6794429743695580115,"profile":14620777910751233144,"path":14824507885935471845,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\once_cell-329334a68b89c051\\dep-lib-once_cell"}}],"rustflags":[],"metadata":14177539708254521827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell new file mode 100644 index 000000000..d4a95bc61 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell @@ -0,0 +1 @@ +9577587a1203c2db \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json new file mode 100644 index 000000000..62797c269 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"race\", \"std\"]","declared_features":"[\"alloc\", \"atomic-polyfill\", \"critical-section\", \"default\", \"parking_lot\", \"portable-atomic\", \"race\", \"std\", \"unstable\"]","target":6794429743695580115,"profile":15621230377962148654,"path":14824507885935471845,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\once_cell-c7131045f0e2879d\\dep-lib-once_cell"}}],"rustflags":[],"metadata":14177539708254521827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener new file mode 100644 index 000000000..4210403f9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener @@ -0,0 +1 @@ +80897b56658c161d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json new file mode 100644 index 000000000..5157d94b0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"dbus-vendored\", \"default\"]","declared_features":"[\"dbus-vendored\", \"default\", \"reveal\"]","target":678811685358403091,"profile":14620777910751233144,"path":14830391658913800960,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502],[12913836590597973986,"normpath",false,6765376318426137598]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\opener-fb4b019db89ff6eb\\dep-lib-opener"}}],"rustflags":[],"metadata":27220870809051472,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest new file mode 100644 index 000000000..e2fe9f014 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest @@ -0,0 +1 @@ +21c107ca41964168 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json new file mode 100644 index 000000000..4e581a693 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"memchr\", \"std\"]","declared_features":"[\"const_prec_climber\", \"default\", \"memchr\", \"pretty-print\", \"std\"]","target":10596230877365890714,"profile":15621230377962148654,"path":10585500784096282585,"deps":[[2298489633419329899,"thiserror",false,7907579467027487062],[15597653465555761019,"ucd_trie",false,10483689843733895142],[15818844694086178958,"memchr",false,17335763315754992443]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest-27ca771d143da417\\dep-lib-pest"}}],"rustflags":[],"metadata":4109276871915991192,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest new file mode 100644 index 000000000..c1c37595f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest @@ -0,0 +1 @@ +c53dfb6135a79d81 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json new file mode 100644 index 000000000..932784796 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"memchr\", \"std\"]","declared_features":"[\"const_prec_climber\", \"default\", \"memchr\", \"pretty-print\", \"std\"]","target":10596230877365890714,"profile":14620777910751233144,"path":10585500784096282585,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[15597653465555761019,"ucd_trie",false,3139975082273742459],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest-ea7293ce37f9767d\\dep-lib-pest"}}],"rustflags":[],"metadata":4109276871915991192,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive new file mode 100644 index 000000000..c569a6995 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive @@ -0,0 +1 @@ +61c0e976f3bcb19d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json new file mode 100644 index 000000000..71b14bd03 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"grammar-extras\", \"not-bootstrap-in-src\", \"std\"]","target":15907432747833421076,"profile":15621230377962148654,"path":12717687634155089182,"deps":[[8153797543571216910,"pest",false,7512450862737244449],[10776416550176975710,"pest_generator",false,8459309697614602255]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_derive-f971c62ee19a3cff\\dep-lib-pest_derive"}}],"rustflags":[],"metadata":15348896602671651495,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator new file mode 100644 index 000000000..c23f0b159 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator @@ -0,0 +1 @@ +0fe055c359816575 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json new file mode 100644 index 000000000..d02c01a96 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"export-internal\", \"grammar-extras\", \"not-bootstrap-in-src\", \"std\"]","target":9031263160361905341,"profile":15621230377962148654,"path":14027015227094177835,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[8153797543571216910,"pest",false,7512450862737244449],[14268468010440576439,"quote",false,420223261422515380],[16568585440644156506,"pest_meta",false,9503765047316037001]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_generator-da91aa5eeb32f21b\\dep-lib-pest_generator"}}],"rustflags":[],"metadata":13919121622331937582,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta new file mode 100644 index 000000000..8f6a62e51 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta @@ -0,0 +1 @@ +89bd0b1af527e483 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json new file mode 100644 index 000000000..ee71711fe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"grammar-extras\", \"not-bootstrap-in-src\"]","target":11184788820884453423,"profile":15621230377962148654,"path":10668005310404873937,"deps":[[4254328441789853856,"once_cell",false,15835222617684998037],[8153797543571216910,"pest",false,7512450862737244449]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_meta-936776a91fcba81c\\dep-lib-pest_meta"}}],"rustflags":[],"metadata":14484941712087668090,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 new file mode 100644 index 000000000..2f626b474 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 @@ -0,0 +1 @@ +f75a1cac98282012 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json new file mode 100644 index 000000000..2a2ef7eea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"nightly\", \"proc-macro\", \"span-locations\"]","target":13874121960490935825,"profile":15621230377962148654,"path":17993159118556329183,"deps":[[6268038585962339854,"build_script_build",false,12697927332937391424],[10045147784146067611,"unicode_ident",false,4756046736092947349]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\proc-macro2-1db249c7677aa3b4\\dep-lib-proc_macro2"}}],"rustflags":[],"metadata":7635439851376710101,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build new file mode 100644 index 000000000..2a8305ff9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build @@ -0,0 +1 @@ +5d49009538777d02 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json new file mode 100644 index 000000000..ae184d737 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"nightly\", \"proc-macro\", \"span-locations\"]","target":9652763411108993936,"profile":15621230377962148654,"path":9707365015246614621,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\proc-macro2-41c4fef2c5039f31\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":7635439851376710101,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build new file mode 100644 index 000000000..6dc00e6e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build @@ -0,0 +1 @@ +40dd74ffa11938b0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json new file mode 100644 index 000000000..2cb721ed9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[6268038585962339854,"build_script_build",false,179430645066385757]],"local":[{"RerunIfChanged":{"output":"release\\build\\proc-macro2-abd444bf5ded0fcb\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build new file mode 100644 index 000000000..67e70bf31 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build @@ -0,0 +1 @@ +7a37d15c62a23981 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json new file mode 100644 index 000000000..406eb20c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[15379124934976656778,"build_script_build",false,6363488814749516920]],"local":[{"Precalculated":"0.10.3"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build new file mode 100644 index 000000000..4837ac9ec --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build @@ -0,0 +1 @@ +7804519f5ca74f58 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json new file mode 100644 index 000000000..1e8ebca35 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"simd\"]","declared_features":"[\"default\", \"gen-tests\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"serde\", \"simd\"]","target":9652763411108993936,"profile":15621230377962148654,"path":13757201965224557936,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-b31e30fcf4858fe2\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":5422167110953535666,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark new file mode 100644 index 000000000..87834b7c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark @@ -0,0 +1 @@ +0a4829e769b5dc54 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json new file mode 100644 index 000000000..3ef2450c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"simd\"]","declared_features":"[\"default\", \"gen-tests\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"serde\", \"simd\"]","target":14173258377163996814,"profile":14620777910751233144,"path":5137384956510996191,"deps":[[6042428607772312501,"pulldown_cmark_escape",false,7640926759105612353],[7472518776289053472,"getopts",false,11975846334595697085],[7803147409971559194,"bitflags",false,6233115892316933917],[15279721705773053031,"unicase",false,7597764377851091555],[15379124934976656778,"build_script_build",false,9311652247912920954],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-eda9ab09dbea3888\\dep-lib-pulldown_cmark"}}],"rustflags":[],"metadata":5422167110953535666,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape new file mode 100644 index 000000000..85591fd48 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape @@ -0,0 +1 @@ +414a446f67060a6a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json new file mode 100644 index 000000000..2c2838d72 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"simd\"]","declared_features":"[\"simd\"]","target":10599612982616907828,"profile":14620777910751233144,"path":11285604270150866447,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-escape-c86762f688315946\\dep-lib-pulldown_cmark_escape"}}],"rustflags":[],"metadata":5200711773101909576,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark new file mode 100644 index 000000000..62e7188d1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark @@ -0,0 +1 @@ +25fe14b9d399b993 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json new file mode 100644 index 000000000..2bd78a119 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":1432562136631916118,"profile":14620777910751233144,"path":11341176081371409276,"deps":[[15379124934976656778,"pulldown_cmark",false,6114961860516726794]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-to-cmark-7be76122b5df6376\\dep-lib-pulldown_cmark_to_cmark"}}],"rustflags":[],"metadata":10132904421119365236,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote new file mode 100644 index 000000000..2484c668e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote @@ -0,0 +1 @@ +b4f4716fd4eed405 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json new file mode 100644 index 000000000..0a8cbfaba --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"proc-macro\"]","target":2971457136760598856,"profile":15621230377962148654,"path":1140538663423296602,"deps":[[6268038585962339854,"proc_macro2",false,1306088528125123319]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\quote-b86bb00919ad5197\\dep-lib-quote"}}],"rustflags":[],"metadata":2717943770976187624,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex new file mode 100644 index 000000000..715ab9fe7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex @@ -0,0 +1 @@ +1a0a04e71d619ea2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json new file mode 100644 index 000000000..4270b59b3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"perf\", \"perf-backtrack\", \"perf-cache\", \"perf-dfa\", \"perf-inline\", \"perf-literal\", \"perf-onepass\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","declared_features":"[\"default\", \"logging\", \"pattern\", \"perf\", \"perf-backtrack\", \"perf-cache\", \"perf-dfa\", \"perf-dfa-full\", \"perf-inline\", \"perf-literal\", \"perf-onepass\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unstable\", \"use_std\"]","target":11287324090508747457,"profile":14620777910751233144,"path":4233516745495808906,"deps":[[483568489426407569,"regex_automata",false,10048164532439324403],[7325384046744447800,"aho_corasick",false,14375275239593337580],[12784352588272788987,"regex_syntax",false,13426384251305482979],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-303fd43f683d0d9c\\dep-lib-regex"}}],"rustflags":[],"metadata":3256615787768725874,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata new file mode 100644 index 000000000..20245b93f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata @@ -0,0 +1 @@ +f396b9a06740728b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json new file mode 100644 index 000000000..7b0fa53a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"dfa-onepass\", \"hybrid\", \"meta\", \"nfa-backtrack\", \"nfa-pikevm\", \"nfa-thompson\", \"perf-inline\", \"perf-literal\", \"perf-literal-multisubstring\", \"perf-literal-substring\", \"std\", \"syntax\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unicode-word-boundary\"]","declared_features":"[\"alloc\", \"default\", \"dfa\", \"dfa-build\", \"dfa-onepass\", \"dfa-search\", \"hybrid\", \"internal-instrument\", \"internal-instrument-pikevm\", \"logging\", \"meta\", \"nfa\", \"nfa-backtrack\", \"nfa-pikevm\", \"nfa-thompson\", \"perf\", \"perf-inline\", \"perf-literal\", \"perf-literal-multisubstring\", \"perf-literal-substring\", \"std\", \"syntax\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unicode-word-boundary\"]","target":2990521512445226391,"profile":14620777910751233144,"path":15875454129770319444,"deps":[[7325384046744447800,"aho_corasick",false,14375275239593337580],[12784352588272788987,"regex_syntax",false,13426384251305482979],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-automata-efbc972b30a2e580\\dep-lib-regex_automata"}}],"rustflags":[],"metadata":8878122455581797878,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax new file mode 100644 index 000000000..fb156d109 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax @@ -0,0 +1 @@ +e35af62c571954ba \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json new file mode 100644 index 000000000..121924dcb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","declared_features":"[\"arbitrary\", \"default\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","target":8313596292075302124,"profile":14620777910751233144,"path":5782403089770095574,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-syntax-f10560a1d1b78872\\dep-lib-regex_syntax"}}],"rustflags":[],"metadata":17586400164587752172,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu new file mode 100644 index 000000000..5c5296f37 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu @@ -0,0 +1 @@ +4a86c0d61a51f3e0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json new file mode 100644 index 000000000..529cfdc75 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no-panic\", \"small\"]","target":8332498352293740753,"profile":14620777910751233144,"path":11013700038906014850,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ryu-2defaf88560c9d34\\dep-lib-ryu"}}],"rustflags":[],"metadata":10387617312689919117,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde new file mode 100644 index 000000000..2cb6147bf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde @@ -0,0 +1 @@ +0705005dcffcd9c5 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json new file mode 100644 index 000000000..3ebf8c607 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"derive\", \"serde_derive\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"derive\", \"rc\", \"serde_derive\", \"std\", \"unstable\"]","target":7162769108158706428,"profile":14620777910751233144,"path":7939759890209142985,"deps":[[8420555068261863417,"serde_derive",false,9979479887115832246],[8725461231676817087,"build_script_build",false,1149964767447481287]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde-6797ee67eb9fc526\\dep-lib-serde"}}],"rustflags":[],"metadata":3767376778934503013,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build new file mode 100644 index 000000000..4fb2c2452 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build @@ -0,0 +1 @@ +c7fbebfbdc7ef50f \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json new file mode 100644 index 000000000..b40f80c9a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[8725461231676817087,"build_script_build",false,14839947487230302774]],"local":[{"RerunIfChanged":{"output":"release\\build\\serde-6aab536be2e6e903\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build new file mode 100644 index 000000000..718dc5fe0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build @@ -0,0 +1 @@ +361ad03d9d15f2cd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json new file mode 100644 index 000000000..12cd73301 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"derive\", \"serde_derive\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"derive\", \"rc\", \"serde_derive\", \"std\", \"unstable\"]","target":13708040221295731214,"profile":15621230377962148654,"path":1805026825088374107,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde-ff50484740259288\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3767376778934503013,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive new file mode 100644 index 000000000..7c52e3348 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive @@ -0,0 +1 @@ +b6cbb172153c7e8a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json new file mode 100644 index 000000000..5a69a7723 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"deserialize_in_place\"]","target":16923867824863365409,"profile":15621230377962148654,"path":1911482977130476596,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_derive-575de12cbf34e7e0\\dep-lib-serde_derive"}}],"rustflags":[],"metadata":14452199383429553764,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build new file mode 100644 index 000000000..71d38cafe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build @@ -0,0 +1 @@ +ac3e455d35e82e15 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json new file mode 100644 index 000000000..e49cdb825 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[7898347539352098708,"build_script_build",false,11083165870690557104]],"local":[{"RerunIfChanged":{"output":"release\\build\\serde_json-34511d4076957f0a\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json new file mode 100644 index 000000000..583455c84 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json @@ -0,0 +1 @@ +8b4857d1983d9e3e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json new file mode 100644 index 000000000..58d7ec2ae --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"alloc\", \"arbitrary_precision\", \"default\", \"float_roundtrip\", \"indexmap\", \"preserve_order\", \"raw_value\", \"std\", \"unbounded_depth\"]","target":8359091782433235722,"profile":14620777910751233144,"path":2458487559455832672,"deps":[[711435865661041740,"ryu",false,16209388659550488138],[7898347539352098708,"build_script_build",false,1526412639620906668],[8725461231676817087,"serde",false,14256704062966727943],[11284357528473424989,"itoa",false,17935759184978178317]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_json-35ecaa4d5c0425a5\\dep-lib-serde_json"}}],"rustflags":[],"metadata":16261601059619201932,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build new file mode 100644 index 000000000..15fcea46d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build @@ -0,0 +1 @@ +b05c3e65a350cf99 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json new file mode 100644 index 000000000..f9a7cd9ec --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"alloc\", \"arbitrary_precision\", \"default\", \"float_roundtrip\", \"indexmap\", \"preserve_order\", \"raw_value\", \"std\", \"unbounded_depth\"]","target":9652763411108993936,"profile":15621230377962148654,"path":12258895971109528893,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_json-c8c997b6bb507ffb\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":16261601059619201932,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/dep-lib-serde_spanned b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/dep-lib-serde_spanned new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/dep-lib-serde_spanned differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned new file mode 100644 index 000000000..86ae2e2b9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned @@ -0,0 +1 @@ +6b9b07611b3d425e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned.json new file mode 100644 index 000000000..f918287c6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/serde_spanned-1c9d84b68bb79a1a/lib-serde_spanned.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"serde\"]","declared_features":"[\"serde\"]","target":7089173841162697067,"profile":995129404481031558,"path":1643033895668846274,"deps":[[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_spanned-1c9d84b68bb79a1a\\dep-lib-serde_spanned"}}],"rustflags":[],"metadata":14007845319687139593,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex new file mode 100644 index 000000000..951f685d0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex @@ -0,0 +1 @@ +0acab837bff0dd70 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json new file mode 100644 index 000000000..ae1f99b86 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":7253733235161264811,"profile":14620777910751233144,"path":3672257909783673666,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\shlex-ea16a86c0c46564c\\dep-lib-shlex"}}],"rustflags":[],"metadata":7790407099652797591,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim new file mode 100644 index 000000000..bec742a00 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim @@ -0,0 +1 @@ +d5a4ad6346767873 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json new file mode 100644 index 000000000..849adc6ea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":15476377186051897656,"profile":14620777910751233144,"path":10211663575747422092,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\strsim-47e65bffce339b7c\\dep-lib-strsim"}}],"rustflags":[],"metadata":6054696607313650198,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn new file mode 100644 index 000000000..2868dd839 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn @@ -0,0 +1 @@ +4ab5ccc956d5bf67 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json new file mode 100644 index 000000000..3a3272ad1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"clone-impls\", \"default\", \"derive\", \"full\", \"parsing\", \"printing\", \"proc-macro\"]","declared_features":"[\"clone-impls\", \"default\", \"derive\", \"extra-traits\", \"fold\", \"full\", \"parsing\", \"printing\", \"proc-macro\", \"test\", \"visit\", \"visit-mut\"]","target":9575650141617900057,"profile":15621230377962148654,"path":7624968525483162342,"deps":[[6268038585962339854,"proc_macro2",false,1306088528125123319],[10045147784146067611,"unicode_ident",false,4756046736092947349],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\syn-12d6af9b5f3fc81f\\dep-lib-syn"}}],"rustflags":[],"metadata":6886477143387768027,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile new file mode 100644 index 000000000..f1104e793 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile @@ -0,0 +1 @@ +f2fad15096c65d9d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json new file mode 100644 index 000000000..d7ab73ecc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":8799845801769823640,"profile":14620777910751233144,"path":17590489710713848646,"deps":[[2452538001284770427,"cfg_if",false,11327479977420139569],[11426986729031771186,"windows_sys",false,2402317607190718502],[14873798182096859425,"fastrand",false,18367281618743225598]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\tempfile-0b3d021dc4bc214f\\dep-lib-tempfile"}}],"rustflags":[],"metadata":14511776352833078154,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size new file mode 100644 index 000000000..c45e24ed5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size @@ -0,0 +1 @@ +9e63962b72061127 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json new file mode 100644 index 000000000..a36827d28 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":3625158601544720694,"profile":14620777910751233144,"path":14565831873911389629,"deps":[[796539694340413272,"windows_sys",false,15579394040051550770]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\terminal_size-d8da13be1d2595d3\\dep-lib-terminal_size"}}],"rustflags":[],"metadata":2052073116003689238,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build new file mode 100644 index 000000000..9667357f2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build @@ -0,0 +1 @@ +6d34c347abbd6ee1 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json new file mode 100644 index 000000000..ae3fbaa23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[2298489633419329899,"build_script_build",false,14760573913178463397]],"local":[{"RerunIfChanged":{"output":"release\\build\\thiserror-3ff39ce20518c5bb\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror new file mode 100644 index 000000000..d7da1bfb6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror @@ -0,0 +1 @@ +dea726436b339cf1 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json new file mode 100644 index 000000000..d267e4bb5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13566008838928707361,"profile":14620777910751233144,"path":9515727956088141749,"deps":[[2298489633419329899,"build_script_build",false,16244129449312990317],[16248561059612021423,"thiserror_impl",false,15945805655279802359]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-425658935e0fef12\\dep-lib-thiserror"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build new file mode 100644 index 000000000..7f55f5d15 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build @@ -0,0 +1 @@ +5a0110aeceb43be8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json new file mode 100644 index 000000000..a079f1fa4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[2298489633419329899,"build_script_build",false,14760573913178463397]],"local":[{"RerunIfChanged":{"output":"release\\build\\thiserror-5eba0824802bec2c\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build new file mode 100644 index 000000000..18456fd10 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build @@ -0,0 +1 @@ +a55ce6e7c417d8cc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json new file mode 100644 index 000000000..bc844ec2c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9652763411108993936,"profile":15621230377962148654,"path":1643624833836974173,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-5ebc22fe453131cf\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror new file mode 100644 index 000000000..98cf40aa7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror @@ -0,0 +1 @@ +5699580da15dbd6d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json new file mode 100644 index 000000000..3180a41a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13566008838928707361,"profile":15621230377962148654,"path":9515727956088141749,"deps":[[2298489633419329899,"build_script_build",false,16734167640201757018],[16248561059612021423,"thiserror_impl",false,15945805655279802359]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-d4341c8e23adc184\\dep-lib-thiserror"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl new file mode 100644 index 000000000..53f176307 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl @@ -0,0 +1 @@ +f7175e4cc2e14add \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json new file mode 100644 index 000000000..108835ea6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":7998322611307123746,"profile":15621230377962148654,"path":11731557558515945928,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-impl-34371baa3f030dd6\\dep-lib-thiserror_impl"}}],"rustflags":[],"metadata":14048383283908260854,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml new file mode 100644 index 000000000..1f4297933 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml @@ -0,0 +1 @@ +e2789a3b84e6b50a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json new file mode 100644 index 000000000..7eaa57c4a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"indexmap\", \"preserve_order\"]","target":7052376538844330470,"profile":14620777910751233144,"path":13621866931221248399,"deps":[[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\toml-4390fb9a32c72b93\\dep-lib-toml"}}],"rustflags":[],"metadata":13437692833141290973,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/dep-lib-toml b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/dep-lib-toml new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/dep-lib-toml differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml new file mode 100644 index 000000000..431affbfa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml @@ -0,0 +1 @@ +11b2aa906007149e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml.json new file mode 100644 index 000000000..03453f21e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml-d1f67976362091fa/lib-toml.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"display\", \"parse\"]","declared_features":"[\"default\", \"display\", \"indexmap\", \"parse\", \"preserve_order\"]","target":16428676033914667516,"profile":995129404481031558,"path":8824270365853261787,"deps":[[5005212103935869559,"toml_datetime",false,17670507643467600760],[7930533144571564837,"serde_spanned",false,6792058375829429099],[8725461231676817087,"serde",false,14256704062966727943],[17584401870292221513,"toml_edit",false,17270726197306792604]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\toml-d1f67976362091fa\\dep-lib-toml"}}],"rustflags":[],"metadata":13437692833141290973,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/dep-lib-toml_datetime b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/dep-lib-toml_datetime new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/dep-lib-toml_datetime differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime new file mode 100644 index 000000000..cf083d093 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime @@ -0,0 +1 @@ +7813b65114413af5 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime.json new file mode 100644 index 000000000..c4a8d85e9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_datetime-e32bc4939fe0dc7a/lib-toml_datetime.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"serde\"]","declared_features":"[\"serde\"]","target":15659038350059736589,"profile":995129404481031558,"path":10527516613557909121,"deps":[[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\toml_datetime-e32bc4939fe0dc7a\\dep-lib-toml_datetime"}}],"rustflags":[],"metadata":4457034034663589510,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/dep-lib-toml_edit b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/dep-lib-toml_edit new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/dep-lib-toml_edit differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit new file mode 100644 index 000000000..b425c3edb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit @@ -0,0 +1 @@ +9c1a81e3f8f1adef \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit.json new file mode 100644 index 000000000..01b8e6fbc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/toml_edit-3ed2114abb12bfb8/lib-toml_edit.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"display\", \"parse\", \"serde\"]","declared_features":"[\"default\", \"display\", \"parse\", \"perf\", \"serde\", \"unbounded\"]","target":10062231346716512314,"profile":995129404481031558,"path":10485864355509925061,"deps":[[5005212103935869559,"toml_datetime",false,17670507643467600760],[5481336202574641354,"indexmap",false,12651926190521080418],[7453291948274827116,"winnow",false,8994110031782734284],[7930533144571564837,"serde_spanned",false,6792058375829429099],[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\toml_edit-3ed2114abb12bfb8\\dep-lib-toml_edit"}}],"rustflags":[],"metadata":17436163843096124214,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort new file mode 100644 index 000000000..64e5608b6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort @@ -0,0 +1 @@ +f7165d69a08ed82d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json new file mode 100644 index 000000000..a481c4322 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":8419607349315859904,"profile":14620777910751233144,"path":12019008239578609725,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\topological-sort-954e09149dd7fd7b\\dep-lib-topological_sort"}}],"rustflags":[],"metadata":6640049001988003030,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie new file mode 100644 index 000000000..ea5e6219a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie @@ -0,0 +1 @@ +7b1e8176b36e932b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json new file mode 100644 index 000000000..45533d205 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"std\"]","target":17450497857988850485,"profile":14620777910751233144,"path":3657472514363523696,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ucd-trie-8190d4a172275685\\dep-lib-ucd_trie"}}],"rustflags":[],"metadata":14294133660085481805,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie new file mode 100644 index 000000000..a64ad222f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie @@ -0,0 +1 @@ +e617212f5e8c7d91 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json new file mode 100644 index 000000000..3ef18c20a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"std\"]","target":17450497857988850485,"profile":15621230377962148654,"path":3657472514363523696,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ucd-trie-c2ba7767e740f24f\\dep-lib-ucd_trie"}}],"rustflags":[],"metadata":14294133660085481805,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase new file mode 100644 index 000000000..9e6808a26 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase @@ -0,0 +1 @@ +635aee6c72ae7069 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json new file mode 100644 index 000000000..f4cdd1c73 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":10930702956497216318,"profile":14620777910751233144,"path":12279451216006871042,"deps":[[15279721705773053031,"build_script_build",false,9797226499707884216]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicase-40efbf7a3440863e\\dep-lib-unicase"}}],"rustflags":[],"metadata":11494574314977672827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build new file mode 100644 index 000000000..24f309fbf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build @@ -0,0 +1 @@ +e7e5a08a56cd4247 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json new file mode 100644 index 000000000..309b59e29 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":6423576478976419116,"profile":15621230377962148654,"path":2313569352815869628,"deps":[[16079472387499994964,"version_check",false,2242397727496318052]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicase-74eb6ba6e3627ded\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":11494574314977672827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build new file mode 100644 index 000000000..1c30da25d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build @@ -0,0 +1 @@ +b8d221f397bdf687 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json new file mode 100644 index 000000000..1b77fa655 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[15279721705773053031,"build_script_build",false,5134892296732468711]],"local":[{"Precalculated":"2.7.0"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident new file mode 100644 index 000000000..44e2d7d32 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident @@ -0,0 +1 @@ +95e3f9cf4edf0042 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json new file mode 100644 index 000000000..c6e80b965 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9052190789159163900,"profile":15621230377962148654,"path":7402503512054951311,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicode-ident-f819cb15e0d54fd0\\dep-lib-unicode_ident"}}],"rustflags":[],"metadata":1159190378059262574,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width new file mode 100644 index 000000000..f2405d55d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width @@ -0,0 +1 @@ +dd75d3e973a0ccc6 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json new file mode 100644 index 000000000..8f813e1e7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"compiler_builtins\", \"core\", \"default\", \"no_std\", \"rustc-dep-of-std\", \"std\"]","target":6958533458770397108,"profile":14620777910751233144,"path":15633698315167197624,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicode-width-a20fd1f1e08492a1\\dep-lib-unicode_width"}}],"rustflags":[],"metadata":2060532119256820226,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse new file mode 100644 index 000000000..840a3d191 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse @@ -0,0 +1 @@ +82e22aa25c9e64e2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json new file mode 100644 index 000000000..17f474537 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"nightly\"]","target":3575735390855902170,"profile":14620777910751233144,"path":10045008861054769558,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\utf8parse-eacf8f0fce7f601b\\dep-lib-utf8parse"}}],"rustflags":[],"metadata":10159711100463582988,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check new file mode 100644 index 000000000..aecb485a7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check @@ -0,0 +1 @@ +64ac8f38da981e1f \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json new file mode 100644 index 000000000..2c2d0d82b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":955292855784393095,"profile":15621230377962148654,"path":15863539904071868725,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\version_check-27170d7ff25bd291\\dep-lib-version_check"}}],"rustflags":[],"metadata":14847206692933921638,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys new file mode 100644 index 000000000..f92b68b23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys @@ -0,0 +1 @@ +26e844be22bf5621 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json new file mode 100644 index 000000000..89d692b88 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"Win32\", \"Win32_Foundation\", \"Win32_Storage\", \"Win32_Storage_FileSystem\", \"Win32_System\", \"Win32_System_Console\", \"Win32_UI\", \"Win32_UI_Shell\", \"Win32_UI_WindowsAndMessaging\", \"default\"]","declared_features":"[\"Wdk\", \"Wdk_Foundation\", \"Wdk_Graphics\", \"Wdk_Graphics_Direct3D\", \"Wdk_Storage\", \"Wdk_Storage_FileSystem\", \"Wdk_Storage_FileSystem_Minifilters\", \"Wdk_System\", \"Wdk_System_IO\", \"Wdk_System_OfflineRegistry\", \"Wdk_System_Registry\", \"Wdk_System_SystemInformation\", \"Wdk_System_SystemServices\", \"Wdk_System_Threading\", \"Win32\", \"Win32_Data\", \"Win32_Data_HtmlHelp\", \"Win32_Data_RightsManagement\", \"Win32_Devices\", \"Win32_Devices_AllJoyn\", \"Win32_Devices_BiometricFramework\", \"Win32_Devices_Bluetooth\", \"Win32_Devices_Communication\", \"Win32_Devices_DeviceAndDriverInstallation\", \"Win32_Devices_DeviceQuery\", \"Win32_Devices_Display\", \"Win32_Devices_Enumeration\", \"Win32_Devices_Enumeration_Pnp\", \"Win32_Devices_Fax\", \"Win32_Devices_HumanInterfaceDevice\", \"Win32_Devices_PortableDevices\", \"Win32_Devices_Properties\", \"Win32_Devices_Pwm\", \"Win32_Devices_Sensors\", \"Win32_Devices_SerialCommunication\", \"Win32_Devices_Tapi\", \"Win32_Devices_Usb\", \"Win32_Devices_WebServicesOnDevices\", \"Win32_Foundation\", \"Win32_Gaming\", \"Win32_Globalization\", \"Win32_Graphics\", \"Win32_Graphics_Dwm\", \"Win32_Graphics_Gdi\", \"Win32_Graphics_GdiPlus\", \"Win32_Graphics_Hlsl\", \"Win32_Graphics_OpenGL\", \"Win32_Graphics_Printing\", \"Win32_Graphics_Printing_PrintTicket\", \"Win32_Management\", \"Win32_Management_MobileDeviceManagementRegistration\", \"Win32_Media\", \"Win32_Media_Audio\", \"Win32_Media_DxMediaObjects\", \"Win32_Media_KernelStreaming\", \"Win32_Media_Multimedia\", \"Win32_Media_Streaming\", \"Win32_Media_WindowsMediaFormat\", \"Win32_NetworkManagement\", \"Win32_NetworkManagement_Dhcp\", \"Win32_NetworkManagement_Dns\", \"Win32_NetworkManagement_InternetConnectionWizard\", \"Win32_NetworkManagement_IpHelper\", \"Win32_NetworkManagement_Multicast\", \"Win32_NetworkManagement_Ndis\", \"Win32_NetworkManagement_NetBios\", \"Win32_NetworkManagement_NetManagement\", \"Win32_NetworkManagement_NetShell\", \"Win32_NetworkManagement_NetworkDiagnosticsFramework\", \"Win32_NetworkManagement_P2P\", \"Win32_NetworkManagement_QoS\", \"Win32_NetworkManagement_Rras\", \"Win32_NetworkManagement_Snmp\", \"Win32_NetworkManagement_WNet\", \"Win32_NetworkManagement_WebDav\", \"Win32_NetworkManagement_WiFi\", \"Win32_NetworkManagement_WindowsConnectionManager\", \"Win32_NetworkManagement_WindowsFilteringPlatform\", \"Win32_NetworkManagement_WindowsFirewall\", \"Win32_NetworkManagement_WindowsNetworkVirtualization\", \"Win32_Networking\", \"Win32_Networking_ActiveDirectory\", \"Win32_Networking_Clustering\", \"Win32_Networking_HttpServer\", \"Win32_Networking_Ldap\", \"Win32_Networking_WebSocket\", \"Win32_Networking_WinHttp\", \"Win32_Networking_WinInet\", \"Win32_Networking_WinSock\", \"Win32_Networking_WindowsWebServices\", \"Win32_Security\", \"Win32_Security_AppLocker\", \"Win32_Security_Authentication\", \"Win32_Security_Authentication_Identity\", \"Win32_Security_Authorization\", \"Win32_Security_Credentials\", \"Win32_Security_Cryptography\", \"Win32_Security_Cryptography_Catalog\", \"Win32_Security_Cryptography_Certificates\", \"Win32_Security_Cryptography_Sip\", \"Win32_Security_Cryptography_UI\", \"Win32_Security_DiagnosticDataQuery\", \"Win32_Security_DirectoryServices\", \"Win32_Security_EnterpriseData\", \"Win32_Security_ExtensibleAuthenticationProtocol\", \"Win32_Security_Isolation\", \"Win32_Security_LicenseProtection\", \"Win32_Security_NetworkAccessProtection\", \"Win32_Security_WinTrust\", \"Win32_Security_WinWlx\", \"Win32_Storage\", \"Win32_Storage_Cabinets\", \"Win32_Storage_CloudFilters\", \"Win32_Storage_Compression\", \"Win32_Storage_DistributedFileSystem\", \"Win32_Storage_FileHistory\", \"Win32_Storage_FileSystem\", \"Win32_Storage_Imapi\", \"Win32_Storage_IndexServer\", \"Win32_Storage_InstallableFileSystems\", \"Win32_Storage_IscsiDisc\", \"Win32_Storage_Jet\", \"Win32_Storage_Nvme\", \"Win32_Storage_OfflineFiles\", \"Win32_Storage_OperationRecorder\", \"Win32_Storage_Packaging\", \"Win32_Storage_Packaging_Appx\", \"Win32_Storage_ProjectedFileSystem\", \"Win32_Storage_StructuredStorage\", \"Win32_Storage_Vhd\", \"Win32_Storage_Xps\", \"Win32_System\", \"Win32_System_AddressBook\", \"Win32_System_Antimalware\", \"Win32_System_ApplicationInstallationAndServicing\", \"Win32_System_ApplicationVerifier\", \"Win32_System_ClrHosting\", \"Win32_System_Com\", \"Win32_System_Com_Marshal\", \"Win32_System_Com_StructuredStorage\", \"Win32_System_Com_Urlmon\", \"Win32_System_ComponentServices\", \"Win32_System_Console\", \"Win32_System_CorrelationVector\", \"Win32_System_DataExchange\", \"Win32_System_DeploymentServices\", \"Win32_System_DeveloperLicensing\", \"Win32_System_Diagnostics\", \"Win32_System_Diagnostics_Ceip\", \"Win32_System_Diagnostics_Debug\", \"Win32_System_Diagnostics_Debug_Extensions\", \"Win32_System_Diagnostics_Etw\", \"Win32_System_Diagnostics_ProcessSnapshotting\", \"Win32_System_Diagnostics_ToolHelp\", \"Win32_System_DistributedTransactionCoordinator\", \"Win32_System_Environment\", \"Win32_System_ErrorReporting\", \"Win32_System_EventCollector\", \"Win32_System_EventLog\", \"Win32_System_EventNotificationService\", \"Win32_System_GroupPolicy\", \"Win32_System_HostCompute\", \"Win32_System_HostComputeNetwork\", \"Win32_System_HostComputeSystem\", \"Win32_System_Hypervisor\", \"Win32_System_IO\", \"Win32_System_Iis\", \"Win32_System_Ioctl\", \"Win32_System_JobObjects\", \"Win32_System_Js\", \"Win32_System_Kernel\", \"Win32_System_LibraryLoader\", \"Win32_System_Mailslots\", \"Win32_System_Mapi\", \"Win32_System_Memory\", \"Win32_System_Memory_NonVolatile\", \"Win32_System_MessageQueuing\", \"Win32_System_MixedReality\", \"Win32_System_Ole\", \"Win32_System_PasswordManagement\", \"Win32_System_Performance\", \"Win32_System_Performance_HardwareCounterProfiling\", \"Win32_System_Pipes\", \"Win32_System_Power\", \"Win32_System_ProcessStatus\", \"Win32_System_Recovery\", \"Win32_System_Registry\", \"Win32_System_RemoteDesktop\", \"Win32_System_RemoteManagement\", \"Win32_System_RestartManager\", \"Win32_System_Restore\", \"Win32_System_Rpc\", \"Win32_System_Search\", \"Win32_System_Search_Common\", \"Win32_System_SecurityCenter\", \"Win32_System_Services\", \"Win32_System_SetupAndMigration\", \"Win32_System_Shutdown\", \"Win32_System_StationsAndDesktops\", \"Win32_System_SubsystemForLinux\", \"Win32_System_SystemInformation\", \"Win32_System_SystemServices\", \"Win32_System_Threading\", \"Win32_System_Time\", \"Win32_System_TpmBaseServices\", \"Win32_System_UserAccessLogging\", \"Win32_System_Variant\", \"Win32_System_VirtualDosMachines\", \"Win32_System_WindowsProgramming\", \"Win32_System_Wmi\", \"Win32_UI\", \"Win32_UI_Accessibility\", \"Win32_UI_ColorSystem\", \"Win32_UI_Controls\", \"Win32_UI_Controls_Dialogs\", \"Win32_UI_HiDpi\", \"Win32_UI_Input\", \"Win32_UI_Input_Ime\", \"Win32_UI_Input_KeyboardAndMouse\", \"Win32_UI_Input_Pointer\", \"Win32_UI_Input_Touch\", \"Win32_UI_Input_XboxController\", \"Win32_UI_InteractionContext\", \"Win32_UI_Magnification\", \"Win32_UI_Shell\", \"Win32_UI_Shell_PropertiesSystem\", \"Win32_UI_TabletPC\", \"Win32_UI_TextServices\", \"Win32_UI_WindowsAndMessaging\", \"Win32_Web\", \"Win32_Web_InternetExplorer\", \"default\", \"docs\"]","target":10970938565070083914,"profile":14620777910751233144,"path":10451393899590562539,"deps":[[9471768686618079862,"windows_targets",false,698127449752346759]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-sys-0250448e5ea1b7e0\\dep-lib-windows_sys"}}],"rustflags":[],"metadata":18220959856227839970,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys new file mode 100644 index 000000000..d733140c2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys @@ -0,0 +1 @@ +324a1c15562035d8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json new file mode 100644 index 000000000..c8f52cb19 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"Win32\", \"Win32_Foundation\", \"Win32_System\", \"Win32_System_Console\", \"default\"]","declared_features":"[\"Wdk\", \"Wdk_System\", \"Wdk_System_OfflineRegistry\", \"Win32\", \"Win32_Data\", \"Win32_Data_HtmlHelp\", \"Win32_Data_RightsManagement\", \"Win32_Data_Xml\", \"Win32_Data_Xml_MsXml\", \"Win32_Data_Xml_XmlLite\", \"Win32_Devices\", \"Win32_Devices_AllJoyn\", \"Win32_Devices_BiometricFramework\", \"Win32_Devices_Bluetooth\", \"Win32_Devices_Communication\", \"Win32_Devices_DeviceAccess\", \"Win32_Devices_DeviceAndDriverInstallation\", \"Win32_Devices_DeviceQuery\", \"Win32_Devices_Display\", \"Win32_Devices_Enumeration\", \"Win32_Devices_Enumeration_Pnp\", \"Win32_Devices_Fax\", \"Win32_Devices_FunctionDiscovery\", \"Win32_Devices_Geolocation\", \"Win32_Devices_HumanInterfaceDevice\", \"Win32_Devices_ImageAcquisition\", \"Win32_Devices_PortableDevices\", \"Win32_Devices_Properties\", \"Win32_Devices_Pwm\", \"Win32_Devices_Sensors\", \"Win32_Devices_SerialCommunication\", \"Win32_Devices_Tapi\", \"Win32_Devices_Usb\", \"Win32_Devices_WebServicesOnDevices\", \"Win32_Foundation\", \"Win32_Gaming\", \"Win32_Globalization\", \"Win32_Graphics\", \"Win32_Graphics_Dwm\", \"Win32_Graphics_Gdi\", \"Win32_Graphics_Hlsl\", \"Win32_Graphics_OpenGL\", \"Win32_Graphics_Printing\", \"Win32_Graphics_Printing_PrintTicket\", \"Win32_Management\", \"Win32_Management_MobileDeviceManagementRegistration\", \"Win32_Media\", \"Win32_Media_Audio\", \"Win32_Media_Audio_Apo\", \"Win32_Media_Audio_DirectMusic\", \"Win32_Media_Audio_Endpoints\", \"Win32_Media_Audio_XAudio2\", \"Win32_Media_DeviceManager\", \"Win32_Media_DxMediaObjects\", \"Win32_Media_KernelStreaming\", \"Win32_Media_LibrarySharingServices\", \"Win32_Media_MediaPlayer\", \"Win32_Media_Multimedia\", \"Win32_Media_Speech\", \"Win32_Media_Streaming\", \"Win32_Media_WindowsMediaFormat\", \"Win32_NetworkManagement\", \"Win32_NetworkManagement_Dhcp\", \"Win32_NetworkManagement_Dns\", \"Win32_NetworkManagement_InternetConnectionWizard\", \"Win32_NetworkManagement_IpHelper\", \"Win32_NetworkManagement_MobileBroadband\", \"Win32_NetworkManagement_Multicast\", \"Win32_NetworkManagement_Ndis\", \"Win32_NetworkManagement_NetBios\", \"Win32_NetworkManagement_NetManagement\", \"Win32_NetworkManagement_NetShell\", \"Win32_NetworkManagement_NetworkDiagnosticsFramework\", \"Win32_NetworkManagement_NetworkPolicyServer\", \"Win32_NetworkManagement_P2P\", \"Win32_NetworkManagement_QoS\", \"Win32_NetworkManagement_Rras\", \"Win32_NetworkManagement_Snmp\", \"Win32_NetworkManagement_WNet\", \"Win32_NetworkManagement_WebDav\", \"Win32_NetworkManagement_WiFi\", \"Win32_NetworkManagement_WindowsConnectNow\", \"Win32_NetworkManagement_WindowsConnectionManager\", \"Win32_NetworkManagement_WindowsFilteringPlatform\", \"Win32_NetworkManagement_WindowsFirewall\", \"Win32_NetworkManagement_WindowsNetworkVirtualization\", \"Win32_Networking\", \"Win32_Networking_ActiveDirectory\", \"Win32_Networking_BackgroundIntelligentTransferService\", \"Win32_Networking_Clustering\", \"Win32_Networking_HttpServer\", \"Win32_Networking_Ldap\", \"Win32_Networking_NetworkListManager\", \"Win32_Networking_RemoteDifferentialCompression\", \"Win32_Networking_WebSocket\", \"Win32_Networking_WinHttp\", \"Win32_Networking_WinInet\", \"Win32_Networking_WinSock\", \"Win32_Networking_WindowsWebServices\", \"Win32_Security\", \"Win32_Security_AppLocker\", \"Win32_Security_Authentication\", \"Win32_Security_Authentication_Identity\", \"Win32_Security_Authentication_Identity_Provider\", \"Win32_Security_Authorization\", \"Win32_Security_Authorization_UI\", \"Win32_Security_ConfigurationSnapin\", \"Win32_Security_Credentials\", \"Win32_Security_Cryptography\", \"Win32_Security_Cryptography_Catalog\", \"Win32_Security_Cryptography_Certificates\", \"Win32_Security_Cryptography_Sip\", \"Win32_Security_Cryptography_UI\", \"Win32_Security_DiagnosticDataQuery\", \"Win32_Security_DirectoryServices\", \"Win32_Security_EnterpriseData\", \"Win32_Security_ExtensibleAuthenticationProtocol\", \"Win32_Security_Isolation\", \"Win32_Security_LicenseProtection\", \"Win32_Security_NetworkAccessProtection\", \"Win32_Security_Tpm\", \"Win32_Security_WinTrust\", \"Win32_Security_WinWlx\", \"Win32_Storage\", \"Win32_Storage_Cabinets\", \"Win32_Storage_CloudFilters\", \"Win32_Storage_Compression\", \"Win32_Storage_DataDeduplication\", \"Win32_Storage_DistributedFileSystem\", \"Win32_Storage_EnhancedStorage\", \"Win32_Storage_FileHistory\", \"Win32_Storage_FileServerResourceManager\", \"Win32_Storage_FileSystem\", \"Win32_Storage_Imapi\", \"Win32_Storage_IndexServer\", \"Win32_Storage_InstallableFileSystems\", \"Win32_Storage_IscsiDisc\", \"Win32_Storage_Jet\", \"Win32_Storage_OfflineFiles\", \"Win32_Storage_OperationRecorder\", \"Win32_Storage_Packaging\", \"Win32_Storage_Packaging_Appx\", \"Win32_Storage_Packaging_Opc\", \"Win32_Storage_ProjectedFileSystem\", \"Win32_Storage_StructuredStorage\", \"Win32_Storage_Vhd\", \"Win32_Storage_VirtualDiskService\", \"Win32_Storage_Vss\", \"Win32_Storage_Xps\", \"Win32_Storage_Xps_Printing\", \"Win32_System\", \"Win32_System_AddressBook\", \"Win32_System_Antimalware\", \"Win32_System_ApplicationInstallationAndServicing\", \"Win32_System_ApplicationVerifier\", \"Win32_System_AssessmentTool\", \"Win32_System_ClrHosting\", \"Win32_System_Com\", \"Win32_System_Com_CallObj\", \"Win32_System_Com_ChannelCredentials\", \"Win32_System_Com_Events\", \"Win32_System_Com_Marshal\", \"Win32_System_Com_StructuredStorage\", \"Win32_System_Com_UI\", \"Win32_System_Com_Urlmon\", \"Win32_System_ComponentServices\", \"Win32_System_Console\", \"Win32_System_Contacts\", \"Win32_System_CorrelationVector\", \"Win32_System_DataExchange\", \"Win32_System_DeploymentServices\", \"Win32_System_DesktopSharing\", \"Win32_System_DeveloperLicensing\", \"Win32_System_Diagnostics\", \"Win32_System_Diagnostics_Ceip\", \"Win32_System_Diagnostics_ClrProfiling\", \"Win32_System_Diagnostics_Debug\", \"Win32_System_Diagnostics_Debug_ActiveScript\", \"Win32_System_Diagnostics_Debug_Extensions\", \"Win32_System_Diagnostics_Etw\", \"Win32_System_Diagnostics_ProcessSnapshotting\", \"Win32_System_Diagnostics_ToolHelp\", \"Win32_System_DistributedTransactionCoordinator\", \"Win32_System_Environment\", \"Win32_System_ErrorReporting\", \"Win32_System_EventCollector\", \"Win32_System_EventLog\", \"Win32_System_EventNotificationService\", \"Win32_System_GroupPolicy\", \"Win32_System_HostCompute\", \"Win32_System_HostComputeNetwork\", \"Win32_System_HostComputeSystem\", \"Win32_System_Hypervisor\", \"Win32_System_IO\", \"Win32_System_Iis\", \"Win32_System_Ioctl\", \"Win32_System_JobObjects\", \"Win32_System_Js\", \"Win32_System_Kernel\", \"Win32_System_LibraryLoader\", \"Win32_System_Mailslots\", \"Win32_System_Mapi\", \"Win32_System_Memory\", \"Win32_System_Memory_NonVolatile\", \"Win32_System_MessageQueuing\", \"Win32_System_MixedReality\", \"Win32_System_Mmc\", \"Win32_System_Ole\", \"Win32_System_ParentalControls\", \"Win32_System_PasswordManagement\", \"Win32_System_Performance\", \"Win32_System_Performance_HardwareCounterProfiling\", \"Win32_System_Pipes\", \"Win32_System_Power\", \"Win32_System_ProcessStatus\", \"Win32_System_RealTimeCommunications\", \"Win32_System_Recovery\", \"Win32_System_Registry\", \"Win32_System_RemoteAssistance\", \"Win32_System_RemoteDesktop\", \"Win32_System_RemoteManagement\", \"Win32_System_RestartManager\", \"Win32_System_Restore\", \"Win32_System_Rpc\", \"Win32_System_Search\", \"Win32_System_Search_Common\", \"Win32_System_SecurityCenter\", \"Win32_System_ServerBackup\", \"Win32_System_Services\", \"Win32_System_SettingsManagementInfrastructure\", \"Win32_System_SetupAndMigration\", \"Win32_System_Shutdown\", \"Win32_System_StationsAndDesktops\", \"Win32_System_SubsystemForLinux\", \"Win32_System_SystemInformation\", \"Win32_System_SystemServices\", \"Win32_System_TaskScheduler\", \"Win32_System_Threading\", \"Win32_System_Time\", \"Win32_System_TpmBaseServices\", \"Win32_System_UpdateAgent\", \"Win32_System_UpdateAssessment\", \"Win32_System_UserAccessLogging\", \"Win32_System_VirtualDosMachines\", \"Win32_System_WindowsProgramming\", \"Win32_System_WindowsSync\", \"Win32_System_Wmi\", \"Win32_UI\", \"Win32_UI_Accessibility\", \"Win32_UI_Animation\", \"Win32_UI_ColorSystem\", \"Win32_UI_Controls\", \"Win32_UI_Controls_Dialogs\", \"Win32_UI_Controls_RichEdit\", \"Win32_UI_HiDpi\", \"Win32_UI_Input\", \"Win32_UI_Input_Ime\", \"Win32_UI_Input_Ink\", \"Win32_UI_Input_KeyboardAndMouse\", \"Win32_UI_Input_Pointer\", \"Win32_UI_Input_Radial\", \"Win32_UI_Input_Touch\", \"Win32_UI_Input_XboxController\", \"Win32_UI_InteractionContext\", \"Win32_UI_LegacyWindowsEnvironmentFeatures\", \"Win32_UI_Magnification\", \"Win32_UI_Notifications\", \"Win32_UI_Ribbon\", \"Win32_UI_Shell\", \"Win32_UI_Shell_Common\", \"Win32_UI_Shell_PropertiesSystem\", \"Win32_UI_TabletPC\", \"Win32_UI_TextServices\", \"Win32_UI_WindowsAndMessaging\", \"Win32_UI_Wpf\", \"Win32_Web\", \"Win32_Web_InternetExplorer\", \"default\"]","target":720495858719652558,"profile":14620777910751233144,"path":16538518685129205655,"deps":[[15728644107383952457,"windows_targets",false,9739022325496119877]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-sys-c09311c24c04cdd1\\dep-lib-windows_sys"}}],"rustflags":[],"metadata":18220959856227839970,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets new file mode 100644 index 000000000..7a76ef0dd --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets @@ -0,0 +1 @@ +4582cb9a34f52787 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json new file mode 100644 index 000000000..19892177a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":10199564376537173956,"profile":14620777910751233144,"path":7907050857598292411,"deps":[[8929410241095451316,"windows_x86_64_msvc",false,7896345554832859366]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-targets-9b59cd7cb302eeeb\\dep-lib-windows_targets"}}],"rustflags":[],"metadata":8011173418319876128,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets new file mode 100644 index 000000000..cb615f5ea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets @@ -0,0 +1 @@ +8720707a373fb009 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json new file mode 100644 index 000000000..61bf39bae --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":16769798786527649118,"profile":6050125052452401304,"path":7899813761505066229,"deps":[[11729866763975256760,"windows_x86_64_msvc",false,9860051450649631827]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-targets-ee0dd0a48f337ab2\\dep-lib-windows_targets"}}],"rustflags":[],"metadata":8011173418319876128,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc new file mode 100644 index 000000000..dcc9208c9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc @@ -0,0 +1 @@ +53dc0bb78df0d588 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json new file mode 100644 index 000000000..ac1f42cb0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":6538977724285316826,"profile":14620777910751233144,"path":7509326034823863656,"deps":[[11729866763975256760,"build_script_build",false,14365432987769844787]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-545c587ad7bce300\\dep-lib-windows_x86_64_msvc"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build new file mode 100644 index 000000000..dbaf7a95b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build @@ -0,0 +1 @@ +1771c47ab3cab990 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json new file mode 100644 index 000000000..32325a54b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13708040221295731214,"profile":15621230377962148654,"path":17515961731087802770,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-5d46425dd2e5da20\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build new file mode 100644 index 000000000..1cb084fdf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build @@ -0,0 +1 @@ +fb43de9b5b9608bc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json new file mode 100644 index 000000000..59b895b2d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[8929410241095451316,"build_script_build",false,10428589284360745239]],"local":[{"Precalculated":"0.48.5"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build new file mode 100644 index 000000000..aa36cf126 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build @@ -0,0 +1 @@ +330b9359a8f28ddf \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json new file mode 100644 index 000000000..85761f674 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9652763411108993936,"profile":15621230377962148654,"path":14474747062449499265,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-70e349852f013a19\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc new file mode 100644 index 000000000..fedbe41f2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc @@ -0,0 +1 @@ +e6208c0b7274956d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json new file mode 100644 index 000000000..cc142e69a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":18393560258677508838,"profile":14620777910751233144,"path":785411964834977431,"deps":[[8929410241095451316,"build_script_build",false,13549244799145362427]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-75e68c161b8e137f\\dep-lib-windows_x86_64_msvc"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build new file mode 100644 index 000000000..c741e9e10 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build @@ -0,0 +1 @@ +3334b3e830455cc7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json new file mode 100644 index 000000000..6c2f4108b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[11729866763975256760,"build_script_build",false,16108798247045368627]],"local":[{"Precalculated":"0.52.5"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/dep-lib-winnow b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/dep-lib-winnow new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/dep-lib-winnow differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow new file mode 100644 index 000000000..044d2c3aa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow @@ -0,0 +1 @@ +cce92fcb6b7fd17c \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow.json b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow.json new file mode 100644 index 000000000..5d8dcab37 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/.fingerprint/winnow-0e2256fe2c2da9de/lib-winnow.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"debug\", \"default\", \"simd\", \"std\", \"unstable-doc\", \"unstable-recover\"]","target":17309693783426942923,"profile":4507284275307728809,"path":4890426222237707196,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\winnow-0e2256fe2c2da9de\\dep-lib-winnow"}}],"rustflags":[],"metadata":7482876514514569712,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d new file mode 100644 index 000000000..016f16189 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\anyhow-4d9c79b21dc2e4f4\out\libanyhow.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\anyhow-4d9c79b21dc2e4f4\out\anyhow.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/output new file mode 100644 index 000000000..8125dde23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/output @@ -0,0 +1,10 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP +cargo:rustc-check-cfg=cfg(anyhow_nightly_testing) +cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str) +cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of) +cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint) +cargo:rustc-check-cfg=cfg(doc_cfg) +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(std_backtrace) +cargo:rustc-cfg=std_backtrace diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output new file mode 100644 index 000000000..bf43bb35e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\anyhow-4d9c79b21dc2e4f4\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-4d9c79b21dc2e4f4/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe new file mode 100644 index 000000000..eac9e1c26 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d new file mode 100644 index 000000000..7dd221579 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\anyhow-a7943f6b1836ace1\build_script_build-a7943f6b1836ace1.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\anyhow-a7943f6b1836ace1\build_script_build-a7943f6b1836ace1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe new file mode 100644 index 000000000..eac9e1c26 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb new file mode 100644 index 000000000..85eecd8d0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb new file mode 100644 index 000000000..85eecd8d0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build-script-build.exe new file mode 100644 index 000000000..503a3417c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.d new file mode 100644 index 000000000..60d117827 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\doc-comment-8982444af1854533\build_script_build-8982444af1854533.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\doc-comment-8982444af1854533\build_script_build-8982444af1854533.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.exe new file mode 100644 index 000000000..503a3417c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.pdb new file mode 100644 index 000000000..f54a75896 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build-8982444af1854533.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build.pdb new file mode 100644 index 000000000..f54a75896 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-8982444af1854533/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/output new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/root-output new file mode 100644 index 000000000..88e7e39e3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\doc-comment-de79b3176dfc735f\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/doc-comment-de79b3176dfc735f/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll new file mode 100644 index 000000000..f6b564817 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll @@ -0,0 +1,10 @@ +; ModuleID = 'probe0.1edfe1de8ca3130a-cgu.0' +source_filename = "probe0.1edfe1de8ca3130a-cgu.0" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +!llvm.module.flags = !{!0} +!llvm.ident = !{!1} + +!0 = !{i32 8, !"PIC Level", i32 2} +!1 = !{!"rustc version 1.81.0 (eeb90cda1 2024-09-04)"} diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll new file mode 100644 index 000000000..9da3a2648 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll @@ -0,0 +1,59 @@ +; ModuleID = 'probe1.cb05c354c6e25008-cgu.0' +source_filename = "probe1.cb05c354c6e25008-cgu.0" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +@alloc_f93507f8ba4b5780b14b2c2584609be0 = private unnamed_addr constant <{ [8 x i8] }> <{ [8 x i8] c"\00\00\00\00\00\00\F0?" }>, align 8 +@alloc_ef0a1f828f3393ef691f2705e817091c = private unnamed_addr constant <{ [8 x i8] }> <{ [8 x i8] c"\00\00\00\00\00\00\00@" }>, align 8 + +; core::f64::::total_cmp +; Function Attrs: inlinehint uwtable +define internal i8 @"_ZN4core3f6421_$LT$impl$u20$f64$GT$9total_cmp17hc4fc46b30fece0a3E"(ptr align 8 %self, ptr align 8 %other) unnamed_addr #0 { +start: + %right = alloca [8 x i8], align 8 + %left = alloca [8 x i8], align 8 + %self1 = load double, ptr %self, align 8 + %_4 = bitcast double %self1 to i64 + store i64 %_4, ptr %left, align 8 + %self2 = load double, ptr %other, align 8 + %_7 = bitcast double %self2 to i64 + store i64 %_7, ptr %right, align 8 + %_13 = load i64, ptr %left, align 8 + %_12 = ashr i64 %_13, 63 + %_10 = lshr i64 %_12, 1 + %0 = load i64, ptr %left, align 8 + %1 = xor i64 %0, %_10 + store i64 %1, ptr %left, align 8 + %_18 = load i64, ptr %right, align 8 + %_17 = ashr i64 %_18, 63 + %_15 = lshr i64 %_17, 1 + %2 = load i64, ptr %right, align 8 + %3 = xor i64 %2, %_15 + store i64 %3, ptr %right, align 8 + %_21 = load i64, ptr %left, align 8 + %_22 = load i64, ptr %right, align 8 + %4 = icmp sgt i64 %_21, %_22 + %5 = zext i1 %4 to i8 + %6 = icmp slt i64 %_21, %_22 + %7 = zext i1 %6 to i8 + %_0 = sub nsw i8 %5, %7 + ret i8 %_0 +} + +; probe1::probe +; Function Attrs: uwtable +define void @_ZN6probe15probe17h179cd2e73a721f32E() unnamed_addr #1 { +start: +; call core::f64::::total_cmp + %_1 = call i8 @"_ZN4core3f6421_$LT$impl$u20$f64$GT$9total_cmp17hc4fc46b30fece0a3E"(ptr align 8 @alloc_f93507f8ba4b5780b14b2c2584609be0, ptr align 8 @alloc_ef0a1f828f3393ef691f2705e817091c) + ret void +} + +attributes #0 = { inlinehint uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" } +attributes #1 = { uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" } + +!llvm.module.flags = !{!0} +!llvm.ident = !{!1} + +!0 = !{i32 8, !"PIC Level", i32 2} +!1 = !{!"rustc version 1.81.0 (eeb90cda1 2024-09-04)"} diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/output new file mode 100644 index 000000000..67aa80016 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/output @@ -0,0 +1,2 @@ +cargo:rustc-cfg=has_total_cmp +cargo:rerun-if-changed=build.rs diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/root-output new file mode 100644 index 000000000..d748427ce --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\num-traits-3a779ab4385ffbfb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-3a779ab4385ffbfb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe new file mode 100644 index 000000000..c83de609b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d new file mode 100644 index 000000000..e8467d4a4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\num-traits-bdb3ab51b4bf54af\build_script_build-bdb3ab51b4bf54af.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\num-traits-bdb3ab51b4bf54af\build_script_build-bdb3ab51b4bf54af.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe new file mode 100644 index 000000000..c83de609b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb new file mode 100644 index 000000000..0ea7213c2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb new file mode 100644 index 000000000..0ea7213c2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe new file mode 100644 index 000000000..698a68391 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d new file mode 100644 index 000000000..e629d11ac --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\proc-macro2-41c4fef2c5039f31\build_script_build-41c4fef2c5039f31.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\proc-macro2-41c4fef2c5039f31\build_script_build-41c4fef2c5039f31.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe new file mode 100644 index 000000000..698a68391 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb new file mode 100644 index 000000000..034a4fec0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb new file mode 100644 index 000000000..034a4fec0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d new file mode 100644 index 000000000..c9dc98f9d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\proc-macro2-abd444bf5ded0fcb\out\libproc_macro2.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\proc-macro2-abd444bf5ded0fcb\out\proc_macro2.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/output new file mode 100644 index 000000000..a3cdc7c6a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/output @@ -0,0 +1,16 @@ +cargo:rustc-check-cfg=cfg(fuzzing) +cargo:rustc-check-cfg=cfg(no_is_available) +cargo:rustc-check-cfg=cfg(no_literal_byte_character) +cargo:rustc-check-cfg=cfg(no_literal_c_string) +cargo:rustc-check-cfg=cfg(no_source_text) +cargo:rustc-check-cfg=cfg(proc_macro_span) +cargo:rustc-check-cfg=cfg(procmacro2_backtrace) +cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing) +cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt) +cargo:rustc-check-cfg=cfg(randomize_layout) +cargo:rustc-check-cfg=cfg(span_locations) +cargo:rustc-check-cfg=cfg(super_unstable) +cargo:rustc-check-cfg=cfg(wrap_proc_macro) +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-cfg=wrap_proc_macro +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output new file mode 100644 index 000000000..0e50bbd53 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\proc-macro2-abd444bf5ded0fcb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/proc-macro2-abd444bf5ded0fcb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/output new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/root-output new file mode 100644 index 000000000..d119e854e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\pulldown-cmark-836fc1ac552be508\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-836fc1ac552be508/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe new file mode 100644 index 000000000..0cb8a9f78 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d new file mode 100644 index 000000000..5927165a6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\pulldown-cmark-b31e30fcf4858fe2\build_script_build-b31e30fcf4858fe2.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\pulldown-cmark-b31e30fcf4858fe2\build_script_build-b31e30fcf4858fe2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe new file mode 100644 index 000000000..0cb8a9f78 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb new file mode 100644 index 000000000..8ba8879fb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb new file mode 100644 index 000000000..8ba8879fb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/output new file mode 100644 index 000000000..d5349a01a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/output @@ -0,0 +1,13 @@ +cargo:rerun-if-changed=build.rs +cargo:rustc-check-cfg=cfg(doc_cfg) +cargo:rustc-check-cfg=cfg(no_core_cstr) +cargo:rustc-check-cfg=cfg(no_core_num_saturating) +cargo:rustc-check-cfg=cfg(no_core_try_from) +cargo:rustc-check-cfg=cfg(no_float_copysign) +cargo:rustc-check-cfg=cfg(no_num_nonzero_signed) +cargo:rustc-check-cfg=cfg(no_relaxed_trait_bounds) +cargo:rustc-check-cfg=cfg(no_serde_derive) +cargo:rustc-check-cfg=cfg(no_std_atomic) +cargo:rustc-check-cfg=cfg(no_std_atomic64) +cargo:rustc-check-cfg=cfg(no_systemtime_checked_add) +cargo:rustc-check-cfg=cfg(no_target_has_atomic) diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/root-output new file mode 100644 index 000000000..e509f1ccc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde-6aab536be2e6e903\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-6aab536be2e6e903/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build-script-build.exe new file mode 100644 index 000000000..601d6a553 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d new file mode 100644 index 000000000..cb97c33af --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde-ff50484740259288\build_script_build-ff50484740259288.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde-ff50484740259288\build_script_build-ff50484740259288.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe new file mode 100644 index 000000000..601d6a553 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb new file mode 100644 index 000000000..4145fb25e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build.pdb new file mode 100644 index 000000000..4145fb25e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde-ff50484740259288/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/output new file mode 100644 index 000000000..da3588de6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build.rs +cargo:rustc-check-cfg=cfg(limb_width_32) +cargo:rustc-check-cfg=cfg(limb_width_64) +cargo:rustc-cfg=limb_width_64 diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/root-output new file mode 100644 index 000000000..20337d42d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde_json-34511d4076957f0a\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-34511d4076957f0a/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe new file mode 100644 index 000000000..b79f5e607 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d new file mode 100644 index 000000000..9c9be1521 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde_json-c8c997b6bb507ffb\build_script_build-c8c997b6bb507ffb.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\serde_json-c8c997b6bb507ffb\build_script_build-c8c997b6bb507ffb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe new file mode 100644 index 000000000..b79f5e607 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb new file mode 100644 index 000000000..c6d87c40c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb new file mode 100644 index 000000000..c6d87c40c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d new file mode 100644 index 000000000..a684717f7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-3ff39ce20518c5bb\out\libthiserror.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-3ff39ce20518c5bb\out\thiserror.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/output new file mode 100644 index 000000000..3b23df4e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(thiserror_nightly_testing) +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/root-output new file mode 100644 index 000000000..3326dedfe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-3ff39ce20518c5bb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-3ff39ce20518c5bb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d new file mode 100644 index 000000000..b9c345275 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-5eba0824802bec2c\out\libthiserror.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-5eba0824802bec2c\out\thiserror.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/output new file mode 100644 index 000000000..3b23df4e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(thiserror_nightly_testing) +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/root-output new file mode 100644 index 000000000..eabd8522d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-5eba0824802bec2c\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5eba0824802bec2c/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe new file mode 100644 index 000000000..9eb590474 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d new file mode 100644 index 000000000..90f0ffec5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-5ebc22fe453131cf\build_script_build-5ebc22fe453131cf.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\thiserror-5ebc22fe453131cf\build_script_build-5ebc22fe453131cf.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe new file mode 100644 index 000000000..9eb590474 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb new file mode 100644 index 000000000..032f59354 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb new file mode 100644 index 000000000..032f59354 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe new file mode 100644 index 000000000..e942c9a03 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d new file mode 100644 index 000000000..e56ca06c8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\unicase-74eb6ba6e3627ded\build_script_build-74eb6ba6e3627ded.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\unicase-74eb6ba6e3627ded\build_script_build-74eb6ba6e3627ded.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe new file mode 100644 index 000000000..e942c9a03 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb new file mode 100644 index 000000000..82ab4efe7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb new file mode 100644 index 000000000..82ab4efe7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/output new file mode 100644 index 000000000..c6738148c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/output @@ -0,0 +1,4 @@ +cargo:rustc-cfg=__unicase__iter_cmp +cargo:rustc-cfg=__unicase__default_hasher +cargo:rustc-cfg=__unicase__const_fns +cargo:rustc-cfg=__unicase__core_and_alloc diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/root-output new file mode 100644 index 000000000..536912bc6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\unicase-eb09b06d620f301b\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/unicase-eb09b06d620f301b/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe new file mode 100644 index 000000000..1b9f91b1d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d new file mode 100644 index 000000000..7388e3d7c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-5d46425dd2e5da20\build_script_build-5d46425dd2e5da20.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-5d46425dd2e5da20\build_script_build-5d46425dd2e5da20.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe new file mode 100644 index 000000000..1b9f91b1d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb new file mode 100644 index 000000000..8e2a7ba1b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb new file mode 100644 index 000000000..8e2a7ba1b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output new file mode 100644 index 000000000..6dae7dfb8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output @@ -0,0 +1 @@ +cargo:rustc-link-search=native=C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\lib diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output new file mode 100644 index 000000000..954eba636 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-650def7ca87b4585\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-650def7ca87b4585/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe new file mode 100644 index 000000000..c1b24aed7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d new file mode 100644 index 000000000..be31f278d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-70e349852f013a19\build_script_build-70e349852f013a19.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-70e349852f013a19\build_script_build-70e349852f013a19.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe new file mode 100644 index 000000000..c1b24aed7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb new file mode 100644 index 000000000..3a73e23bc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb new file mode 100644 index 000000000..3a73e23bc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output new file mode 100644 index 000000000..e6011e8c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output @@ -0,0 +1 @@ +cargo:rustc-link-search=native=C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\lib diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output new file mode 100644 index 000000000..28a91eafe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\build\windows_x86_64_msvc-9b6a2824b1c48b90\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/stderr b/rustbook-ru/packages/mdbook-trpl-listing/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d new file mode 100644 index 000000000..9c810113f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d @@ -0,0 +1,35 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libaho_corasick-9aecbe7599ed1c3c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libaho_corasick-9aecbe7599ed1c3c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\aho_corasick-9aecbe7599ed1c3c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstream-680ff811fd8a5ff2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstream-680ff811fd8a5ff2.d new file mode 100644 index 000000000..37b12b00a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstream-680ff811fd8a5ff2.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstream-680ff811fd8a5ff2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstream-680ff811fd8a5ff2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anstream-680ff811fd8a5ff2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle-546d425a429ba834.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle-546d425a429ba834.d new file mode 100644 index 000000000..39066343d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle-546d425a429ba834.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle-546d425a429ba834.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle-546d425a429ba834.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anstyle-546d425a429ba834.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d new file mode 100644 index 000000000..ee5a1b811 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d @@ -0,0 +1,11 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_parse-16a7ce764a60d6c5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_parse-16a7ce764a60d6c5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anstyle_parse-16a7ce764a60d6c5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_query-55471d262361d969.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_query-55471d262361d969.d new file mode 100644 index 000000000..f0720ea16 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_query-55471d262361d969.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_query-55471d262361d969.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_query-55471d262361d969.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anstyle_query-55471d262361d969.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d new file mode 100644 index 000000000..a7362ffc0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_wincon-16d1f280e2db68d2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanstyle_wincon-16d1f280e2db68d2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anstyle_wincon-16d1f280e2db68d2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anyhow-b7b3f7fb9b7594ea.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anyhow-b7b3f7fb9b7594ea.d new file mode 100644 index 000000000..488d7d7f8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/anyhow-b7b3f7fb9b7594ea.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanyhow-b7b3f7fb9b7594ea.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libanyhow-b7b3f7fb9b7594ea.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\anyhow-b7b3f7fb9b7594ea.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/autocfg-ad0bff98703cb9e9.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/autocfg-ad0bff98703cb9e9.d new file mode 100644 index 000000000..5e6e431d1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/autocfg-ad0bff98703cb9e9.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libautocfg-ad0bff98703cb9e9.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libautocfg-ad0bff98703cb9e9.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\autocfg-ad0bff98703cb9e9.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/bitflags-11015e225f23efd0.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/bitflags-11015e225f23efd0.d new file mode 100644 index 000000000..8a3419dfa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/bitflags-11015e225f23efd0.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libbitflags-11015e225f23efd0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libbitflags-11015e225f23efd0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\bitflags-11015e225f23efd0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/cfg_if-8767b834a7308c67.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/cfg_if-8767b834a7308c67.d new file mode 100644 index 000000000..2bcedf436 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/cfg_if-8767b834a7308c67.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libcfg_if-8767b834a7308c67.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libcfg_if-8767b834a7308c67.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\cfg_if-8767b834a7308c67.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/chrono-94fe39ff394230ed.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/chrono-94fe39ff394230ed.d new file mode 100644 index 000000000..41786ea1f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/chrono-94fe39ff394230ed.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libchrono-94fe39ff394230ed.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libchrono-94fe39ff394230ed.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\chrono-94fe39ff394230ed.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap-9a0ba72745542e32.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap-9a0ba72745542e32.d new file mode 100644 index 000000000..e32b5d062 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap-9a0ba72745542e32.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap-9a0ba72745542e32.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap-9a0ba72745542e32.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap-9a0ba72745542e32.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_builder-6b89262c860f8a32.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_builder-6b89262c860f8a32.d new file mode 100644 index 000000000..0ec0eec04 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_builder-6b89262c860f8a32.d @@ -0,0 +1,61 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_builder-6b89262c860f8a32.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_builder-6b89262c860f8a32.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap_builder-6b89262c860f8a32.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_complete-a7ad4f06481b96eb.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_complete-a7ad4f06481b96eb.d new file mode 100644 index 000000000..cc7df5e06 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_complete-a7ad4f06481b96eb.d @@ -0,0 +1,18 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_complete-a7ad4f06481b96eb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_complete-a7ad4f06481b96eb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap_complete-a7ad4f06481b96eb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.d new file mode 100644 index 000000000..4c1403311 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.d @@ -0,0 +1,21 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap_derive-928f3257cb5195d6.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap_derive-928f3257cb5195d6.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll new file mode 100644 index 000000000..e926b1865 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp new file mode 100644 index 000000000..34334e7f0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib new file mode 100644 index 000000000..16c236101 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.pdb new file mode 100644 index 000000000..23b5e684f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_derive-928f3257cb5195d6.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_lex-27c5293d8d8c133a.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_lex-27c5293d8d8c133a.d new file mode 100644 index 000000000..86db305db --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/clap_lex-27c5293d8d8c133a.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_lex-27c5293d8d8c133a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libclap_lex-27c5293d8d8c133a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\clap_lex-27c5293d8d8c133a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/colorchoice-6846e899ff583e3a.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/colorchoice-6846e899ff583e3a.d new file mode 100644 index 000000000..9bc76137d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/colorchoice-6846e899ff583e3a.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libcolorchoice-6846e899ff583e3a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libcolorchoice-6846e899ff583e3a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\colorchoice-6846e899ff583e3a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/doc_comment-f13cfea23ab3da07.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/doc_comment-f13cfea23ab3da07.d new file mode 100644 index 000000000..310b19d65 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/doc_comment-f13cfea23ab3da07.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libdoc_comment-f13cfea23ab3da07.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libdoc_comment-f13cfea23ab3da07.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\doc_comment-f13cfea23ab3da07.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\doc-comment-0.3.3\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_filter-e93210b2aeb1774d.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_filter-e93210b2aeb1774d.d new file mode 100644 index 000000000..6c4705cb1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_filter-e93210b2aeb1774d.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libenv_filter-e93210b2aeb1774d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libenv_filter-e93210b2aeb1774d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\env_filter-e93210b2aeb1774d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_logger-1ad5f95231033016.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_logger-1ad5f95231033016.d new file mode 100644 index 000000000..210470330 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/env_logger-1ad5f95231033016.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libenv_logger-1ad5f95231033016.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libenv_logger-1ad5f95231033016.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\env_logger-1ad5f95231033016.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/equivalent-8dfdb0adfc2c5ec8.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/equivalent-8dfdb0adfc2c5ec8.d new file mode 100644 index 000000000..16843f7c1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/equivalent-8dfdb0adfc2c5ec8.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libequivalent-8dfdb0adfc2c5ec8.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\equivalent-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libequivalent-8dfdb0adfc2c5ec8.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\equivalent-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\equivalent-8dfdb0adfc2c5ec8.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\equivalent-1.0.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\equivalent-1.0.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/fastrand-857f7a2c79d6103e.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/fastrand-857f7a2c79d6103e.d new file mode 100644 index 000000000..9bea65e8d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/fastrand-857f7a2c79d6103e.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libfastrand-857f7a2c79d6103e.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libfastrand-857f7a2c79d6103e.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\fastrand-857f7a2c79d6103e.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/getopts-d5410df6c2bb16c4.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/getopts-d5410df6c2bb16c4.d new file mode 100644 index 000000000..d59e3c30a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/getopts-d5410df6c2bb16c4.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libgetopts-d5410df6c2bb16c4.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libgetopts-d5410df6c2bb16c4.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\getopts-d5410df6c2bb16c4.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/handlebars-4ecd7c29e70ab3a9.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/handlebars-4ecd7c29e70ab3a9.d new file mode 100644 index 000000000..6fd78495f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/handlebars-4ecd7c29e70ab3a9.d @@ -0,0 +1,36 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhandlebars-4ecd7c29e70ab3a9.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhandlebars-4ecd7c29e70ab3a9.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\handlebars-4ecd7c29e70ab3a9.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/hashbrown-b148a2d4fe531c77.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/hashbrown-b148a2d4fe531c77.d new file mode 100644 index 000000000..87c998165 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/hashbrown-b148a2d4fe531c77.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhashbrown-b148a2d4fe531c77.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\alloc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\bitmask.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\external_trait_impls\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\scopeguard.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\sse2.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhashbrown-b148a2d4fe531c77.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\alloc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\bitmask.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\external_trait_impls\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\scopeguard.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\sse2.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\hashbrown-b148a2d4fe531c77.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\alloc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\bitmask.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\external_trait_impls\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\scopeguard.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\sse2.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\alloc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\bitmask.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\external_trait_impls\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\scopeguard.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.5\src\raw\sse2.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/heck-7178f53dab92b944.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/heck-7178f53dab92b944.d new file mode 100644 index 000000000..7ee8534b5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/heck-7178f53dab92b944.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libheck-7178f53dab92b944.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libheck-7178f53dab92b944.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\heck-7178f53dab92b944.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/html_parser-dda0ef31ddac26ff.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/html_parser-dda0ef31ddac26ff.d new file mode 100644 index 000000000..adb1c7e30 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/html_parser-dda0ef31ddac26ff.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhtml_parser-dda0ef31ddac26ff.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\element.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\node.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\grammar\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src/grammar/rules.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhtml_parser-dda0ef31ddac26ff.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\element.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\node.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\grammar\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src/grammar/rules.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\html_parser-dda0ef31ddac26ff.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\element.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\node.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\grammar\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src/grammar/rules.pest + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\element.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\formatting.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\node.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\dom\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src\grammar\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\html_parser-0.7.0\src/grammar/rules.pest: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/humantime-992fbb70b5bd7874.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/humantime-992fbb70b5bd7874.d new file mode 100644 index 000000000..e2646f7a7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/humantime-992fbb70b5bd7874.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhumantime-992fbb70b5bd7874.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libhumantime-992fbb70b5bd7874.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\humantime-992fbb70b5bd7874.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/indexmap-3d0fe27396cf6b7e.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/indexmap-3d0fe27396cf6b7e.d new file mode 100644 index 000000000..c64cb426e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/indexmap-3d0fe27396cf6b7e.d @@ -0,0 +1,22 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libindexmap-3d0fe27396cf6b7e.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\arbitrary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\entry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw_entry_v1.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\slice.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\slice.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libindexmap-3d0fe27396cf6b7e.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\arbitrary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\entry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw_entry_v1.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\slice.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\slice.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\indexmap-3d0fe27396cf6b7e.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\arbitrary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\entry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw_entry_v1.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\slice.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\mutable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\slice.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\arbitrary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\entry.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\core\raw_entry_v1.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\mutable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\map\slice.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\mutable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\indexmap-2.2.6\src\set\slice.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/is_terminal_polyfill-e2c161c489984045.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/is_terminal_polyfill-e2c161c489984045.d new file mode 100644 index 000000000..7141b9717 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/is_terminal_polyfill-e2c161c489984045.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libis_terminal_polyfill-e2c161c489984045.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libis_terminal_polyfill-e2c161c489984045.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\is_terminal_polyfill-e2c161c489984045.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/itoa-32b3647f851aaeb2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/itoa-32b3647f851aaeb2.d new file mode 100644 index 000000000..61e5bccd4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/itoa-32b3647f851aaeb2.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libitoa-32b3647f851aaeb2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libitoa-32b3647f851aaeb2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\itoa-32b3647f851aaeb2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib new file mode 100644 index 000000000..61ff00220 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta new file mode 100644 index 000000000..e4f739d09 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rlib new file mode 100644 index 000000000..b3130754d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta new file mode 100644 index 000000000..858940287 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rlib new file mode 100644 index 000000000..4ed539ca1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rmeta new file mode 100644 index 000000000..dabf7126b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle-546d425a429ba834.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib new file mode 100644 index 000000000..964ad13cc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta new file mode 100644 index 000000000..6a911271a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rlib new file mode 100644 index 000000000..34234ce7d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rmeta new file mode 100644 index 000000000..97e21fc04 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_query-55471d262361d969.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib new file mode 100644 index 000000000..eeb5170b8 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta new file mode 100644 index 000000000..b3607a524 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib new file mode 100644 index 000000000..ec584b4a6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta new file mode 100644 index 000000000..5d8741e2b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib new file mode 100644 index 000000000..266adbf71 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta new file mode 100644 index 000000000..34b0fb9a9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rlib new file mode 100644 index 000000000..44461c7bc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rmeta new file mode 100644 index 000000000..5db6c47e9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libbitflags-11015e225f23efd0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rlib new file mode 100644 index 000000000..8b5942786 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rmeta new file mode 100644 index 000000000..7af27c0bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcfg_if-8767b834a7308c67.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rlib new file mode 100644 index 000000000..788509b98 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rmeta new file mode 100644 index 000000000..020505c43 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libchrono-94fe39ff394230ed.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rlib new file mode 100644 index 000000000..67eaaa018 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rmeta new file mode 100644 index 000000000..ec5461699 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap-9a0ba72745542e32.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rlib new file mode 100644 index 000000000..09119dc10 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta new file mode 100644 index 000000000..ec879f820 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib new file mode 100644 index 000000000..9fec26c7c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta new file mode 100644 index 000000000..93b0aab62 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib new file mode 100644 index 000000000..18d32e4b1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta new file mode 100644 index 000000000..53b338e0a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib new file mode 100644 index 000000000..f1489b68e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta new file mode 100644 index 000000000..28f5e69ef Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rlib new file mode 100644 index 000000000..e7757471d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rmeta new file mode 100644 index 000000000..7d466f639 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libdoc_comment-f13cfea23ab3da07.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib new file mode 100644 index 000000000..58c54f39c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta new file mode 100644 index 000000000..d0a6134b9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rlib new file mode 100644 index 000000000..5431ca007 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rmeta new file mode 100644 index 000000000..559707fff Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libenv_logger-1ad5f95231033016.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rlib new file mode 100644 index 000000000..050c34d21 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rmeta new file mode 100644 index 000000000..b95758bd7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libequivalent-8dfdb0adfc2c5ec8.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rlib new file mode 100644 index 000000000..b86c4ccb9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta new file mode 100644 index 000000000..4f51edc2d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib new file mode 100644 index 000000000..c0a2b6822 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta new file mode 100644 index 000000000..d1d4d234a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib new file mode 100644 index 000000000..56b477f09 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta new file mode 100644 index 000000000..7db200062 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rlib new file mode 100644 index 000000000..acccf2460 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rmeta new file mode 100644 index 000000000..35e10e231 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhashbrown-b148a2d4fe531c77.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rlib new file mode 100644 index 000000000..6f97dfe03 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rmeta new file mode 100644 index 000000000..a3a7dac6a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libheck-7178f53dab92b944.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rlib new file mode 100644 index 000000000..d318afcff Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rmeta new file mode 100644 index 000000000..634082cfc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhtml_parser-dda0ef31ddac26ff.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rlib new file mode 100644 index 000000000..abbccdaf0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta new file mode 100644 index 000000000..231610300 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rlib new file mode 100644 index 000000000..c26fe079b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rmeta new file mode 100644 index 000000000..4342caf4c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libindexmap-3d0fe27396cf6b7e.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib new file mode 100644 index 000000000..650eb7bad Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta new file mode 100644 index 000000000..e60d9c418 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rlib new file mode 100644 index 000000000..de349b52f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rmeta new file mode 100644 index 000000000..72400adb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libitoa-32b3647f851aaeb2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rlib new file mode 100644 index 000000000..44c6b6185 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rmeta new file mode 100644 index 000000000..ee7ba2ff6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/liblog-df458d1cd0ebed3f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rlib new file mode 100644 index 000000000..bdb5e8961 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rmeta new file mode 100644 index 000000000..27fbe4a40 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook-9ae3392d0139d616.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rlib new file mode 100644 index 000000000..2858ee60b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rmeta new file mode 100644 index 000000000..f182f359c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmdbook_trpl_listing-6e6284517de7cf86.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rlib new file mode 100644 index 000000000..0f82c96be Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rmeta new file mode 100644 index 000000000..965ca4803 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-45e54b823ffb518a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rlib new file mode 100644 index 000000000..818b98b6b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta new file mode 100644 index 000000000..049f535a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rlib new file mode 100644 index 000000000..246af1d45 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta new file mode 100644 index 000000000..4a567c35c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib new file mode 100644 index 000000000..557799c22 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta new file mode 100644 index 000000000..f3795449e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rlib new file mode 100644 index 000000000..1995962c5 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rmeta new file mode 100644 index 000000000..e5620de04 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-329334a68b89c051.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rlib new file mode 100644 index 000000000..a1deb024a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta new file mode 100644 index 000000000..7a0557d33 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rlib new file mode 100644 index 000000000..9d2bf6f76 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rmeta new file mode 100644 index 000000000..54f76ea34 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libopener-fb4b019db89ff6eb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rlib new file mode 100644 index 000000000..6b0fa8d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rmeta new file mode 100644 index 000000000..32948d77f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-27ca771d143da417.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rlib new file mode 100644 index 000000000..aed40d578 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rmeta new file mode 100644 index 000000000..ec3205bfc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest-ea7293ce37f9767d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib new file mode 100644 index 000000000..f9ffe26a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta new file mode 100644 index 000000000..eaa12cc19 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rlib new file mode 100644 index 000000000..ee16a819c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rmeta new file mode 100644 index 000000000..7e723cde0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpest_meta-936776a91fcba81c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib new file mode 100644 index 000000000..d6c8914b8 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta new file mode 100644 index 000000000..f87909bbf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib new file mode 100644 index 000000000..245f8375d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta new file mode 100644 index 000000000..b59352438 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib new file mode 100644 index 000000000..28b9adf9d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta new file mode 100644 index 000000000..d8f8c514b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib new file mode 100644 index 000000000..d58e3a7d9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta new file mode 100644 index 000000000..147b9f9ef Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rlib new file mode 100644 index 000000000..002f4dab0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rmeta new file mode 100644 index 000000000..ec82757ec Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libquote-b86bb00919ad5197.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rlib new file mode 100644 index 000000000..867548cea Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rmeta new file mode 100644 index 000000000..414180758 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex-303fd43f683d0d9c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rlib new file mode 100644 index 000000000..abdf214b4 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta new file mode 100644 index 000000000..ea07e130a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib new file mode 100644 index 000000000..e6249354a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta new file mode 100644 index 000000000..f2682a887 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rlib new file mode 100644 index 000000000..6eed4e1bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rmeta new file mode 100644 index 000000000..96a4d88ff Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libryu-2defaf88560c9d34.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rlib new file mode 100644 index 000000000..0728d5ace Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rmeta new file mode 100644 index 000000000..ff60fc3cf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde-6797ee67eb9fc526.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib new file mode 100644 index 000000000..57e9d940b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta new file mode 100644 index 000000000..48076cbdf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rlib new file mode 100644 index 000000000..282bd91be Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rmeta new file mode 100644 index 000000000..ff48e9de3 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libserde_spanned-1c9d84b68bb79a1a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rlib new file mode 100644 index 000000000..b36d96def Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rmeta new file mode 100644 index 000000000..a2b556070 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libshlex-ea16a86c0c46564c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rlib new file mode 100644 index 000000000..bcf6be24d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rmeta new file mode 100644 index 000000000..50bd96e99 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libstrsim-47e65bffce339b7c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib new file mode 100644 index 000000000..b42844260 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta new file mode 100644 index 000000000..aa0ab7cdb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib new file mode 100644 index 000000000..47a931856 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta new file mode 100644 index 000000000..d401f54f6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib new file mode 100644 index 000000000..258675444 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta new file mode 100644 index 000000000..896e45d99 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rlib new file mode 100644 index 000000000..50b34ed73 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rmeta new file mode 100644 index 000000000..bbba9c320 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-425658935e0fef12.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rlib new file mode 100644 index 000000000..9e2766a85 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rmeta new file mode 100644 index 000000000..d23101a24 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libthiserror-d4341c8e23adc184.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rlib new file mode 100644 index 000000000..5ecaa16bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rmeta new file mode 100644 index 000000000..8a4665297 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-4390fb9a32c72b93.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rlib new file mode 100644 index 000000000..72852d0cf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rmeta new file mode 100644 index 000000000..b1410cf78 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml-d1f67976362091fa.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rlib new file mode 100644 index 000000000..96c662471 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rmeta new file mode 100644 index 000000000..2c5fcd632 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_datetime-e32bc4939fe0dc7a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rlib new file mode 100644 index 000000000..ff4fa875c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rmeta new file mode 100644 index 000000000..c34f4692e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtoml_edit-3ed2114abb12bfb8.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib new file mode 100644 index 000000000..4ac6a8e39 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta new file mode 100644 index 000000000..96e49fad9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rlib new file mode 100644 index 000000000..fc7ca3a6a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rmeta new file mode 100644 index 000000000..06603a05d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-8190d4a172275685.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib new file mode 100644 index 000000000..a724c3962 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta new file mode 100644 index 000000000..3ee3388dd Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rlib new file mode 100644 index 000000000..5dddaa772 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rmeta new file mode 100644 index 000000000..56410594c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicase-40efbf7a3440863e.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib new file mode 100644 index 000000000..5e39d836f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta new file mode 100644 index 000000000..8fd14cd89 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib new file mode 100644 index 000000000..c30253dde Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta new file mode 100644 index 000000000..c18d07716 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib new file mode 100644 index 000000000..b6aad784e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta new file mode 100644 index 000000000..7318e5eca Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rlib new file mode 100644 index 000000000..e731fceab Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rmeta new file mode 100644 index 000000000..2de6e43d7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libversion_check-27170d7ff25bd291.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib new file mode 100644 index 000000000..afc5ebe9e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta new file mode 100644 index 000000000..51bdd5e69 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib new file mode 100644 index 000000000..0dca3949c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta new file mode 100644 index 000000000..83313bb06 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib new file mode 100644 index 000000000..461c2f4b1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta new file mode 100644 index 000000000..f04356a1e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib new file mode 100644 index 000000000..62222bbb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta new file mode 100644 index 000000000..f1216ded4 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib new file mode 100644 index 000000000..5df526a32 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta new file mode 100644 index 000000000..d91b90703 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib new file mode 100644 index 000000000..3762eaf3e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta new file mode 100644 index 000000000..068e288a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rlib new file mode 100644 index 000000000..09fe798f3 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rmeta b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rmeta new file mode 100644 index 000000000..cd0666ec3 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/libwinnow-0e2256fe2c2da9de.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/log-df458d1cd0ebed3f.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/log-df458d1cd0ebed3f.d new file mode 100644 index 000000000..d1bd51bbc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/log-df458d1cd0ebed3f.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\liblog-df458d1cd0ebed3f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\liblog-df458d1cd0ebed3f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\log-df458d1cd0ebed3f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook-9ae3392d0139d616.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook-9ae3392d0139d616.d new file mode 100644 index 000000000..40fb46587 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook-9ae3392d0139d616.d @@ -0,0 +1,75 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmdbook-9ae3392d0139d616.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmdbook-9ae3392d0139d616.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\mdbook-9ae3392d0139d616.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf: + +# env-dep:CARGO_PKG_VERSION=0.4.40 diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing-6e6284517de7cf86.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing-6e6284517de7cf86.d new file mode 100644 index 000000000..7058ff48a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing-6e6284517de7cf86.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmdbook_trpl_listing-6e6284517de7cf86.rmeta: src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmdbook_trpl_listing-6e6284517de7cf86.rlib: src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\mdbook_trpl_listing-6e6284517de7cf86.d: src\lib.rs + +src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.d new file mode 100644 index 000000000..0724d40dc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\mdbook_trpl_listing.exe: src/main.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\mdbook_trpl_listing.d: src/main.rs + +src/main.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.exe new file mode 100644 index 000000000..00300dc3d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.pdb new file mode 100644 index 000000000..ad4ee2199 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/mdbook_trpl_listing.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-45e54b823ffb518a.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-45e54b823ffb518a.d new file mode 100644 index 000000000..122e9b1f4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-45e54b823ffb518a.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmemchr-45e54b823ffb518a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmemchr-45e54b823ffb518a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\memchr-45e54b823ffb518a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-cde140c03a14d1ce.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-cde140c03a14d1ce.d new file mode 100644 index 000000000..e213e78d4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/memchr-cde140c03a14d1ce.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmemchr-cde140c03a14d1ce.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libmemchr-cde140c03a14d1ce.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\memchr-cde140c03a14d1ce.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/normpath-47b4ab670cf56a60.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/normpath-47b4ab670cf56a60.d new file mode 100644 index 000000000..8640899eb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/normpath-47b4ab670cf56a60.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libnormpath-47b4ab670cf56a60.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libnormpath-47b4ab670cf56a60.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\normpath-47b4ab670cf56a60.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/num_traits-2ab4e4646f31cfc5.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/num_traits-2ab4e4646f31cfc5.d new file mode 100644 index 000000000..7c3f5e342 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/num_traits-2ab4e4646f31cfc5.d @@ -0,0 +1,25 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libnum_traits-2ab4e4646f31cfc5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libnum_traits-2ab4e4646f31cfc5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\num_traits-2ab4e4646f31cfc5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-329334a68b89c051.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-329334a68b89c051.d new file mode 100644 index 000000000..5f662cb05 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-329334a68b89c051.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libonce_cell-329334a68b89c051.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libonce_cell-329334a68b89c051.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\once_cell-329334a68b89c051.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-c7131045f0e2879d.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-c7131045f0e2879d.d new file mode 100644 index 000000000..1f790e12d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/once_cell-c7131045f0e2879d.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libonce_cell-c7131045f0e2879d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libonce_cell-c7131045f0e2879d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\once_cell-c7131045f0e2879d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/opener-fb4b019db89ff6eb.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/opener-fb4b019db89ff6eb.d new file mode 100644 index 000000000..6480ac06f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/opener-fb4b019db89ff6eb.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libopener-fb4b019db89ff6eb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libopener-fb4b019db89ff6eb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\opener-fb4b019db89ff6eb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-27ca771d143da417.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-27ca771d143da417.d new file mode 100644 index 000000000..2c336a2ff --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-27ca771d143da417.d @@ -0,0 +1,28 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest-27ca771d143da417.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest-27ca771d143da417.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest-27ca771d143da417.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-ea7293ce37f9767d.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-ea7293ce37f9767d.d new file mode 100644 index 000000000..c3c4ed93d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest-ea7293ce37f9767d.d @@ -0,0 +1,28 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest-ea7293ce37f9767d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest-ea7293ce37f9767d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest-ea7293ce37f9767d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.d new file mode 100644 index 000000000..7c2b7d279 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest_derive-f971c62ee19a3cff.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest_derive-f971c62ee19a3cff.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll new file mode 100644 index 000000000..0708a922a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp new file mode 100644 index 000000000..774f619a1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib new file mode 100644 index 000000000..7e1fa93a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.pdb new file mode 100644 index 000000000..36f24f426 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_derive-f971c62ee19a3cff.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_generator-da91aa5eeb32f21b.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_generator-da91aa5eeb32f21b.d new file mode 100644 index 000000000..6b010c7ee --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_generator-da91aa5eeb32f21b.d @@ -0,0 +1,11 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest_generator-da91aa5eeb32f21b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest_generator-da91aa5eeb32f21b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest_generator-da91aa5eeb32f21b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_meta-936776a91fcba81c.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_meta-936776a91fcba81c.d new file mode 100644 index 000000000..c4abadadb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pest_meta-936776a91fcba81c.d @@ -0,0 +1,19 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest_meta-936776a91fcba81c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpest_meta-936776a91fcba81c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pest_meta-936776a91fcba81c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/proc_macro2-1db249c7677aa3b4.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/proc_macro2-1db249c7677aa3b4.d new file mode 100644 index 000000000..57ef097b4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/proc_macro2-1db249c7677aa3b4.d @@ -0,0 +1,14 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libproc_macro2-1db249c7677aa3b4.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libproc_macro2-1db249c7677aa3b4.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\proc_macro2-1db249c7677aa3b4.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d new file mode 100644 index 000000000..04504d3ac --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark-eda9ab09dbea3888.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark-eda9ab09dbea3888.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pulldown_cmark-eda9ab09dbea3888.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_escape-c86762f688315946.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_escape-c86762f688315946.d new file mode 100644 index 000000000..0d354f709 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_escape-c86762f688315946.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark_escape-c86762f688315946.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark_escape-c86762f688315946.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pulldown_cmark_escape-c86762f688315946.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d new file mode 100644 index 000000000..78400d054 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libpulldown_cmark_to_cmark-7be76122b5df6376.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\pulldown_cmark_to_cmark-7be76122b5df6376.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/quote-b86bb00919ad5197.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/quote-b86bb00919ad5197.d new file mode 100644 index 000000000..d035b0171 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/quote-b86bb00919ad5197.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libquote-b86bb00919ad5197.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libquote-b86bb00919ad5197.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\quote-b86bb00919ad5197.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex-303fd43f683d0d9c.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex-303fd43f683d0d9c.d new file mode 100644 index 000000000..7f66e0d75 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex-303fd43f683d0d9c.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex-303fd43f683d0d9c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex-303fd43f683d0d9c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\regex-303fd43f683d0d9c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_automata-efbc972b30a2e580.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_automata-efbc972b30a2e580.d new file mode 100644 index 000000000..980f2cb02 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_automata-efbc972b30a2e580.d @@ -0,0 +1,65 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex_automata-efbc972b30a2e580.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex_automata-efbc972b30a2e580.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\regex_automata-efbc972b30a2e580.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_syntax-f10560a1d1b78872.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_syntax-f10560a1d1b78872.d new file mode 100644 index 000000000..8ea527029 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/regex_syntax-f10560a1d1b78872.d @@ -0,0 +1,37 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex_syntax-f10560a1d1b78872.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libregex_syntax-f10560a1d1b78872.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\regex_syntax-f10560a1d1b78872.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ryu-2defaf88560c9d34.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ryu-2defaf88560c9d34.d new file mode 100644 index 000000000..6ef491ca4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ryu-2defaf88560c9d34.d @@ -0,0 +1,18 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libryu-2defaf88560c9d34.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libryu-2defaf88560c9d34.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\ryu-2defaf88560c9d34.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde-6797ee67eb9fc526.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde-6797ee67eb9fc526.d new file mode 100644 index 000000000..be50c731a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde-6797ee67eb9fc526.d @@ -0,0 +1,24 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde-6797ee67eb9fc526.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde-6797ee67eb9fc526.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\serde-6797ee67eb9fc526.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.d new file mode 100644 index 000000000..01fa493fb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.d @@ -0,0 +1,21 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\serde_derive-575de12cbf34e7e0.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\serde_derive-575de12cbf34e7e0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll new file mode 100644 index 000000000..207edefd5 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp new file mode 100644 index 000000000..99337676c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib new file mode 100644 index 000000000..8764863d9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.pdb new file mode 100644 index 000000000..6ed6ca802 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_derive-575de12cbf34e7e0.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_json-35ecaa4d5c0425a5.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_json-35ecaa4d5c0425a5.d new file mode 100644 index 000000000..e160688b8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_json-35ecaa4d5c0425a5.d @@ -0,0 +1,22 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde_json-35ecaa4d5c0425a5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde_json-35ecaa4d5c0425a5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\serde_json-35ecaa4d5c0425a5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_spanned-1c9d84b68bb79a1a.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_spanned-1c9d84b68bb79a1a.d new file mode 100644 index 000000000..2432e305f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/serde_spanned-1c9d84b68bb79a1a.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde_spanned-1c9d84b68bb79a1a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libserde_spanned-1c9d84b68bb79a1a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\serde_spanned-1c9d84b68bb79a1a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\spanned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_spanned-0.6.6\src\spanned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/shlex-ea16a86c0c46564c.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/shlex-ea16a86c0c46564c.d new file mode 100644 index 000000000..44fbafb09 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/shlex-ea16a86c0c46564c.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libshlex-ea16a86c0c46564c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libshlex-ea16a86c0c46564c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\shlex-ea16a86c0c46564c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/strsim-47e65bffce339b7c.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/strsim-47e65bffce339b7c.d new file mode 100644 index 000000000..13d40a987 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/strsim-47e65bffce339b7c.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libstrsim-47e65bffce339b7c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libstrsim-47e65bffce339b7c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\strsim-47e65bffce339b7c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/syn-12d6af9b5f3fc81f.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/syn-12d6af9b5f3fc81f.d new file mode 100644 index 000000000..2c30b25a2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/syn-12d6af9b5f3fc81f.d @@ -0,0 +1,53 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libsyn-12d6af9b5f3fc81f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libsyn-12d6af9b5f3fc81f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\syn-12d6af9b5f3fc81f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/tempfile-0b3d021dc4bc214f.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/tempfile-0b3d021dc4bc214f.d new file mode 100644 index 000000000..6db61c4e6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/tempfile-0b3d021dc4bc214f.d @@ -0,0 +1,16 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtempfile-0b3d021dc4bc214f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtempfile-0b3d021dc4bc214f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\tempfile-0b3d021dc4bc214f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/terminal_size-d8da13be1d2595d3.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/terminal_size-d8da13be1d2595d3.d new file mode 100644 index 000000000..15dd84ef3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/terminal_size-d8da13be1d2595d3.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libterminal_size-d8da13be1d2595d3.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libterminal_size-d8da13be1d2595d3.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\terminal_size-d8da13be1d2595d3.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-425658935e0fef12.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-425658935e0fef12.d new file mode 100644 index 000000000..4f4fb2d9a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-425658935e0fef12.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libthiserror-425658935e0fef12.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libthiserror-425658935e0fef12.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\thiserror-425658935e0fef12.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-d4341c8e23adc184.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-d4341c8e23adc184.d new file mode 100644 index 000000000..9e7f51ee5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror-d4341c8e23adc184.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libthiserror-d4341c8e23adc184.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libthiserror-d4341c8e23adc184.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\thiserror-d4341c8e23adc184.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.d new file mode 100644 index 000000000..89bfec7e6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\thiserror_impl-34371baa3f030dd6.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\thiserror_impl-34371baa3f030dd6.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll new file mode 100644 index 000000000..485f9c39b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp new file mode 100644 index 000000000..ab62cb09e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib new file mode 100644 index 000000000..90ae92541 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb new file mode 100644 index 000000000..4b2000efa Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-4390fb9a32c72b93.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-4390fb9a32c72b93.d new file mode 100644 index 000000000..9174e9a03 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-4390fb9a32c72b93.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml-4390fb9a32c72b93.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml-4390fb9a32c72b93.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\toml-4390fb9a32c72b93.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-d1f67976362091fa.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-d1f67976362091fa.d new file mode 100644 index 000000000..4b4f8c1f7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml-d1f67976362091fa.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml-d1f67976362091fa.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\edit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml-d1f67976362091fa.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\edit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\toml-d1f67976362091fa.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\edit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\table.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\edit.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.8.13\src\table.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_datetime-e32bc4939fe0dc7a.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_datetime-e32bc4939fe0dc7a.d new file mode 100644 index 000000000..a37dbf6f3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_datetime-e32bc4939fe0dc7a.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml_datetime-e32bc4939fe0dc7a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\datetime.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml_datetime-e32bc4939fe0dc7a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\datetime.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\toml_datetime-e32bc4939fe0dc7a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\datetime.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_datetime-0.6.6\src\datetime.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_edit-3ed2114abb12bfb8.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_edit-3ed2114abb12bfb8.d new file mode 100644 index 000000000..a37aa8f7b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/toml_edit-3ed2114abb12bfb8.d @@ -0,0 +1,50 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml_edit-3ed2114abb12bfb8.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array_of_tables.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\encode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\internal_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\numbers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\trivia.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\raw_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\repr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\pretty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit_mut.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtoml_edit-3ed2114abb12bfb8.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array_of_tables.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\encode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\internal_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\numbers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\trivia.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\raw_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\repr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\pretty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit_mut.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\toml_edit-3ed2114abb12bfb8.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array_of_tables.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\encode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\internal_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\document.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\inline_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\numbers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\trivia.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\raw_string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\repr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\array.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\key.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\pretty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit_mut.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\array_of_tables.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\document.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\encode.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\inline_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\internal_string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\item.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\key.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\array.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\datetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\document.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\inline_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\key.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\numbers.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\strings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\trivia.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\parser\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\raw_string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\repr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\array.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\datetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\key.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\spanned.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\table_enum.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\de\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\array.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\key.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\pretty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\ser\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml_edit-0.22.13\src\visit_mut.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/topological_sort-954e09149dd7fd7b.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/topological_sort-954e09149dd7fd7b.d new file mode 100644 index 000000000..b4e60b831 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/topological_sort-954e09149dd7fd7b.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtopological_sort-954e09149dd7fd7b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libtopological_sort-954e09149dd7fd7b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\topological_sort-954e09149dd7fd7b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-8190d4a172275685.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-8190d4a172275685.d new file mode 100644 index 000000000..9359a6e13 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-8190d4a172275685.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libucd_trie-8190d4a172275685.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libucd_trie-8190d4a172275685.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\ucd_trie-8190d4a172275685.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-c2ba7767e740f24f.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-c2ba7767e740f24f.d new file mode 100644 index 000000000..ddbf89e82 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/ucd_trie-c2ba7767e740f24f.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libucd_trie-c2ba7767e740f24f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libucd_trie-c2ba7767e740f24f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\ucd_trie-c2ba7767e740f24f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicase-40efbf7a3440863e.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicase-40efbf7a3440863e.d new file mode 100644 index 000000000..254a178d2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicase-40efbf7a3440863e.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicase-40efbf7a3440863e.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicase-40efbf7a3440863e.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\unicase-40efbf7a3440863e.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_ident-f819cb15e0d54fd0.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_ident-f819cb15e0d54fd0.d new file mode 100644 index 000000000..5d595cac9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_ident-f819cb15e0d54fd0.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicode_ident-f819cb15e0d54fd0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicode_ident-f819cb15e0d54fd0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\unicode_ident-f819cb15e0d54fd0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_width-a20fd1f1e08492a1.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_width-a20fd1f1e08492a1.d new file mode 100644 index 000000000..d7b7418ce --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/unicode_width-a20fd1f1e08492a1.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicode_width-a20fd1f1e08492a1.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libunicode_width-a20fd1f1e08492a1.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\unicode_width-a20fd1f1e08492a1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/utf8parse-eacf8f0fce7f601b.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/utf8parse-eacf8f0fce7f601b.d new file mode 100644 index 000000000..7f2d81c3b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/utf8parse-eacf8f0fce7f601b.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libutf8parse-eacf8f0fce7f601b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libutf8parse-eacf8f0fce7f601b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\utf8parse-eacf8f0fce7f601b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/version_check-27170d7ff25bd291.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/version_check-27170d7ff25bd291.d new file mode 100644 index 000000000..dbd72e314 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/version_check-27170d7ff25bd291.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libversion_check-27170d7ff25bd291.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libversion_check-27170d7ff25bd291.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\version_check-27170d7ff25bd291.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-0250448e5ea1b7e0.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-0250448e5ea1b7e0.d new file mode 100644 index 000000000..92a963e46 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-0250448e5ea1b7e0.d @@ -0,0 +1,19 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_sys-0250448e5ea1b7e0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_sys-0250448e5ea1b7e0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_sys-0250448e5ea1b7e0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-c09311c24c04cdd1.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-c09311c24c04cdd1.d new file mode 100644 index 000000000..83ae2572c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_sys-c09311c24c04cdd1.d @@ -0,0 +1,14 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_sys-c09311c24c04cdd1.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_sys-c09311c24c04cdd1.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_sys-c09311c24c04cdd1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-9b59cd7cb302eeeb.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-9b59cd7cb302eeeb.d new file mode 100644 index 000000000..f50e36d28 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-9b59cd7cb302eeeb.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_targets-9b59cd7cb302eeeb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_targets-9b59cd7cb302eeeb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_targets-9b59cd7cb302eeeb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-ee0dd0a48f337ab2.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-ee0dd0a48f337ab2.d new file mode 100644 index 000000000..cc7b276d6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_targets-ee0dd0a48f337ab2.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_targets-ee0dd0a48f337ab2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_targets-ee0dd0a48f337ab2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_targets-ee0dd0a48f337ab2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d new file mode 100644 index 000000000..cbe2f4059 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_x86_64_msvc-545c587ad7bce300.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_x86_64_msvc-545c587ad7bce300.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_x86_64_msvc-545c587ad7bce300.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d new file mode 100644 index 000000000..3ed5d25cf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_x86_64_msvc-75e68c161b8e137f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwindows_x86_64_msvc-75e68c161b8e137f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\windows_x86_64_msvc-75e68c161b8e137f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/winnow-0e2256fe2c2da9de.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/winnow-0e2256fe2c2da9de.d new file mode 100644 index 000000000..8cd0c24e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/deps/winnow-0e2256fe2c2da9de.d @@ -0,0 +1,26 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwinnow-0e2256fe2c2da9de.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\dispatch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\seq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\ascii\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\bits\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\branch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\debug\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\multi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\sequence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\token\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\../examples/css/parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\libwinnow-0e2256fe2c2da9de.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\dispatch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\seq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\ascii\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\bits\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\branch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\debug\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\multi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\sequence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\token\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\../examples/css/parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\deps\winnow-0e2256fe2c2da9de.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\dispatch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\seq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\ascii\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\bits\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\branch.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\debug\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\multi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\sequence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\token\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\../examples/css/parser.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\dispatch.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\macros\seq.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\stream\impls.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\ascii\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\binary\bits\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\branch.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\core.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\debug\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\multi.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\combinator\sequence.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\token\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winnow-0.6.8\src\../examples/css/parser.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.d new file mode 100644 index 000000000..40b427d5e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.d @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\libmdbook_trpl_listing.rlib: E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\src\lib.rs diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.rlib b/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.rlib new file mode 100644 index 000000000..2858ee60b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/libmdbook_trpl_listing.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.d b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.d new file mode 100644 index 000000000..8cef70747 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.d @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\target\release\mdbook-trpl-listing.exe: E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\src\lib.rs E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-listing\src\main.rs diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.exe b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.exe new file mode 100644 index 000000000..00300dc3d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook-trpl-listing.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook_trpl_listing.pdb b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook_trpl_listing.pdb new file mode 100644 index 000000000..ad4ee2199 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-listing/target/release/mdbook_trpl_listing.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/Cargo.lock b/rustbook-ru/packages/mdbook-trpl-note/Cargo.lock new file mode 100644 index 000000000..25a63dab1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/Cargo.lock @@ -0,0 +1,1087 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "assert_cmd" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" +dependencies = [ + "anstyle", + "bstr", + "doc-comment", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.5", +] + +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_complete" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dbus" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getopts" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "handlebars" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libdbus-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mdbook" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45a38e19bd200220ef07c892b0157ad3d2365e5b5a267ca01ad12182491eea5" +dependencies = [ + "anyhow", + "chrono", + "clap", + "clap_complete", + "env_logger", + "handlebars", + "log", + "memchr", + "once_cell", + "opener", + "pulldown-cmark", + "regex", + "serde", + "serde_json", + "shlex", + "tempfile", + "toml", + "topological-sort", +] + +[[package]] +name = "mdbook-trpl-note" +version = "1.0.0" +dependencies = [ + "assert_cmd", + "clap", + "mdbook", + "pulldown-cmark", + "pulldown-cmark-to-cmark", + "serde_json", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "normpath" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opener" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0" +dependencies = [ + "bstr", + "dbus", + "normpath", + "windows-sys 0.52.0", +] + +[[package]] +name = "pest" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "predicates" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +dependencies = [ + "anstyle", + "difflib", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro2" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pulldown-cmark" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" +dependencies = [ + "bitflags", + "getopts", + "memchr", + "pulldown-cmark-escape", + "unicase", +] + +[[package]] +name = "pulldown-cmark-escape" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f609795c8d835f79dcfcf768415b9fb57ef1b74891e99f86e73f43a7a257163b" +dependencies = [ + "pulldown-cmark", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.202" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.202" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-width" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/rustbook-ru/packages/mdbook-trpl-note/Cargo.toml b/rustbook-ru/packages/mdbook-trpl-note/Cargo.toml new file mode 100644 index 000000000..e8dc53cc4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "mdbook-trpl-note" +version = "1.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4", features = ["derive"] } +mdbook = { version = "0.4", default-features = false } # only need the library +pulldown-cmark = { version = "0.10", features = ["simd"] } +pulldown-cmark-to-cmark = "13" +serde_json = "1" + +[dev-dependencies] +assert_cmd = "2" diff --git a/rustbook-ru/packages/mdbook-trpl-note/README.md b/rustbook-ru/packages/mdbook-trpl-note/README.md new file mode 100644 index 000000000..0a369a347 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/README.md @@ -0,0 +1,51 @@ +# mdbook-trpl-note + +This is a *very* simple [preprocessor][pre] for [mdBook][mdbook], focused specifically on the content of _Язык программирования Ржавчина_ book. This preprocessor takes Markdown like this— + +```markdown +> Note: This is some material we want to provide more emphasis for, because it +> is important in some way! + +Some text. + +> ## Some subject +> +> Here is all the important things to know about that particular subject. +``` + +—and rewrites the Markdown to this: + +```html +
+ +This is some material we want to provide more emphasis for, because it is +important in some way! + +
+ +Some text. + +
+ +## Some subject + +Here is all the important things to know about that particular subject. + +
+``` + +This allows using the relatively standard Markdown convention of (incorrectly!) using blockquotes for “callouts” or “notes” like this, while still producing semantic HTML which conveys the actual intent. + +> [!NOTE] +> This is *not* a full “admonition” preprocessor, and it is not remotely compliant with [the GitHub “alert” syntax][alerts]. It exists almost entirely for the sake of providing better semantic HTML for _Язык программирования Ржавчина_ book with a minimum of disruption to existing workflows! +> +> You are probably better off using one of the other existing alert/admonition preprocessors: +> +> - [mdbook-alerts][mdbook-alerts] +> - [mdbook-admonish][mdbook-admonish] + +[pre]: https://rust-lang.github.io/mdBook/format/configuration/preprocessors.html +[mdbook]: https://github.com/rust-lang/mdBook +[alerts]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts +[mdbook-alerts]: https://github.com/lambdalisue/rs-mdbook-alerts +[mdbook-admonish]: https://github.com/tommilligan/mdbook-admonish diff --git a/rustbook-ru/packages/mdbook-trpl-note/src/lib.rs b/rustbook-ru/packages/mdbook-trpl-note/src/lib.rs new file mode 100644 index 000000000..f52d7b23a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/src/lib.rs @@ -0,0 +1,346 @@ +use mdbook::{ + book::Book, + errors::Result, + preprocess::{Preprocessor, PreprocessorContext}, + utils::new_cmark_parser, + BookItem, +}; +use pulldown_cmark::{ + Event::{self, *}, + Tag, TagEnd, +}; +use pulldown_cmark_to_cmark::cmark; + +/// A simple preprocessor for semantic notes in _Язык программирования Ржавчина_. +/// +/// Takes in Markdown like this: +/// +/// ```markdown +/// > Note: This is a note. +/// ``` +/// +/// Spits out Markdown like this: +/// +/// ```markdown +///
+/// +/// This is a note. +/// +///
+/// ``` +pub struct TrplNote; + +impl Preprocessor for TrplNote { + fn name(&self) -> &str { + "simple-note-preprocessor" + } + + fn run( + &self, + _ctx: &PreprocessorContext, + mut book: Book, + ) -> Result { + book.for_each_mut(|item| { + if let BookItem::Chapter(ref mut chapter) = item { + chapter.content = rewrite(&chapter.content); + } + }); + Ok(book) + } + + fn supports_renderer(&self, renderer: &str) -> bool { + renderer == "html" || renderer == "markdown" || renderer == "test" + } +} + +pub fn rewrite(text: &str) -> String { + let parser = new_cmark_parser(text, true); + + let mut events = Vec::new(); + let mut state = Default; + + for event in parser { + match (&mut state, event) { + (Default, Start(Tag::BlockQuote)) => { + state = StartingBlockquote(vec![Start(Tag::BlockQuote)]); + } + + (StartingBlockquote(blockquote_events), Text(content)) => { + if content.starts_with("Note: ") { + // This needs the "extra" `SoftBreak`s so that when the final rendering pass + // happens, it does not end up treating the internal content as inline *or* + // treating the HTML tags as inline tags: + // + // - Content inside HTML blocks is only rendered as Markdown when it is + // separated from the block HTML elements: otherwise it gets treated as inline + // HTML and *not* rendered. + // - Along the same lines, an HTML tag that happens to be directly adjacent to + // the end of a previous Markdown block will end up being rendered as part of + // that block. + events.extend([ + SoftBreak, + SoftBreak, + Html( + r#"
"#.into(), + ), + SoftBreak, + SoftBreak, + Start(Tag::Paragraph), + Text(content), + ]); + state = InNote; + } else { + events.append(blockquote_events); + events.push(Text(content)); + state = Default; + } + } + + ( + StartingBlockquote(_blockquote_events), + heading @ Start(Tag::Heading { .. }), + ) => { + events.extend([ + SoftBreak, + SoftBreak, + Html(r#"
"#.into()), + SoftBreak, + SoftBreak, + heading, + ]); + state = InNote; + } + + (StartingBlockquote(ref mut events), Start(tag)) => { + events.push(Start(tag)); + } + + (InNote, End(TagEnd::BlockQuote)) => { + // As with the start of the block HTML, the closing HTML must be + // separated from the Markdown text by two newlines. + events.extend([ + SoftBreak, + SoftBreak, + Html("
".into()), + ]); + state = Default; + } + + (_, event) => { + events.push(event); + } + } + } + + let mut buf = String::new(); + cmark(events.into_iter(), &mut buf).unwrap(); + buf +} + +use State::*; + +#[derive(Debug)] +enum State<'e> { + Default, + StartingBlockquote(Vec>), + InNote, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn no_note() { + let text = "Hello, world.\n\nThis is some text."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "

Hello, world.

\n

This is some text.

\n" + ); + } + + #[test] + fn with_note() { + let text = "> Note: This is some text.\n> It keeps going."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Note: This is some text.\nIt keeps going.

\n
" + ); + } + + #[test] + fn regular_blockquote() { + let text = "> This is some text.\n> It keeps going."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

This is some text.\nIt keeps going.

\n
\n" + ); + } + + #[test] + fn combined() { + let text = "> Note: This is some text.\n> It keeps going.\n\nThis is regular text.\n\n> This is a blockquote.\n"; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Note: This is some text.\nIt keeps going.

\n
\n

This is regular text.

\n
\n

This is a blockquote.

\n
\n" + ); + } + + #[test] + fn blockquote_then_note() { + let text = "> This is quoted.\n\n> Note: This is noted."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

This is quoted.

\n
\n
\n

Note: This is noted.

\n
" + ); + } + + #[test] + fn note_then_blockquote() { + let text = "> Note: This is noted.\n\n> This is quoted."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Note: This is noted.

\n
\n
\n

This is quoted.

\n
\n" + ); + } + + #[test] + fn with_h1_note() { + let text = "> # Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Header

\n

And then some note content.

\n
" + ); + } + + #[test] + fn with_h2_note() { + let text = "> ## Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Header

\n

And then some note content.

\n
" + ); + } + + #[test] + fn with_h3_note() { + let text = "> ### Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Header

\n

And then some note content.

\n
" + ); + } + + #[test] + fn with_h4_note() { + let text = "> #### Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Header

\n

And then some note content.

\n
" + ); + } + + #[test] + fn with_h5_note() { + let text = "> ##### Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n
Header
\n

And then some note content.

\n
" + ); + } + + #[test] + fn with_h6_note() { + let text = "> ###### Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n
Header
\n

And then some note content.

\n
" + ); + } + + #[test] + fn h1_then_blockquote() { + let text = + "> # Header\n > And then some note content.\n\n> This is quoted."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Header

\n

And then some note content.

\n
\n
\n

This is quoted.

\n
\n" + ); + } + + #[test] + fn blockquote_then_h1_note() { + let text = + "> This is quoted.\n\n> # Header\n > And then some note content."; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

This is quoted.

\n
\n
\n

Header

\n

And then some note content.

\n
" + ); + } + + #[test] + fn blockquote_with_strong() { + let text = "> **Bold text in a paragraph.**"; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

Bold text in a paragraph.

\n
\n" + ); + } + + #[test] + fn normal_table() { + let text = "| Header 1 | Header 2 |\n| -------- | -------- |\n| Text 123 | More 456 |"; + let processed = rewrite(text); + + assert_eq!( + processed, + "|Header 1|Header 2|\n|--------|--------|\n|Text 123|More 456|", + "It strips some whitespace but otherwise leaves the table intact." + ); + } + + #[test] + fn table_in_note() { + let text = "> Note: table stuff.\n\n| Header 1 | Header 2 |\n| -------- | -------- |\n| Text 123 | More 456 |"; + let processed = rewrite(text); + + assert_eq!( + processed, + "\n\n
\n\nNote: table stuff.\n\n
\n\n|Header 1|Header 2|\n|--------|--------|\n|Text 123|More 456|", + "It adds the note markup but leaves the table untouched, to be rendered as Markdown." + ); + } + + #[test] + fn table_in_quote() { + let text = "> A table.\n\n| Header 1 | Header 2 |\n| -------- | -------- |\n| Text 123 | More 456 |"; + let processed = rewrite(text); + assert_eq!( + render_markdown(&processed), + "
\n

A table.

\n
\n\n\n
Header 1Header 2
Text 123More 456
\n", + "It renders blockquotes with nested tables as expected." + ); + } + + fn render_markdown(text: &str) -> String { + let parser = new_cmark_parser(text, true); + let mut buf = String::new(); + pulldown_cmark::html::push_html(&mut buf, parser); + buf + } +} diff --git a/rustbook-ru/packages/mdbook-trpl-note/src/main.rs b/rustbook-ru/packages/mdbook-trpl-note/src/main.rs new file mode 100644 index 000000000..4b2a8fa10 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/src/main.rs @@ -0,0 +1,38 @@ +use std::io; + +use clap::{self, Parser, Subcommand}; +use mdbook::preprocess::{CmdPreprocessor, Preprocessor}; + +use mdbook_trpl_note::TrplNote; + +fn main() -> Result<(), String> { + let cli = Cli::parse(); + let simple_note = TrplNote; + if let Some(Command::Supports { renderer }) = cli.command { + return if simple_note.supports_renderer(&renderer) { + Ok(()) + } else { + Err(format!("Renderer '{renderer}' is unsupported")) + }; + } + + let (ctx, book) = + CmdPreprocessor::parse_input(io::stdin()).map_err(|e| format!("blah: {e}"))?; + let processed = simple_note.run(&ctx, book).map_err(|e| format!("{e}"))?; + serde_json::to_writer(io::stdout(), &processed).map_err(|e| format!("{e}")) +} + +/// A simple preprocessor for semantic notes in _Язык программирования Ржавчина_. +#[derive(Parser, Debug)] +struct Cli { + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand, Debug)] +enum Command { + /// Is the renderer supported? + /// + /// All renderers are supported! This is the contract for mdBook. + Supports { renderer: String }, +} diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/.rustc_info.json b/rustbook-ru/packages/mdbook-trpl-note/target/.rustc_info.json new file mode 100644 index 000000000..e0698102a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":8894157253988407288,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.81.0 (eeb90cda1 2024-09-04)\nbinary: rustc\ncommit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c\ncommit-date: 2024-09-04\nhost: x86_64-pc-windows-msvc\nrelease: 1.81.0\nLLVM version: 18.1.7\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/CACHEDIR.TAG b/rustbook-ru/packages/mdbook-trpl-note/target/CACHEDIR.TAG new file mode 100644 index 000000000..20d7c319c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.cargo-lock b/rustbook-ru/packages/mdbook-trpl-note/target/release/.cargo-lock new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/dep-lib-aho_corasick differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick new file mode 100644 index 000000000..2bc124081 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick @@ -0,0 +1 @@ +ece26dbcaa3c7fc7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json new file mode 100644 index 000000000..807dac316 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/aho-corasick-9aecbe7599ed1c3c/lib-aho_corasick.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"perf-literal\", \"std\"]","declared_features":"[\"default\", \"logging\", \"perf-literal\", \"std\"]","target":9771195463141993919,"profile":14620777910751233144,"path":315585277297123955,"deps":[[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\aho-corasick-9aecbe7599ed1c3c\\dep-lib-aho_corasick"}}],"rustflags":[],"metadata":13904389431191498124,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/dep-lib-anstream differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream new file mode 100644 index 000000000..cd39a7b1e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream @@ -0,0 +1 @@ +5c4ffed1ba25b194 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json new file mode 100644 index 000000000..222967723 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstream-680ff811fd8a5ff2/lib-anstream.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"auto\", \"default\", \"wincon\"]","declared_features":"[\"auto\", \"default\", \"test\", \"wincon\"]","target":14678495327963445937,"profile":995129404481031558,"path":10509098586486583087,"deps":[[586690293298905842,"anstyle_query",false,10953502178889718747],[1822318453936871207,"anstyle_wincon",false,8496636152828274502],[2294077528697419694,"utf8parse",false,16313337870937678466],[12423115053093093635,"is_terminal_polyfill",false,1553848363984580399],[15873833695005184023,"colorchoice",false,8645855937848871466],[16609132864249042075,"anstyle_parse",false,14894262068820411552],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstream-680ff811fd8a5ff2\\dep-lib-anstream"}}],"rustflags":[],"metadata":7500874485387469444,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/dep-lib-anstyle differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle new file mode 100644 index 000000000..d7f4b3174 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle @@ -0,0 +1 @@ +335eef359e79d985 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json new file mode 100644 index 000000000..eff6b75d9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-546d425a429ba834/lib-anstyle.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":7171498741014507518,"profile":995129404481031558,"path":13884029777877037710,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-546d425a429ba834\\dep-lib-anstyle"}}],"rustflags":[],"metadata":14064844656010464607,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/dep-lib-anstyle_parse differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse new file mode 100644 index 000000000..72502564b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse @@ -0,0 +1 @@ +a0849d3b700cb3ce \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json new file mode 100644 index 000000000..3bf482a19 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-parse-16a7ce764a60d6c5/lib-anstyle_parse.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"utf8\"]","declared_features":"[\"core\", \"default\", \"utf8\"]","target":16532437263334685269,"profile":995129404481031558,"path":11524608868306533075,"deps":[[2294077528697419694,"utf8parse",false,16313337870937678466]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-parse-16a7ce764a60d6c5\\dep-lib-anstyle_parse"}}],"rustflags":[],"metadata":9799137552285937175,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/dep-lib-anstyle_query differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query new file mode 100644 index 000000000..d96e21f7e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query @@ -0,0 +1 @@ +db5b309332a80298 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json new file mode 100644 index 000000000..1dc8c8b8d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-query-55471d262361d969/lib-anstyle_query.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":15444555938411509536,"profile":995129404481031558,"path":14674231680796983345,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-query-55471d262361d969\\dep-lib-anstyle_query"}}],"rustflags":[],"metadata":10674566383365303417,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/dep-lib-anstyle_wincon differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon new file mode 100644 index 000000000..cbf2b440c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon @@ -0,0 +1 @@ +4627125b901dea75 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json new file mode 100644 index 000000000..aa59bfc44 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anstyle-wincon-16d1f280e2db68d2/lib-anstyle_wincon.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":14626972302400552205,"profile":995129404481031558,"path":1738858255770414673,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anstyle-wincon-16d1f280e2db68d2\\dep-lib-anstyle_wincon"}}],"rustflags":[],"metadata":10007381969299487346,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build new file mode 100644 index 000000000..2238afa34 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build @@ -0,0 +1 @@ +45d2461c994b6113 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json new file mode 100644 index 000000000..139c7fe53 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-4d9c79b21dc2e4f4/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[16045357212464686133,"build_script_build",false,8182181152569577808]],"local":[{"RerunIfChanged":{"output":"release\\build\\anyhow-4d9c79b21dc2e4f4\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build new file mode 100644 index 000000000..5bd94dac0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build @@ -0,0 +1 @@ +5051ce3e68f28c71 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json new file mode 100644 index 000000000..ecf49d6f9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"backtrace\", \"default\", \"std\"]","target":13708040221295731214,"profile":15621230377962148654,"path":12949867758696785302,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anyhow-a7943f6b1836ace1\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":17154292783084528516,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-a7943f6b1836ace1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/dep-lib-anyhow differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow new file mode 100644 index 000000000..68dad1f1d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow @@ -0,0 +1 @@ +ad55b6dc07739bd9 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json new file mode 100644 index 000000000..19f6e0820 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/anyhow-b7b3f7fb9b7594ea/lib-anyhow.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"backtrace\", \"default\", \"std\"]","target":863081735331048100,"profile":14620777910751233144,"path":12659645468741012932,"deps":[[16045357212464686133,"build_script_build",false,1396480480438047301]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\anyhow-b7b3f7fb9b7594ea\\dep-lib-anyhow"}}],"rustflags":[],"metadata":17154292783084528516,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/dep-lib-autocfg differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg new file mode 100644 index 000000000..368434c67 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg @@ -0,0 +1 @@ +c108f32d54052f38 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json new file mode 100644 index 000000000..d8122f613 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/autocfg-ad0bff98703cb9e9/lib-autocfg.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9761386671650792958,"profile":15621230377962148654,"path":9726554179280314580,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\autocfg-ad0bff98703cb9e9\\dep-lib-autocfg"}}],"rustflags":[],"metadata":13102859075309379048,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/dep-lib-bitflags differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags new file mode 100644 index 000000000..ed7527eaa --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags @@ -0,0 +1 @@ +1d8f642de1798056 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json new file mode 100644 index 000000000..2fe8e44a7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/bitflags-11015e225f23efd0/lib-bitflags.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"arbitrary\", \"bytemuck\", \"compiler_builtins\", \"core\", \"example_generated\", \"rustc-dep-of-std\", \"serde\", \"std\"]","target":14463131919016566876,"profile":14620777910751233144,"path":18276530296250666590,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\bitflags-11015e225f23efd0\\dep-lib-bitflags"}}],"rustflags":[],"metadata":14564035643000669268,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/dep-lib-cfg_if differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if new file mode 100644 index 000000000..08f9def4e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if @@ -0,0 +1 @@ +312c7a1e064b339d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json new file mode 100644 index 000000000..5931e006b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/cfg-if-8767b834a7308c67/lib-cfg_if.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"compiler_builtins\", \"core\", \"rustc-dep-of-std\"]","target":11601024444410784892,"profile":14620777910751233144,"path":13471862296553709438,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\cfg-if-8767b834a7308c67\\dep-lib-cfg_if"}}],"rustflags":[],"metadata":8462187951337715540,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/dep-lib-chrono differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono new file mode 100644 index 000000000..af7956458 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono @@ -0,0 +1 @@ +0c86a452411c27b2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json new file mode 100644 index 000000000..23a512670 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/chrono-94fe39ff394230ed/lib-chrono.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"android-tzdata\", \"clock\", \"iana-time-zone\", \"now\", \"std\", \"winapi\", \"windows-targets\"]","declared_features":"[\"__internal_bench\", \"alloc\", \"android-tzdata\", \"arbitrary\", \"clock\", \"default\", \"iana-time-zone\", \"js-sys\", \"libc\", \"now\", \"oldtime\", \"pure-rust-locales\", \"rkyv\", \"rkyv-16\", \"rkyv-32\", \"rkyv-64\", \"rkyv-validation\", \"serde\", \"std\", \"unstable-locales\", \"wasm-bindgen\", \"wasmbind\", \"winapi\", \"windows-targets\"]","target":3643947551994703751,"profile":14620777910751233144,"path":7468534507969858669,"deps":[[9471768686618079862,"windows_targets",false,698127449752346759],[10448766010662481490,"num_traits",false,10793000490354472189]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\chrono-94fe39ff394230ed\\dep-lib-chrono"}}],"rustflags":[],"metadata":9803565982372010724,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/dep-lib-clap differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap new file mode 100644 index 000000000..643ecd6bb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap @@ -0,0 +1 @@ +e0204bd3b8ad8fb7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json new file mode 100644 index 000000000..e9be15296 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap-9a0ba72745542e32/lib-clap.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"cargo\", \"color\", \"default\", \"derive\", \"error-context\", \"help\", \"std\", \"suggestions\", \"usage\", \"wrap_help\"]","declared_features":"[\"cargo\", \"color\", \"debug\", \"default\", \"deprecated\", \"derive\", \"env\", \"error-context\", \"help\", \"std\", \"string\", \"suggestions\", \"unicode\", \"unstable-doc\", \"unstable-styles\", \"unstable-v5\", \"usage\", \"wrap_help\"]","target":3867101554193434771,"profile":14620777910751233144,"path":9745555515622033310,"deps":[[8642186927319252504,"clap_builder",false,14471042115223297753],[14428068728819244653,"clap_derive",false,3345902488860417389]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap-9a0ba72745542e32\\dep-lib-clap"}}],"rustflags":[],"metadata":13636260659328210681,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/dep-lib-clap_builder differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder new file mode 100644 index 000000000..dedf9e082 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder @@ -0,0 +1 @@ +d91e9a072278d3c8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json new file mode 100644 index 000000000..fb874f2b4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_builder-6b89262c860f8a32/lib-clap_builder.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"cargo\", \"color\", \"error-context\", \"help\", \"std\", \"suggestions\", \"usage\", \"wrap_help\"]","declared_features":"[\"cargo\", \"color\", \"debug\", \"default\", \"deprecated\", \"env\", \"error-context\", \"help\", \"std\", \"string\", \"suggestions\", \"unicode\", \"unstable-doc\", \"unstable-styles\", \"unstable-v5\", \"usage\", \"wrap_help\"]","target":4644856140729466895,"profile":14620777910751233144,"path":7106509597257098468,"deps":[[967775003968733193,"strsim",false,8320530356259103957],[8241424469277789533,"terminal_size",false,2815038329510585246],[10467672271736017538,"anstream",false,10714386472808370012],[12562571902142552798,"clap_lex",false,14831618001985906145],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_builder-6b89262c860f8a32\\dep-lib-clap_builder"}}],"rustflags":[],"metadata":13636260659328210681,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/dep-lib-clap_complete differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete new file mode 100644 index 000000000..0fe52f682 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete @@ -0,0 +1 @@ +56470e319de7b524 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json new file mode 100644 index 000000000..207a17958 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_complete-a7ad4f06481b96eb/lib-clap_complete.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"debug\", \"default\", \"unstable-doc\", \"unstable-dynamic\"]","target":11987084266351445162,"profile":14620777910751233144,"path":17934022816917661757,"deps":[[9602749528789499273,"clap",false,13226981639940940000]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_complete-a7ad4f06481b96eb\\dep-lib-clap_complete"}}],"rustflags":[],"metadata":5048524194917773874,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/dep-lib-clap_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive new file mode 100644 index 000000000..5d8f9f7c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive @@ -0,0 +1 @@ +6ddd9e1596086f2e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json new file mode 100644 index 000000000..24930251c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_derive-928f3257cb5195d6/lib-clap_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"debug\", \"default\", \"deprecated\", \"raw-deprecated\", \"unstable-v5\"]","target":9283944131990107227,"profile":15621230377962148654,"path":5852482638034792233,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380],[17175234422038868540,"heck",false,13614703808375705157]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_derive-928f3257cb5195d6\\dep-lib-clap_derive"}}],"rustflags":[],"metadata":751742508315986310,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/dep-lib-clap_lex differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex new file mode 100644 index 000000000..74f19c07a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex @@ -0,0 +1 @@ +e1a5a8d4fd7dd4cd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json new file mode 100644 index 000000000..91a218673 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/clap_lex-27c5293d8d8c133a/lib-clap_lex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":14633152357712548181,"profile":14620777910751233144,"path":3162528872785267419,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\clap_lex-27c5293d8d8c133a\\dep-lib-clap_lex"}}],"rustflags":[],"metadata":10867457033190240412,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/dep-lib-colorchoice differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice new file mode 100644 index 000000000..6f221e0a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice @@ -0,0 +1 @@ +2a0aaff22a40fc77 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json new file mode 100644 index 000000000..4139416dc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/colorchoice-6846e899ff583e3a/lib-colorchoice.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":10647325813053673184,"profile":995129404481031558,"path":17128989343466695641,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\colorchoice-6846e899ff583e3a\\dep-lib-colorchoice"}}],"rustflags":[],"metadata":16033661185762923568,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/dep-lib-env_filter differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter new file mode 100644 index 000000000..fb09b21bd --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter @@ -0,0 +1 @@ +13372c7d33f02d70 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json new file mode 100644 index 000000000..9a2f801b9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_filter-e93210b2aeb1774d/lib-env_filter.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"regex\"]","declared_features":"[\"default\", \"regex\"]","target":15931849289142950406,"profile":14620777910751233144,"path":14719178554194305841,"deps":[[7667881417093566568,"regex",false,11717910061522356762],[10187828652899488954,"log",false,12598582175174921379]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\env_filter-e93210b2aeb1774d\\dep-lib-env_filter"}}],"rustflags":[],"metadata":10457561132037420740,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/dep-lib-env_logger differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger new file mode 100644 index 000000000..b41bba417 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger @@ -0,0 +1 @@ +059b3821742e604b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json new file mode 100644 index 000000000..5d22a81c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/env_logger-1ad5f95231033016/lib-env_logger.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"auto-color\", \"color\", \"default\", \"humantime\", \"regex\"]","declared_features":"[\"auto-color\", \"color\", \"default\", \"humantime\", \"regex\", \"unstable-kv\"]","target":7366343831621488814,"profile":14620777910751233144,"path":10642576440398364931,"deps":[[2355222013140718847,"env_filter",false,8083381010133956371],[10187828652899488954,"log",false,12598582175174921379],[10467672271736017538,"anstream",false,10714386472808370012],[13547796294171082677,"humantime",false,14784915955436352238],[16999472572377377103,"anstyle",false,9644873797407301171]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\env_logger-1ad5f95231033016\\dep-lib-env_logger"}}],"rustflags":[],"metadata":16604235976610830136,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/dep-lib-fastrand differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand new file mode 100644 index 000000000..add19ad4d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand @@ -0,0 +1 @@ +fe6cc07651b1e5fe \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json new file mode 100644 index 000000000..526902db9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/fastrand-857f7a2c79d6103e/lib-fastrand.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"getrandom\", \"js\", \"std\"]","target":13038976728470949040,"profile":14620777910751233144,"path":6376291730327509201,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\fastrand-857f7a2c79d6103e\\dep-lib-fastrand"}}],"rustflags":[],"metadata":10402231642546230285,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/dep-lib-getopts differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts new file mode 100644 index 000000000..4f7b78841 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts @@ -0,0 +1 @@ +bd893d62cac032a6 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json new file mode 100644 index 000000000..be6b085d0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/getopts-d5410df6c2bb16c4/lib-getopts.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"core\", \"rustc-dep-of-std\", \"std\"]","target":1977464407919124015,"profile":14620777910751233144,"path":10360612012968844872,"deps":[[11292725862571439900,"unicode_width",false,14325000934463337949]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\getopts-d5410df6c2bb16c4\\dep-lib-getopts"}}],"rustflags":[],"metadata":12800380490319660633,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/dep-lib-handlebars differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars new file mode 100644 index 000000000..04458ca99 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars @@ -0,0 +1 @@ +b585a639cf20ebb4 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json new file mode 100644 index 000000000..2a298d4db --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/handlebars-4ecd7c29e70ab3a9/lib-handlebars.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"dir_source\", \"heck\", \"no_logging\", \"rhai\", \"rust-embed\", \"script_helper\", \"string_helpers\", \"walkdir\"]","target":10016905383071618913,"profile":14620777910751233144,"path":13187492646891310997,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[7781844590611205158,"pest_derive",false,11363071088690577505],[7898347539352098708,"serde_json",false,4512111603228297355],[8153797543571216910,"pest",false,9339805049955237317],[8725461231676817087,"serde",false,14256704062966727943],[10187828652899488954,"log",false,12598582175174921379]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\handlebars-4ecd7c29e70ab3a9\\dep-lib-handlebars"}}],"rustflags":[],"metadata":4366444519170567992,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/dep-lib-heck differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck new file mode 100644 index 000000000..299796f61 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck @@ -0,0 +1 @@ +454e64dcfa24f1bc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json new file mode 100644 index 000000000..33f6e7504 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/heck-7178f53dab92b944/lib-heck.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":835452791756564323,"profile":15621230377962148654,"path":7280437115999382909,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\heck-7178f53dab92b944\\dep-lib-heck"}}],"rustflags":[],"metadata":1438596273099979389,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/dep-lib-humantime differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime new file mode 100644 index 000000000..ea08bd14c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime @@ -0,0 +1 @@ +eef2c945ba922ecd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json new file mode 100644 index 000000000..b9fcaced8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/humantime-992fbb70b5bd7874/lib-humantime.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":3421103426456302212,"profile":14620777910751233144,"path":13678489989023312453,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\humantime-992fbb70b5bd7874\\dep-lib-humantime"}}],"rustflags":[],"metadata":16972751450777833143,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/dep-lib-is_terminal_polyfill differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill new file mode 100644 index 000000000..4997b58f5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill @@ -0,0 +1 @@ +2f6f1fbada609015 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json new file mode 100644 index 000000000..97e5e1db3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/is_terminal_polyfill-e2c161c489984045/lib-is_terminal_polyfill.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\"]","target":17527010720891347357,"profile":4523493358069192447,"path":3116646572239039878,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\is_terminal_polyfill-e2c161c489984045\\dep-lib-is_terminal_polyfill"}}],"rustflags":[],"metadata":8562399766395157780,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/dep-lib-itoa differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa new file mode 100644 index 000000000..59c0af79b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa @@ -0,0 +1 @@ +0df19275f39de8f8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json new file mode 100644 index 000000000..37394bc9f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/itoa-32b3647f851aaeb2/lib-itoa.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no-panic\"]","target":4403177153059382235,"profile":14620777910751233144,"path":8809167177894238621,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\itoa-32b3647f851aaeb2\\dep-lib-itoa"}}],"rustflags":[],"metadata":851671291587502216,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/dep-lib-log differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log new file mode 100644 index 000000000..2bfd78ed2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log @@ -0,0 +1 @@ +a38cdef8bc27d7ae \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json new file mode 100644 index 000000000..e922bf839 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/log-df458d1cd0ebed3f/lib-log.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"kv\", \"kv_serde\", \"kv_std\", \"kv_sval\", \"kv_unstable\", \"kv_unstable_serde\", \"kv_unstable_std\", \"kv_unstable_sval\", \"max_level_debug\", \"max_level_error\", \"max_level_info\", \"max_level_off\", \"max_level_trace\", \"max_level_warn\", \"release_max_level_debug\", \"release_max_level_error\", \"release_max_level_info\", \"release_max_level_off\", \"release_max_level_trace\", \"release_max_level_warn\", \"serde\", \"std\", \"sval\", \"sval_ref\", \"value-bag\"]","target":8820396181212955802,"profile":14620777910751233144,"path":10073275341893082220,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\log-df458d1cd0ebed3f\\dep-lib-log"}}],"rustflags":[],"metadata":179143468214550567,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/dep-lib-mdbook differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook new file mode 100644 index 000000000..a9eb1fec1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook @@ -0,0 +1 @@ +be96334009dd990d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json new file mode 100644 index 000000000..f7b6a4000 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-9ae3392d0139d616/lib-mdbook.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"search\", \"serve\", \"watch\"]","target":5638316641849725610,"profile":14620777910751233144,"path":17417807524590661292,"deps":[[1541909981555329547,"tempfile",false,11339437785692109554],[1995708430520600615,"env_logger",false,5431392226917260037],[4254328441789853856,"once_cell",false,9742840886364516168],[6554997584025100622,"toml",false,771776366773958882],[6835213927646743608,"opener",false,2096017043458066816],[7126841912348334847,"chrono",false,12837260329727854092],[7667881417093566568,"regex",false,11717910061522356762],[7898347539352098708,"serde_json",false,4512111603228297355],[7988379052066022850,"clap_complete",false,2645275018468935510],[8725461231676817087,"serde",false,14256704062966727943],[9602749528789499273,"clap",false,13226981639940940000],[10053317485738497124,"topological_sort",false,3303547146289878775],[10187828652899488954,"log",false,12598582175174921379],[15215384180442390425,"shlex",false,8132921206165260810],[15379124934976656778,"pulldown_cmark",false,6114961860516726794],[15818844694086178958,"memchr",false,15301846604188935865],[16045357212464686133,"anyhow",false,15680253005225416109],[17227095802678555946,"handlebars",false,13036549620751566261]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-9ae3392d0139d616\\dep-lib-mdbook"}}],"rustflags":[],"metadata":1587312970192705599,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note new file mode 100644 index 000000000..9b974cb45 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note @@ -0,0 +1 @@ +ad42efbdff5cc40e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note.json new file mode 100644 index 000000000..ec11a042c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/bin-mdbook-trpl-note.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":4094236586972958666,"profile":14620777910751233144,"path":10602529704205407992,"deps":[[2490412269847159966,"mdbook",false,980057425731360446],[7898347539352098708,"serde_json",false,4512111603228297355],[8344921790127479269,"pulldown_cmark_to_cmark",false,10644708328889187877],[9602749528789499273,"clap",false,13226981639940940000],[13289458212017776763,"mdbook_trpl_note",false,11023610136550125872],[15379124934976656778,"pulldown_cmark",false,6114961860516726794]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-trpl-note-60a4b89930408395\\dep-bin-mdbook-trpl-note"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/dep-bin-mdbook-trpl-note b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/dep-bin-mdbook-trpl-note new file mode 100644 index 000000000..17b9f6086 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/dep-bin-mdbook-trpl-note differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-60a4b89930408395/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/dep-lib-mdbook_trpl_note b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/dep-lib-mdbook_trpl_note new file mode 100644 index 000000000..5053a7fc0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/dep-lib-mdbook_trpl_note differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note new file mode 100644 index 000000000..536760f38 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note @@ -0,0 +1 @@ +3031777b03bbfb98 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note.json new file mode 100644 index 000000000..54ae8d4c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/mdbook-trpl-note-735ac6387a7505cf/lib-mdbook_trpl_note.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":16299125181940587509,"profile":14620777910751233144,"path":17777289886553719987,"deps":[[2490412269847159966,"mdbook",false,980057425731360446],[7898347539352098708,"serde_json",false,4512111603228297355],[8344921790127479269,"pulldown_cmark_to_cmark",false,10644708328889187877],[9602749528789499273,"clap",false,13226981639940940000],[15379124934976656778,"pulldown_cmark",false,6114961860516726794]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\mdbook-trpl-note-735ac6387a7505cf\\dep-lib-mdbook_trpl_note"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/dep-lib-memchr differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr new file mode 100644 index 000000000..ea5983d08 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr @@ -0,0 +1 @@ +b9e632f269145bd4 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json new file mode 100644 index 000000000..5aaf56209 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-45e54b823ffb518a/lib-memchr.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"compiler_builtins\", \"core\", \"default\", \"libc\", \"logging\", \"rustc-dep-of-std\", \"std\", \"use_std\"]","target":11224823532731451965,"profile":14620777910751233144,"path":11849873841126342966,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\memchr-45e54b823ffb518a\\dep-lib-memchr"}}],"rustflags":[],"metadata":7513296495906230968,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/dep-lib-memchr differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr new file mode 100644 index 000000000..ec8556510 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr @@ -0,0 +1 @@ +3b03d309e30095f0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json new file mode 100644 index 000000000..a54d157c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/memchr-cde140c03a14d1ce/lib-memchr.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"compiler_builtins\", \"core\", \"default\", \"libc\", \"logging\", \"rustc-dep-of-std\", \"std\", \"use_std\"]","target":11224823532731451965,"profile":15621230377962148654,"path":11849873841126342966,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\memchr-cde140c03a14d1ce\\dep-lib-memchr"}}],"rustflags":[],"metadata":7513296495906230968,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/dep-lib-normpath differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath new file mode 100644 index 000000000..9d5a4cf8d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath @@ -0,0 +1 @@ +fe43a1c7ea71e35d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json new file mode 100644 index 000000000..c9940ab92 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/normpath-47b4ab670cf56a60/lib-normpath.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"localization\", \"print_bytes\", \"serde\", \"uniquote\"]","target":1382406623815190553,"profile":14620777910751233144,"path":17189523945017309559,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\normpath-47b4ab670cf56a60\\dep-lib-normpath"}}],"rustflags":[],"metadata":14881282335678235538,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/dep-lib-num_traits differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits new file mode 100644 index 000000000..a8e2f6e75 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits @@ -0,0 +1 @@ +fdf43120c370c895 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json new file mode 100644 index 000000000..0feee5664 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-2ab4e4646f31cfc5/lib-num_traits.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"i128\", \"libm\", \"std\"]","target":12477478524311379690,"profile":14620777910751233144,"path":6318628890682793046,"deps":[[10448766010662481490,"build_script_build",false,12300628192593037662]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\num-traits-2ab4e4646f31cfc5\\dep-lib-num_traits"}}],"rustflags":[],"metadata":14621636500951049976,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build new file mode 100644 index 000000000..8b862f329 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build @@ -0,0 +1 @@ +5ec9a96d2b9cb4aa \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json new file mode 100644 index 000000000..aca950f35 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-3a779ab4385ffbfb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[10448766010662481490,"build_script_build",false,16018969146381369568]],"local":[{"RerunIfChanged":{"output":"release\\build\\num-traits-3a779ab4385ffbfb\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build new file mode 100644 index 000000000..0c0a741da --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build @@ -0,0 +1 @@ +e000010691cf4ede \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json new file mode 100644 index 000000000..52b150fe6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"default\", \"i128\", \"libm\", \"std\"]","target":9652763411108993936,"profile":15621230377962148654,"path":7440296701701900126,"deps":[[10438594093624915123,"autocfg",false,4048460449135659201]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\num-traits-bdb3ab51b4bf54af\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":14621636500951049976,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/num-traits-bdb3ab51b4bf54af/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/dep-lib-once_cell differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell new file mode 100644 index 000000000..ec0138f7f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell @@ -0,0 +1 @@ +48afe8962a863587 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json new file mode 100644 index 000000000..223e1d59b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-329334a68b89c051/lib-once_cell.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"race\", \"std\"]","declared_features":"[\"alloc\", \"atomic-polyfill\", \"critical-section\", \"default\", \"parking_lot\", \"portable-atomic\", \"race\", \"std\", \"unstable\"]","target":6794429743695580115,"profile":14620777910751233144,"path":14824507885935471845,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\once_cell-329334a68b89c051\\dep-lib-once_cell"}}],"rustflags":[],"metadata":14177539708254521827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/dep-lib-once_cell differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell new file mode 100644 index 000000000..d4a95bc61 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell @@ -0,0 +1 @@ +9577587a1203c2db \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json new file mode 100644 index 000000000..62797c269 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/once_cell-c7131045f0e2879d/lib-once_cell.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"default\", \"race\", \"std\"]","declared_features":"[\"alloc\", \"atomic-polyfill\", \"critical-section\", \"default\", \"parking_lot\", \"portable-atomic\", \"race\", \"std\", \"unstable\"]","target":6794429743695580115,"profile":15621230377962148654,"path":14824507885935471845,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\once_cell-c7131045f0e2879d\\dep-lib-once_cell"}}],"rustflags":[],"metadata":14177539708254521827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/dep-lib-opener differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener new file mode 100644 index 000000000..4210403f9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener @@ -0,0 +1 @@ +80897b56658c161d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json new file mode 100644 index 000000000..5157d94b0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/opener-fb4b019db89ff6eb/lib-opener.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"dbus-vendored\", \"default\"]","declared_features":"[\"dbus-vendored\", \"default\", \"reveal\"]","target":678811685358403091,"profile":14620777910751233144,"path":14830391658913800960,"deps":[[11426986729031771186,"windows_sys",false,2402317607190718502],[12913836590597973986,"normpath",false,6765376318426137598]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\opener-fb4b019db89ff6eb\\dep-lib-opener"}}],"rustflags":[],"metadata":27220870809051472,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/dep-lib-pest differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest new file mode 100644 index 000000000..e2fe9f014 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest @@ -0,0 +1 @@ +21c107ca41964168 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json new file mode 100644 index 000000000..4e581a693 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-27ca771d143da417/lib-pest.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"memchr\", \"std\"]","declared_features":"[\"const_prec_climber\", \"default\", \"memchr\", \"pretty-print\", \"std\"]","target":10596230877365890714,"profile":15621230377962148654,"path":10585500784096282585,"deps":[[2298489633419329899,"thiserror",false,7907579467027487062],[15597653465555761019,"ucd_trie",false,10483689843733895142],[15818844694086178958,"memchr",false,17335763315754992443]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest-27ca771d143da417\\dep-lib-pest"}}],"rustflags":[],"metadata":4109276871915991192,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/dep-lib-pest differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest new file mode 100644 index 000000000..c1c37595f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest @@ -0,0 +1 @@ +c53dfb6135a79d81 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json new file mode 100644 index 000000000..932784796 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest-ea7293ce37f9767d/lib-pest.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"memchr\", \"std\"]","declared_features":"[\"const_prec_climber\", \"default\", \"memchr\", \"pretty-print\", \"std\"]","target":10596230877365890714,"profile":14620777910751233144,"path":10585500784096282585,"deps":[[2298489633419329899,"thiserror",false,17409846795288618974],[15597653465555761019,"ucd_trie",false,3139975082273742459],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest-ea7293ce37f9767d\\dep-lib-pest"}}],"rustflags":[],"metadata":4109276871915991192,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/dep-lib-pest_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive new file mode 100644 index 000000000..c569a6995 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive @@ -0,0 +1 @@ +61c0e976f3bcb19d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json new file mode 100644 index 000000000..71b14bd03 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_derive-f971c62ee19a3cff/lib-pest_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"grammar-extras\", \"not-bootstrap-in-src\", \"std\"]","target":15907432747833421076,"profile":15621230377962148654,"path":12717687634155089182,"deps":[[8153797543571216910,"pest",false,7512450862737244449],[10776416550176975710,"pest_generator",false,8459309697614602255]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_derive-f971c62ee19a3cff\\dep-lib-pest_derive"}}],"rustflags":[],"metadata":15348896602671651495,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/dep-lib-pest_generator differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator new file mode 100644 index 000000000..c23f0b159 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator @@ -0,0 +1 @@ +0fe055c359816575 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json new file mode 100644 index 000000000..d02c01a96 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_generator-da91aa5eeb32f21b/lib-pest_generator.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"export-internal\", \"grammar-extras\", \"not-bootstrap-in-src\", \"std\"]","target":9031263160361905341,"profile":15621230377962148654,"path":14027015227094177835,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[8153797543571216910,"pest",false,7512450862737244449],[14268468010440576439,"quote",false,420223261422515380],[16568585440644156506,"pest_meta",false,9503765047316037001]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_generator-da91aa5eeb32f21b\\dep-lib-pest_generator"}}],"rustflags":[],"metadata":13919121622331937582,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/dep-lib-pest_meta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta new file mode 100644 index 000000000..8f6a62e51 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta @@ -0,0 +1 @@ +89bd0b1af527e483 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json new file mode 100644 index 000000000..ee71711fe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pest_meta-936776a91fcba81c/lib-pest_meta.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"grammar-extras\", \"not-bootstrap-in-src\"]","target":11184788820884453423,"profile":15621230377962148654,"path":10668005310404873937,"deps":[[4254328441789853856,"once_cell",false,15835222617684998037],[8153797543571216910,"pest",false,7512450862737244449]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pest_meta-936776a91fcba81c\\dep-lib-pest_meta"}}],"rustflags":[],"metadata":14484941712087668090,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/dep-lib-proc_macro2 differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 new file mode 100644 index 000000000..2f626b474 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2 @@ -0,0 +1 @@ +f75a1cac98282012 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json new file mode 100644 index 000000000..2a2ef7eea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-1db249c7677aa3b4/lib-proc_macro2.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"nightly\", \"proc-macro\", \"span-locations\"]","target":13874121960490935825,"profile":15621230377962148654,"path":17993159118556329183,"deps":[[6268038585962339854,"build_script_build",false,12697927332937391424],[10045147784146067611,"unicode_ident",false,4756046736092947349]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\proc-macro2-1db249c7677aa3b4\\dep-lib-proc_macro2"}}],"rustflags":[],"metadata":7635439851376710101,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build new file mode 100644 index 000000000..2a8305ff9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build @@ -0,0 +1 @@ +5d49009538777d02 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json new file mode 100644 index 000000000..ae184d737 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"nightly\", \"proc-macro\", \"span-locations\"]","target":9652763411108993936,"profile":15621230377962148654,"path":9707365015246614621,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\proc-macro2-41c4fef2c5039f31\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":7635439851376710101,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-41c4fef2c5039f31/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build new file mode 100644 index 000000000..6dc00e6e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build @@ -0,0 +1 @@ +40dd74ffa11938b0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json new file mode 100644 index 000000000..2cb721ed9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/proc-macro2-abd444bf5ded0fcb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[6268038585962339854,"build_script_build",false,179430645066385757]],"local":[{"RerunIfChanged":{"output":"release\\build\\proc-macro2-abd444bf5ded0fcb\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build new file mode 100644 index 000000000..67e70bf31 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build @@ -0,0 +1 @@ +7a37d15c62a23981 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json new file mode 100644 index 000000000..406eb20c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-836fc1ac552be508/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[15379124934976656778,"build_script_build",false,6363488814749516920]],"local":[{"Precalculated":"0.10.3"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build new file mode 100644 index 000000000..4837ac9ec --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build @@ -0,0 +1 @@ +7804519f5ca74f58 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json new file mode 100644 index 000000000..1e8ebca35 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"simd\"]","declared_features":"[\"default\", \"gen-tests\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"serde\", \"simd\"]","target":9652763411108993936,"profile":15621230377962148654,"path":13757201965224557936,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-b31e30fcf4858fe2\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":5422167110953535666,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-b31e30fcf4858fe2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/dep-lib-pulldown_cmark differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark new file mode 100644 index 000000000..87834b7c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark @@ -0,0 +1 @@ +0a4829e769b5dc54 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json new file mode 100644 index 000000000..3ef2450c0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-eda9ab09dbea3888/lib-pulldown_cmark.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"simd\"]","declared_features":"[\"default\", \"gen-tests\", \"getopts\", \"html\", \"pulldown-cmark-escape\", \"serde\", \"simd\"]","target":14173258377163996814,"profile":14620777910751233144,"path":5137384956510996191,"deps":[[6042428607772312501,"pulldown_cmark_escape",false,7640926759105612353],[7472518776289053472,"getopts",false,11975846334595697085],[7803147409971559194,"bitflags",false,6233115892316933917],[15279721705773053031,"unicase",false,7597764377851091555],[15379124934976656778,"build_script_build",false,9311652247912920954],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-eda9ab09dbea3888\\dep-lib-pulldown_cmark"}}],"rustflags":[],"metadata":5422167110953535666,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/dep-lib-pulldown_cmark_escape differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape new file mode 100644 index 000000000..85591fd48 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape @@ -0,0 +1 @@ +414a446f67060a6a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json new file mode 100644 index 000000000..2c2838d72 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-escape-c86762f688315946/lib-pulldown_cmark_escape.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"simd\"]","declared_features":"[\"simd\"]","target":10599612982616907828,"profile":14620777910751233144,"path":11285604270150866447,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-escape-c86762f688315946\\dep-lib-pulldown_cmark_escape"}}],"rustflags":[],"metadata":5200711773101909576,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/dep-lib-pulldown_cmark_to_cmark differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark new file mode 100644 index 000000000..62e7188d1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark @@ -0,0 +1 @@ +25fe14b9d399b993 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json new file mode 100644 index 000000000..2bd78a119 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/pulldown-cmark-to-cmark-7be76122b5df6376/lib-pulldown_cmark_to_cmark.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":1432562136631916118,"profile":14620777910751233144,"path":11341176081371409276,"deps":[[15379124934976656778,"pulldown_cmark",false,6114961860516726794]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\pulldown-cmark-to-cmark-7be76122b5df6376\\dep-lib-pulldown_cmark_to_cmark"}}],"rustflags":[],"metadata":10132904421119365236,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/dep-lib-quote differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote new file mode 100644 index 000000000..2484c668e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote @@ -0,0 +1 @@ +b4f4716fd4eed405 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json new file mode 100644 index 000000000..0a8cbfaba --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/quote-b86bb00919ad5197/lib-quote.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"proc-macro\"]","declared_features":"[\"default\", \"proc-macro\"]","target":2971457136760598856,"profile":15621230377962148654,"path":1140538663423296602,"deps":[[6268038585962339854,"proc_macro2",false,1306088528125123319]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\quote-b86bb00919ad5197\\dep-lib-quote"}}],"rustflags":[],"metadata":2717943770976187624,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/dep-lib-regex differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex new file mode 100644 index 000000000..715ab9fe7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex @@ -0,0 +1 @@ +1a0a04e71d619ea2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json new file mode 100644 index 000000000..4270b59b3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-303fd43f683d0d9c/lib-regex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"perf\", \"perf-backtrack\", \"perf-cache\", \"perf-dfa\", \"perf-inline\", \"perf-literal\", \"perf-onepass\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","declared_features":"[\"default\", \"logging\", \"pattern\", \"perf\", \"perf-backtrack\", \"perf-cache\", \"perf-dfa\", \"perf-dfa-full\", \"perf-inline\", \"perf-literal\", \"perf-onepass\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unstable\", \"use_std\"]","target":11287324090508747457,"profile":14620777910751233144,"path":4233516745495808906,"deps":[[483568489426407569,"regex_automata",false,10048164532439324403],[7325384046744447800,"aho_corasick",false,14375275239593337580],[12784352588272788987,"regex_syntax",false,13426384251305482979],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-303fd43f683d0d9c\\dep-lib-regex"}}],"rustflags":[],"metadata":3256615787768725874,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/dep-lib-regex_automata differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata new file mode 100644 index 000000000..20245b93f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata @@ -0,0 +1 @@ +f396b9a06740728b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json new file mode 100644 index 000000000..7b0fa53a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-automata-efbc972b30a2e580/lib-regex_automata.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"alloc\", \"dfa-onepass\", \"hybrid\", \"meta\", \"nfa-backtrack\", \"nfa-pikevm\", \"nfa-thompson\", \"perf-inline\", \"perf-literal\", \"perf-literal-multisubstring\", \"perf-literal-substring\", \"std\", \"syntax\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unicode-word-boundary\"]","declared_features":"[\"alloc\", \"default\", \"dfa\", \"dfa-build\", \"dfa-onepass\", \"dfa-search\", \"hybrid\", \"internal-instrument\", \"internal-instrument-pikevm\", \"logging\", \"meta\", \"nfa\", \"nfa-backtrack\", \"nfa-pikevm\", \"nfa-thompson\", \"perf\", \"perf-inline\", \"perf-literal\", \"perf-literal-multisubstring\", \"perf-literal-substring\", \"std\", \"syntax\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\", \"unicode-word-boundary\"]","target":2990521512445226391,"profile":14620777910751233144,"path":15875454129770319444,"deps":[[7325384046744447800,"aho_corasick",false,14375275239593337580],[12784352588272788987,"regex_syntax",false,13426384251305482979],[15818844694086178958,"memchr",false,15301846604188935865]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-automata-efbc972b30a2e580\\dep-lib-regex_automata"}}],"rustflags":[],"metadata":8878122455581797878,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/dep-lib-regex_syntax differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax new file mode 100644 index 000000000..fb156d109 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax @@ -0,0 +1 @@ +e35af62c571954ba \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json new file mode 100644 index 000000000..121924dcb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/regex-syntax-f10560a1d1b78872/lib-regex_syntax.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","declared_features":"[\"arbitrary\", \"default\", \"std\", \"unicode\", \"unicode-age\", \"unicode-bool\", \"unicode-case\", \"unicode-gencat\", \"unicode-perl\", \"unicode-script\", \"unicode-segment\"]","target":8313596292075302124,"profile":14620777910751233144,"path":5782403089770095574,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\regex-syntax-f10560a1d1b78872\\dep-lib-regex_syntax"}}],"rustflags":[],"metadata":17586400164587752172,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/dep-lib-ryu differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu new file mode 100644 index 000000000..5c5296f37 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu @@ -0,0 +1 @@ +4a86c0d61a51f3e0 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json new file mode 100644 index 000000000..529cfdc75 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ryu-2defaf88560c9d34/lib-ryu.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"no-panic\", \"small\"]","target":8332498352293740753,"profile":14620777910751233144,"path":11013700038906014850,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ryu-2defaf88560c9d34\\dep-lib-ryu"}}],"rustflags":[],"metadata":10387617312689919117,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/dep-lib-serde differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde new file mode 100644 index 000000000..2cb6147bf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde @@ -0,0 +1 @@ +0705005dcffcd9c5 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json new file mode 100644 index 000000000..3ebf8c607 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6797ee67eb9fc526/lib-serde.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"derive\", \"serde_derive\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"derive\", \"rc\", \"serde_derive\", \"std\", \"unstable\"]","target":7162769108158706428,"profile":14620777910751233144,"path":7939759890209142985,"deps":[[8420555068261863417,"serde_derive",false,9979479887115832246],[8725461231676817087,"build_script_build",false,1149964767447481287]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde-6797ee67eb9fc526\\dep-lib-serde"}}],"rustflags":[],"metadata":3767376778934503013,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build new file mode 100644 index 000000000..4fb2c2452 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build @@ -0,0 +1 @@ +c7fbebfbdc7ef50f \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json new file mode 100644 index 000000000..b40f80c9a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-6aab536be2e6e903/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[8725461231676817087,"build_script_build",false,14839947487230302774]],"local":[{"RerunIfChanged":{"output":"release\\build\\serde-6aab536be2e6e903\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build new file mode 100644 index 000000000..718dc5fe0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build @@ -0,0 +1 @@ +361ad03d9d15f2cd \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json new file mode 100644 index 000000000..12cd73301 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"derive\", \"serde_derive\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"derive\", \"rc\", \"serde_derive\", \"std\", \"unstable\"]","target":13708040221295731214,"profile":15621230377962148654,"path":1805026825088374107,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde-ff50484740259288\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3767376778934503013,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde-ff50484740259288/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/dep-lib-serde_derive differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive new file mode 100644 index 000000000..7c52e3348 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive @@ -0,0 +1 @@ +b6cbb172153c7e8a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json new file mode 100644 index 000000000..5a69a7723 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_derive-575de12cbf34e7e0/lib-serde_derive.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"deserialize_in_place\"]","target":16923867824863365409,"profile":15621230377962148654,"path":1911482977130476596,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_derive-575de12cbf34e7e0\\dep-lib-serde_derive"}}],"rustflags":[],"metadata":14452199383429553764,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build new file mode 100644 index 000000000..71d38cafe --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build @@ -0,0 +1 @@ +ac3e455d35e82e15 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json new file mode 100644 index 000000000..e49cdb825 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-34511d4076957f0a/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[7898347539352098708,"build_script_build",false,11083165870690557104]],"local":[{"RerunIfChanged":{"output":"release\\build\\serde_json-34511d4076957f0a\\output","paths":["build.rs"]}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/dep-lib-serde_json differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json new file mode 100644 index 000000000..583455c84 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json @@ -0,0 +1 @@ +8b4857d1983d9e3e \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json new file mode 100644 index 000000000..58d7ec2ae --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-35ecaa4d5c0425a5/lib-serde_json.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"alloc\", \"arbitrary_precision\", \"default\", \"float_roundtrip\", \"indexmap\", \"preserve_order\", \"raw_value\", \"std\", \"unbounded_depth\"]","target":8359091782433235722,"profile":14620777910751233144,"path":2458487559455832672,"deps":[[711435865661041740,"ryu",false,16209388659550488138],[7898347539352098708,"build_script_build",false,1526412639620906668],[8725461231676817087,"serde",false,14256704062966727943],[11284357528473424989,"itoa",false,17935759184978178317]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_json-35ecaa4d5c0425a5\\dep-lib-serde_json"}}],"rustflags":[],"metadata":16261601059619201932,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build new file mode 100644 index 000000000..15fcea46d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build @@ -0,0 +1 @@ +b05c3e65a350cf99 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json new file mode 100644 index 000000000..f9a7cd9ec --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"alloc\", \"arbitrary_precision\", \"default\", \"float_roundtrip\", \"indexmap\", \"preserve_order\", \"raw_value\", \"std\", \"unbounded_depth\"]","target":9652763411108993936,"profile":15621230377962148654,"path":12258895971109528893,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\serde_json-c8c997b6bb507ffb\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":16261601059619201932,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/serde_json-c8c997b6bb507ffb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/dep-lib-shlex differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex new file mode 100644 index 000000000..951f685d0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex @@ -0,0 +1 @@ +0acab837bff0dd70 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json new file mode 100644 index 000000000..ae1f99b86 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/shlex-ea16a86c0c46564c/lib-shlex.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":7253733235161264811,"profile":14620777910751233144,"path":3672257909783673666,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\shlex-ea16a86c0c46564c\\dep-lib-shlex"}}],"rustflags":[],"metadata":7790407099652797591,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/dep-lib-strsim differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim new file mode 100644 index 000000000..bec742a00 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim @@ -0,0 +1 @@ +d5a4ad6346767873 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json new file mode 100644 index 000000000..849adc6ea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/strsim-47e65bffce339b7c/lib-strsim.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":15476377186051897656,"profile":14620777910751233144,"path":10211663575747422092,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\strsim-47e65bffce339b7c\\dep-lib-strsim"}}],"rustflags":[],"metadata":6054696607313650198,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/dep-lib-syn differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn new file mode 100644 index 000000000..2868dd839 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn @@ -0,0 +1 @@ +4ab5ccc956d5bf67 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json new file mode 100644 index 000000000..3a3272ad1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/syn-12d6af9b5f3fc81f/lib-syn.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"clone-impls\", \"default\", \"derive\", \"full\", \"parsing\", \"printing\", \"proc-macro\"]","declared_features":"[\"clone-impls\", \"default\", \"derive\", \"extra-traits\", \"fold\", \"full\", \"parsing\", \"printing\", \"proc-macro\", \"test\", \"visit\", \"visit-mut\"]","target":9575650141617900057,"profile":15621230377962148654,"path":7624968525483162342,"deps":[[6268038585962339854,"proc_macro2",false,1306088528125123319],[10045147784146067611,"unicode_ident",false,4756046736092947349],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\syn-12d6af9b5f3fc81f\\dep-lib-syn"}}],"rustflags":[],"metadata":6886477143387768027,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/dep-lib-tempfile differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile new file mode 100644 index 000000000..f1104e793 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile @@ -0,0 +1 @@ +f2fad15096c65d9d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json new file mode 100644 index 000000000..d7ab73ecc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/tempfile-0b3d021dc4bc214f/lib-tempfile.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":8799845801769823640,"profile":14620777910751233144,"path":17590489710713848646,"deps":[[2452538001284770427,"cfg_if",false,11327479977420139569],[11426986729031771186,"windows_sys",false,2402317607190718502],[14873798182096859425,"fastrand",false,18367281618743225598]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\tempfile-0b3d021dc4bc214f\\dep-lib-tempfile"}}],"rustflags":[],"metadata":14511776352833078154,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/dep-lib-terminal_size differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size new file mode 100644 index 000000000..c45e24ed5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size @@ -0,0 +1 @@ +9e63962b72061127 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json new file mode 100644 index 000000000..a36827d28 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/terminal_size-d8da13be1d2595d3/lib-terminal_size.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":3625158601544720694,"profile":14620777910751233144,"path":14565831873911389629,"deps":[[796539694340413272,"windows_sys",false,15579394040051550770]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\terminal_size-d8da13be1d2595d3\\dep-lib-terminal_size"}}],"rustflags":[],"metadata":2052073116003689238,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build new file mode 100644 index 000000000..9667357f2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build @@ -0,0 +1 @@ +6d34c347abbd6ee1 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json new file mode 100644 index 000000000..ae3fbaa23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-3ff39ce20518c5bb/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[2298489633419329899,"build_script_build",false,14760573913178463397]],"local":[{"RerunIfChanged":{"output":"release\\build\\thiserror-3ff39ce20518c5bb\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/dep-lib-thiserror differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror new file mode 100644 index 000000000..d7da1bfb6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror @@ -0,0 +1 @@ +dea726436b339cf1 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json new file mode 100644 index 000000000..d267e4bb5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-425658935e0fef12/lib-thiserror.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13566008838928707361,"profile":14620777910751233144,"path":9515727956088141749,"deps":[[2298489633419329899,"build_script_build",false,16244129449312990317],[16248561059612021423,"thiserror_impl",false,15945805655279802359]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-425658935e0fef12\\dep-lib-thiserror"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build new file mode 100644 index 000000000..7f55f5d15 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build @@ -0,0 +1 @@ +5a0110aeceb43be8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json new file mode 100644 index 000000000..a079f1fa4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5eba0824802bec2c/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[2298489633419329899,"build_script_build",false,14760573913178463397]],"local":[{"RerunIfChanged":{"output":"release\\build\\thiserror-5eba0824802bec2c\\output","paths":["build/probe.rs"]}},{"RerunIfEnvChanged":{"var":"RUSTC_BOOTSTRAP","val":null}}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build new file mode 100644 index 000000000..18456fd10 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build @@ -0,0 +1 @@ +a55ce6e7c417d8cc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json new file mode 100644 index 000000000..bc844ec2c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9652763411108993936,"profile":15621230377962148654,"path":1643624833836974173,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-5ebc22fe453131cf\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-5ebc22fe453131cf/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/dep-lib-thiserror differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror new file mode 100644 index 000000000..98cf40aa7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror @@ -0,0 +1 @@ +5699580da15dbd6d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json new file mode 100644 index 000000000..3180a41a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-d4341c8e23adc184/lib-thiserror.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13566008838928707361,"profile":15621230377962148654,"path":9515727956088141749,"deps":[[2298489633419329899,"build_script_build",false,16734167640201757018],[16248561059612021423,"thiserror_impl",false,15945805655279802359]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-d4341c8e23adc184\\dep-lib-thiserror"}}],"rustflags":[],"metadata":11722078131081488174,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/dep-lib-thiserror_impl differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl new file mode 100644 index 000000000..53f176307 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl @@ -0,0 +1 @@ +f7175e4cc2e14add \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json new file mode 100644 index 000000000..108835ea6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/thiserror-impl-34371baa3f030dd6/lib-thiserror_impl.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":7998322611307123746,"profile":15621230377962148654,"path":11731557558515945928,"deps":[[6195451030748563610,"syn",false,7475928475187852618],[6268038585962339854,"proc_macro2",false,1306088528125123319],[14268468010440576439,"quote",false,420223261422515380]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\thiserror-impl-34371baa3f030dd6\\dep-lib-thiserror_impl"}}],"rustflags":[],"metadata":14048383283908260854,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/dep-lib-toml differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml new file mode 100644 index 000000000..1f4297933 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml @@ -0,0 +1 @@ +e2789a3b84e6b50a \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json new file mode 100644 index 000000000..7eaa57c4a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/toml-4390fb9a32c72b93/lib-toml.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"indexmap\", \"preserve_order\"]","target":7052376538844330470,"profile":14620777910751233144,"path":13621866931221248399,"deps":[[8725461231676817087,"serde",false,14256704062966727943]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\toml-4390fb9a32c72b93\\dep-lib-toml"}}],"rustflags":[],"metadata":13437692833141290973,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/dep-lib-topological_sort differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort new file mode 100644 index 000000000..64e5608b6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort @@ -0,0 +1 @@ +f7165d69a08ed82d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json new file mode 100644 index 000000000..a481c4322 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/topological-sort-954e09149dd7fd7b/lib-topological_sort.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":8419607349315859904,"profile":14620777910751233144,"path":12019008239578609725,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\topological-sort-954e09149dd7fd7b\\dep-lib-topological_sort"}}],"rustflags":[],"metadata":6640049001988003030,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/dep-lib-ucd_trie differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie new file mode 100644 index 000000000..ea5e6219a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie @@ -0,0 +1 @@ +7b1e8176b36e932b \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json new file mode 100644 index 000000000..45533d205 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-8190d4a172275685/lib-ucd_trie.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"std\"]","target":17450497857988850485,"profile":14620777910751233144,"path":3657472514363523696,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ucd-trie-8190d4a172275685\\dep-lib-ucd_trie"}}],"rustflags":[],"metadata":14294133660085481805,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/dep-lib-ucd_trie differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie new file mode 100644 index 000000000..a64ad222f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie @@ -0,0 +1 @@ +e617212f5e8c7d91 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json new file mode 100644 index 000000000..3ef18c20a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/ucd-trie-c2ba7767e740f24f/lib-ucd_trie.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"std\"]","declared_features":"[\"default\", \"std\"]","target":17450497857988850485,"profile":15621230377962148654,"path":3657472514363523696,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\ucd-trie-c2ba7767e740f24f\\dep-lib-ucd_trie"}}],"rustflags":[],"metadata":14294133660085481805,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/dep-lib-unicase differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase new file mode 100644 index 000000000..9e6808a26 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase @@ -0,0 +1 @@ +635aee6c72ae7069 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json new file mode 100644 index 000000000..f4cdd1c73 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-40efbf7a3440863e/lib-unicase.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":10930702956497216318,"profile":14620777910751233144,"path":12279451216006871042,"deps":[[15279721705773053031,"build_script_build",false,9797226499707884216]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicase-40efbf7a3440863e\\dep-lib-unicase"}}],"rustflags":[],"metadata":11494574314977672827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build new file mode 100644 index 000000000..24f309fbf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build @@ -0,0 +1 @@ +e7e5a08a56cd4247 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json new file mode 100644 index 000000000..309b59e29 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[\"nightly\"]","target":6423576478976419116,"profile":15621230377962148654,"path":2313569352815869628,"deps":[[16079472387499994964,"version_check",false,2242397727496318052]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicase-74eb6ba6e3627ded\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":11494574314977672827,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-74eb6ba6e3627ded/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build new file mode 100644 index 000000000..1c30da25d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build @@ -0,0 +1 @@ +b8d221f397bdf687 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json new file mode 100644 index 000000000..1b77fa655 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicase-eb09b06d620f301b/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[15279721705773053031,"build_script_build",false,5134892296732468711]],"local":[{"Precalculated":"2.7.0"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/dep-lib-unicode_ident differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident new file mode 100644 index 000000000..44e2d7d32 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident @@ -0,0 +1 @@ +95e3f9cf4edf0042 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json new file mode 100644 index 000000000..c6e80b965 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-ident-f819cb15e0d54fd0/lib-unicode_ident.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9052190789159163900,"profile":15621230377962148654,"path":7402503512054951311,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicode-ident-f819cb15e0d54fd0\\dep-lib-unicode_ident"}}],"rustflags":[],"metadata":1159190378059262574,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/dep-lib-unicode_width differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width new file mode 100644 index 000000000..f2405d55d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width @@ -0,0 +1 @@ +dd75d3e973a0ccc6 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json new file mode 100644 index 000000000..8f813e1e7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/unicode-width-a20fd1f1e08492a1/lib-unicode_width.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"compiler_builtins\", \"core\", \"default\", \"no_std\", \"rustc-dep-of-std\", \"std\"]","target":6958533458770397108,"profile":14620777910751233144,"path":15633698315167197624,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\unicode-width-a20fd1f1e08492a1\\dep-lib-unicode_width"}}],"rustflags":[],"metadata":2060532119256820226,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/dep-lib-utf8parse differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse new file mode 100644 index 000000000..840a3d191 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse @@ -0,0 +1 @@ +82e22aa25c9e64e2 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json new file mode 100644 index 000000000..17f474537 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/utf8parse-eacf8f0fce7f601b/lib-utf8parse.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"default\"]","declared_features":"[\"default\", \"nightly\"]","target":3575735390855902170,"profile":14620777910751233144,"path":10045008861054769558,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\utf8parse-eacf8f0fce7f601b\\dep-lib-utf8parse"}}],"rustflags":[],"metadata":10159711100463582988,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/dep-lib-version_check differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check new file mode 100644 index 000000000..aecb485a7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check @@ -0,0 +1 @@ +64ac8f38da981e1f \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json new file mode 100644 index 000000000..2c2d0d82b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/version_check-27170d7ff25bd291/lib-version_check.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":955292855784393095,"profile":15621230377962148654,"path":15863539904071868725,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\version_check-27170d7ff25bd291\\dep-lib-version_check"}}],"rustflags":[],"metadata":14847206692933921638,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/dep-lib-windows_sys differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys new file mode 100644 index 000000000..f92b68b23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys @@ -0,0 +1 @@ +26e844be22bf5621 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json new file mode 100644 index 000000000..89d692b88 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-0250448e5ea1b7e0/lib-windows_sys.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"Win32\", \"Win32_Foundation\", \"Win32_Storage\", \"Win32_Storage_FileSystem\", \"Win32_System\", \"Win32_System_Console\", \"Win32_UI\", \"Win32_UI_Shell\", \"Win32_UI_WindowsAndMessaging\", \"default\"]","declared_features":"[\"Wdk\", \"Wdk_Foundation\", \"Wdk_Graphics\", \"Wdk_Graphics_Direct3D\", \"Wdk_Storage\", \"Wdk_Storage_FileSystem\", \"Wdk_Storage_FileSystem_Minifilters\", \"Wdk_System\", \"Wdk_System_IO\", \"Wdk_System_OfflineRegistry\", \"Wdk_System_Registry\", \"Wdk_System_SystemInformation\", \"Wdk_System_SystemServices\", \"Wdk_System_Threading\", \"Win32\", \"Win32_Data\", \"Win32_Data_HtmlHelp\", \"Win32_Data_RightsManagement\", \"Win32_Devices\", \"Win32_Devices_AllJoyn\", \"Win32_Devices_BiometricFramework\", \"Win32_Devices_Bluetooth\", \"Win32_Devices_Communication\", \"Win32_Devices_DeviceAndDriverInstallation\", \"Win32_Devices_DeviceQuery\", \"Win32_Devices_Display\", \"Win32_Devices_Enumeration\", \"Win32_Devices_Enumeration_Pnp\", \"Win32_Devices_Fax\", \"Win32_Devices_HumanInterfaceDevice\", \"Win32_Devices_PortableDevices\", \"Win32_Devices_Properties\", \"Win32_Devices_Pwm\", \"Win32_Devices_Sensors\", \"Win32_Devices_SerialCommunication\", \"Win32_Devices_Tapi\", \"Win32_Devices_Usb\", \"Win32_Devices_WebServicesOnDevices\", \"Win32_Foundation\", \"Win32_Gaming\", \"Win32_Globalization\", \"Win32_Graphics\", \"Win32_Graphics_Dwm\", \"Win32_Graphics_Gdi\", \"Win32_Graphics_GdiPlus\", \"Win32_Graphics_Hlsl\", \"Win32_Graphics_OpenGL\", \"Win32_Graphics_Printing\", \"Win32_Graphics_Printing_PrintTicket\", \"Win32_Management\", \"Win32_Management_MobileDeviceManagementRegistration\", \"Win32_Media\", \"Win32_Media_Audio\", \"Win32_Media_DxMediaObjects\", \"Win32_Media_KernelStreaming\", \"Win32_Media_Multimedia\", \"Win32_Media_Streaming\", \"Win32_Media_WindowsMediaFormat\", \"Win32_NetworkManagement\", \"Win32_NetworkManagement_Dhcp\", \"Win32_NetworkManagement_Dns\", \"Win32_NetworkManagement_InternetConnectionWizard\", \"Win32_NetworkManagement_IpHelper\", \"Win32_NetworkManagement_Multicast\", \"Win32_NetworkManagement_Ndis\", \"Win32_NetworkManagement_NetBios\", \"Win32_NetworkManagement_NetManagement\", \"Win32_NetworkManagement_NetShell\", \"Win32_NetworkManagement_NetworkDiagnosticsFramework\", \"Win32_NetworkManagement_P2P\", \"Win32_NetworkManagement_QoS\", \"Win32_NetworkManagement_Rras\", \"Win32_NetworkManagement_Snmp\", \"Win32_NetworkManagement_WNet\", \"Win32_NetworkManagement_WebDav\", \"Win32_NetworkManagement_WiFi\", \"Win32_NetworkManagement_WindowsConnectionManager\", \"Win32_NetworkManagement_WindowsFilteringPlatform\", \"Win32_NetworkManagement_WindowsFirewall\", \"Win32_NetworkManagement_WindowsNetworkVirtualization\", \"Win32_Networking\", \"Win32_Networking_ActiveDirectory\", \"Win32_Networking_Clustering\", \"Win32_Networking_HttpServer\", \"Win32_Networking_Ldap\", \"Win32_Networking_WebSocket\", \"Win32_Networking_WinHttp\", \"Win32_Networking_WinInet\", \"Win32_Networking_WinSock\", \"Win32_Networking_WindowsWebServices\", \"Win32_Security\", \"Win32_Security_AppLocker\", \"Win32_Security_Authentication\", \"Win32_Security_Authentication_Identity\", \"Win32_Security_Authorization\", \"Win32_Security_Credentials\", \"Win32_Security_Cryptography\", \"Win32_Security_Cryptography_Catalog\", \"Win32_Security_Cryptography_Certificates\", \"Win32_Security_Cryptography_Sip\", \"Win32_Security_Cryptography_UI\", \"Win32_Security_DiagnosticDataQuery\", \"Win32_Security_DirectoryServices\", \"Win32_Security_EnterpriseData\", \"Win32_Security_ExtensibleAuthenticationProtocol\", \"Win32_Security_Isolation\", \"Win32_Security_LicenseProtection\", \"Win32_Security_NetworkAccessProtection\", \"Win32_Security_WinTrust\", \"Win32_Security_WinWlx\", \"Win32_Storage\", \"Win32_Storage_Cabinets\", \"Win32_Storage_CloudFilters\", \"Win32_Storage_Compression\", \"Win32_Storage_DistributedFileSystem\", \"Win32_Storage_FileHistory\", \"Win32_Storage_FileSystem\", \"Win32_Storage_Imapi\", \"Win32_Storage_IndexServer\", \"Win32_Storage_InstallableFileSystems\", \"Win32_Storage_IscsiDisc\", \"Win32_Storage_Jet\", \"Win32_Storage_Nvme\", \"Win32_Storage_OfflineFiles\", \"Win32_Storage_OperationRecorder\", \"Win32_Storage_Packaging\", \"Win32_Storage_Packaging_Appx\", \"Win32_Storage_ProjectedFileSystem\", \"Win32_Storage_StructuredStorage\", \"Win32_Storage_Vhd\", \"Win32_Storage_Xps\", \"Win32_System\", \"Win32_System_AddressBook\", \"Win32_System_Antimalware\", \"Win32_System_ApplicationInstallationAndServicing\", \"Win32_System_ApplicationVerifier\", \"Win32_System_ClrHosting\", \"Win32_System_Com\", \"Win32_System_Com_Marshal\", \"Win32_System_Com_StructuredStorage\", \"Win32_System_Com_Urlmon\", \"Win32_System_ComponentServices\", \"Win32_System_Console\", \"Win32_System_CorrelationVector\", \"Win32_System_DataExchange\", \"Win32_System_DeploymentServices\", \"Win32_System_DeveloperLicensing\", \"Win32_System_Diagnostics\", \"Win32_System_Diagnostics_Ceip\", \"Win32_System_Diagnostics_Debug\", \"Win32_System_Diagnostics_Debug_Extensions\", \"Win32_System_Diagnostics_Etw\", \"Win32_System_Diagnostics_ProcessSnapshotting\", \"Win32_System_Diagnostics_ToolHelp\", \"Win32_System_DistributedTransactionCoordinator\", \"Win32_System_Environment\", \"Win32_System_ErrorReporting\", \"Win32_System_EventCollector\", \"Win32_System_EventLog\", \"Win32_System_EventNotificationService\", \"Win32_System_GroupPolicy\", \"Win32_System_HostCompute\", \"Win32_System_HostComputeNetwork\", \"Win32_System_HostComputeSystem\", \"Win32_System_Hypervisor\", \"Win32_System_IO\", \"Win32_System_Iis\", \"Win32_System_Ioctl\", \"Win32_System_JobObjects\", \"Win32_System_Js\", \"Win32_System_Kernel\", \"Win32_System_LibraryLoader\", \"Win32_System_Mailslots\", \"Win32_System_Mapi\", \"Win32_System_Memory\", \"Win32_System_Memory_NonVolatile\", \"Win32_System_MessageQueuing\", \"Win32_System_MixedReality\", \"Win32_System_Ole\", \"Win32_System_PasswordManagement\", \"Win32_System_Performance\", \"Win32_System_Performance_HardwareCounterProfiling\", \"Win32_System_Pipes\", \"Win32_System_Power\", \"Win32_System_ProcessStatus\", \"Win32_System_Recovery\", \"Win32_System_Registry\", \"Win32_System_RemoteDesktop\", \"Win32_System_RemoteManagement\", \"Win32_System_RestartManager\", \"Win32_System_Restore\", \"Win32_System_Rpc\", \"Win32_System_Search\", \"Win32_System_Search_Common\", \"Win32_System_SecurityCenter\", \"Win32_System_Services\", \"Win32_System_SetupAndMigration\", \"Win32_System_Shutdown\", \"Win32_System_StationsAndDesktops\", \"Win32_System_SubsystemForLinux\", \"Win32_System_SystemInformation\", \"Win32_System_SystemServices\", \"Win32_System_Threading\", \"Win32_System_Time\", \"Win32_System_TpmBaseServices\", \"Win32_System_UserAccessLogging\", \"Win32_System_Variant\", \"Win32_System_VirtualDosMachines\", \"Win32_System_WindowsProgramming\", \"Win32_System_Wmi\", \"Win32_UI\", \"Win32_UI_Accessibility\", \"Win32_UI_ColorSystem\", \"Win32_UI_Controls\", \"Win32_UI_Controls_Dialogs\", \"Win32_UI_HiDpi\", \"Win32_UI_Input\", \"Win32_UI_Input_Ime\", \"Win32_UI_Input_KeyboardAndMouse\", \"Win32_UI_Input_Pointer\", \"Win32_UI_Input_Touch\", \"Win32_UI_Input_XboxController\", \"Win32_UI_InteractionContext\", \"Win32_UI_Magnification\", \"Win32_UI_Shell\", \"Win32_UI_Shell_PropertiesSystem\", \"Win32_UI_TabletPC\", \"Win32_UI_TextServices\", \"Win32_UI_WindowsAndMessaging\", \"Win32_Web\", \"Win32_Web_InternetExplorer\", \"default\", \"docs\"]","target":10970938565070083914,"profile":14620777910751233144,"path":10451393899590562539,"deps":[[9471768686618079862,"windows_targets",false,698127449752346759]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-sys-0250448e5ea1b7e0\\dep-lib-windows_sys"}}],"rustflags":[],"metadata":18220959856227839970,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/dep-lib-windows_sys differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys new file mode 100644 index 000000000..d733140c2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys @@ -0,0 +1 @@ +324a1c15562035d8 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json new file mode 100644 index 000000000..c8f52cb19 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-sys-c09311c24c04cdd1/lib-windows_sys.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[\"Win32\", \"Win32_Foundation\", \"Win32_System\", \"Win32_System_Console\", \"default\"]","declared_features":"[\"Wdk\", \"Wdk_System\", \"Wdk_System_OfflineRegistry\", \"Win32\", \"Win32_Data\", \"Win32_Data_HtmlHelp\", \"Win32_Data_RightsManagement\", \"Win32_Data_Xml\", \"Win32_Data_Xml_MsXml\", \"Win32_Data_Xml_XmlLite\", \"Win32_Devices\", \"Win32_Devices_AllJoyn\", \"Win32_Devices_BiometricFramework\", \"Win32_Devices_Bluetooth\", \"Win32_Devices_Communication\", \"Win32_Devices_DeviceAccess\", \"Win32_Devices_DeviceAndDriverInstallation\", \"Win32_Devices_DeviceQuery\", \"Win32_Devices_Display\", \"Win32_Devices_Enumeration\", \"Win32_Devices_Enumeration_Pnp\", \"Win32_Devices_Fax\", \"Win32_Devices_FunctionDiscovery\", \"Win32_Devices_Geolocation\", \"Win32_Devices_HumanInterfaceDevice\", \"Win32_Devices_ImageAcquisition\", \"Win32_Devices_PortableDevices\", \"Win32_Devices_Properties\", \"Win32_Devices_Pwm\", \"Win32_Devices_Sensors\", \"Win32_Devices_SerialCommunication\", \"Win32_Devices_Tapi\", \"Win32_Devices_Usb\", \"Win32_Devices_WebServicesOnDevices\", \"Win32_Foundation\", \"Win32_Gaming\", \"Win32_Globalization\", \"Win32_Graphics\", \"Win32_Graphics_Dwm\", \"Win32_Graphics_Gdi\", \"Win32_Graphics_Hlsl\", \"Win32_Graphics_OpenGL\", \"Win32_Graphics_Printing\", \"Win32_Graphics_Printing_PrintTicket\", \"Win32_Management\", \"Win32_Management_MobileDeviceManagementRegistration\", \"Win32_Media\", \"Win32_Media_Audio\", \"Win32_Media_Audio_Apo\", \"Win32_Media_Audio_DirectMusic\", \"Win32_Media_Audio_Endpoints\", \"Win32_Media_Audio_XAudio2\", \"Win32_Media_DeviceManager\", \"Win32_Media_DxMediaObjects\", \"Win32_Media_KernelStreaming\", \"Win32_Media_LibrarySharingServices\", \"Win32_Media_MediaPlayer\", \"Win32_Media_Multimedia\", \"Win32_Media_Speech\", \"Win32_Media_Streaming\", \"Win32_Media_WindowsMediaFormat\", \"Win32_NetworkManagement\", \"Win32_NetworkManagement_Dhcp\", \"Win32_NetworkManagement_Dns\", \"Win32_NetworkManagement_InternetConnectionWizard\", \"Win32_NetworkManagement_IpHelper\", \"Win32_NetworkManagement_MobileBroadband\", \"Win32_NetworkManagement_Multicast\", \"Win32_NetworkManagement_Ndis\", \"Win32_NetworkManagement_NetBios\", \"Win32_NetworkManagement_NetManagement\", \"Win32_NetworkManagement_NetShell\", \"Win32_NetworkManagement_NetworkDiagnosticsFramework\", \"Win32_NetworkManagement_NetworkPolicyServer\", \"Win32_NetworkManagement_P2P\", \"Win32_NetworkManagement_QoS\", \"Win32_NetworkManagement_Rras\", \"Win32_NetworkManagement_Snmp\", \"Win32_NetworkManagement_WNet\", \"Win32_NetworkManagement_WebDav\", \"Win32_NetworkManagement_WiFi\", \"Win32_NetworkManagement_WindowsConnectNow\", \"Win32_NetworkManagement_WindowsConnectionManager\", \"Win32_NetworkManagement_WindowsFilteringPlatform\", \"Win32_NetworkManagement_WindowsFirewall\", \"Win32_NetworkManagement_WindowsNetworkVirtualization\", \"Win32_Networking\", \"Win32_Networking_ActiveDirectory\", \"Win32_Networking_BackgroundIntelligentTransferService\", \"Win32_Networking_Clustering\", \"Win32_Networking_HttpServer\", \"Win32_Networking_Ldap\", \"Win32_Networking_NetworkListManager\", \"Win32_Networking_RemoteDifferentialCompression\", \"Win32_Networking_WebSocket\", \"Win32_Networking_WinHttp\", \"Win32_Networking_WinInet\", \"Win32_Networking_WinSock\", \"Win32_Networking_WindowsWebServices\", \"Win32_Security\", \"Win32_Security_AppLocker\", \"Win32_Security_Authentication\", \"Win32_Security_Authentication_Identity\", \"Win32_Security_Authentication_Identity_Provider\", \"Win32_Security_Authorization\", \"Win32_Security_Authorization_UI\", \"Win32_Security_ConfigurationSnapin\", \"Win32_Security_Credentials\", \"Win32_Security_Cryptography\", \"Win32_Security_Cryptography_Catalog\", \"Win32_Security_Cryptography_Certificates\", \"Win32_Security_Cryptography_Sip\", \"Win32_Security_Cryptography_UI\", \"Win32_Security_DiagnosticDataQuery\", \"Win32_Security_DirectoryServices\", \"Win32_Security_EnterpriseData\", \"Win32_Security_ExtensibleAuthenticationProtocol\", \"Win32_Security_Isolation\", \"Win32_Security_LicenseProtection\", \"Win32_Security_NetworkAccessProtection\", \"Win32_Security_Tpm\", \"Win32_Security_WinTrust\", \"Win32_Security_WinWlx\", \"Win32_Storage\", \"Win32_Storage_Cabinets\", \"Win32_Storage_CloudFilters\", \"Win32_Storage_Compression\", \"Win32_Storage_DataDeduplication\", \"Win32_Storage_DistributedFileSystem\", \"Win32_Storage_EnhancedStorage\", \"Win32_Storage_FileHistory\", \"Win32_Storage_FileServerResourceManager\", \"Win32_Storage_FileSystem\", \"Win32_Storage_Imapi\", \"Win32_Storage_IndexServer\", \"Win32_Storage_InstallableFileSystems\", \"Win32_Storage_IscsiDisc\", \"Win32_Storage_Jet\", \"Win32_Storage_OfflineFiles\", \"Win32_Storage_OperationRecorder\", \"Win32_Storage_Packaging\", \"Win32_Storage_Packaging_Appx\", \"Win32_Storage_Packaging_Opc\", \"Win32_Storage_ProjectedFileSystem\", \"Win32_Storage_StructuredStorage\", \"Win32_Storage_Vhd\", \"Win32_Storage_VirtualDiskService\", \"Win32_Storage_Vss\", \"Win32_Storage_Xps\", \"Win32_Storage_Xps_Printing\", \"Win32_System\", \"Win32_System_AddressBook\", \"Win32_System_Antimalware\", \"Win32_System_ApplicationInstallationAndServicing\", \"Win32_System_ApplicationVerifier\", \"Win32_System_AssessmentTool\", \"Win32_System_ClrHosting\", \"Win32_System_Com\", \"Win32_System_Com_CallObj\", \"Win32_System_Com_ChannelCredentials\", \"Win32_System_Com_Events\", \"Win32_System_Com_Marshal\", \"Win32_System_Com_StructuredStorage\", \"Win32_System_Com_UI\", \"Win32_System_Com_Urlmon\", \"Win32_System_ComponentServices\", \"Win32_System_Console\", \"Win32_System_Contacts\", \"Win32_System_CorrelationVector\", \"Win32_System_DataExchange\", \"Win32_System_DeploymentServices\", \"Win32_System_DesktopSharing\", \"Win32_System_DeveloperLicensing\", \"Win32_System_Diagnostics\", \"Win32_System_Diagnostics_Ceip\", \"Win32_System_Diagnostics_ClrProfiling\", \"Win32_System_Diagnostics_Debug\", \"Win32_System_Diagnostics_Debug_ActiveScript\", \"Win32_System_Diagnostics_Debug_Extensions\", \"Win32_System_Diagnostics_Etw\", \"Win32_System_Diagnostics_ProcessSnapshotting\", \"Win32_System_Diagnostics_ToolHelp\", \"Win32_System_DistributedTransactionCoordinator\", \"Win32_System_Environment\", \"Win32_System_ErrorReporting\", \"Win32_System_EventCollector\", \"Win32_System_EventLog\", \"Win32_System_EventNotificationService\", \"Win32_System_GroupPolicy\", \"Win32_System_HostCompute\", \"Win32_System_HostComputeNetwork\", \"Win32_System_HostComputeSystem\", \"Win32_System_Hypervisor\", \"Win32_System_IO\", \"Win32_System_Iis\", \"Win32_System_Ioctl\", \"Win32_System_JobObjects\", \"Win32_System_Js\", \"Win32_System_Kernel\", \"Win32_System_LibraryLoader\", \"Win32_System_Mailslots\", \"Win32_System_Mapi\", \"Win32_System_Memory\", \"Win32_System_Memory_NonVolatile\", \"Win32_System_MessageQueuing\", \"Win32_System_MixedReality\", \"Win32_System_Mmc\", \"Win32_System_Ole\", \"Win32_System_ParentalControls\", \"Win32_System_PasswordManagement\", \"Win32_System_Performance\", \"Win32_System_Performance_HardwareCounterProfiling\", \"Win32_System_Pipes\", \"Win32_System_Power\", \"Win32_System_ProcessStatus\", \"Win32_System_RealTimeCommunications\", \"Win32_System_Recovery\", \"Win32_System_Registry\", \"Win32_System_RemoteAssistance\", \"Win32_System_RemoteDesktop\", \"Win32_System_RemoteManagement\", \"Win32_System_RestartManager\", \"Win32_System_Restore\", \"Win32_System_Rpc\", \"Win32_System_Search\", \"Win32_System_Search_Common\", \"Win32_System_SecurityCenter\", \"Win32_System_ServerBackup\", \"Win32_System_Services\", \"Win32_System_SettingsManagementInfrastructure\", \"Win32_System_SetupAndMigration\", \"Win32_System_Shutdown\", \"Win32_System_StationsAndDesktops\", \"Win32_System_SubsystemForLinux\", \"Win32_System_SystemInformation\", \"Win32_System_SystemServices\", \"Win32_System_TaskScheduler\", \"Win32_System_Threading\", \"Win32_System_Time\", \"Win32_System_TpmBaseServices\", \"Win32_System_UpdateAgent\", \"Win32_System_UpdateAssessment\", \"Win32_System_UserAccessLogging\", \"Win32_System_VirtualDosMachines\", \"Win32_System_WindowsProgramming\", \"Win32_System_WindowsSync\", \"Win32_System_Wmi\", \"Win32_UI\", \"Win32_UI_Accessibility\", \"Win32_UI_Animation\", \"Win32_UI_ColorSystem\", \"Win32_UI_Controls\", \"Win32_UI_Controls_Dialogs\", \"Win32_UI_Controls_RichEdit\", \"Win32_UI_HiDpi\", \"Win32_UI_Input\", \"Win32_UI_Input_Ime\", \"Win32_UI_Input_Ink\", \"Win32_UI_Input_KeyboardAndMouse\", \"Win32_UI_Input_Pointer\", \"Win32_UI_Input_Radial\", \"Win32_UI_Input_Touch\", \"Win32_UI_Input_XboxController\", \"Win32_UI_InteractionContext\", \"Win32_UI_LegacyWindowsEnvironmentFeatures\", \"Win32_UI_Magnification\", \"Win32_UI_Notifications\", \"Win32_UI_Ribbon\", \"Win32_UI_Shell\", \"Win32_UI_Shell_Common\", \"Win32_UI_Shell_PropertiesSystem\", \"Win32_UI_TabletPC\", \"Win32_UI_TextServices\", \"Win32_UI_WindowsAndMessaging\", \"Win32_UI_Wpf\", \"Win32_Web\", \"Win32_Web_InternetExplorer\", \"default\"]","target":720495858719652558,"profile":14620777910751233144,"path":16538518685129205655,"deps":[[15728644107383952457,"windows_targets",false,9739022325496119877]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-sys-c09311c24c04cdd1\\dep-lib-windows_sys"}}],"rustflags":[],"metadata":18220959856227839970,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/dep-lib-windows_targets differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets new file mode 100644 index 000000000..7a76ef0dd --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets @@ -0,0 +1 @@ +4582cb9a34f52787 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json new file mode 100644 index 000000000..19892177a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-9b59cd7cb302eeeb/lib-windows_targets.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":10199564376537173956,"profile":14620777910751233144,"path":7907050857598292411,"deps":[[8929410241095451316,"windows_x86_64_msvc",false,7896345554832859366]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-targets-9b59cd7cb302eeeb\\dep-lib-windows_targets"}}],"rustflags":[],"metadata":8011173418319876128,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/dep-lib-windows_targets differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets new file mode 100644 index 000000000..cb615f5ea --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets @@ -0,0 +1 @@ +8720707a373fb009 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json new file mode 100644 index 000000000..61bf39bae --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows-targets-ee0dd0a48f337ab2/lib-windows_targets.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":16769798786527649118,"profile":6050125052452401304,"path":7899813761505066229,"deps":[[11729866763975256760,"windows_x86_64_msvc",false,9860051450649631827]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows-targets-ee0dd0a48f337ab2\\dep-lib-windows_targets"}}],"rustflags":[],"metadata":8011173418319876128,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/dep-lib-windows_x86_64_msvc differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc new file mode 100644 index 000000000..dcc9208c9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc @@ -0,0 +1 @@ +53dc0bb78df0d588 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json new file mode 100644 index 000000000..ac1f42cb0 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-545c587ad7bce300/lib-windows_x86_64_msvc.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":6538977724285316826,"profile":14620777910751233144,"path":7509326034823863656,"deps":[[11729866763975256760,"build_script_build",false,14365432987769844787]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-545c587ad7bce300\\dep-lib-windows_x86_64_msvc"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build new file mode 100644 index 000000000..dbaf7a95b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build @@ -0,0 +1 @@ +1771c47ab3cab990 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json new file mode 100644 index 000000000..32325a54b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":13708040221295731214,"profile":15621230377962148654,"path":17515961731087802770,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-5d46425dd2e5da20\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-5d46425dd2e5da20/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build new file mode 100644 index 000000000..1cb084fdf --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build @@ -0,0 +1 @@ +fb43de9b5b9608bc \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json new file mode 100644 index 000000000..59b895b2d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-650def7ca87b4585/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[8929410241095451316,"build_script_build",false,10428589284360745239]],"local":[{"Precalculated":"0.48.5"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build new file mode 100644 index 000000000..aa36cf126 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build @@ -0,0 +1 @@ +330b9359a8f28ddf \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json new file mode 100644 index 000000000..85761f674 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":9652763411108993936,"profile":15621230377962148654,"path":14474747062449499265,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-70e349852f013a19\\dep-build-script-build-script-build"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/dep-build-script-build-script-build differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-70e349852f013a19/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc new file mode 100644 index 000000000..1b1cb4d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/dep-lib-windows_x86_64_msvc differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc new file mode 100644 index 000000000..fedbe41f2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc @@ -0,0 +1 @@ +e6208c0b7274956d \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json new file mode 100644 index 000000000..cc142e69a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-75e68c161b8e137f/lib-windows_x86_64_msvc.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"[]","declared_features":"[]","target":18393560258677508838,"profile":14620777910751233144,"path":785411964834977431,"deps":[[8929410241095451316,"build_script_build",false,13549244799145362427]],"local":[{"CheckDepInfo":{"dep_info":"release\\.fingerprint\\windows_x86_64_msvc-75e68c161b8e137f\\dep-lib-windows_x86_64_msvc"}}],"rustflags":[],"metadata":3732427515522591159,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build new file mode 100644 index 000000000..c741e9e10 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build @@ -0,0 +1 @@ +3334b3e830455cc7 \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json new file mode 100644 index 000000000..6c2f4108b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/.fingerprint/windows_x86_64_msvc-9b6a2824b1c48b90/run-build-script-build-script-build.json @@ -0,0 +1 @@ +{"rustc":16073551614293250696,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[11729866763975256760,"build_script_build",false,16108798247045368627]],"local":[{"Precalculated":"0.52.5"}],"rustflags":[],"metadata":0,"config":0,"compile_kind":0} \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d new file mode 100644 index 000000000..efba8afe1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/out/anyhow.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\anyhow-4d9c79b21dc2e4f4\out\libanyhow.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\anyhow-4d9c79b21dc2e4f4\out\anyhow.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/output new file mode 100644 index 000000000..8125dde23 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/output @@ -0,0 +1,10 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP +cargo:rustc-check-cfg=cfg(anyhow_nightly_testing) +cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str) +cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of) +cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint) +cargo:rustc-check-cfg=cfg(doc_cfg) +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(std_backtrace) +cargo:rustc-cfg=std_backtrace diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output new file mode 100644 index 000000000..db08fce5b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\anyhow-4d9c79b21dc2e4f4\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-4d9c79b21dc2e4f4/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe new file mode 100644 index 000000000..d38d6d73b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d new file mode 100644 index 000000000..d69aaa867 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\anyhow-a7943f6b1836ace1\build_script_build-a7943f6b1836ace1.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\anyhow-a7943f6b1836ace1\build_script_build-a7943f6b1836ace1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe new file mode 100644 index 000000000..d38d6d73b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb new file mode 100644 index 000000000..62db6c387 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build-a7943f6b1836ace1.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb new file mode 100644 index 000000000..62db6c387 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/anyhow-a7943f6b1836ace1/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll new file mode 100644 index 000000000..f6b564817 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe0.ll @@ -0,0 +1,10 @@ +; ModuleID = 'probe0.1edfe1de8ca3130a-cgu.0' +source_filename = "probe0.1edfe1de8ca3130a-cgu.0" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +!llvm.module.flags = !{!0} +!llvm.ident = !{!1} + +!0 = !{i32 8, !"PIC Level", i32 2} +!1 = !{!"rustc version 1.81.0 (eeb90cda1 2024-09-04)"} diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll new file mode 100644 index 000000000..9da3a2648 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/out/probe1.ll @@ -0,0 +1,59 @@ +; ModuleID = 'probe1.cb05c354c6e25008-cgu.0' +source_filename = "probe1.cb05c354c6e25008-cgu.0" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +@alloc_f93507f8ba4b5780b14b2c2584609be0 = private unnamed_addr constant <{ [8 x i8] }> <{ [8 x i8] c"\00\00\00\00\00\00\F0?" }>, align 8 +@alloc_ef0a1f828f3393ef691f2705e817091c = private unnamed_addr constant <{ [8 x i8] }> <{ [8 x i8] c"\00\00\00\00\00\00\00@" }>, align 8 + +; core::f64::::total_cmp +; Function Attrs: inlinehint uwtable +define internal i8 @"_ZN4core3f6421_$LT$impl$u20$f64$GT$9total_cmp17hc4fc46b30fece0a3E"(ptr align 8 %self, ptr align 8 %other) unnamed_addr #0 { +start: + %right = alloca [8 x i8], align 8 + %left = alloca [8 x i8], align 8 + %self1 = load double, ptr %self, align 8 + %_4 = bitcast double %self1 to i64 + store i64 %_4, ptr %left, align 8 + %self2 = load double, ptr %other, align 8 + %_7 = bitcast double %self2 to i64 + store i64 %_7, ptr %right, align 8 + %_13 = load i64, ptr %left, align 8 + %_12 = ashr i64 %_13, 63 + %_10 = lshr i64 %_12, 1 + %0 = load i64, ptr %left, align 8 + %1 = xor i64 %0, %_10 + store i64 %1, ptr %left, align 8 + %_18 = load i64, ptr %right, align 8 + %_17 = ashr i64 %_18, 63 + %_15 = lshr i64 %_17, 1 + %2 = load i64, ptr %right, align 8 + %3 = xor i64 %2, %_15 + store i64 %3, ptr %right, align 8 + %_21 = load i64, ptr %left, align 8 + %_22 = load i64, ptr %right, align 8 + %4 = icmp sgt i64 %_21, %_22 + %5 = zext i1 %4 to i8 + %6 = icmp slt i64 %_21, %_22 + %7 = zext i1 %6 to i8 + %_0 = sub nsw i8 %5, %7 + ret i8 %_0 +} + +; probe1::probe +; Function Attrs: uwtable +define void @_ZN6probe15probe17h179cd2e73a721f32E() unnamed_addr #1 { +start: +; call core::f64::::total_cmp + %_1 = call i8 @"_ZN4core3f6421_$LT$impl$u20$f64$GT$9total_cmp17hc4fc46b30fece0a3E"(ptr align 8 @alloc_f93507f8ba4b5780b14b2c2584609be0, ptr align 8 @alloc_ef0a1f828f3393ef691f2705e817091c) + ret void +} + +attributes #0 = { inlinehint uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" } +attributes #1 = { uwtable "target-cpu"="x86-64" "target-features"="+cx16,+sse3,+sahf" } + +!llvm.module.flags = !{!0} +!llvm.ident = !{!1} + +!0 = !{i32 8, !"PIC Level", i32 2} +!1 = !{!"rustc version 1.81.0 (eeb90cda1 2024-09-04)"} diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/output new file mode 100644 index 000000000..67aa80016 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/output @@ -0,0 +1,2 @@ +cargo:rustc-cfg=has_total_cmp +cargo:rerun-if-changed=build.rs diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/root-output new file mode 100644 index 000000000..f3ce6287f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\num-traits-3a779ab4385ffbfb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-3a779ab4385ffbfb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe new file mode 100644 index 000000000..ca97bcd0d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d new file mode 100644 index 000000000..6eda35f01 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\num-traits-bdb3ab51b4bf54af\build_script_build-bdb3ab51b4bf54af.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\num-traits-bdb3ab51b4bf54af\build_script_build-bdb3ab51b4bf54af.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe new file mode 100644 index 000000000..ca97bcd0d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb new file mode 100644 index 000000000..d051704af Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build-bdb3ab51b4bf54af.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb new file mode 100644 index 000000000..d051704af Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/num-traits-bdb3ab51b4bf54af/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe new file mode 100644 index 000000000..86adbd6a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d new file mode 100644 index 000000000..071757e04 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\proc-macro2-41c4fef2c5039f31\build_script_build-41c4fef2c5039f31.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\proc-macro2-41c4fef2c5039f31\build_script_build-41c4fef2c5039f31.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe new file mode 100644 index 000000000..86adbd6a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb new file mode 100644 index 000000000..c515c872e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build-41c4fef2c5039f31.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb new file mode 100644 index 000000000..c515c872e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-41c4fef2c5039f31/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d new file mode 100644 index 000000000..c93ab3280 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/out/proc_macro2.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\proc-macro2-abd444bf5ded0fcb\out\libproc_macro2.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\proc-macro2-abd444bf5ded0fcb\out\proc_macro2.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/output new file mode 100644 index 000000000..a3cdc7c6a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/output @@ -0,0 +1,16 @@ +cargo:rustc-check-cfg=cfg(fuzzing) +cargo:rustc-check-cfg=cfg(no_is_available) +cargo:rustc-check-cfg=cfg(no_literal_byte_character) +cargo:rustc-check-cfg=cfg(no_literal_c_string) +cargo:rustc-check-cfg=cfg(no_source_text) +cargo:rustc-check-cfg=cfg(proc_macro_span) +cargo:rustc-check-cfg=cfg(procmacro2_backtrace) +cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing) +cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt) +cargo:rustc-check-cfg=cfg(randomize_layout) +cargo:rustc-check-cfg=cfg(span_locations) +cargo:rustc-check-cfg=cfg(super_unstable) +cargo:rustc-check-cfg=cfg(wrap_proc_macro) +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-cfg=wrap_proc_macro +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output new file mode 100644 index 000000000..adc926ddc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\proc-macro2-abd444bf5ded0fcb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/proc-macro2-abd444bf5ded0fcb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/output new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/root-output new file mode 100644 index 000000000..4ccf7fbe1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\pulldown-cmark-836fc1ac552be508\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-836fc1ac552be508/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe new file mode 100644 index 000000000..69e6a2a74 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d new file mode 100644 index 000000000..ef67a8f70 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\pulldown-cmark-b31e30fcf4858fe2\build_script_build-b31e30fcf4858fe2.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\pulldown-cmark-b31e30fcf4858fe2\build_script_build-b31e30fcf4858fe2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe new file mode 100644 index 000000000..69e6a2a74 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb new file mode 100644 index 000000000..c215d2392 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build-b31e30fcf4858fe2.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb new file mode 100644 index 000000000..c215d2392 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/pulldown-cmark-b31e30fcf4858fe2/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/output new file mode 100644 index 000000000..d5349a01a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/output @@ -0,0 +1,13 @@ +cargo:rerun-if-changed=build.rs +cargo:rustc-check-cfg=cfg(doc_cfg) +cargo:rustc-check-cfg=cfg(no_core_cstr) +cargo:rustc-check-cfg=cfg(no_core_num_saturating) +cargo:rustc-check-cfg=cfg(no_core_try_from) +cargo:rustc-check-cfg=cfg(no_float_copysign) +cargo:rustc-check-cfg=cfg(no_num_nonzero_signed) +cargo:rustc-check-cfg=cfg(no_relaxed_trait_bounds) +cargo:rustc-check-cfg=cfg(no_serde_derive) +cargo:rustc-check-cfg=cfg(no_std_atomic) +cargo:rustc-check-cfg=cfg(no_std_atomic64) +cargo:rustc-check-cfg=cfg(no_systemtime_checked_add) +cargo:rustc-check-cfg=cfg(no_target_has_atomic) diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/root-output new file mode 100644 index 000000000..2978d7405 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde-6aab536be2e6e903\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-6aab536be2e6e903/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build-script-build.exe new file mode 100644 index 000000000..98f86993f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d new file mode 100644 index 000000000..4bc540d76 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde-ff50484740259288\build_script_build-ff50484740259288.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde-ff50484740259288\build_script_build-ff50484740259288.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe new file mode 100644 index 000000000..98f86993f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb new file mode 100644 index 000000000..a8cb2ddbb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build-ff50484740259288.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build.pdb new file mode 100644 index 000000000..a8cb2ddbb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde-ff50484740259288/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/output new file mode 100644 index 000000000..da3588de6 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build.rs +cargo:rustc-check-cfg=cfg(limb_width_32) +cargo:rustc-check-cfg=cfg(limb_width_64) +cargo:rustc-cfg=limb_width_64 diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/root-output new file mode 100644 index 000000000..464d01418 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde_json-34511d4076957f0a\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-34511d4076957f0a/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe new file mode 100644 index 000000000..edfb11831 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d new file mode 100644 index 000000000..a18d7ecd3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde_json-c8c997b6bb507ffb\build_script_build-c8c997b6bb507ffb.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\serde_json-c8c997b6bb507ffb\build_script_build-c8c997b6bb507ffb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe new file mode 100644 index 000000000..edfb11831 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb new file mode 100644 index 000000000..a7410d197 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build-c8c997b6bb507ffb.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb new file mode 100644 index 000000000..a7410d197 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/serde_json-c8c997b6bb507ffb/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d new file mode 100644 index 000000000..484320b2d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/out/thiserror.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-3ff39ce20518c5bb\out\libthiserror.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-3ff39ce20518c5bb\out\thiserror.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/output new file mode 100644 index 000000000..3b23df4e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(thiserror_nightly_testing) +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/root-output new file mode 100644 index 000000000..41ed4cd52 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-3ff39ce20518c5bb\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-3ff39ce20518c5bb/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d new file mode 100644 index 000000000..2fe49d88f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/out/thiserror.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-5eba0824802bec2c\out\libthiserror.rmeta: build\probe.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-5eba0824802bec2c\out\thiserror.d: build\probe.rs + +build\probe.rs: + +# env-dep:RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/output new file mode 100644 index 000000000..3b23df4e1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/output @@ -0,0 +1,4 @@ +cargo:rerun-if-changed=build/probe.rs +cargo:rustc-check-cfg=cfg(error_generic_member_access) +cargo:rustc-check-cfg=cfg(thiserror_nightly_testing) +cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/root-output new file mode 100644 index 000000000..108f17588 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-5eba0824802bec2c\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5eba0824802bec2c/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe new file mode 100644 index 000000000..f970a1668 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d new file mode 100644 index 000000000..113c94f3d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-5ebc22fe453131cf\build_script_build-5ebc22fe453131cf.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\thiserror-5ebc22fe453131cf\build_script_build-5ebc22fe453131cf.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe new file mode 100644 index 000000000..f970a1668 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb new file mode 100644 index 000000000..a6208175f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build-5ebc22fe453131cf.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb new file mode 100644 index 000000000..a6208175f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/thiserror-5ebc22fe453131cf/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe new file mode 100644 index 000000000..996222eb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d new file mode 100644 index 000000000..5d51d237a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\unicase-74eb6ba6e3627ded\build_script_build-74eb6ba6e3627ded.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\unicase-74eb6ba6e3627ded\build_script_build-74eb6ba6e3627ded.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe new file mode 100644 index 000000000..996222eb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb new file mode 100644 index 000000000..d958a432b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build-74eb6ba6e3627ded.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb new file mode 100644 index 000000000..d958a432b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-74eb6ba6e3627ded/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/output new file mode 100644 index 000000000..c6738148c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/output @@ -0,0 +1,4 @@ +cargo:rustc-cfg=__unicase__iter_cmp +cargo:rustc-cfg=__unicase__default_hasher +cargo:rustc-cfg=__unicase__const_fns +cargo:rustc-cfg=__unicase__core_and_alloc diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/root-output new file mode 100644 index 000000000..f55011f2e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\unicase-eb09b06d620f301b\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/unicase-eb09b06d620f301b/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe new file mode 100644 index 000000000..c45920642 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d new file mode 100644 index 000000000..58e6e15f2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-5d46425dd2e5da20\build_script_build-5d46425dd2e5da20.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-5d46425dd2e5da20\build_script_build-5d46425dd2e5da20.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe new file mode 100644 index 000000000..c45920642 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb new file mode 100644 index 000000000..5f1a28a12 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build-5d46425dd2e5da20.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb new file mode 100644 index 000000000..5f1a28a12 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-5d46425dd2e5da20/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output new file mode 100644 index 000000000..6dae7dfb8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/output @@ -0,0 +1 @@ +cargo:rustc-link-search=native=C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\lib diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output new file mode 100644 index 000000000..93d5a91e2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-650def7ca87b4585\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-650def7ca87b4585/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe new file mode 100644 index 000000000..69e51b94e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build-script-build.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d new file mode 100644 index 000000000..4bafe598c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-70e349852f013a19\build_script_build-70e349852f013a19.exe: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-70e349852f013a19\build_script_build-70e349852f013a19.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\build.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe new file mode 100644 index 000000000..69e51b94e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb new file mode 100644 index 000000000..b5ab9cdb6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build-70e349852f013a19.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb new file mode 100644 index 000000000..b5ab9cdb6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-70e349852f013a19/build_script_build.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output new file mode 100644 index 000000000..e6011e8c4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/output @@ -0,0 +1 @@ +cargo:rustc-link-search=native=C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\lib diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output new file mode 100644 index 000000000..59c8c73b4 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/root-output @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\build\windows_x86_64_msvc-9b6a2824b1c48b90\out \ No newline at end of file diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/stderr b/rustbook-ru/packages/mdbook-trpl-note/target/release/build/windows_x86_64_msvc-9b6a2824b1c48b90/stderr new file mode 100644 index 000000000..e69de29bb diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d new file mode 100644 index 000000000..773900856 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/aho_corasick-9aecbe7599ed1c3c.d @@ -0,0 +1,35 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libaho_corasick-9aecbe7599ed1c3c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libaho_corasick-9aecbe7599ed1c3c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\aho_corasick-9aecbe7599ed1c3c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\ahocorasick.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\automaton.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\dfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\contiguous.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\nfa\noncontiguous.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\api.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\pattern.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\builder.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\teddy\generic.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\packed\vector.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\alphabet.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\byte_frequencies.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\debug.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\prefilter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\primitives.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\remapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\aho-corasick-1.1.3\src\util\special.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstream-680ff811fd8a5ff2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstream-680ff811fd8a5ff2.d new file mode 100644 index 000000000..7d4526b49 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstream-680ff811fd8a5ff2.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstream-680ff811fd8a5ff2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstream-680ff811fd8a5ff2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anstream-680ff811fd8a5ff2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\strip.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\adapter\wincon.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\stream.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\auto.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\strip.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstream-0.6.14\src\wincon.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle-546d425a429ba834.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle-546d425a429ba834.d new file mode 100644 index 000000000..643b57720 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle-546d425a429ba834.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle-546d425a429ba834.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle-546d425a429ba834.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anstyle-546d425a429ba834.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\color.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\effect.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\reset.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-1.0.7\src\style.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d new file mode 100644 index 000000000..e50a487c3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_parse-16a7ce764a60d6c5.d @@ -0,0 +1,11 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_parse-16a7ce764a60d6c5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_parse-16a7ce764a60d6c5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anstyle_parse-16a7ce764a60d6c5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\params.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\definitions.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-parse-0.2.4\src\state\table.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_query-55471d262361d969.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_query-55471d262361d969.d new file mode 100644 index 000000000..f34425514 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_query-55471d262361d969.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_query-55471d262361d969.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_query-55471d262361d969.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anstyle_query-55471d262361d969.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-query-1.0.3\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d new file mode 100644 index 000000000..dfeae7130 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anstyle_wincon-16d1f280e2db68d2.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_wincon-16d1f280e2db68d2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanstyle_wincon-16d1f280e2db68d2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anstyle_wincon-16d1f280e2db68d2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\ansi.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\stream.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anstyle-wincon-3.0.3\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anyhow-b7b3f7fb9b7594ea.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anyhow-b7b3f7fb9b7594ea.d new file mode 100644 index 000000000..5f5513fa8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/anyhow-b7b3f7fb9b7594ea.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanyhow-b7b3f7fb9b7594ea.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libanyhow-b7b3f7fb9b7594ea.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\anyhow-b7b3f7fb9b7594ea.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\backtrace.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\chain.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ensure.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\kind.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\ptr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\anyhow-1.0.86\src\wrapper.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/autocfg-ad0bff98703cb9e9.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/autocfg-ad0bff98703cb9e9.d new file mode 100644 index 000000000..ed4e40178 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/autocfg-ad0bff98703cb9e9.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libautocfg-ad0bff98703cb9e9.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libautocfg-ad0bff98703cb9e9.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\autocfg-ad0bff98703cb9e9.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\rustc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\autocfg-1.3.0\src\version.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/bitflags-11015e225f23efd0.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/bitflags-11015e225f23efd0.d new file mode 100644 index 000000000..8d2f41bf1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/bitflags-11015e225f23efd0.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libbitflags-11015e225f23efd0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libbitflags-11015e225f23efd0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\bitflags-11015e225f23efd0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\traits.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\public.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\internal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bitflags-2.5.0\src\external.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/cfg_if-8767b834a7308c67.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/cfg_if-8767b834a7308c67.d new file mode 100644 index 000000000..07644e541 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/cfg_if-8767b834a7308c67.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libcfg_if-8767b834a7308c67.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libcfg_if-8767b834a7308c67.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\cfg_if-8767b834a7308c67.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cfg-if-1.0.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/chrono-94fe39ff394230ed.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/chrono-94fe39ff394230ed.d new file mode 100644 index 000000000..fae89006f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/chrono-94fe39ff394230ed.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libchrono-94fe39ff394230ed.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libchrono-94fe39ff394230ed.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\chrono-94fe39ff394230ed.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\time_delta.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\date.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\datetime\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\formatting.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parsed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\scan.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\strftime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\format\locales.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\date\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\datetime\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\internals.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\isoweek.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\naive\time\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\fixed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\windows.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\local\win_bindings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\offset\utc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\round.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\weekday.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\month.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\chrono-0.4.38\src\traits.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap-9a0ba72745542e32.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap-9a0ba72745542e32.d new file mode 100644 index 000000000..749258792 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap-9a0ba72745542e32.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap-9a0ba72745542e32.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap-9a0ba72745542e32.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap-9a0ba72745542e32.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap-4.5.4\src\../examples/demo.md: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_builder-6b89262c860f8a32.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_builder-6b89262c860f8a32.d new file mode 100644 index 000000000..e92ccf96b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_builder-6b89262c860f8a32.d @@ -0,0 +1,61 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_builder-6b89262c860f8a32.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_builder-6b89262c860f8a32.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap_builder-6b89262c860f8a32.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\derive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\action.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\app_settings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_group.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_predicate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\arg_settings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\command.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\os_str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\possible_value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\range.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\resettable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styled_str.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_hint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\value_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\builder\styling.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\error\kind.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\arg_matcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\arg_matches.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\matched_arg.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\matches\value_source.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\validator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\parser\features\suggestions.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\mkeymap.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\help_template.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\usage.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\core.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\word_separators.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\output\textwrap\wrap_algorithms.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\any_value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\flat_set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\graph.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\id.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\str_to_bool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\util\color.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_builder-4.5.2\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_complete-a7ad4f06481b96eb.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_complete-a7ad4f06481b96eb.d new file mode 100644 index 000000000..a5270eb9e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_complete-a7ad4f06481b96eb.d @@ -0,0 +1,18 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_complete-a7ad4f06481b96eb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_complete-a7ad4f06481b96eb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap_complete-a7ad4f06481b96eb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\generator\utils.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\bash.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\elvish.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\fish.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\powershell.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\shell.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\shells\zsh.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_complete-4.5.2\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.d new file mode 100644 index 000000000..251617766 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.d @@ -0,0 +1,21 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap_derive-928f3257cb5195d6.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap_derive-928f3257cb5195d6.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\args.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\into_app.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\subcommand.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\derives\value_enum.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\dummies.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\item.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\doc_comments.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\spanned.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\utils\ty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_derive-4.5.4\src\../README.md: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll new file mode 100644 index 000000000..b0868234e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp new file mode 100644 index 000000000..74f3fdb9a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib new file mode 100644 index 000000000..16c236101 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.pdb new file mode 100644 index 000000000..5f4296b57 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_derive-928f3257cb5195d6.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_lex-27c5293d8d8c133a.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_lex-27c5293d8d8c133a.d new file mode 100644 index 000000000..a421897e9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/clap_lex-27c5293d8d8c133a.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_lex-27c5293d8d8c133a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libclap_lex-27c5293d8d8c133a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\clap_lex-27c5293d8d8c133a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\clap_lex-0.7.0\src\ext.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/colorchoice-6846e899ff583e3a.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/colorchoice-6846e899ff583e3a.d new file mode 100644 index 000000000..7ce852674 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/colorchoice-6846e899ff583e3a.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libcolorchoice-6846e899ff583e3a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libcolorchoice-6846e899ff583e3a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\colorchoice-6846e899ff583e3a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\colorchoice-1.0.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_filter-e93210b2aeb1774d.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_filter-e93210b2aeb1774d.d new file mode 100644 index 000000000..dbcf719f7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_filter-e93210b2aeb1774d.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libenv_filter-e93210b2aeb1774d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libenv_filter-e93210b2aeb1774d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\env_filter-e93210b2aeb1774d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\directive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\filtered_log.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\op.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_filter-0.1.0\src\parser.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_logger-1ad5f95231033016.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_logger-1ad5f95231033016.d new file mode 100644 index 000000000..127bf1a8a --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/env_logger-1ad5f95231033016.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libenv_logger-1ad5f95231033016.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libenv_logger-1ad5f95231033016.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\env_logger-1ad5f95231033016.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\logger.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\humantime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\env_logger-0.11.3\src\fmt\writer\target.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/fastrand-857f7a2c79d6103e.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/fastrand-857f7a2c79d6103e.d new file mode 100644 index 000000000..2c249f035 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/fastrand-857f7a2c79d6103e.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libfastrand-857f7a2c79d6103e.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libfastrand-857f7a2c79d6103e.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\fastrand-857f7a2c79d6103e.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fastrand-2.1.0\src\global_rng.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/getopts-d5410df6c2bb16c4.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/getopts-d5410df6c2bb16c4.d new file mode 100644 index 000000000..7c6ba1683 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/getopts-d5410df6c2bb16c4.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libgetopts-d5410df6c2bb16c4.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libgetopts-d5410df6c2bb16c4.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\getopts-d5410df6c2bb16c4.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getopts-0.2.21\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/handlebars-4ecd7c29e70ab3a9.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/handlebars-4ecd7c29e70ab3a9.d new file mode 100644 index 000000000..743d2ecc5 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/handlebars-4ecd7c29e70ab3a9.d @@ -0,0 +1,36 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libhandlebars-4ecd7c29e70ab3a9.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libhandlebars-4ecd7c29e70ab3a9.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\handlebars-4ecd7c29e70ab3a9.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\block.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\context.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\decorators\inline.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\grammar.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\block_util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_each.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_extras.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_if.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_log.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_lookup.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_raw.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\helpers\helper_with.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\path.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\json\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\local_vars.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\output.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\partial.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\registry.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\render.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\sources.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\support.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\template.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src\util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\handlebars-5.1.2\src/grammar.pest: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/heck-7178f53dab92b944.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/heck-7178f53dab92b944.d new file mode 100644 index 000000000..3fb07fcd1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/heck-7178f53dab92b944.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libheck-7178f53dab92b944.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libheck-7178f53dab92b944.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\heck-7178f53dab92b944.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\kebab.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\lower_camel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_kebab.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\shouty_snake.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\snake.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\title.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\train.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\heck-0.5.0\src\upper_camel.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/humantime-992fbb70b5bd7874.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/humantime-992fbb70b5bd7874.d new file mode 100644 index 000000000..419079d81 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/humantime-992fbb70b5bd7874.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libhumantime-992fbb70b5bd7874.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libhumantime-992fbb70b5bd7874.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\humantime-992fbb70b5bd7874.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\duration.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\wrapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\humantime-2.1.0\src\date.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/is_terminal_polyfill-e2c161c489984045.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/is_terminal_polyfill-e2c161c489984045.d new file mode 100644 index 000000000..0dfeb35bb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/is_terminal_polyfill-e2c161c489984045.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libis_terminal_polyfill-e2c161c489984045.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libis_terminal_polyfill-e2c161c489984045.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\is_terminal_polyfill-e2c161c489984045.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is_terminal_polyfill-1.70.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/itoa-32b3647f851aaeb2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/itoa-32b3647f851aaeb2.d new file mode 100644 index 000000000..1425d84be --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/itoa-32b3647f851aaeb2.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libitoa-32b3647f851aaeb2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libitoa-32b3647f851aaeb2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\itoa-32b3647f851aaeb2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\itoa-1.0.11\src\udiv128.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib new file mode 100644 index 000000000..61ff00220 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta new file mode 100644 index 000000000..e4f739d09 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libaho_corasick-9aecbe7599ed1c3c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rlib new file mode 100644 index 000000000..b3130754d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta new file mode 100644 index 000000000..858940287 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstream-680ff811fd8a5ff2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rlib new file mode 100644 index 000000000..4ed539ca1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rmeta new file mode 100644 index 000000000..dabf7126b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle-546d425a429ba834.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib new file mode 100644 index 000000000..964ad13cc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta new file mode 100644 index 000000000..6a911271a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_parse-16a7ce764a60d6c5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rlib new file mode 100644 index 000000000..34234ce7d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rmeta new file mode 100644 index 000000000..97e21fc04 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_query-55471d262361d969.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib new file mode 100644 index 000000000..eeb5170b8 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta new file mode 100644 index 000000000..b3607a524 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanstyle_wincon-16d1f280e2db68d2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib new file mode 100644 index 000000000..ec584b4a6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta new file mode 100644 index 000000000..5d8741e2b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libanyhow-b7b3f7fb9b7594ea.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib new file mode 100644 index 000000000..266adbf71 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta new file mode 100644 index 000000000..34b0fb9a9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libautocfg-ad0bff98703cb9e9.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rlib new file mode 100644 index 000000000..44461c7bc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rmeta new file mode 100644 index 000000000..5db6c47e9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libbitflags-11015e225f23efd0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rlib new file mode 100644 index 000000000..8b5942786 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rmeta new file mode 100644 index 000000000..7af27c0bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcfg_if-8767b834a7308c67.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rlib new file mode 100644 index 000000000..788509b98 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rmeta new file mode 100644 index 000000000..020505c43 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libchrono-94fe39ff394230ed.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rlib new file mode 100644 index 000000000..67eaaa018 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rmeta new file mode 100644 index 000000000..ec5461699 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap-9a0ba72745542e32.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rlib new file mode 100644 index 000000000..09119dc10 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta new file mode 100644 index 000000000..ec879f820 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_builder-6b89262c860f8a32.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib new file mode 100644 index 000000000..9fec26c7c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta new file mode 100644 index 000000000..93b0aab62 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_complete-a7ad4f06481b96eb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib new file mode 100644 index 000000000..18d32e4b1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta new file mode 100644 index 000000000..53b338e0a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libclap_lex-27c5293d8d8c133a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib new file mode 100644 index 000000000..f1489b68e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta new file mode 100644 index 000000000..28f5e69ef Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libcolorchoice-6846e899ff583e3a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib new file mode 100644 index 000000000..58c54f39c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta new file mode 100644 index 000000000..d0a6134b9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_filter-e93210b2aeb1774d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rlib new file mode 100644 index 000000000..5431ca007 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rmeta new file mode 100644 index 000000000..559707fff Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libenv_logger-1ad5f95231033016.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rlib new file mode 100644 index 000000000..b86c4ccb9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta new file mode 100644 index 000000000..4f51edc2d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libfastrand-857f7a2c79d6103e.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib new file mode 100644 index 000000000..c0a2b6822 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta new file mode 100644 index 000000000..d1d4d234a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libgetopts-d5410df6c2bb16c4.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib new file mode 100644 index 000000000..56b477f09 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta new file mode 100644 index 000000000..7db200062 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhandlebars-4ecd7c29e70ab3a9.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rlib new file mode 100644 index 000000000..6f97dfe03 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rmeta new file mode 100644 index 000000000..a3a7dac6a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libheck-7178f53dab92b944.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rlib new file mode 100644 index 000000000..abbccdaf0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta new file mode 100644 index 000000000..231610300 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libhumantime-992fbb70b5bd7874.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib new file mode 100644 index 000000000..650eb7bad Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta new file mode 100644 index 000000000..e60d9c418 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libis_terminal_polyfill-e2c161c489984045.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rlib new file mode 100644 index 000000000..de349b52f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rmeta new file mode 100644 index 000000000..72400adb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libitoa-32b3647f851aaeb2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rlib new file mode 100644 index 000000000..44c6b6185 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rmeta new file mode 100644 index 000000000..ee7ba2ff6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/liblog-df458d1cd0ebed3f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rlib new file mode 100644 index 000000000..bdb5e8961 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rmeta new file mode 100644 index 000000000..27fbe4a40 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook-9ae3392d0139d616.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rlib new file mode 100644 index 000000000..0285c7e3b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rmeta new file mode 100644 index 000000000..194f3b7d6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmdbook_trpl_note-735ac6387a7505cf.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rlib new file mode 100644 index 000000000..0f82c96be Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rmeta new file mode 100644 index 000000000..965ca4803 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-45e54b823ffb518a.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rlib new file mode 100644 index 000000000..818b98b6b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta new file mode 100644 index 000000000..049f535a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libmemchr-cde140c03a14d1ce.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rlib new file mode 100644 index 000000000..246af1d45 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta new file mode 100644 index 000000000..4a567c35c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnormpath-47b4ab670cf56a60.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib new file mode 100644 index 000000000..557799c22 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta new file mode 100644 index 000000000..f3795449e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libnum_traits-2ab4e4646f31cfc5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rlib new file mode 100644 index 000000000..1995962c5 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rmeta new file mode 100644 index 000000000..e5620de04 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-329334a68b89c051.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rlib new file mode 100644 index 000000000..a1deb024a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta new file mode 100644 index 000000000..7a0557d33 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libonce_cell-c7131045f0e2879d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rlib new file mode 100644 index 000000000..9d2bf6f76 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rmeta new file mode 100644 index 000000000..54f76ea34 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libopener-fb4b019db89ff6eb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rlib new file mode 100644 index 000000000..6b0fa8d44 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rmeta new file mode 100644 index 000000000..32948d77f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-27ca771d143da417.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rlib new file mode 100644 index 000000000..aed40d578 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rmeta new file mode 100644 index 000000000..ec3205bfc Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest-ea7293ce37f9767d.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib new file mode 100644 index 000000000..f9ffe26a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta new file mode 100644 index 000000000..eaa12cc19 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_generator-da91aa5eeb32f21b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rlib new file mode 100644 index 000000000..ee16a819c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rmeta new file mode 100644 index 000000000..7e723cde0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpest_meta-936776a91fcba81c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib new file mode 100644 index 000000000..d6c8914b8 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta new file mode 100644 index 000000000..f87909bbf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libproc_macro2-1db249c7677aa3b4.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib new file mode 100644 index 000000000..245f8375d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta new file mode 100644 index 000000000..b59352438 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark-eda9ab09dbea3888.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib new file mode 100644 index 000000000..28b9adf9d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta new file mode 100644 index 000000000..d8f8c514b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_escape-c86762f688315946.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib new file mode 100644 index 000000000..d58e3a7d9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta new file mode 100644 index 000000000..147b9f9ef Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rlib new file mode 100644 index 000000000..002f4dab0 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rmeta new file mode 100644 index 000000000..ec82757ec Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libquote-b86bb00919ad5197.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rlib new file mode 100644 index 000000000..867548cea Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rmeta new file mode 100644 index 000000000..414180758 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex-303fd43f683d0d9c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rlib new file mode 100644 index 000000000..abdf214b4 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta new file mode 100644 index 000000000..ea07e130a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_automata-efbc972b30a2e580.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib new file mode 100644 index 000000000..e6249354a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta new file mode 100644 index 000000000..f2682a887 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libregex_syntax-f10560a1d1b78872.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rlib new file mode 100644 index 000000000..6eed4e1bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rmeta new file mode 100644 index 000000000..96a4d88ff Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libryu-2defaf88560c9d34.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rlib new file mode 100644 index 000000000..0728d5ace Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rmeta new file mode 100644 index 000000000..ff60fc3cf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde-6797ee67eb9fc526.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib new file mode 100644 index 000000000..57e9d940b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta new file mode 100644 index 000000000..48076cbdf Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libserde_json-35ecaa4d5c0425a5.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rlib new file mode 100644 index 000000000..b36d96def Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rmeta new file mode 100644 index 000000000..a2b556070 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libshlex-ea16a86c0c46564c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rlib new file mode 100644 index 000000000..bcf6be24d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rmeta new file mode 100644 index 000000000..50bd96e99 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libstrsim-47e65bffce339b7c.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib new file mode 100644 index 000000000..b42844260 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta new file mode 100644 index 000000000..aa0ab7cdb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libsyn-12d6af9b5f3fc81f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib new file mode 100644 index 000000000..47a931856 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta new file mode 100644 index 000000000..d401f54f6 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtempfile-0b3d021dc4bc214f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib new file mode 100644 index 000000000..258675444 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta new file mode 100644 index 000000000..896e45d99 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libterminal_size-d8da13be1d2595d3.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rlib new file mode 100644 index 000000000..50b34ed73 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rmeta new file mode 100644 index 000000000..bbba9c320 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-425658935e0fef12.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rlib new file mode 100644 index 000000000..9e2766a85 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rmeta new file mode 100644 index 000000000..d23101a24 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libthiserror-d4341c8e23adc184.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rlib new file mode 100644 index 000000000..5ecaa16bb Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rmeta new file mode 100644 index 000000000..8a4665297 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtoml-4390fb9a32c72b93.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib new file mode 100644 index 000000000..4ac6a8e39 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta new file mode 100644 index 000000000..96e49fad9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libtopological_sort-954e09149dd7fd7b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rlib new file mode 100644 index 000000000..fc7ca3a6a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rmeta new file mode 100644 index 000000000..06603a05d Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-8190d4a172275685.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib new file mode 100644 index 000000000..a724c3962 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta new file mode 100644 index 000000000..3ee3388dd Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libucd_trie-c2ba7767e740f24f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rlib new file mode 100644 index 000000000..5dddaa772 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rmeta new file mode 100644 index 000000000..56410594c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicase-40efbf7a3440863e.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib new file mode 100644 index 000000000..5e39d836f Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta new file mode 100644 index 000000000..8fd14cd89 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_ident-f819cb15e0d54fd0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib new file mode 100644 index 000000000..c30253dde Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta new file mode 100644 index 000000000..c18d07716 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libunicode_width-a20fd1f1e08492a1.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib new file mode 100644 index 000000000..b6aad784e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta new file mode 100644 index 000000000..7318e5eca Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libutf8parse-eacf8f0fce7f601b.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rlib new file mode 100644 index 000000000..e731fceab Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rmeta new file mode 100644 index 000000000..2de6e43d7 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libversion_check-27170d7ff25bd291.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib new file mode 100644 index 000000000..afc5ebe9e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta new file mode 100644 index 000000000..51bdd5e69 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-0250448e5ea1b7e0.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib new file mode 100644 index 000000000..0dca3949c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta new file mode 100644 index 000000000..83313bb06 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_sys-c09311c24c04cdd1.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib new file mode 100644 index 000000000..461c2f4b1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta new file mode 100644 index 000000000..f04356a1e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-9b59cd7cb302eeeb.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib new file mode 100644 index 000000000..62222bbb1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta new file mode 100644 index 000000000..f1216ded4 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_targets-ee0dd0a48f337ab2.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib new file mode 100644 index 000000000..5df526a32 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta new file mode 100644 index 000000000..d91b90703 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-545c587ad7bce300.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib new file mode 100644 index 000000000..3762eaf3e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta new file mode 100644 index 000000000..068e288a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/libwindows_x86_64_msvc-75e68c161b8e137f.rmeta differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/log-df458d1cd0ebed3f.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/log-df458d1cd0ebed3f.d new file mode 100644 index 000000000..7225d72ca --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/log-df458d1cd0ebed3f.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\liblog-df458d1cd0ebed3f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\liblog-df458d1cd0ebed3f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\log-df458d1cd0ebed3f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\serde.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\log-0.4.21\src\__private_api.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook-9ae3392d0139d616.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook-9ae3392d0139d616.d new file mode 100644 index 000000000..411c5fa36 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook-9ae3392d0139d616.d @@ -0,0 +1,75 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmdbook-9ae3392d0139d616.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmdbook-9ae3392d0139d616.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\mdbook-9ae3392d0139d616.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2 C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\book.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\init.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\book\summary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\config.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\cmd.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\preprocess\links.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\hbs_renderer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\navigation.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\theme.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\html_handlebars\helpers\toc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\renderer\markdown_renderer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\fs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\utils\toml_ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\editor.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\ace.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\mode-rust.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-dawn.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\playground_editor\theme-tomorrow_night.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\fonts.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\OPEN-SANS-LICENSE.txt: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\SOURCE-CODE-PRO-LICENSE.txt: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-300italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-regular.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-600italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-700italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\open-sans-v17-all-charsets-800italic.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\fonts\source-code-pro-v11-all-charsets-500.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\index.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\head.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\redirect.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\header.hbs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/chrome.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/general.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/print.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\css/variables.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.png: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\favicon.svg: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\book.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\tomorrow-night.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\highlight.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\ayu-highlight.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\clipboard.min.js: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/css/font-awesome.min.css: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.eot: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.svg: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.ttf: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/fontawesome-webfont.woff2: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\mdbook-0.4.40\src\theme\FontAwesome/fonts/FontAwesome.otf: + +# env-dep:CARGO_PKG_VERSION=0.4.40 diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note-735ac6387a7505cf.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note-735ac6387a7505cf.d new file mode 100644 index 000000000..55d80ca06 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note-735ac6387a7505cf.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmdbook_trpl_note-735ac6387a7505cf.rmeta: src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmdbook_trpl_note-735ac6387a7505cf.rlib: src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\mdbook_trpl_note-735ac6387a7505cf.d: src\lib.rs + +src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.d new file mode 100644 index 000000000..d5a86bb67 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\mdbook_trpl_note.exe: src/main.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\mdbook_trpl_note.d: src/main.rs + +src/main.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.exe new file mode 100644 index 000000000..b88464b2a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.pdb new file mode 100644 index 000000000..c89341a12 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/mdbook_trpl_note.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-45e54b823ffb518a.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-45e54b823ffb518a.d new file mode 100644 index 000000000..56cf3ef2e --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-45e54b823ffb518a.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmemchr-45e54b823ffb518a.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmemchr-45e54b823ffb518a.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\memchr-45e54b823ffb518a.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-cde140c03a14d1ce.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-cde140c03a14d1ce.d new file mode 100644 index 000000000..3fd60e65c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/memchr-cde140c03a14d1ce.d @@ -0,0 +1,33 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmemchr-cde140c03a14d1ce.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libmemchr-cde140c03a14d1ce.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\memchr-cde140c03a14d1ce.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\packedpair\default_rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\rabinkarp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\shiftor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\all\twoway.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\generic\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\avx2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\sse2\packedpair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\arch\x86_64\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\cow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\memmem\searcher.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\memchr-2.7.2\src\vector.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/normpath-47b4ab670cf56a60.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/normpath-47b4ab670cf56a60.d new file mode 100644 index 000000000..03bd55a83 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/normpath-47b4ab670cf56a60.d @@ -0,0 +1,12 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libnormpath-47b4ab670cf56a60.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libnormpath-47b4ab670cf56a60.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\normpath-47b4ab670cf56a60.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\base.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\cmp.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\normpath-1.2.0\src\windows\normalize.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/num_traits-2ab4e4646f31cfc5.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/num_traits-2ab4e4646f31cfc5.d new file mode 100644 index 000000000..91a9e15f7 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/num_traits-2ab4e4646f31cfc5.d @@ -0,0 +1,25 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libnum_traits-2ab4e4646f31cfc5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libnum_traits-2ab4e4646f31cfc5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\num_traits-2ab4e4646f31cfc5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\bounds.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\cast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\float.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\identities.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\checked.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\euclid.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\inv.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\mul_add.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\overflowing.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\saturating.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\ops\wrapping.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\pow.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\real.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\num-traits-0.2.19\src\sign.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-329334a68b89c051.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-329334a68b89c051.d new file mode 100644 index 000000000..9e3b7ad51 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-329334a68b89c051.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libonce_cell-329334a68b89c051.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libonce_cell-329334a68b89c051.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\once_cell-329334a68b89c051.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-c7131045f0e2879d.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-c7131045f0e2879d.d new file mode 100644 index 000000000..1b1fba465 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/once_cell-c7131045f0e2879d.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libonce_cell-c7131045f0e2879d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libonce_cell-c7131045f0e2879d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\once_cell-c7131045f0e2879d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\imp_std.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.19.0\src\race.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/opener-fb4b019db89ff6eb.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/opener-fb4b019db89ff6eb.d new file mode 100644 index 000000000..5e9b90f40 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/opener-fb4b019db89ff6eb.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libopener-fb4b019db89ff6eb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libopener-fb4b019db89ff6eb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\opener-fb4b019db89ff6eb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\opener-0.7.1\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-27ca771d143da417.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-27ca771d143da417.d new file mode 100644 index 000000000..cfc6efb24 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-27ca771d143da417.d @@ -0,0 +1,28 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest-27ca771d143da417.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest-27ca771d143da417.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest-27ca771d143da417.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-ea7293ce37f9767d.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-ea7293ce37f9767d.d new file mode 100644 index 000000000..55c121d9b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest-ea7293ce37f9767d.d @@ -0,0 +1,28 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest-ea7293ce37f9767d.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest-ea7293ce37f9767d.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest-ea7293ce37f9767d.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\flat_pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\line_index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pair.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\pairs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\queueable_token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\iterators\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\parser_state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\position.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\pratt_parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\prec_climber.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\stack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\binary.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest-2.7.10\src\unicode\script.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.d new file mode 100644 index 000000000..2cf4df716 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.d @@ -0,0 +1,5 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest_derive-f971c62ee19a3cff.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest_derive-f971c62ee19a3cff.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_derive-2.7.10\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll new file mode 100644 index 000000000..e2bbf3b32 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp new file mode 100644 index 000000000..f9645ec0e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib new file mode 100644 index 000000000..7e1fa93a2 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.pdb new file mode 100644 index 000000000..94d643e4a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_derive-f971c62ee19a3cff.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_generator-da91aa5eeb32f21b.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_generator-da91aa5eeb32f21b.d new file mode 100644 index 000000000..fb102e996 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_generator-da91aa5eeb32f21b.d @@ -0,0 +1,11 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest_generator-da91aa5eeb32f21b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest_generator-da91aa5eeb32f21b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest_generator-da91aa5eeb32f21b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\docs.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\generator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_generator-2.7.10\src\parse_derive.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_meta-936776a91fcba81c.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_meta-936776a91fcba81c.d new file mode 100644 index 000000000..70c29af6b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pest_meta-936776a91fcba81c.d @@ -0,0 +1,19 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest_meta-936776a91fcba81c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpest_meta-936776a91fcba81c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pest_meta-936776a91fcba81c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\concatenator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\factorizer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\lister.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\restorer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\rotater.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\skipper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\optimizer\unroller.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\validator.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pest_meta-2.7.10\src\grammar.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/proc_macro2-1db249c7677aa3b4.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/proc_macro2-1db249c7677aa3b4.d new file mode 100644 index 000000000..dbd285af1 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/proc_macro2-1db249c7677aa3b4.d @@ -0,0 +1,14 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libproc_macro2-1db249c7677aa3b4.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libproc_macro2-1db249c7677aa3b4.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\proc_macro2-1db249c7677aa3b4.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\marker.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\rcvec.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\detection.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\fallback.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\extra.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.83\src\wrapper.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d new file mode 100644 index 000000000..066f62ed2 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark-eda9ab09dbea3888.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark-eda9ab09dbea3888.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark-eda9ab09dbea3888.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pulldown_cmark-eda9ab09dbea3888.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\html.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\utils.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\entities.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\firstpass.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\linklabel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\puncttable.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\scanners.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\strings.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-0.10.3\src\tree.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_escape-c86762f688315946.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_escape-c86762f688315946.d new file mode 100644 index 000000000..a20814d03 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_escape-c86762f688315946.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark_escape-c86762f688315946.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark_escape-c86762f688315946.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pulldown_cmark_escape-c86762f688315946.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-escape-0.10.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d new file mode 100644 index 000000000..d7ed477e8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/pulldown_cmark_to_cmark-7be76122b5df6376.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark_to_cmark-7be76122b5df6376.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libpulldown_cmark_to_cmark-7be76122b5df6376.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\pulldown_cmark_to_cmark-7be76122b5df6376.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pulldown-cmark-to-cmark-13.0.0\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/quote-b86bb00919ad5197.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/quote-b86bb00919ad5197.d new file mode 100644 index 000000000..7718395a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/quote-b86bb00919ad5197.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libquote-b86bb00919ad5197.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libquote-b86bb00919ad5197.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\quote-b86bb00919ad5197.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\ident_fragment.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\to_tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\runtime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\quote-1.0.36\src\spanned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex-303fd43f683d0d9c.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex-303fd43f683d0d9c.d new file mode 100644 index 000000000..7e3a01611 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex-303fd43f683d0d9c.d @@ -0,0 +1,17 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex-303fd43f683d0d9c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex-303fd43f683d0d9c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\regex-303fd43f683d0d9c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\builders.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\find_byte.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regex\string.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\bytes.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-1.10.4\src\regexset\string.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_automata-efbc972b30a2e580.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_automata-efbc972b30a2e580.d new file mode 100644 index 000000000..1af65a278 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_automata-efbc972b30a2e580.d @@ -0,0 +1,65 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex_automata-efbc972b30a2e580.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex_automata-efbc972b30a2e580.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\regex_automata-efbc972b30a2e580.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\onepass.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\dfa\remapper.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\dfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\id.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\regex.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\hybrid\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\limited.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\literal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\regex.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\reverse_inner.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\stopat.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\strategy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\meta\wrappers.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\backtrack.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\builder.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\compiler.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\literal_trie.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\nfa.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\pikevm.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\nfa\thompson\range_trie.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\alphabet.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\captures.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\escape.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\interpolate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\lazy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\look.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\pool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\aho_corasick.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\byteset.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\memmem.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\prefilter\teddy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\primitives.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\start.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\syntax.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\wire.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\determinize\state.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\empty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\int.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\memchr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\search.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\sparse_set.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\unicode_data\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-automata-0.4.6\src\util\utf8.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_syntax-f10560a1d1b78872.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_syntax-f10560a1d1b78872.d new file mode 100644 index 000000000..a66f4601d --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/regex_syntax-f10560a1d1b78872.d @@ -0,0 +1,37 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex_syntax-f10560a1d1b78872.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libregex_syntax-f10560a1d1b78872.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\regex_syntax-f10560a1d1b78872.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\ast\visitor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\debug.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\either.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\interval.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\literal.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\translate.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\hir\visitor.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\parser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\rank.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\age.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\case_folding_simple.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\general_category.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\grapheme_cluster_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\perl_word.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_bool.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_names.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\property_values.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\script_extension.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\sentence_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\unicode_tables\word_break.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\regex-syntax-0.8.3\src\utf8.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ryu-2defaf88560c9d34.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ryu-2defaf88560c9d34.d new file mode 100644 index 000000000..9b2edb116 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ryu-2defaf88560c9d34.d @@ -0,0 +1,18 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libryu-2defaf88560c9d34.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libryu-2defaf88560c9d34.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\ryu-2defaf88560c9d34.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\buffer\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\common.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_full_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\d2s_intrinsics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\digit_table.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\f2s_intrinsics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\exponent.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ryu-1.0.18\src\pretty\mantissa.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde-6797ee67eb9fc526.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde-6797ee67eb9fc526.d new file mode 100644 index 000000000..73df5993c --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde-6797ee67eb9fc526.d @@ -0,0 +1,24 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libserde-6797ee67eb9fc526.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libserde-6797ee67eb9fc526.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\serde-6797ee67eb9fc526.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\integer128.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\format.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\ignored_any.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\impls.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\size_hint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impls.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\ser\impossible.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\private\doc.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde-1.0.202\src\de\seed.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.d new file mode 100644 index 000000000..227eb9da3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.d @@ -0,0 +1,21 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\serde_derive-575de12cbf34e7e0.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\serde_derive-575de12cbf34e7e0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\case.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\check.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\ctxt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\receiver.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\respan.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\internals\symbol.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\bound.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\fragment.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\dummy.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\pretend.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_derive-1.0.202\src\this.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll new file mode 100644 index 000000000..bb0ce0411 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp new file mode 100644 index 000000000..8dc3a5ae1 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib new file mode 100644 index 000000000..8764863d9 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.pdb new file mode 100644 index 000000000..0a49bed7e Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_derive-575de12cbf34e7e0.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_json-35ecaa4d5c0425a5.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_json-35ecaa4d5c0425a5.d new file mode 100644 index 000000000..80f1ba5c3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/serde_json-35ecaa4d5c0425a5.d @@ -0,0 +1,22 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libserde_json-35ecaa4d5c0425a5.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libserde_json-35ecaa4d5c0425a5.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\serde_json-35ecaa4d5c0425a5.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\from.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\index.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\partial_eq.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\value\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\io\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\iter.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\number.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\serde_json-1.0.117\src\read.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/shlex-ea16a86c0c46564c.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/shlex-ea16a86c0c46564c.d new file mode 100644 index 000000000..c3bb2abda --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/shlex-ea16a86c0c46564c.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libshlex-ea16a86c0c46564c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libshlex-ea16a86c0c46564c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\shlex-ea16a86c0c46564c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\shlex-1.3.0\src\bytes.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/strsim-47e65bffce339b7c.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/strsim-47e65bffce339b7c.d new file mode 100644 index 000000000..c01f99d55 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/strsim-47e65bffce339b7c.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libstrsim-47e65bffce339b7c.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libstrsim-47e65bffce339b7c.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\strsim-47e65bffce339b7c.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\strsim-0.11.1\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/syn-12d6af9b5f3fc81f.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/syn-12d6af9b5f3fc81f.d new file mode 100644 index 000000000..e5e0dad64 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/syn-12d6af9b5f3fc81f.d @@ -0,0 +1,53 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libsyn-12d6af9b5f3fc81f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libsyn-12d6af9b5f3fc81f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\syn-12d6af9b5f3fc81f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\group.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\token.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\bigint.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\buffer.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\classify.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_keyword.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\custom_punctuation.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\data.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\derive.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\drops.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\expr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ext.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\file.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\fixup.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\generics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ident.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\item.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lifetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lit.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\lookahead.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\mac.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\meta.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\op.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\discouraged.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_macro_input.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\parse_quote.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\pat.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\path.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\precedence.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\print.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\punctuated.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\restriction.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\sealed.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\spanned.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\stmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\thread.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\ty.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\verbatim.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\whitespace.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\export.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\syn-2.0.65\src\gen\clone.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/tempfile-0b3d021dc4bc214f.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/tempfile-0b3d021dc4bc214f.d new file mode 100644 index 000000000..239d720fb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/tempfile-0b3d021dc4bc214f.d @@ -0,0 +1,16 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtempfile-0b3d021dc4bc214f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtempfile-0b3d021dc4bc214f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\tempfile-0b3d021dc4bc214f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\dir\imp\any.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\error.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\spooled.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\util.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.10.1\src\file\imp\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/terminal_size-d8da13be1d2595d3.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/terminal_size-d8da13be1d2595d3.d new file mode 100644 index 000000000..9691efe92 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/terminal_size-d8da13be1d2595d3.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libterminal_size-d8da13be1d2595d3.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libterminal_size-d8da13be1d2595d3.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\terminal_size-d8da13be1d2595d3.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\terminal_size-0.3.0\src\windows.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-425658935e0fef12.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-425658935e0fef12.d new file mode 100644 index 000000000..8ec1cd5bb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-425658935e0fef12.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libthiserror-425658935e0fef12.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libthiserror-425658935e0fef12.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\thiserror-425658935e0fef12.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-d4341c8e23adc184.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-d4341c8e23adc184.d new file mode 100644 index 000000000..8ad793d00 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror-d4341c8e23adc184.d @@ -0,0 +1,9 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libthiserror-d4341c8e23adc184.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libthiserror-d4341c8e23adc184.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\thiserror-d4341c8e23adc184.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\aserror.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-1.0.61\src\display.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.d new file mode 100644 index 000000000..defe51cfc --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.d @@ -0,0 +1,13 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\thiserror_impl-34371baa3f030dd6.dll: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\thiserror_impl-34371baa3f030dd6.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src/lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\ast.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\attr.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\expand.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\fmt.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\generics.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\prop.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\span.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\thiserror-impl-1.0.61\src\valid.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll new file mode 100644 index 000000000..72136d242 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp new file mode 100644 index 000000000..bf05f151c Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.exp differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib new file mode 100644 index 000000000..90ae92541 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.dll.lib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb new file mode 100644 index 000000000..99cbb0f26 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/thiserror_impl-34371baa3f030dd6.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/toml-4390fb9a32c72b93.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/toml-4390fb9a32c72b93.d new file mode 100644 index 000000000..752bad879 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/toml-4390fb9a32c72b93.d @@ -0,0 +1,15 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtoml-4390fb9a32c72b93.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtoml-4390fb9a32c72b93.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\toml-4390fb9a32c72b93.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\map.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\value.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\datetime.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\ser.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\de.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\tokens.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\macros.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\toml-0.5.11\src\spanned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/topological_sort-954e09149dd7fd7b.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/topological_sort-954e09149dd7fd7b.d new file mode 100644 index 000000000..39f6ff3a8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/topological_sort-954e09149dd7fd7b.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtopological_sort-954e09149dd7fd7b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libtopological_sort-954e09149dd7fd7b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\topological_sort-954e09149dd7fd7b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\topological-sort-0.2.2\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-8190d4a172275685.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-8190d4a172275685.d new file mode 100644 index 000000000..c526d0a4f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-8190d4a172275685.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libucd_trie-8190d4a172275685.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libucd_trie-8190d4a172275685.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\ucd_trie-8190d4a172275685.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-c2ba7767e740f24f.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-c2ba7767e740f24f.d new file mode 100644 index 000000000..caf3c2bdb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/ucd_trie-c2ba7767e740f24f.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libucd_trie-c2ba7767e740f24f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libucd_trie-c2ba7767e740f24f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\ucd_trie-c2ba7767e740f24f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ucd-trie-0.1.6\src\owned.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicase-40efbf7a3440863e.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicase-40efbf7a3440863e.d new file mode 100644 index 000000000..05afd6100 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicase-40efbf7a3440863e.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicase-40efbf7a3440863e.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicase-40efbf7a3440863e.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\unicase-40efbf7a3440863e.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\ascii.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicase-2.7.0\src\unicode\map.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_ident-f819cb15e0d54fd0.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_ident-f819cb15e0d54fd0.d new file mode 100644 index 000000000..e0269f6d3 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_ident-f819cb15e0d54fd0.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicode_ident-f819cb15e0d54fd0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicode_ident-f819cb15e0d54fd0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\unicode_ident-f819cb15e0d54fd0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-ident-1.0.12\src\tables.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_width-a20fd1f1e08492a1.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_width-a20fd1f1e08492a1.d new file mode 100644 index 000000000..95be0ca3b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/unicode_width-a20fd1f1e08492a1.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicode_width-a20fd1f1e08492a1.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libunicode_width-a20fd1f1e08492a1.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\unicode_width-a20fd1f1e08492a1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\unicode-width-0.1.12\src\tables.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/utf8parse-eacf8f0fce7f601b.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/utf8parse-eacf8f0fce7f601b.d new file mode 100644 index 000000000..b731e9b51 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/utf8parse-eacf8f0fce7f601b.d @@ -0,0 +1,8 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libutf8parse-eacf8f0fce7f601b.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libutf8parse-eacf8f0fce7f601b.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\utf8parse-eacf8f0fce7f601b.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\utf8parse-0.2.1\src\types.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/version_check-27170d7ff25bd291.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/version_check-27170d7ff25bd291.d new file mode 100644 index 000000000..fa91096b9 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/version_check-27170d7ff25bd291.d @@ -0,0 +1,10 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libversion_check-27170d7ff25bd291.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libversion_check-27170d7ff25bd291.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\version_check-27170d7ff25bd291.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\version.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\channel.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\version_check-0.9.4\src\date.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-0250448e5ea1b7e0.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-0250448e5ea1b7e0.d new file mode 100644 index 000000000..a48e11009 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-0250448e5ea1b7e0.d @@ -0,0 +1,19 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_sys-0250448e5ea1b7e0.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_sys-0250448e5ea1b7e0.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_sys-0250448e5ea1b7e0.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\core\literals.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows/mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Foundation\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\System\Console\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\Shell\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-c09311c24c04cdd1.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-c09311c24c04cdd1.d new file mode 100644 index 000000000..484651e9b --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_sys-c09311c24c04cdd1.d @@ -0,0 +1,14 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_sys-c09311c24c04cdd1.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_sys-c09311c24c04cdd1.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_sys-c09311c24c04cdd1.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\lib.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\Foundation\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\Windows\Win32\System\Console\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\mod.rs: +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.48.0\src\core\literals.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-9b59cd7cb302eeeb.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-9b59cd7cb302eeeb.d new file mode 100644 index 000000000..bd32ca3eb --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-9b59cd7cb302eeeb.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_targets-9b59cd7cb302eeeb.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_targets-9b59cd7cb302eeeb.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_targets-9b59cd7cb302eeeb.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.48.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-ee0dd0a48f337ab2.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-ee0dd0a48f337ab2.d new file mode 100644 index 000000000..f08a4417f --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_targets-ee0dd0a48f337ab2.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_targets-ee0dd0a48f337ab2.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_targets-ee0dd0a48f337ab2.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_targets-ee0dd0a48f337ab2.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-targets-0.52.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d new file mode 100644 index 000000000..5f0680099 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-545c587ad7bce300.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_x86_64_msvc-545c587ad7bce300.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_x86_64_msvc-545c587ad7bce300.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_x86_64_msvc-545c587ad7bce300.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d new file mode 100644 index 000000000..1b473e4c8 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/deps/windows_x86_64_msvc-75e68c161b8e137f.d @@ -0,0 +1,7 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_x86_64_msvc-75e68c161b8e137f.rmeta: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\libwindows_x86_64_msvc-75e68c161b8e137f.rlib: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\deps\windows_x86_64_msvc-75e68c161b8e137f.d: C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs + +C:\Users\AveN\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\src\lib.rs: diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.d new file mode 100644 index 000000000..d51f83545 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.d @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\libmdbook_trpl_note.rlib: E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\src\lib.rs diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.rlib b/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.rlib new file mode 100644 index 000000000..0285c7e3b Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/libmdbook_trpl_note.rlib differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.d b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.d new file mode 100644 index 000000000..fc282c061 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.d @@ -0,0 +1 @@ +E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\target\release\mdbook-trpl-note.exe: E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\src\lib.rs E:\Rust\книги\book\rustbook-ru\packages\mdbook-trpl-note\src\main.rs diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.exe b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.exe new file mode 100644 index 000000000..b88464b2a Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook-trpl-note.exe differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook_trpl_note.pdb b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook_trpl_note.pdb new file mode 100644 index 000000000..c89341a12 Binary files /dev/null and b/rustbook-ru/packages/mdbook-trpl-note/target/release/mdbook_trpl_note.pdb differ diff --git a/rustbook-ru/packages/mdbook-trpl-note/tests/integration/main.rs b/rustbook-ru/packages/mdbook-trpl-note/tests/integration/main.rs new file mode 100644 index 000000000..6944fae69 --- /dev/null +++ b/rustbook-ru/packages/mdbook-trpl-note/tests/integration/main.rs @@ -0,0 +1,22 @@ +use assert_cmd::Command; + +#[test] +fn supports_html_renderer() { + let cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")) + .unwrap() + .args(["supports", "html"]) + .ok(); + assert!(cmd.is_ok()); +} + +#[test] +fn errors_for_other_renderers() { + let cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")) + .unwrap() + .args(["supports", "total-nonsense"]) + .ok(); + assert!(cmd.is_err()); +} + +// It would be nice to add an actual fixture for an mdbook, but doing *that* is +// going to be a bit of a pain, and what I have should cover it for now. diff --git a/rustbook-ru/packages/tools/Cargo.toml b/rustbook-ru/packages/tools/Cargo.toml new file mode 100644 index 000000000..95dda7a18 --- /dev/null +++ b/rustbook-ru/packages/tools/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "rust-book-tools" +version = "0.0.1" +description = "The Rust Book" +edition = "2021" + +[[bin]] +name = "concat_chapters" +path = "src/bin/concat_chapters.rs" + +[[bin]] +name = "convert_quotes" +path = "src/bin/convert_quotes.rs" + +[[bin]] +name = "lfp" +path = "src/bin/lfp.rs" + +[[bin]] +name = "link2print" +path = "src/bin/link2print.rs" + +[[bin]] +name = "release_listings" +path = "src/bin/release_listings.rs" + +[[bin]] +name = "remove_hidden_lines" +path = "src/bin/remove_hidden_lines.rs" + +[[bin]] +name = "remove_links" +path = "src/bin/remove_links.rs" + +[[bin]] +name = "remove_markup" +path = "src/bin/remove_markup.rs" + +[dependencies] +walkdir = { workspace = true } +docopt = { workspace = true } +serde = { workspace = true } +regex = { workspace = true } +lazy_static = { workspace = true } +flate2 = { workspace = true } +tar = { workspace = true } diff --git a/rustbook-ru/packages/tools/src/bin/concat_chapters.rs b/rustbook-ru/packages/tools/src/bin/concat_chapters.rs new file mode 100644 index 000000000..046870edb --- /dev/null +++ b/rustbook-ru/packages/tools/src/bin/concat_chapters.rs @@ -0,0 +1,125 @@ +use std::collections::BTreeMap; +use std::env; +use std::fs::{create_dir, read_dir, File}; +use std::io; +use std::io::{Read, Write}; +use std::path::{Path, PathBuf}; +use std::process::exit; + +use lazy_static::lazy_static; +use regex::Regex; + +static PATTERNS: &[(&str, &str)] = &[ + (r"ch(\d\d)-\d\d-.*\.md", "chapter$1.md"), + (r"appendix-(\d\d).*\.md", "appendix.md"), +]; + +lazy_static! { + static ref MATCHERS: Vec<(Regex, &'static str)> = { + PATTERNS + .iter() + .map(|&(expr, repl)| (Regex::new(expr).unwrap(), repl)) + .collect() + }; +} + +fn main() { + let args: Vec = env::args().collect(); + + if args.len() < 3 { + println!("Usage: {} ", args[0]); + exit(1); + } + + let source_dir = ensure_dir_exists(&args[1]).unwrap(); + let target_dir = ensure_dir_exists(&args[2]).unwrap(); + + let mut matched_files = match_files(source_dir, target_dir); + matched_files.sort(); + + for (target_path, source_paths) in group_by_target(matched_files) { + concat_files(source_paths, target_path).unwrap(); + } +} + +fn match_files( + source_dir: &Path, + target_dir: &Path, +) -> Vec<(PathBuf, PathBuf)> { + read_dir(source_dir) + .expect("Unable to read source directory") + .filter_map(|maybe_entry| maybe_entry.ok()) + .filter_map(|entry| { + let source_filename = entry.file_name(); + let source_filename = + &source_filename.to_string_lossy().into_owned(); + for &(ref regex, replacement) in MATCHERS.iter() { + if regex.is_match(source_filename) { + let target_filename = + regex.replace_all(source_filename, replacement); + let source_path = entry.path(); + let mut target_path = PathBuf::from(&target_dir); + target_path.push(target_filename.to_string()); + return Some((source_path, target_path)); + } + } + None + }) + .collect() +} + +fn group_by_target( + matched_files: Vec<(PathBuf, PathBuf)>, +) -> BTreeMap> { + let mut grouped: BTreeMap> = BTreeMap::new(); + for (source, target) in matched_files { + if let Some(source_paths) = grouped.get_mut(&target) { + source_paths.push(source); + continue; + } + let source_paths = vec![source]; + grouped.insert(target.clone(), source_paths); + } + grouped +} + +fn concat_files( + source_paths: Vec, + target_path: PathBuf, +) -> io::Result<()> { + println!("Concatenating into {}:", target_path.to_string_lossy()); + let mut target = File::create(target_path)?; + + write!( + target, + "\ + + +[TOC] +" + )?; + + for path in source_paths { + println!(" {}", path.to_string_lossy()); + let mut source = File::open(path)?; + let mut contents: Vec = Vec::new(); + source.read_to_end(&mut contents)?; + + target.write_all(b"\n")?; + target.write_all(&contents)?; + target.write_all(b"\n")?; + } + Ok(()) +} + +fn ensure_dir_exists(dir_string: &str) -> io::Result<&Path> { + let path = Path::new(dir_string); + if !path.exists() { + create_dir(path)?; + } + Ok(path) +} diff --git a/rustbook-ru/packages/tools/src/bin/convert_quotes.rs b/rustbook-ru/packages/tools/src/bin/convert_quotes.rs new file mode 100644 index 000000000..a6a8dae72 --- /dev/null +++ b/rustbook-ru/packages/tools/src/bin/convert_quotes.rs @@ -0,0 +1,78 @@ +use std::io; +use std::io::Read; + +fn main() { + let mut is_in_code_block = false; + let mut is_in_inline_code = false; + let mut is_in_html_tag = false; + + let mut buffer = String::new(); + if let Err(e) = io::stdin().read_to_string(&mut buffer) { + panic!("{e}"); + } + + for line in buffer.lines() { + if line.is_empty() { + is_in_inline_code = false; + } + if line.starts_with("```") { + is_in_code_block = !is_in_code_block; + } + if is_in_code_block { + is_in_inline_code = false; + is_in_html_tag = false; + println!("{line}"); + } else { + let modified_line = &mut String::new(); + let mut previous_char = std::char::REPLACEMENT_CHARACTER; + let chars_in_line = line.chars(); + + for possible_match in chars_in_line { + // Check if inside inline code. + if possible_match == '`' { + is_in_inline_code = !is_in_inline_code; + } + // Check if inside HTML tag. + if possible_match == '<' && !is_in_inline_code { + is_in_html_tag = true; + } + if possible_match == '>' && !is_in_inline_code { + is_in_html_tag = false; + } + + // Replace with right/left apostrophe/quote. + let char_to_push = if possible_match == '\'' + && !is_in_inline_code + && !is_in_html_tag + { + if (previous_char != std::char::REPLACEMENT_CHARACTER + && !previous_char.is_whitespace()) + || previous_char == '‘' + { + '’' + } else { + '‘' + } + } else if possible_match == '"' + && !is_in_inline_code + && !is_in_html_tag + { + if (previous_char != std::char::REPLACEMENT_CHARACTER + && !previous_char.is_whitespace()) + || previous_char == '“' + { + '”' + } else { + '“' + } + } else { + // Leave untouched. + possible_match + }; + modified_line.push(char_to_push); + previous_char = char_to_push; + } + println!("{modified_line}"); + } + } +} diff --git a/rustbook-ru/packages/tools/src/bin/lfp.rs b/rustbook-ru/packages/tools/src/bin/lfp.rs new file mode 100644 index 000000000..ee7f39c3c --- /dev/null +++ b/rustbook-ru/packages/tools/src/bin/lfp.rs @@ -0,0 +1,249 @@ +// We have some long regex literals, so: +// ignore-tidy-linelength + +use std::io::BufRead; +use std::{fs, io, path}; + +use docopt::Docopt; +use serde::Deserialize; + +fn main() { + let args: Args = Docopt::new(USAGE) + .and_then(|d| d.deserialize()) + .unwrap_or_else(|e| e.exit()); + + let src_dir = &path::Path::new(&args.arg_src_dir); + let found_errs = walkdir::WalkDir::new(src_dir) + .min_depth(1) + .into_iter() + .map(|entry| match entry { + Ok(entry) => entry, + Err(err) => { + eprintln!("{err:?}"); + std::process::exit(911) + } + }) + .map(|entry| { + let path = entry.path(); + if is_file_of_interest(path) { + let err_vec = lint_file(path); + for err in &err_vec { + match *err { + LintingError::LineOfInterest(line_num, ref line) => { + eprintln!( + "{}:{}\t{}", + path.display(), + line_num, + line + ) + } + LintingError::UnableToOpenFile => { + eprintln!("Unable to open {}.", path.display()) + } + } + } + !err_vec.is_empty() + } else { + false + } + }) + .collect::>() + .iter() + .any(|result| *result); + + if found_errs { + std::process::exit(1) + } else { + std::process::exit(0) + } +} + +const USAGE: &str = " +counter +Usage: + lfp + lfp (-h | --help) +Options: + -h --help Show this screen. +"; + +#[derive(Debug, Deserialize)] +struct Args { + arg_src_dir: String, +} + +fn lint_file(path: &path::Path) -> Vec { + match fs::File::open(path) { + Ok(file) => lint_lines(io::BufReader::new(&file).lines()), + Err(_) => vec![LintingError::UnableToOpenFile], + } +} + +fn lint_lines(lines: I) -> Vec +where + I: Iterator>, +{ + lines + .enumerate() + .map(|(line_num, line)| { + let raw_line = line.unwrap(); + if is_line_of_interest(&raw_line) { + Err(LintingError::LineOfInterest(line_num, raw_line)) + } else { + Ok(()) + } + }) + .filter(|result| result.is_err()) + .map(|result| result.unwrap_err()) + .collect() +} + +fn is_file_of_interest(path: &path::Path) -> bool { + path.extension().map_or(false, |ext| ext == "md") +} + +fn is_line_of_interest(line: &str) -> bool { + line.split_whitespace().any(|sub_string| { + sub_string.contains("file://") + && !sub_string.contains("file:///projects/") + }) +} + +#[derive(Debug)] +enum LintingError { + UnableToOpenFile, + LineOfInterest(usize, String), +} + +#[cfg(test)] +mod tests { + + use std::path; + + #[test] + fn lint_file_returns_a_vec_with_errs_when_lines_of_interest_are_found() { + let string = r#" + $ cargo run + Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game) + Running `target/guessing_game` + Guess the number! + The secret number is: 61 + Please input your guess. + 10 + You guessed: 10 + Too small! + Please input your guess. + 99 + You guessed: 99 + Too big! + Please input your guess. + foo + Please input your guess. + 61 + You guessed: 61 + You win! + $ cargo run + Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game) + Running `target/debug/guessing_game` + Guess the number! + The secret number is: 7 + Please input your guess. + 4 + You guessed: 4 + $ cargo run + Running `target/debug/guessing_game` + Guess the number! + The secret number is: 83 + Please input your guess. + 5 + $ cargo run + Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game) + Running `target/debug/guessing_game` + Hello, world! + "#; + + let raw_lines = string.to_string(); + let lines = raw_lines.lines().map(|line| Ok(line.to_string())); + + let result_vec = super::lint_lines(lines); + + assert!(!result_vec.is_empty()); + assert_eq!(3, result_vec.len()); + } + + #[test] + fn lint_file_returns_an_empty_vec_when_no_lines_of_interest_are_found() { + let string = r#" + $ cargo run + Compiling guessing_game v0.1.0 (file:///projects/guessing_game) + Running `target/guessing_game` + Guess the number! + The secret number is: 61 + Please input your guess. + 10 + You guessed: 10 + Too small! + Please input your guess. + 99 + You guessed: 99 + Too big! + Please input your guess. + foo + Please input your guess. + 61 + You guessed: 61 + You win! + "#; + + let raw_lines = string.to_string(); + let lines = raw_lines.lines().map(|line| Ok(line.to_string())); + + let result_vec = super::lint_lines(lines); + + assert!(result_vec.is_empty()); + } + + #[test] + fn is_file_of_interest_returns_false_when_the_path_is_a_directory() { + let uninteresting_fn = "src/img"; + + assert!(!super::is_file_of_interest(path::Path::new( + uninteresting_fn + ))); + } + + #[test] + fn is_file_of_interest_returns_false_when_the_filename_does_not_have_the_md_extension( + ) { + let uninteresting_fn = "src/img/foo1.png"; + + assert!(!super::is_file_of_interest(path::Path::new( + uninteresting_fn + ))); + } + + #[test] + fn is_file_of_interest_returns_true_when_the_filename_has_the_md_extension() + { + let interesting_fn = "src/ch01-00-introduction.md"; + + assert!(super::is_file_of_interest(path::Path::new(interesting_fn))); + } + + #[test] + fn is_line_of_interest_does_not_report_a_line_if_the_line_contains_a_file_url_which_is_directly_followed_by_the_project_path( + ) { + let sample_line = + "Compiling guessing_game v0.1.0 (file:///projects/guessing_game)"; + + assert!(!super::is_line_of_interest(sample_line)); + } + + #[test] + fn is_line_of_interest_reports_a_line_if_the_line_contains_a_file_url_which_is_not_directly_followed_by_the_project_path( + ) { + let sample_line = "Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)"; + + assert!(super::is_line_of_interest(sample_line)); + } +} diff --git a/rustbook-ru/packages/tools/src/bin/link2print.rs b/rustbook-ru/packages/tools/src/bin/link2print.rs new file mode 100644 index 000000000..6212ca012 --- /dev/null +++ b/rustbook-ru/packages/tools/src/bin/link2print.rs @@ -0,0 +1,406 @@ +// FIXME: we have some long lines that could be refactored, but it's not a big deal. +// ignore-tidy-linelength + +use std::collections::HashMap; +use std::io; +use std::io::Read; + +use regex::{Captures, Regex}; + +fn main() { + write_md(parse_links(parse_references(read_md()))); +} + +fn read_md() -> String { + let mut buffer = String::new(); + match io::stdin().read_to_string(&mut buffer) { + Ok(_) => buffer, + Err(error) => panic!("{error}"), + } +} + +fn write_md(output: String) { + print!("{output}"); +} + +fn parse_references(buffer: String) -> (String, HashMap) { + let mut ref_map = HashMap::new(); + // FIXME: currently doesn't handle "title" in following line. + let re = Regex::new(r###"(?m)\n?^ {0,3}\[([^]]+)\]:[[:blank:]]*(.*)$"###) + .unwrap(); + let output = re + .replace_all(&buffer, |caps: &Captures<'_>| { + let key = caps.get(1).unwrap().as_str().to_uppercase(); + let val = caps.get(2).unwrap().as_str().to_string(); + if ref_map.insert(key, val).is_some() { + panic!( + "Did not expect markdown page to have duplicate reference" + ); + } + "".to_string() + }) + .to_string(); + (output, ref_map) +} + +fn parse_links((buffer, ref_map): (String, HashMap)) -> String { + // FIXME: check which punctuation is allowed by spec. + let re = Regex::new(r###"(?:(?P
(?:```(?:[^`]|`[^`])*`?\n```\n)|(?:[^\[]`[^`\n]+[\n]?[^`\n]*`))|(?:\[(?P[^]]+)\](?:(?:\([[:blank:]]*(?P[^")]*[^ ])(?:[[:blank:]]*"[^"]*")?\))|(?:\[(?P[^]]*)\]))?))"###).expect("could not create regex");
+    let output = re.replace_all(&buffer, |caps: &Captures<'_>| {
+        match caps.name("pre") {
+            Some(pre_section) => pre_section.as_str().to_string(),
+            None => {
+                let name = caps.name("name").expect("could not get name").as_str();
+
+                let val = match caps.name("val") {
+                    // `[name](link)`
+                    Some(value) => value.as_str().to_string(),
+                    None => {
+                        match caps.name("key") {
+                            Some(key) => {
+                                match key.as_str() {
+                                    // `[name][]`
+                                    "" => ref_map.get(&name.to_uppercase()).unwrap_or_else(|| panic!("could not find url for the link text `{name}`")).to_string(),
+                                    // `[name][reference]`
+                                    _ => ref_map.get(&key.as_str().to_uppercase()).unwrap_or_else(|| panic!("could not find url for the link text `{}`", key.as_str())).to_string(),
+                                }
+                            }
+                            // `[name]` is within code and should not be treated as a link
+                            None => {
+                                return format!("[{name}]");
+                            }
+                        }
+                    }
+                };
+                format!("{name} at *{val}*")
+            }
+        }
+    });
+    output.to_string()
+}
+
+#[cfg(test)]
+mod tests {
+    fn parse(source: String) -> String {
+        super::parse_links(super::parse_references(source))
+    }
+
+    #[test]
+    fn parses_inline_link() {
+        let source =
+            r"This is a [link](http://google.com) that should be expanded"
+                .to_string();
+        let target =
+            r"This is a link at *http://google.com* that should be expanded"
+                .to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_multiline_links() {
+        let source = r"This is a [link](http://google.com) that
+should appear expanded. Another [location](/here/) and [another](http://gogogo)"
+            .to_string();
+        let target = r"This is a link at *http://google.com* that
+should appear expanded. Another location at */here/* and another at *http://gogogo*"
+            .to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_reference() {
+        let source = r"This is a [link][theref].
+[theref]: http://example.com/foo
+more text"
+            .to_string();
+        let target = r"This is a link at *http://example.com/foo*.
+more text"
+            .to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_implicit_link() {
+        let source = r"This is an [implicit][] link.
+[implicit]: /The Link/"
+            .to_string();
+        let target = r"This is an implicit at */The Link/* link.".to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn parses_refs_with_one_space_indentation() {
+        let source = r"This is a [link][ref]
+ [ref]: The link"
+            .to_string();
+        let target = r"This is a link at *The link*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_refs_with_two_space_indentation() {
+        let source = r"This is a [link][ref]
+  [ref]: The link"
+            .to_string();
+        let target = r"This is a link at *The link*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_refs_with_three_space_indentation() {
+        let source = r"This is a [link][ref]
+   [ref]: The link"
+            .to_string();
+        let target = r"This is a link at *The link*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    #[should_panic]
+    fn rejects_refs_with_four_space_indentation() {
+        let source = r"This is a [link][ref]
+    [ref]: The link"
+            .to_string();
+        let target = r"This is a link at *The link*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn ignores_optional_inline_title() {
+        let source =
+            r###"This is a titled [link](http://example.com "My title")."###
+                .to_string();
+        let target =
+            r"This is a titled link at *http://example.com*.".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_title_with_puctuation() {
+        let source =
+            r###"[link](http://example.com "It's Title")"###.to_string();
+        let target = r"link at *http://example.com*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_name_with_punctuation() {
+        let source = r###"[I'm here](there)"###.to_string();
+        let target = r###"I'm here at *there*"###.to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn parses_name_with_utf8() {
+        let source = r###"[user’s forum](the user’s forum)"###.to_string();
+        let target = r###"user’s forum at *the user’s forum*"###.to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_reference_with_punctuation() {
+        let source = r###"[link][the ref-ref]
+[the ref-ref]:http://example.com/ref-ref"###
+            .to_string();
+        let target = r###"link at *http://example.com/ref-ref*"###.to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn parses_reference_case_insensitively() {
+        let source = r"[link][Ref]
+[ref]: The reference"
+            .to_string();
+        let target = r"link at *The reference*".to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn parses_link_as_reference_when_reference_is_empty() {
+        let source = r"[link as reference][]
+[link as reference]: the actual reference"
+            .to_string();
+        let target = r"link as reference at *the actual reference*".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn does_not_parse_link_without_reference_as_reference() {
+        let source = r"[link] is alone
+[link]: The contents"
+            .to_string();
+        let target = r"[link] is alone".to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    #[ignore]
+    fn parses_link_without_reference_as_reference_with_asterisks() {
+        let source = r"*[link]* is alone
+[link]: The contents"
+            .to_string();
+        let target = r"*link* at *The contents* is alone".to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn ignores_links_in_pre_sections() {
+        let source = r###"```toml
+[package]
+name = "hello_cargo"
+version = "0.1.0"
+
+[dependencies]
+```
+"###
+        .to_string();
+        let target = source.clone();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn ignores_links_in_quoted_sections() {
+        let source = r###"do not change `[package]`."###.to_string();
+        let target = source.clone();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn ignores_links_in_quoted_sections_containing_newlines() {
+        let source = r"do not change `this [package]
+is still here` [link](ref)"
+            .to_string();
+        let target = r"do not change `this [package]
+is still here` link at *ref*"
+            .to_string();
+        assert_eq!(parse(source), target);
+    }
+
+    #[test]
+    fn ignores_links_in_pre_sections_while_still_handling_links() {
+        let source = r###"```toml
+[package]
+name = "hello_cargo"
+version = "0.1.0"
+
+[dependencies]
+```
+Another [link][]
+more text
+[link]: http://gohere
+"###
+        .to_string();
+        let target = r###"```toml
+[package]
+name = "hello_cargo"
+version = "0.1.0"
+
+[dependencies]
+```
+Another link at *http://gohere*
+more text
+"###
+        .to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn ignores_quotes_in_pre_sections() {
+        let source = r###"```bash
+$ cargo build
+   Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
+src/main.rs:23:21: 23:35 error: mismatched types [E0308]
+src/main.rs:23     match guess.cmp(&secret_number) {
+                                   ^~~~~~~~~~~~~~
+src/main.rs:23:21: 23:35 help: run `rustc --explain E0308` to see a detailed explanation
+src/main.rs:23:21: 23:35 note: expected type `&std::string::String`
+src/main.rs:23:21: 23:35 note:    found type `&_`
+error: aborting due to previous error
+Could not compile `guessing_game`.
+```
+"###
+            .to_string();
+        let target = source.clone();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn ignores_short_quotes() {
+        let source = r"to `1` at index `[0]` i".to_string();
+        let target = source.clone();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn ignores_pre_sections_with_final_quote() {
+        let source = r###"```bash
+$ cargo run
+   Compiling points v0.1.0 (file:///projects/points)
+error: the trait bound `Point: std::fmt::Display` is not satisfied [--explain E0277]
+ --> src/main.rs:8:29
+8 |>     println!("Point 1: {}", p1);
+  |>                             ^^
+:2:27: 2:58: note: in this expansion of format_args!
+:3:1: 3:54: note: in this expansion of print! (defined in )
+src/main.rs:8:5: 8:33: note: in this expansion of println! (defined in )
+note: `Point` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
+note: required by `std::fmt::Display::fmt`
+```
+`here` is another [link](the ref)
+"###.to_string();
+        let target = r###"```bash
+$ cargo run
+   Compiling points v0.1.0 (file:///projects/points)
+error: the trait bound `Point: std::fmt::Display` is not satisfied [--explain E0277]
+ --> src/main.rs:8:29
+8 |>     println!("Point 1: {}", p1);
+  |>                             ^^
+:2:27: 2:58: note: in this expansion of format_args!
+:3:1: 3:54: note: in this expansion of print! (defined in )
+src/main.rs:8:5: 8:33: note: in this expansion of println! (defined in )
+note: `Point` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
+note: required by `std::fmt::Display::fmt`
+```
+`here` is another link at *the ref*
+"###.to_string();
+        assert_eq!(parse(source), target);
+    }
+    #[test]
+    fn parses_adam_p_cheatsheet() {
+        let source = r###"[I'm an inline-style link](https://www.google.com)
+
+[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
+
+[I'm a reference-style link][Arbitrary case-insensitive reference text]
+
+[I'm a relative reference to a repository file](../blob/master/LICENSE)
+
+[You can use numbers for reference-style link definitions][1]
+
+Or leave it empty and use the [link text itself][].
+
+URLs and URLs in angle brackets will automatically get turned into links.
+http://www.example.com or  and sometimes
+example.com (but not on Github, for example).
+
+Some text to show that the reference links can follow later.
+
+[arbitrary case-insensitive reference text]: https://www.mozilla.org
+[1]: http://slashdot.org
+[link text itself]: http://www.reddit.com"###
+            .to_string();
+
+        let target = r###"I'm an inline-style link at *https://www.google.com*
+
+I'm an inline-style link with title at *https://www.google.com*
+
+I'm a reference-style link at *https://www.mozilla.org*
+
+I'm a relative reference to a repository file at *../blob/master/LICENSE*
+
+You can use numbers for reference-style link definitions at *http://slashdot.org*
+
+Or leave it empty and use the link text itself at *http://www.reddit.com*.
+
+URLs and URLs in angle brackets will automatically get turned into links.
+http://www.example.com or  and sometimes
+example.com (but not on Github, for example).
+
+Some text to show that the reference links can follow later.
+"###
+            .to_string();
+        assert_eq!(parse(source), target);
+    }
+}
diff --git a/rustbook-ru/packages/tools/src/bin/release_listings.rs b/rustbook-ru/packages/tools/src/bin/release_listings.rs
new file mode 100644
index 000000000..09fb20976
--- /dev/null
+++ b/rustbook-ru/packages/tools/src/bin/release_listings.rs
@@ -0,0 +1,206 @@
+use std::error::Error;
+use std::fs;
+use std::fs::File;
+use std::io::prelude::*;
+use std::io::{BufReader, BufWriter};
+use std::path::{Path, PathBuf};
+
+use lazy_static::lazy_static;
+use regex::Regex;
+
+fn main() -> Result<(), Box> {
+    // Get all listings from the `listings` directory
+    let listings_dir = Path::new("listings");
+
+    // Put the results in the `tmp/listings` directory
+    let out_dir = Path::new("tmp/listings");
+
+    // Clear out any existing content in `tmp/listings`
+    if out_dir.is_dir() {
+        fs::remove_dir_all(out_dir)?;
+    }
+
+    // Create a new, empty `tmp/listings` directory
+    fs::create_dir(out_dir)?;
+
+    // For each chapter in the `listings` directory,
+    for chapter in fs::read_dir(listings_dir)? {
+        let chapter = chapter?;
+        let chapter_path = chapter.path();
+
+        if !chapter_path.is_dir() {
+            eprintln!(
+                "'{}' is not a directory, skipping",
+                chapter_path.display()
+            );
+            continue;
+        }
+
+        let chapter_name = chapter_path
+            .file_name()
+            .expect("Chapter should've had a name");
+
+        // Create a corresponding chapter dir in `tmp/listings`
+        let output_chapter_path = out_dir.join(chapter_name);
+        fs::create_dir(&output_chapter_path).map_err(|e| {
+            format!(
+                "could not create dir at '{}': {e}",
+                output_chapter_path.display()
+            )
+        })?;
+
+        // For each listing in the chapter directory,
+        for listing in fs::read_dir(&chapter_path).map_err(|e| {
+            format!("Could not read '{}': {e}", chapter_path.display())
+        })? {
+            let listing = listing.map_err(|e| {
+                format!(
+                    "bad dir entry listing in {}: {e}",
+                    chapter_path.display()
+                )
+            })?;
+            let listing_path = listing.path();
+
+            if !listing_path.is_dir() {
+                eprintln!(
+                    "'{}' is not a directory, skipping",
+                    chapter_path.display()
+                );
+                continue;
+            }
+
+            let listing_name = listing_path
+                .file_name()
+                .expect("Listing should've had a name");
+
+            // Create a corresponding listing dir in the tmp chapter dir
+            let output_listing_dir = output_chapter_path.join(listing_name);
+            fs::create_dir(&output_listing_dir).map_err(|e| {
+                format!(
+                    "could not create dir '{}': {e}",
+                    output_listing_dir.display()
+                )
+            })?;
+
+            // Copy all the cleaned files in the listing to the tmp directory
+            copy_cleaned_listing_files(listing_path, output_listing_dir)?;
+        }
+    }
+
+    // Create a compressed archive of all the listings
+    let tarfile = File::create("tmp/listings.tar.gz")?;
+    let encoder =
+        flate2::write::GzEncoder::new(tarfile, flate2::Compression::default());
+    let mut archive = tar::Builder::new(encoder);
+    archive.append_dir_all("listings", "tmp/listings")?;
+
+    // Assure whoever is running this that the script exiting successfully, and remind them
+    // where the generated file ends up
+    println!("Release tarball of listings in tmp/listings.tar.gz");
+
+    Ok(())
+}
+
+// Cleaned listings will not contain:
+//
+// - `target` directories
+// - `output.txt` files used to display output in the book
+// - `rustfmt-ignore` files used to signal to update-rustc.sh the listing shouldn't be formatted
+// - anchor comments or snip comments
+// - empty `main` functions in `lib.rs` files used to trick rustdoc
+fn copy_cleaned_listing_files(
+    from: PathBuf,
+    to: PathBuf,
+) -> Result<(), Box> {
+    for item in fs::read_dir(&from).map_err(|e| {
+        format!("Could not read_dir on '{}': {e}", from.display())
+    })? {
+        let item = item.map_err(|e| {
+            format!("invalid dir entry in {}: {e}", from.display())
+        })?;
+        let item_path = item.path();
+
+        let item_name =
+            item_path.file_name().expect("Item should've had a name");
+        let output_item = to.join(item_name);
+
+        if item_path.is_dir() {
+            // Don't copy `target` directories
+            if item_name != "target" {
+                fs::create_dir(&output_item).map_err(|e| {
+                    format!(
+                        "Could not create output directory '{}': {e}",
+                        output_item.display()
+                    )
+                })?;
+                copy_cleaned_listing_files(item_path, output_item)?;
+            }
+        } else {
+            // Don't copy output files or files that tell update-rustc.sh not to format
+            if item_name != "output.txt" && item_name != "rustfmt-ignore" {
+                let item_extension = item_path.extension();
+                if item_extension.is_some() && item_extension.unwrap() == "rs" {
+                    copy_cleaned_rust_file(
+                        item_name,
+                        &item_path,
+                        &output_item,
+                    )?;
+                } else {
+                    // Copy any non-Rust files without modification
+                    fs::copy(&item_path, &output_item).map_err(|e| {
+                        format!(
+                            "Could not copy from '{}' to '{}': {e}",
+                            item_path.display(),
+                            output_item.display()
+                        )
+                    })?;
+                }
+            }
+        }
+    }
+
+    Ok(())
+}
+
+lazy_static! {
+    static ref ANCHOR_OR_SNIP_COMMENTS: Regex = Regex::new(
+        r"(?x)
+    //\s*ANCHOR:\s*[\w_-]+      # Remove all anchor comments
+    |
+    //\s*ANCHOR_END:\s*[\w_-]+  # Remove all anchor ending comments
+    |
+    //\s*--snip--               # Remove all snip comments
+    "
+    )
+    .unwrap();
+}
+
+lazy_static! {
+    static ref EMPTY_MAIN: Regex = Regex::new(r"fn main\(\) \{}").unwrap();
+}
+
+// Cleaned Rust files will not contain:
+//
+// - anchor comments or snip comments
+// - empty `main` functions in `lib.rs` files used to trick rustdoc
+fn copy_cleaned_rust_file(
+    item_name: &std::ffi::OsStr,
+    from: &PathBuf,
+    to: &PathBuf,
+) -> Result<(), Box> {
+    let from_buf = BufReader::new(File::open(from)?);
+    let mut to_buf = BufWriter::new(File::create(to)?);
+
+    for line in from_buf.lines() {
+        let line = line?;
+        if !ANCHOR_OR_SNIP_COMMENTS.is_match(&line)
+            && (item_name != "lib.rs" || !EMPTY_MAIN.is_match(&line))
+        {
+            writeln!(&mut to_buf, "{line}")?;
+        }
+    }
+
+    to_buf.flush()?;
+
+    Ok(())
+}
diff --git a/rustbook-ru/packages/tools/src/bin/remove_hidden_lines.rs b/rustbook-ru/packages/tools/src/bin/remove_hidden_lines.rs
new file mode 100644
index 000000000..934b64eb6
--- /dev/null
+++ b/rustbook-ru/packages/tools/src/bin/remove_hidden_lines.rs
@@ -0,0 +1,83 @@
+use std::io;
+use std::io::prelude::*;
+
+fn main() {
+    write_md(remove_hidden_lines(&read_md()));
+}
+
+fn read_md() -> String {
+    let mut buffer = String::new();
+    match io::stdin().read_to_string(&mut buffer) {
+        Ok(_) => buffer,
+        Err(error) => panic!("{error}"),
+    }
+}
+
+fn write_md(output: String) {
+    print!("{output}");
+}
+
+fn remove_hidden_lines(input: &str) -> String {
+    let mut resulting_lines = vec![];
+    let mut within_codeblock = false;
+
+    for line in input.lines() {
+        if line.starts_with("```") {
+            within_codeblock = !within_codeblock;
+        }
+
+        if !within_codeblock || (!line.starts_with("# ") && line != "#") {
+            resulting_lines.push(line)
+        }
+    }
+
+    resulting_lines.join("\n")
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::remove_hidden_lines;
+
+    #[test]
+    fn hidden_line_in_code_block_is_removed() {
+        let input = r#"
+In this listing:
+
+```
+fn main() {
+# secret
+}
+```
+
+you can see that...
+        "#;
+        let output = remove_hidden_lines(input);
+
+        let desired_output = r#"
+In this listing:
+
+```
+fn main() {
+}
+```
+
+you can see that...
+        "#;
+
+        assert_eq!(output, desired_output);
+    }
+
+    #[test]
+    fn headings_arent_removed() {
+        let input = r#"
+# Heading 1
+        "#;
+        let output = remove_hidden_lines(input);
+
+        let desired_output = r#"
+# Heading 1
+        "#;
+
+        assert_eq!(output, desired_output);
+    }
+}
diff --git a/rustbook-ru/packages/tools/src/bin/remove_links.rs b/rustbook-ru/packages/tools/src/bin/remove_links.rs
new file mode 100644
index 000000000..ebb46e2c2
--- /dev/null
+++ b/rustbook-ru/packages/tools/src/bin/remove_links.rs
@@ -0,0 +1,43 @@
+use regex::{Captures, Regex};
+use std::collections::HashSet;
+use std::io;
+use std::io::Read;
+
+fn main() {
+    let mut buffer = String::new();
+    if let Err(e) = io::stdin().read_to_string(&mut buffer) {
+        panic!("{e}");
+    }
+
+    let mut refs = HashSet::new();
+
+    // Capture all links and link references.
+    let regex =
+        r"\[([^\]]+)\](?:(?:\[([^\]]+)\])|(?:\([^\)]+\)))(?i)";
+    let link_regex = Regex::new(regex).unwrap();
+    let first_pass = link_regex.replace_all(&buffer, |caps: &Captures<'_>| {
+        // Save the link reference we want to delete.
+        if let Some(reference) = caps.get(2) {
+            refs.insert(reference.as_str().to_string());
+        }
+
+        // Put the link title back.
+        caps.get(1).unwrap().as_str().to_string()
+    });
+
+    // Search for the references we need to delete.
+    let ref_regex = Regex::new(r"(?m)^\[([^\]]+)\]:\s.*\n").unwrap();
+    let out = ref_regex.replace_all(&first_pass, |caps: &Captures<'_>| {
+        let capture = caps.get(1).unwrap().to_owned();
+
+        // Check if we've marked this reference for deletion ...
+        if refs.contains(capture.as_str()) {
+            return "".to_string();
+        }
+
+        // ... else we put back everything we captured.
+        caps.get(0).unwrap().as_str().to_string()
+    });
+
+    print!("{out}");
+}
diff --git a/rustbook-ru/packages/tools/src/bin/remove_markup.rs b/rustbook-ru/packages/tools/src/bin/remove_markup.rs
new file mode 100644
index 000000000..6ec0fdfb9
--- /dev/null
+++ b/rustbook-ru/packages/tools/src/bin/remove_markup.rs
@@ -0,0 +1,52 @@
+use std::io;
+use std::io::Read;
+
+use regex::{Captures, Regex};
+
+fn main() {
+    write_md(remove_markup(read_md()));
+}
+
+fn read_md() -> String {
+    let mut buffer = String::new();
+    match io::stdin().read_to_string(&mut buffer) {
+        Ok(_) => buffer,
+        Err(error) => panic!("{error}"),
+    }
+}
+
+fn write_md(output: String) {
+    print!("{output}");
+}
+
+fn remove_markup(input: String) -> String {
+    let filename_regex =
+        Regex::new(r#"\A(.*)\z"#).unwrap();
+    // Captions sometimes take up multiple lines.
+    let caption_start_regex =
+        Regex::new(r#"\A(.*)\z"#).unwrap();
+    let caption_end_regex = Regex::new(r#"(.*)\z"#).unwrap();
+    let regexen = [filename_regex, caption_start_regex, caption_end_regex];
+
+    let lines: Vec<_> = input
+        .lines()
+        .flat_map(|line| {
+            // Remove our syntax highlighting and rustdoc markers.
+            if line.starts_with("```") {
+                Some(String::from("```"))
+            // Remove the span around filenames and captions.
+            } else {
+                let result =
+                    regexen.iter().fold(line.to_string(), |result, regex| {
+                        regex
+                            .replace_all(&result, |caps: &Captures<'_>| {
+                                caps.get(1).unwrap().as_str().to_string()
+                            })
+                            .to_string()
+                    });
+                Some(result)
+            }
+        })
+        .collect();
+    lines.join("\n")
+}
diff --git a/rustbook-ru/redirects/README.md b/rustbook-ru/redirects/README.md
new file mode 100644
index 000000000..845254b68
--- /dev/null
+++ b/rustbook-ru/redirects/README.md
@@ -0,0 +1,11 @@
+% Язык программирования Ржавчина
+
+There are two editions of "Язык программирования Ржавчина":
+
+* [First edition](first-edition/index.html)
+* [Second edition](second-edition/index.html)
+
+The second edition is a complete re-write. It is still under construction;
+though it is far enough along to learn most of Rust; we suggest reading the
+second edition and then checking out the first edition later to pick up some of
+the more esoteric parts of the language.
diff --git a/rustbook-ru/redirects/SUMMARY.md b/rustbook-ru/redirects/SUMMARY.md
new file mode 100644
index 000000000..845254b68
--- /dev/null
+++ b/rustbook-ru/redirects/SUMMARY.md
@@ -0,0 +1,11 @@
+% Язык программирования Ржавчина
+
+There are two editions of "Язык программирования Ржавчина":
+
+* [First edition](first-edition/index.html)
+* [Second edition](second-edition/index.html)
+
+The second edition is a complete re-write. It is still under construction;
+though it is far enough along to learn most of Rust; we suggest reading the
+second edition and then checking out the first edition later to pick up some of
+the more esoteric parts of the language.
diff --git a/rustbook-ru/redirects/associated-types.md b/rustbook-ru/redirects/associated-types.md
new file mode 100644
index 000000000..b222f3298
--- /dev/null
+++ b/rustbook-ru/redirects/associated-types.md
@@ -0,0 +1,17 @@
+% Associated Types
+
+There is a new edition of the book and this is an old link.
+
+> Associated types are a way of associating a type placeholder with a trait such that the trait method definitions can use these placeholder types in their signatures.
+
+```rust
+pub trait Iterator {
+    type Item;
+    fn next(&mut self) -> Option;
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-03-advanced-traits.html#specifying-placeholder-types-in-trait-definitions-with-associated-types).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/attributes.md b/rustbook-ru/redirects/attributes.md
new file mode 100644
index 000000000..812cbbcd3
--- /dev/null
+++ b/rustbook-ru/redirects/attributes.md
@@ -0,0 +1,24 @@
+% Attributes
+
+There is a new edition of the book and this is an old link.
+
+> Any item declaration may have an attribute applied to it.
+
+```rust
+// A function marked as a unit test
+#[test]
+fn test_foo() {
+    /* ... */
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[In the Rust Reference: Ch 6.5 — Attributes][2]**
+* [In the first edition: Ch 3.27 — Attributes][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/attributes.html
+[2]: ../reference/attributes.html
diff --git a/rustbook-ru/redirects/bibliography.md b/rustbook-ru/redirects/bibliography.md
new file mode 100644
index 000000000..aca777e39
--- /dev/null
+++ b/rustbook-ru/redirects/bibliography.md
@@ -0,0 +1,14 @@
+% Bibliography
+
+There is a new edition of the book and this is an old link.
+
+This page does not exist in [the second edition][2].
+You might be interested in a similar page in [the Rust Reference][3].
+
+* **[In the Rust Reference: Appendix — Influences][3]**
+* [In the first edition: Section 7 — Bibliography][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/bibliography.html
+[2]: index.html
+[3]: ../reference/influences.html
diff --git a/rustbook-ru/redirects/borrow-and-asref.md b/rustbook-ru/redirects/borrow-and-asref.md
new file mode 100644
index 000000000..6541e59ba
--- /dev/null
+++ b/rustbook-ru/redirects/borrow-and-asref.md
@@ -0,0 +1,25 @@
+% Borrow and AsRef
+
+There is a new edition of the book and this is an old link.
+
+> A cheap reference-to-reference conversion.
+> Used to convert a value to a reference value within generic code.
+
+```rust
+fn is_hello>(s: T) {
+   assert_eq!("hello", s.as_ref());
+}
+```
+
+---
+
+This chapter does not exist in [the second edition][2].
+The best place to learn more about this is [the Rust documentation][3].
+
+* **[In the Rust documentation: `convert::AsRef`][3]**
+* [In the first edition: Ch 4.10 — Borrow and AsRef][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/borrow-and-asref.html
+[2]: index.html
+[3]: ../std/convert/trait.AsRef.html
diff --git a/rustbook-ru/redirects/casting-between-types.md b/rustbook-ru/redirects/casting-between-types.md
new file mode 100644
index 000000000..7e1eb7744
--- /dev/null
+++ b/rustbook-ru/redirects/casting-between-types.md
@@ -0,0 +1,32 @@
+% Casting between types
+
+There is a new edition of the book and this is an old link.
+
+> A type cast expression is denoted with the binary operator `as`.
+> Executing an `as` expression casts the value on the left-hand side to the type on the right-hand side.
+
+```rust
+# fn sum(values: &[f64]) -> f64 { 0.0 }
+# fn len(values: &[f64]) -> i32 { 0 }
+
+fn average(values: &[f64]) -> f64 {
+    let sum: f64 = sum(values);
+    let size: f64 = len(values) as f64;
+    sum / size
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Appendix A — Keywords][2]**
+* [In the Rust Reference: Type Cast Expressions][3]
+* [In the Rust documentation: `mem::transmute`][4]
+* [In the first edition: Ch 3.29 — Casting between types][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/casting-between-types.html
+[2]: appendix-01-keywords.html
+[3]: ../reference/expressions/operator-expr.html#type-cast-expressions
+[4]: ../std/mem/fn.transmute.html
\ No newline at end of file
diff --git a/rustbook-ru/redirects/choosing-your-guarantees.md b/rustbook-ru/redirects/choosing-your-guarantees.md
new file mode 100644
index 000000000..d8a4e3a3f
--- /dev/null
+++ b/rustbook-ru/redirects/choosing-your-guarantees.md
@@ -0,0 +1,22 @@
+% Choosing your Guarantees
+
+There is a new edition of the book and this is an old link.
+
+> Smart pointers are data structures that act like a pointer, but they also have additional metadata and capabilities.
+> The different smart pointers defined in Rust’s standard library provide extra functionality beyond what references provide.
+
+```rust
+let b = Box::new(5);
+println!("b = {b}");
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[In the current edition: Ch 15.00 — Smart Pointers][2]**
+* [In the first edition: Ch 4.8 — Choosing your Guarantees][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/choosing-your-guarantees.html
+[2]: ch15-00-smart-pointers.html
diff --git a/rustbook-ru/redirects/closures.md b/rustbook-ru/redirects/closures.md
new file mode 100644
index 000000000..55b88767f
--- /dev/null
+++ b/rustbook-ru/redirects/closures.md
@@ -0,0 +1,28 @@
+% Closures
+
+There is a new edition of the book and this is an old link.
+
+> Anonymous functions you can save in a variable or pass as arguments to other functions.
+
+```rust
+# use std::thread;
+# use std::time::Duration;
+
+let expensive_closure = |num| {
+    println!("calculating slowly...");
+    thread::sleep(Duration::from_secs(2));
+    num
+};
+# expensive_closure(5);
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 13.01 — Closures][2]**
+* [In the first edition: Ch 3.23 — Closures][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/closures.html
+[2]: ch13-01-closures.html
diff --git a/rustbook-ru/redirects/comments.md b/rustbook-ru/redirects/comments.md
new file mode 100644
index 000000000..d8e94f7e9
--- /dev/null
+++ b/rustbook-ru/redirects/comments.md
@@ -0,0 +1,23 @@
+% Comments
+
+There is a new edition of the book and this is an old link.
+
+> Comments must start with two slashes and continue until the end of the line.
+> For comments that extend beyond a single line, you’ll need to include // on each line.
+
+```rust
+// So we’re doing something complicated here, long enough that we need
+// multiple lines of comments to do it! Whew! Hopefully, this comment will
+// explain what’s going on.
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 3.04 — Comments][2]**
+* [In the first edition: Ch 3.4 — Comments][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/comments.html
+[2]: ch03-04-comments.html
diff --git a/rustbook-ru/redirects/compiler-plugins.md b/rustbook-ru/redirects/compiler-plugins.md
new file mode 100644
index 000000000..67187f5f6
--- /dev/null
+++ b/rustbook-ru/redirects/compiler-plugins.md
@@ -0,0 +1,6 @@
+% Compiler Plugins
+
+There is a new edition of the book and this is an old link.
+
+> Compiler plugins were user-provided libraries that extended the compiler's behavior in certain ways. 
+> Support for them has been removed.
diff --git a/rustbook-ru/redirects/concurrency.md b/rustbook-ru/redirects/concurrency.md
new file mode 100644
index 000000000..da7fb2fb0
--- /dev/null
+++ b/rustbook-ru/redirects/concurrency.md
@@ -0,0 +1,17 @@
+% Concurrency
+
+There is a new edition of the book and this is an old link.
+
+> Historically, programming [concurrency] has been difficult and error prone: Rust hopes to change that.
+> Fearless concurrency allows you to write code that’s free of subtle bugs and is easy to refactor without introducing new bugs.
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 16.00 — Fearless Concurrency][2]**
+* [In the first edition: Ch 4.6 — Concurrency][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/concurrency.html
+[2]: ch16-00-concurrency.html
diff --git a/rustbook-ru/redirects/conditional-compilation.md b/rustbook-ru/redirects/conditional-compilation.md
new file mode 100644
index 000000000..b25c02f74
--- /dev/null
+++ b/rustbook-ru/redirects/conditional-compilation.md
@@ -0,0 +1,28 @@
+% Conditional Compilation
+
+There is a new edition of the book and this is an old link.
+
+> Sometimes one wants to have different compiler outputs from the same code, depending on build target, such as targeted operating system, or to enable release builds.
+> Configuration options are either provided by the compiler or passed in on the command line using.
+> Rust code then checks for their presence using the `#[cfg(...)]` attribute
+
+```rust
+// The function is only included in the build when compiling for macOS
+#[cfg(target_os = "macos")]
+fn macos_only() {
+  // ...
+}
+```
+
+---
+
+This particular chapter does not exist in [the second edition][2].
+The best place to learn about it is [the Rust Reference][3].
+
+* **[In the Rust Reference: Ch 5 — Conditional Compilation][3]**
+* [In the first edition: Ch 4.3 — Conditional Compilation][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/conditional-compilation.html
+[2]: index.html
+[3]: ../reference/conditional-compilation.html
diff --git a/rustbook-ru/redirects/const-and-static.md b/rustbook-ru/redirects/const-and-static.md
new file mode 100644
index 000000000..b87bdd383
--- /dev/null
+++ b/rustbook-ru/redirects/const-and-static.md
@@ -0,0 +1,21 @@
+% `const` and `static`
+
+There is a new edition of the book and this is an old link.
+
+> Constants are _always_ immutable, and may only be set to a constant expression, not the result of a function call or any other value that could only be computed at runtime.
+>
+> Global variables are called `static` in Rust.
+
+```rust
+const MAX_POINTS: u32 = 100_000;
+static HELLO_WORLD: &str = "Hello, world!";
+```
+
+---
+
+You can find the latest version about constants
+[here](ch03-01-variables-and-mutability.html#constants),
+and about statics
+[here](ch19-01-unsafe-rust.html#accessing-or-modifying-a-mutable-static-variable).
+
+
diff --git a/rustbook-ru/redirects/crates-and-modules.md b/rustbook-ru/redirects/crates-and-modules.md
new file mode 100644
index 000000000..d526c9564
--- /dev/null
+++ b/rustbook-ru/redirects/crates-and-modules.md
@@ -0,0 +1,28 @@
+% Crates and Modules
+
+There is a new edition of the book and this is an old link.
+
+> Rust has a module system that enables the reuse of code in an organized fashion.
+> A module is a namespace that contains definitions of functions or types, and you can choose whether those definitions are visible outside their module (public) or not (private).
+>
+> A crate is a project that other people can pull into their projects as a dependency.
+
+```rust
+mod network {
+    fn connect() {
+    }
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 7.01 — `mod` and the Filesystem][2]**
+* [in the current edition: Ch 14.02 — Publishing a Crate to Crates.io][3]
+* [In the first edition: Ch 3.25 — Crates and Modules][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/crates-and-modules.html
+[2]: ch07-00-managing-growing-projects-with-packages-crates-and-modules.html
+[3]: ch14-02-publishing-to-crates-io.html
diff --git a/rustbook-ru/redirects/deref-coercions.md b/rustbook-ru/redirects/deref-coercions.md
new file mode 100644
index 000000000..61d407e1d
--- /dev/null
+++ b/rustbook-ru/redirects/deref-coercions.md
@@ -0,0 +1,30 @@
+% Deref coercions
+
+There is a new edition of the book and this is an old link.
+
+> Implementing the `Deref` trait allows us to customize the behavior of the _dereference operator_ `*`.
+> By implementing `Deref` in such a way that a smart pointer can be treated like a regular reference, we can write code that operates on references and use that code with smart pointers too.
+
+```rust
+use std::ops::Deref;
+
+# struct MyBox(T);
+impl Deref for MyBox {
+    type Target = T;
+
+    fn deref(&self) -> &T {
+        &self.0
+    }
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 15.02 — Treating Smart Pointers like Regular References with the `Deref` Trait][2]**
+* [In the first edition: Ch 3.33 — Deref coercions][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/deref-coercions.html
+[2]: ch15-02-deref.html
diff --git a/rustbook-ru/redirects/documentation.md b/rustbook-ru/redirects/documentation.md
new file mode 100644
index 000000000..ac7c881de
--- /dev/null
+++ b/rustbook-ru/redirects/documentation.md
@@ -0,0 +1,26 @@
+% Documentation
+
+There is a new edition of the book and this is an old link.
+
+> Documentation comments use `///` instead of `//` and support Markdown notation for formatting the text if you’d like.
+> You place documentation comments just before the item they are documenting. 
+
+```rust,no_run
+/// Adds one to the number given.
+///
+/// # Examples
+///
+/// ```
+/// let five = 5;
+///
+/// assert_eq!(6, my_crate::add_one(5));
+/// ```
+pub fn add_one(x: i32) -> i32 {
+    x + 1
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/drop.md b/rustbook-ru/redirects/drop.md
new file mode 100644
index 000000000..164f1d745
--- /dev/null
+++ b/rustbook-ru/redirects/drop.md
@@ -0,0 +1,34 @@
+% Drop
+
+There is a new edition of the book and this is an old link.
+
+> `Drop` lets us customize what happens when a value is about to go out of scope.
+
+```rust
+struct CustomSmartPointer {
+    data: String,
+}
+
+impl Drop for CustomSmartPointer {
+    fn drop(&mut self) {
+        println!("Dropping CustomSmartPointer with data `{}`!", self.data);
+    }
+}
+
+fn main() {
+    let c = CustomSmartPointer { data: String::from("my stuff") };
+    let d = CustomSmartPointer { data: String::from("other stuff") };
+    println!("CustomSmartPointers created.");
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 15.03 — The `Drop` Trait Runs Code on Cleanup][2]**
+* [In the first edition: Ch 3.20 — Drop][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/drop.html
+[2]: ch15-03-drop.html
diff --git a/rustbook-ru/redirects/effective-rust.md b/rustbook-ru/redirects/effective-rust.md
new file mode 100644
index 000000000..0cf808b2f
--- /dev/null
+++ b/rustbook-ru/redirects/effective-rust.md
@@ -0,0 +1,14 @@
+% Effective Rust
+
+There is a new edition of the book and this is an old link.
+
+This section does not exist in [the second edition][2].
+However, the second edition encourages writing effective Rust from the start.
+It is recommended to start there.
+
+* **[The second edition of Язык программирования Ржавчина][2]**
+* [In the first edition: Ch 4 — Effective Rust][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/effective-rust.html
+[2]: index.html
diff --git a/rustbook-ru/redirects/enums.md b/rustbook-ru/redirects/enums.md
new file mode 100644
index 000000000..c770d6b00
--- /dev/null
+++ b/rustbook-ru/redirects/enums.md
@@ -0,0 +1,23 @@
+% Enums
+
+There is a new edition of the book and this is an old link.
+
+> Enums allow you to define a type by enumerating its possible values.
+
+```rust
+enum IpAddrKind {
+    V4,
+    V6,
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 6.01 — Defining an Enum][2]**
+* [In the first edition: Ch 3.13 — Enums][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/enums.html
+[2]: ch06-01-defining-an-enum.html
diff --git a/rustbook-ru/redirects/error-handling.md b/rustbook-ru/redirects/error-handling.md
new file mode 100644
index 000000000..7abc9642b
--- /dev/null
+++ b/rustbook-ru/redirects/error-handling.md
@@ -0,0 +1,16 @@
+% Error Handling
+
+There is a new edition of the book and this is an old link.
+
+> Rust groups errors into two major categories: _recoverable_ errors with `Result` and _unrecoverable_ errors with `panic!`.
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 9.00 — Error Handling][2]**
+* [In the first edition: Ch 4.7 — Error Handling][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/error-handling.html
+[2]: ch09-00-error-handling.html
diff --git a/rustbook-ru/redirects/ffi.md b/rustbook-ru/redirects/ffi.md
new file mode 100644
index 000000000..20ed3963e
--- /dev/null
+++ b/rustbook-ru/redirects/ffi.md
@@ -0,0 +1,23 @@
+% FFI
+
+There is a new edition of the book and this is an old link.
+
+> Sometimes, your Rust code may need to interact with code written in another language.
+> To do this, Rust has a keyword, `extern`, that facilitates creating and using a _Foreign Function Interface_ (FFI).
+
+```rust
+extern "C" {
+    fn abs(input: i32) -> i32;
+}
+
+fn main() {
+    unsafe {
+        println!("Absolute value of -3 according to C: {}", abs(-3));
+    }
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code)
\ No newline at end of file
diff --git a/rustbook-ru/redirects/functions.md b/rustbook-ru/redirects/functions.md
new file mode 100644
index 000000000..eecbfd49c
--- /dev/null
+++ b/rustbook-ru/redirects/functions.md
@@ -0,0 +1,30 @@
+% Functions
+
+There is a new edition of the book and this is an old link.
+
+> Function definitions in Rust start with `fn` and have a set of parentheses after the function name.
+> The curly brackets tell the compiler where the function body begins and ends.
+> We can call any function we’ve defined by entering its name followed by a set of parentheses. 
+
+```rust
+fn main() {
+    println!("Hello, world!");
+
+    another_function();
+}
+
+fn another_function() {
+    println!("Another function.");
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[In the first edition: Ch 3.2 — Functions][1]**
+* [in the current edition: Ch 3.03 — Functions][2]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/functions.html
+[2]: ch03-03-how-functions-work.html
diff --git a/rustbook-ru/redirects/generics.md b/rustbook-ru/redirects/generics.md
new file mode 100644
index 000000000..80700973f
--- /dev/null
+++ b/rustbook-ru/redirects/generics.md
@@ -0,0 +1,30 @@
+% Generics
+
+There is a new edition of the book and this is an old link.
+
+> Generics are abstract stand-ins for concrete types or other properties.
+
+```rust
+struct Point {
+    x: T,
+    y: U,
+}
+
+fn main() {
+    let both_integer = Point { x: 5, y: 10 };
+    let both_float = Point { x: 1.0, y: 4.0 };
+    let integer_and_float = Point { x: 5, y: 4.0 };
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 10.00 — Generic Types, Traits, and Lifetimes][2]**
+* [In the first edition: Ch 3.18 — Generics][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/generics.html
+[2]: ch10-00-generics.html
+
diff --git a/rustbook-ru/redirects/getting-started.md b/rustbook-ru/redirects/getting-started.md
new file mode 100644
index 000000000..1c84cbbaf
--- /dev/null
+++ b/rustbook-ru/redirects/getting-started.md
@@ -0,0 +1,13 @@
+% Getting Started
+
+There is a new edition of the book and this is an old link.
+
+You can [continue to the exact older page][1].
+If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
+
+* **[in the current edition: Getting Started][2]**
+* [In the first edition: Getting Started][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/getting-started.html
+[2]: ch01-00-getting-started.html
diff --git a/rustbook-ru/redirects/glossary.md b/rustbook-ru/redirects/glossary.md
new file mode 100644
index 000000000..a9720001b
--- /dev/null
+++ b/rustbook-ru/redirects/glossary.md
@@ -0,0 +1,14 @@
+% Glossary
+
+There is a new edition of the book and this is an old link.
+
+This section does not exist in [the second edition][2].
+However, the second edition defines the terms it uses inline, rather than using a glossary.
+It is recommended to start there.
+
+* **[The second edition of Язык программирования Ржавчина][2]**
+* [In the first edition: Glossary][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/glossary.html
+[2]: index.html
diff --git a/rustbook-ru/redirects/guessing-game.md b/rustbook-ru/redirects/guessing-game.md
new file mode 100644
index 000000000..6abf4023b
--- /dev/null
+++ b/rustbook-ru/redirects/guessing-game.md
@@ -0,0 +1,12 @@
+% Tutorial: Guessing Game
+
+There is a new edition of the book and this is an old link.
+
+If you're trying to learn Rust, checking out [the second edition][2] might be a better choice.
+
+* **[In the first edition: Tutorial — Guessing Game][1]**
+* [in the current edition: Ch 2.00 — Guessing Game tutorial][2]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/guessing-game.html
+[2]: ch02-00-guessing-game-tutorial.html
diff --git a/rustbook-ru/redirects/if-let.md b/rustbook-ru/redirects/if-let.md
new file mode 100644
index 000000000..edbe5d88b
--- /dev/null
+++ b/rustbook-ru/redirects/if-let.md
@@ -0,0 +1,22 @@
+% if let
+
+There is a new edition of the book and this is an old link.
+
+> The `if let` syntax lets you combine `if` and `let` into a less verbose way to handle values that match one pattern and ignore the rest.
+
+```rust
+let some_u8_value = Some(3u8);
+if let Some(3) = some_u8_value {
+    println!("three");
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* [In the current edition: Ch 6.03 — Concise Control Flow with `if let`][2]
+* [In the first edition: Ch 3.21 — if let][1]
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/if-let.html
+[2]: ch06-03-if-let.html
diff --git a/rustbook-ru/redirects/if.md b/rustbook-ru/redirects/if.md
new file mode 100644
index 000000000..ff97e94f1
--- /dev/null
+++ b/rustbook-ru/redirects/if.md
@@ -0,0 +1,22 @@
+% if
+
+There is a new edition of the book and this is an old link.
+
+> An `if` expression allows us to branch our code depending on conditions.
+
+```rust
+fn main() {
+    let number = 3;
+
+    if number < 5 {
+        println!("condition was true");
+    } else {
+        println!("condition was false");
+    }
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch03-05-control-flow.html#if-expressions).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/iterators.md b/rustbook-ru/redirects/iterators.md
new file mode 100644
index 000000000..d8a73dab8
--- /dev/null
+++ b/rustbook-ru/redirects/iterators.md
@@ -0,0 +1,27 @@
+% Iterators
+
+There is a new edition of the book and this is an old link.
+
+> The iterator pattern allows you to perform some task on a sequence of items in turn.
+> An iterator is responsible for the logic of iterating over each item and determining when the sequence has finished.
+
+```rust
+let v1 = vec![1, 2, 3];
+
+let v1_iter = v1.iter();
+
+for val in v1_iter {
+    println!("Got: {val}");
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 13.02 — Iterators][2]**
+* [In the first edition: Ch 4.5 — Iterators][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/iterators.html
+[2]: ch13-02-iterators.html
diff --git a/rustbook-ru/redirects/lifetimes.md b/rustbook-ru/redirects/lifetimes.md
new file mode 100644
index 000000000..8a27ec172
--- /dev/null
+++ b/rustbook-ru/redirects/lifetimes.md
@@ -0,0 +1,28 @@
+% Lifetimes
+
+There is a new edition of the book and this is an old link.
+
+> Every reference in Rust has a lifetime, which is the scope for which that reference is valid.
+> Most of the time lifetimes are implicit and inferred.
+
+```rust
+{
+    let x = 5;            // -----+-- 'b
+                          //      |
+    let r = &x;           // --+--+-- 'a
+                          //   |  |
+    println!("r: {r}");   //   |  |
+                          // --+  |
+}                         // -----+
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 10.03 — Lifetimes][2]**
+* [In the first edition: Ch 3.10 — Lifetimes][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/lifetimes.html
+[2]: ch10-03-lifetime-syntax.html
diff --git a/rustbook-ru/redirects/loops.md b/rustbook-ru/redirects/loops.md
new file mode 100644
index 000000000..30c7d4059
--- /dev/null
+++ b/rustbook-ru/redirects/loops.md
@@ -0,0 +1,30 @@
+% Loops
+
+There is a new edition of the book and this is an old link.
+
+> Rust has three kinds of loops: `loop`, `while`, and `for`.
+> The `loop` keyword tells Rust to execute a block of code over and over again forever or until you explicitly tell it to stop.
+> `while` loops evaluate a block of code until a condition ceases to be true.
+> A `for` loop executes some code for each item in a collection.
+
+```rust,no_run
+loop {
+    println!("again!");
+}
+
+let mut number = 3;
+while number != 0 {
+    println!("{number}!");
+    number = number - 1;
+}
+
+let a = [10, 20, 30, 40, 50];
+for element in a.iter() {
+    println!("the value is: {element}");
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch03-05-control-flow.html#repetition-with-loops).
diff --git a/rustbook-ru/redirects/macros.md b/rustbook-ru/redirects/macros.md
new file mode 100644
index 000000000..08217d115
--- /dev/null
+++ b/rustbook-ru/redirects/macros.md
@@ -0,0 +1,30 @@
+% Macros
+
+There is a new edition of the book and this is an old link.
+
+> While functions and types abstract over code, macros abstract at a syntactic level.
+
+```rust
+macro_rules! five_times {
+    ($x:expr) => (5 * $x);
+}
+
+fn main() {
+    assert_eq!(25, five_times!(2 + 3));
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[In the current edition: Ch 19.06 Macros][2]**
+* [Rust By Example: Macros][3]
+* [In the Rust Reference: Ch 3.1 — Macros by Example][4]
+* [In the first edition: Ch 3.34 — Macros][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/macros.html
+[2]: ch19-06-macros.html
+[3]: https://rustbyexample.com/macros.html
+[4]: ../reference/macros-by-example.html
diff --git a/rustbook-ru/redirects/match.md b/rustbook-ru/redirects/match.md
new file mode 100644
index 000000000..fd28ba8de
--- /dev/null
+++ b/rustbook-ru/redirects/match.md
@@ -0,0 +1,38 @@
+% Match
+
+There is a new edition of the book and this is an old link.
+
+> `match` allows us to compare a value against a series of patterns and then execute code based on which pattern matches.
+> Patterns can be made up of literal values, variable names, wildcards, and many other things.
+
+```rust
+enum Coin {
+    Penny,
+    Nickel,
+    Dime,
+    Quarter,
+}
+
+fn value_in_cents(coin: Coin) -> u32 {
+    match coin {
+        Coin::Penny => 1,
+        Coin::Nickel => 5,
+        Coin::Dime => 10,
+        Coin::Quarter => 25,
+    }
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 6.02 — The `match` Control Flow Operator][2]**
+* [in the current edition: Ch 18.00 — Patterns][3]
+* [In the first edition: Ch 3.14 — Match][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/match.html
+[2]: ch06-02-match.html
+[3]: ch18-00-patterns.html
+
diff --git a/rustbook-ru/redirects/method-syntax.md b/rustbook-ru/redirects/method-syntax.md
new file mode 100644
index 000000000..29cd2cd7c
--- /dev/null
+++ b/rustbook-ru/redirects/method-syntax.md
@@ -0,0 +1,29 @@
+% Method Syntax
+
+There is a new edition of the book and this is an old link.
+
+> Methods are different from functions in that they’re defined within the context of a struct, and their first parameter is always `self`, which represents the instance of the struct the method is being called on.
+
+```rust
+# struct Rectangle {
+#     width: u32,
+#     height: u32,
+# }
+
+impl Rectangle {
+    fn area(&self) -> u32 {
+        self.width * self.height
+    }
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 5.03 — Method Syntax][2]**
+* [In the first edition: Ch 3.16 — Method Syntax][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/method-syntax.html
+[2]: ch05-03-method-syntax.html
diff --git a/rustbook-ru/redirects/mutability.md b/rustbook-ru/redirects/mutability.md
new file mode 100644
index 000000000..4e64953c1
--- /dev/null
+++ b/rustbook-ru/redirects/mutability.md
@@ -0,0 +1,23 @@
+% Mutability
+
+There is a new edition of the book and this is an old link.
+
+> Variables are immutable only by default; we can make them mutable by adding mut in front of the variable name.
+
+```rust
+let mut x = 5;
+println!("The value of x is: {x}");
+x = 6;
+println!("The value of x is: {x}");
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 3.01 — Variables and Mutability][2]**
+* [In the first edition: Ch 3.11 — Mutability][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/mutability.html
+[2]: ch03-01-variables-and-mutability.html
diff --git a/rustbook-ru/redirects/operators-and-overloading.md b/rustbook-ru/redirects/operators-and-overloading.md
new file mode 100644
index 000000000..ff9a33048
--- /dev/null
+++ b/rustbook-ru/redirects/operators-and-overloading.md
@@ -0,0 +1,36 @@
+% Operators and Overloading
+
+There is a new edition of the book and this is an old link.
+
+> Rust does not allow you to create your own operators or overload arbitrary operators, but the operations and corresponding traits listed in `std::ops` can be overloaded by implementing the traits associated with the operator.
+
+```rust
+use std::ops::Add;
+
+#[derive(Debug,PartialEq)]
+struct Point {
+    x: i32,
+    y: i32,
+}
+
+impl Add for Point {
+    type Output = Point;
+
+    fn add(self, other: Point) -> Point {
+        Point {
+            x: self.x + other.x,
+            y: self.y + other.y,
+        }
+    }
+}
+
+fn main() {
+    assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 },
+               Point { x: 3, y: 3 });
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-03-advanced-traits.html).
diff --git a/rustbook-ru/redirects/ownership.md b/rustbook-ru/redirects/ownership.md
new file mode 100644
index 000000000..3e7ece3b4
--- /dev/null
+++ b/rustbook-ru/redirects/ownership.md
@@ -0,0 +1,20 @@
+% Ownership
+
+There is a new edition of the book and this is an old link.
+
+> Ownership is Rust’s most unique feature, and it enables Rust to make memory safety guarantees without needing a garbage collector.
+>
+> 1. Each value in Rust has a variable that’s called its _owner_.
+> 2. There can only be one owner at a time.
+> 3. When the owner goes out of scope, the value will be dropped.
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 4.00 — Understanding Ownership][2]**
+* [In the first edition: Ch 3.8 — Ownership][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/ownership.html
+[2]: ch04-00-understanding-ownership.html
diff --git a/rustbook-ru/redirects/patterns.md b/rustbook-ru/redirects/patterns.md
new file mode 100644
index 000000000..1936368b2
--- /dev/null
+++ b/rustbook-ru/redirects/patterns.md
@@ -0,0 +1,23 @@
+% Patterns
+
+There is a new edition of the book and this is an old link.
+
+> Patterns are a special syntax within Rust for matching against the structure of our types, complex or simple.
+> A pattern is made up of some combination of literals; destructured arrays, enums, structs, or tuples; variables, wildcards, and placeholders.
+> These pieces describe the “shape” of the data we’re working with.
+
+```rust
+let x = Some(5);
+let y = 10;
+
+match x {
+    Some(50) => println!("Got 50"),
+    Some(y) => println!("Matched, y = {:?}", y),
+    _ => println!("Default case, x = {:?}", x),
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch06-02-match.html).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/primitive-types.md b/rustbook-ru/redirects/primitive-types.md
new file mode 100644
index 000000000..aff51f782
--- /dev/null
+++ b/rustbook-ru/redirects/primitive-types.md
@@ -0,0 +1,24 @@
+% Primitive Types
+
+There is a new edition of the book and this is an old link.
+
+> Rust is a _statically typed_ language, which means that it must know the types of all variables at compile time.
+> The compiler can usually infer what type we want to use based on the value and how we use it.
+> In cases when many types are possible, a _type annotation_ must be added.
+
+```rust
+let x = 2.0; // f64
+
+let y: f32 = 3.0; // f32
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 3.02 — Data Types][2]**
+* [In the first edition: Ch 3.3 — Primitive Types][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/primitive-types.html
+[2]: ch03-02-data-types.html
diff --git a/rustbook-ru/redirects/procedural-macros.md b/rustbook-ru/redirects/procedural-macros.md
new file mode 100644
index 000000000..bf6665f1a
--- /dev/null
+++ b/rustbook-ru/redirects/procedural-macros.md
@@ -0,0 +1,21 @@
+% Procedural Macros (and custom Derive)
+
+There is a new edition of the book and this is an old link.
+
+> Procedural macros allow for all sorts of advanced metaprogramming in Rust.
+
+---
+
+This chapter does not exist yet in [the second edition][2].
+You can check out other resources that describe macros.
+
+* **[In the current edition: Ch 19.06 Macros][2]**
+* [In the Rust Reference: Ch 3.2 — Procedural Macros][4]
+* [The `proc_macro` crate documentation][3]
+* [In the first edition: Ch 4.13 — Procedural Macros (and custom Derive)][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/procedural-macros.html
+[2]: ch19-06-macros.html
+[3]: ../proc_macro/index.html
+[4]: ../reference/procedural-macros.html
diff --git a/rustbook-ru/redirects/raw-pointers.md b/rustbook-ru/redirects/raw-pointers.md
new file mode 100644
index 000000000..773f3abc4
--- /dev/null
+++ b/rustbook-ru/redirects/raw-pointers.md
@@ -0,0 +1,17 @@
+% Raw Pointers
+
+There is a new edition of the book and this is an old link.
+
+> Raw pointers are allowed to ignore many of the rules that references have to follow.
+
+```rust
+let mut num = 5;
+
+let r1 = &num as *const i32;
+let r2 = &mut num as *mut i32;
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-01-unsafe-rust.html#dereferencing-a-raw-pointer)
\ No newline at end of file
diff --git a/rustbook-ru/redirects/references-and-borrowing.md b/rustbook-ru/redirects/references-and-borrowing.md
new file mode 100644
index 000000000..7eb8da2bd
--- /dev/null
+++ b/rustbook-ru/redirects/references-and-borrowing.md
@@ -0,0 +1,24 @@
+% References and Borrowing
+
+There is a new edition of the book and this is an old link.
+
+> A reference _refers_ to a value but does not own it.
+> Because it does not own it, the value it points to will not be dropped when the reference goes out of scope.
+
+```rust
+fn calculate_length(s: &String) -> usize { // s is a reference to a String
+    s.len()
+} // Here, s goes out of scope. But because it does not have ownership of what
+  // it refers to, nothing happens.
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 4.02 — References and Borrowing][2]**
+* [In the first edition: Ch 3.9 — References and Borrowing][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/references-and-borrowing.html
+[2]: ch04-02-references-and-borrowing.html
diff --git a/rustbook-ru/redirects/release-channels.md b/rustbook-ru/redirects/release-channels.md
new file mode 100644
index 000000000..6e01e227f
--- /dev/null
+++ b/rustbook-ru/redirects/release-channels.md
@@ -0,0 +1,28 @@
+% Release Channels
+
+There is a new edition of the book and this is an old link.
+
+> The Rust project uses a concept called ‘release channels’ to manage releases.
+> New nightly releases are created once a day.
+> Every six weeks, the latest nightly release is promoted to ‘Beta’.
+> At that point, it will only receive patches to fix serious errors.
+> Six weeks later, the beta is promoted to ‘Stable’.
+
+---
+
+This chapter does not exist yet in [the second edition][2].
+You can check out other resources that describe release channels.
+
+* **[In the Rustup documentation: Keeping Rust Up-to-date][4]**
+* [On the website: Install Rust][5]
+* [In the Rust RFCs: RFC 507 — Release Channels][3]
+* [in the current edition: How Rust is Made and “Nightly Rust”][2]
+* [In the first edition: Ch 4.11 — Release Channels][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/release-channels.html
+[2]: appendix-07-nightly-rust.html
+[3]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md
+[4]: https://github.com/rust-lang-nursery/rustup.rs/blob/master/README.md#keeping-rust-up-to-date
+[5]: https://www.rust-lang.org/en-US/tools/install
+
diff --git a/rustbook-ru/redirects/strings.md b/rustbook-ru/redirects/strings.md
new file mode 100644
index 000000000..3084e8d45
--- /dev/null
+++ b/rustbook-ru/redirects/strings.md
@@ -0,0 +1,19 @@
+% Strings
+
+There is a new edition of the book and this is an old link.
+
+> A `String` is allocated on the heap and as such is able to store an amount of text that is unknown to us at compile time.
+> You can create a `String` from a string literal using the `from` function.
+> A _string slice_ is a reference to part of a `String`.
+
+```rust
+let s = String::from("hello world");
+
+let hello = &s[0..5];
+let world = &s[6..11];
+```
+
+---
+
+You can find the latest version of this information
+[here](ch08-02-strings.html).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/structs.md b/rustbook-ru/redirects/structs.md
new file mode 100644
index 000000000..5c5427c55
--- /dev/null
+++ b/rustbook-ru/redirects/structs.md
@@ -0,0 +1,25 @@
+% Structs
+
+There is a new edition of the book and this is an old link.
+
+> A _struct_ is a custom data type that lets us name and package together multiple related values that make up a meaningful group.
+
+```rust
+struct User {
+    username: String,
+    email: String,
+    sign_in_count: u64,
+    active: bool,
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[In second edition: Ch 5.00 — Structs][2]**
+* [In the first edition: Ch 3.12 — Structs][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/structs.html
+[2]: ch05-00-structs.html
diff --git a/rustbook-ru/redirects/syntax-and-semantics.md b/rustbook-ru/redirects/syntax-and-semantics.md
new file mode 100644
index 000000000..b1f4f8aca
--- /dev/null
+++ b/rustbook-ru/redirects/syntax-and-semantics.md
@@ -0,0 +1,18 @@
+% Syntax and Semantics
+
+There is a new edition of the book and this is an old link.
+
+Here are the relevant sections in the new and old books:
+
+
+* **[in the current edition: Ch 3.00 — Common Programming Concepts][2]**
+* [in the current edition: Appendix A — Keywords][3]
+* [in the current edition: Appendix B — Operators][4]
+* [In the first edition: Ch 3 — Syntax and Semantics][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/syntax-and-semantics.html
+[2]: ch03-00-common-programming-concepts.html
+[3]: appendix-01-keywords.html
+[4]: appendix-02-operators.html
+
diff --git a/rustbook-ru/redirects/syntax-index.md b/rustbook-ru/redirects/syntax-index.md
new file mode 100644
index 000000000..c9513bf0e
--- /dev/null
+++ b/rustbook-ru/redirects/syntax-index.md
@@ -0,0 +1,13 @@
+% Syntax Index
+
+There is a new edition of the book and this is an old link.
+
+Here are the relevant sections in the new and old books:
+
+* **[In the current edition: Appendix A — Keywords][2]**
+* **[In the current edition: Appendix B — Operators][3]**
+* [In the first edition: Ch 6 — Syntax Index][1]
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/syntax-index.html
+[2]: appendix-01-keywords.html
+[3]: appendix-02-operators.html
diff --git a/rustbook-ru/redirects/testing.md b/rustbook-ru/redirects/testing.md
new file mode 100644
index 000000000..f2030654f
--- /dev/null
+++ b/rustbook-ru/redirects/testing.md
@@ -0,0 +1,25 @@
+% Testing
+
+There is a new edition of the book and this is an old link.
+
+> Rust includes support for writing software tests within the language itself.
+
+```rust
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {
+    }
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 11.00 — Testing][2]**
+* [In the first edition: Ch 4.2 — Testing][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/testing.html
+[2]: ch11-00-testing.html
diff --git a/rustbook-ru/redirects/the-stack-and-the-heap.md b/rustbook-ru/redirects/the-stack-and-the-heap.md
new file mode 100644
index 000000000..e2d4d3ac9
--- /dev/null
+++ b/rustbook-ru/redirects/the-stack-and-the-heap.md
@@ -0,0 +1,13 @@
+% The Stack and the Heap
+
+There is a new edition of the book and this is an old link.
+
+> Both the stack and the heap are parts of memory that is available to your code to use at runtime, but they are structured in different ways.
+> The stack stores values in the order it gets them and removes the values in the opposite order.
+> All data on the stack must take up a known, fixed size.
+> For data with a size unknown to us at compile time or a size that might change, we can store data on the heap instead.
+
+---
+
+You can find the latest version of this information
+[here](ch04-01-what-is-ownership.html#the-stack-and-the-heap).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/trait-objects.md b/rustbook-ru/redirects/trait-objects.md
new file mode 100644
index 000000000..3200e26a1
--- /dev/null
+++ b/rustbook-ru/redirects/trait-objects.md
@@ -0,0 +1,68 @@
+% Trait Objects
+
+There is a new edition of the book and this is an old link.
+
+> Trait objects combine the data made up of the pointer to a concrete object with the behavior of the methods defined in the trait.
+> A trait defines behavior that we need in a given situation.
+> We can then use a trait as a trait object in places where we would use a concrete type or a generic type.
+
+```rust,ignore
+pub struct InputBox {
+    pub label: String,
+}
+
+impl Draw for InputBox {
+    fn draw(&self) {
+        // Code to actually draw an input box
+    }
+}
+
+pub struct Button {
+    pub label: String,
+}
+
+impl Draw for Button {
+    fn draw(&self) {
+        // Code to actually draw a button
+    }
+}
+
+pub struct Screen {
+    pub components: Vec,
+}
+
+impl Screen
+    where T: Draw {
+    pub fn run(&self) {
+        for component in self.components.iter() {
+            component.draw();
+        }
+    }
+}
+
+fn main() {
+    let screen = Screen {
+        components: vec![
+            Box::new(InputBox {
+                label: String::from("OK"),
+            }),
+            Box::new(Button {
+                label: String::from("OK"),
+            }),
+        ],
+    };
+
+    screen.run();
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 17.02 — Trait Objects][2]**
+* [In the first edition: Ch 3.22 — Trait Objects][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/trait-objects.html
+[2]: ch17-02-trait-objects.html
diff --git a/rustbook-ru/redirects/traits.md b/rustbook-ru/redirects/traits.md
new file mode 100644
index 000000000..dcb577e97
--- /dev/null
+++ b/rustbook-ru/redirects/traits.md
@@ -0,0 +1,24 @@
+% Traits
+
+There is a new edition of the book and this is an old link.
+
+> Traits abstract over behavior that types can have in common.
+
+```rust
+pub trait Summarizable {
+    fn summary(&self) -> String;
+}
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 10.02 — Traits][2]**
+* [in the current edition: Ch 19.03 — Advanced Traits][3]
+* [In the first edition: Ch 3.19 — Traits][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/traits.html
+[2]: ch10-02-traits.html
+[3]: ch19-03-advanced-traits.html
diff --git a/rustbook-ru/redirects/type-aliases.md b/rustbook-ru/redirects/type-aliases.md
new file mode 100644
index 000000000..85cd4c9ec
--- /dev/null
+++ b/rustbook-ru/redirects/type-aliases.md
@@ -0,0 +1,14 @@
+% `type` aliases
+
+There is a new edition of the book and this is an old link.
+
+> Rust provides the ability to declare a _type alias_ with the `type` keyword to give an existing type another name.
+
+```rust
+type Kilometers = i32;
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-04-advanced-types.html#creating-type-synonyms-with-type-aliases).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/ufcs.md b/rustbook-ru/redirects/ufcs.md
new file mode 100644
index 000000000..2959c06bd
--- /dev/null
+++ b/rustbook-ru/redirects/ufcs.md
@@ -0,0 +1,48 @@
+% Universal Function Call Syntax
+
+There is a new edition of the book and this is an old link.
+
+> Rust cannot prevent a trait from having a method with the same name as another trait’s method, nor can it prevent us from implementing both of these traits on one type.
+> In order to be able to call each of the methods with the same name, then, we need to tell Rust which one we want to use.
+
+```rust
+trait Pilot {
+    fn fly(&self);
+}
+
+trait Wizard {
+    fn fly(&self);
+}
+
+struct Human;
+
+impl Pilot for Human {
+#     fn fly(&self) {
+#         println!("This is your captain speaking.");
+#     }
+}
+
+impl Wizard for Human {
+#     fn fly(&self) {
+#         println!("Up!");
+#     }
+}
+
+impl Human {
+#     fn fly(&self) {
+#         println!("*waving arms furiously*");
+#     }
+}
+
+fn main() {
+    let person = Human;
+    Pilot::fly(&person);
+    Wizard::fly(&person);
+    person.fly();
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/unsafe.md b/rustbook-ru/redirects/unsafe.md
new file mode 100644
index 000000000..8628c7aa9
--- /dev/null
+++ b/rustbook-ru/redirects/unsafe.md
@@ -0,0 +1,18 @@
+% `unsafe`
+
+There is a new edition of the book and this is an old link.
+
+> Rust has a second language hiding out inside of it, unsafe Rust, which does not enforce memory safety guarantees.
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 19.01 — Unsafe Rust][2]**
+* [The Rustonomicon, The Dark Arts of Advanced and Unsafe Rust Programming][3]
+* [In the first edition: Ch 3.36 — `unsafe`][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/unsafe.html
+[2]: ch19-01-unsafe-rust.html
+[3]: ../nomicon/index.html
diff --git a/rustbook-ru/redirects/unsized-types.md b/rustbook-ru/redirects/unsized-types.md
new file mode 100644
index 000000000..bd9582cba
--- /dev/null
+++ b/rustbook-ru/redirects/unsized-types.md
@@ -0,0 +1,18 @@
+% Unsized Types
+
+There is a new edition of the book and this is an old link.
+
+> Sometimes referred to as ‘DSTs’ or ‘unsized types’, these types let us talk about types whose size we can only know at runtime.
+> The `Sized` trait is automatically implemented for everything the compiler knows the size of at compile time.
+> A trait bound on `?Sized` is the opposite of a trait bound on `Sized`; that is, we would read this as “`T` may or may not be `Sized`”.
+
+```rust,ignore
+fn generic(t: &T) {
+    // ...snip...
+}
+```
+
+---
+
+You can find the latest version of this information
+[here](ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/using-rust-without-the-standard-library.md b/rustbook-ru/redirects/using-rust-without-the-standard-library.md
new file mode 100644
index 000000000..0fbdfebdd
--- /dev/null
+++ b/rustbook-ru/redirects/using-rust-without-the-standard-library.md
@@ -0,0 +1,17 @@
+% Using Rust without the Standard Library
+
+There is a new edition of the book and this is an old link.
+
+> Rust’s standard library provides a lot of useful functionality, but assumes support for various features of its host system: threads, networking, heap allocation, and others.
+> There are systems that do not have these features, however.
+
+---
+
+This particular chapter has moved to [the Rustonomicon][2].
+
+* **[In the Rustonomicon: Beneath std][2]**
+* [In the first edition: Ch 4.12 — Using Rust without the Standard Library][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/using-rust-without-the-standard-library.html
+[2]: ../nomicon/beneath-std.html
diff --git a/rustbook-ru/redirects/variable-bindings.md b/rustbook-ru/redirects/variable-bindings.md
new file mode 100644
index 000000000..0bd437ec3
--- /dev/null
+++ b/rustbook-ru/redirects/variable-bindings.md
@@ -0,0 +1,14 @@
+% Variable Bindings
+
+There is a new edition of the book and this is an old link.
+
+> Variable bindings bind some value to a name, so it can be used later.
+
+```rust
+let foo = 5;
+```
+
+---
+
+You can find the latest version of this information
+[here](ch02-00-guessing-game-tutorial.html#storing-values-with-variables).
\ No newline at end of file
diff --git a/rustbook-ru/redirects/vectors.md b/rustbook-ru/redirects/vectors.md
new file mode 100644
index 000000000..1359f9da8
--- /dev/null
+++ b/rustbook-ru/redirects/vectors.md
@@ -0,0 +1,23 @@
+% Vectors
+
+There is a new edition of the book and this is an old link.
+
+> Vectors store more than one value in a single data structure that puts all the values next to each other in memory.
+> Vectors can only store values of the same type.
+
+```rust
+let v: Vec = Vec::new();
+let numbers = vec![1, 2, 3];
+```
+
+---
+
+Here are the relevant sections in the new and old books:
+
+* **[in the current edition: Ch 8.01 — Vectors][2]**
+* [In the first edition: Ch 3.7 — Vectors][1]
+
+
+[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/vectors.html
+[2]: ch08-01-vectors.html
+
diff --git a/rustbook-ru/rust-toolchain b/rustbook-ru/rust-toolchain
new file mode 100644
index 000000000..ea3769f29
--- /dev/null
+++ b/rustbook-ru/rust-toolchain
@@ -0,0 +1 @@
+1.81
diff --git a/rustbook-ru/rustfmt.toml b/rustbook-ru/rustfmt.toml
new file mode 100644
index 000000000..df99c6919
--- /dev/null
+++ b/rustbook-ru/rustfmt.toml
@@ -0,0 +1 @@
+max_width = 80
diff --git a/rustbook-ru/src/SUMMARY.md b/rustbook-ru/src/SUMMARY.md
index d5fe6cad2..57102dd0d 100644
--- a/rustbook-ru/src/SUMMARY.md
+++ b/rustbook-ru/src/SUMMARY.md
@@ -1,6 +1,6 @@
-# The Rust Programming Language
+# The Ржавчина Programming Language
 
-[Язык программирования Rust](title-page.md) [Предисловие](foreword.md) [Введение](ch00-00-introduction.md)
+[Язык программирования Ржавчина](title-page.md) [Предисловие](foreword.md) [Введение](ch00-00-introduction.md)
 
 ## С чего начать
 
@@ -12,46 +12,46 @@
 
 - [Программирование игры в загадки](ch02-00-guessing-game-tutorial.md)
 
-- [Общие концепции программирования](ch03-00-common-programming-concepts.md)
+- [Общие подходы программирования](ch03-00-common-programming-concepts.md)
 
     - [Переменные и изменяемость](ch03-01-variables-and-mutability.md)
-    - [Типы Данных](ch03-02-data-types.md)
+    - [Виды Данных](ch03-02-data-types.md)
     - [Функции](ch03-03-how-functions-work.md)
-    - [Комментарии](ch03-04-comments.md)
-    - [Управляющие конструкции](ch03-05-control-flow.md)
+    - [Примечания](ch03-04-comments.md)
+    - [Круговороты](ch03-05-control-flow.md)
 
 - [Понимание владения](ch04-00-understanding-ownership.md)
 
     - [Что такое "владение"?](ch04-01-what-is-ownership.md)
     - [Ссылки и заимствование](ch04-02-references-and-borrowing.md)
-    - [Тип среза](ch04-03-slices.md)
+    - [Вид среза](ch04-03-slices.md)
 
-- [Использование структур для объединения связанных данных](ch05-00-structs.md)
+- [Использование стопок для объединения связанных данных](ch05-00-structs.md)
 
-    - [Определение и создание экземпляров структур](ch05-01-defining-structs.md)
-    - [Пример программы, использующей структуры](ch05-02-example-structs.md)
-    - [Синтаксис метода](ch05-03-method-syntax.md)
+    - [Определение и создание образцов стопок](ch05-01-defining-structs.md)
+    - [Пример программы, использующей устройства](ch05-02-example-structs.md)
+    - [Правила написания способов](ch05-03-method-syntax.md)
 
 - [Перечисления и сопоставление с образцом](ch06-00-enums.md)
 
     - [Определение Enum](ch06-01-defining-an-enum.md)
-    - [Конструкция потока управления `match`](ch06-02-match.md)
-    - [Лаконичный поток управления с `if let`](ch06-03-if-let.md)
+    - [Устройство потока управления `match`](ch06-02-match.md)
+    - [Краткий поток управления с `if let`](ch06-03-if-let.md)
 
-## Основы Rust
+## Основы Ржавчины
 
-- [Управление растущими проектами с помощью пакетов, крейтов и модулей](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md)
+- [Управление растущими делами с помощью дополнений, ящиков и разделов](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md)
 
-    - [Пакеты и крейты](ch07-01-packages-and-crates.md)
-    - [Определение модулей для управления областью действия и конфиденциальностью](ch07-02-defining-modules-to-control-scope-and-privacy.md)
-    - [Пути для ссылки на элемент в дереве модулей](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md)
+    - [Дополнения и ящики](ch07-01-packages-and-crates.md)
+    - [Определение разделов для управления областью действия и тайностью](ch07-02-defining-modules-to-control-scope-and-privacy.md)
+    - [Пути для ссылки на переменную в дереве разделов](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md)
     - [Введение путей в область видимости с помощью ключевого слова `use`](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md)
-    - [Separating Modules into Different Files](ch07-05-separating-modules-into-different-files.md)
+    - [Разделение разделов на разные файлы](ch07-05-separating-modules-into-different-files.md)
 
-- [Общие коллекции](ch08-00-common-collections.md)
+- [Общее: Собрания](ch08-00-common-collections.md)
 
     - [Хранение списков значений с векторами](ch08-01-vectors.md)
-    - [Хранение закодированного текста UTF-8 со строками](ch08-02-strings.md)
+    - [Хранение закодированного писания UTF-8 со строками](ch08-02-strings.md)
     - [Хранение ключей со связанными значениями в HashMap](ch08-03-hash-maps.md)
 
 - [Обработка ошибок](ch09-00-error-handling.md)
@@ -60,94 +60,94 @@
     - [Устранимые ошибки с `Result`](ch09-02-recoverable-errors-with-result.md)
     - [`panic!` или Не `panic!`](ch09-03-to-panic-or-not-to-panic.md)
 
-- [Общие типы, трейты (характеристики) и время жизни](ch10-00-generics.md)
+- [Общие виды данных, сущности (свойства) и время жизни](ch10-00-generics.md)
 
-    - [Обобщённые типы данных](ch10-01-syntax.md)
-    - [Трейты (характеристики): определение разделяемого поведения](ch10-02-traits.md)
-    - [Валидация ссылок посредством сроков жизни](ch10-03-lifetime-syntax.md)
+    - [Обобщённые виды данных](ch10-01-syntax.md)
+    - [Сущности (свойства): определение разделяемого поведения](ch10-02-traits.md)
+    - [Проверка действительности ссылок посредством сроков жизни](ch10-03-lifetime-syntax.md)
 
-- [Написание автоматических тестов](ch11-00-testing.md)
+- [Написание самостоятельно х проверок](ch11-00-testing.md)
 
-    - [Как писать тесты](ch11-01-writing-tests.md)
-    - [Управление выполнением тестов](ch11-02-running-tests.md)
-    - [Организация тестов](ch11-03-test-organization.md)
+    - [Как писать проверки](ch11-01-writing-tests.md)
+    - [Управление выполнением проверок](ch11-02-running-tests.md)
+    - [Создание проверок](ch11-03-test-organization.md)
 
-- [Проект с вводом-выводом: создание программы командной строки](ch12-00-an-io-project.md)
+- [Дело с вводом-выводом: создание программы приказной строки](ch12-00-an-io-project.md)
 
-    - [Получение аргументов командной строки](ch12-01-accepting-command-line-arguments.md)
+    - [Получение переменных приказной строки](ch12-01-accepting-command-line-arguments.md)
     - [Чтение файла](ch12-02-reading-a-file.md)
-    - [Рефакторинг для обеспечения модульности и улучшения обработки ошибок](ch12-03-improving-error-handling-and-modularity.md)
-    - [Разработка функциональности библиотеки с помощью разработки через тестирование](ch12-04-testing-the-librarys-functionality.md)
+    - [Переработка рукописи для обеспечения выделения на разделы и улучшения обработки ошибок](ch12-03-improving-error-handling-and-modularity.md)
+    - [Разработка возможности библиотеки с помощью разработки через проверку](ch12-04-testing-the-librarys-functionality.md)
     - [Работа с переменными среды](ch12-05-working-with-environment-variables.md)
     - [Запись сообщений об ошибках в stderr вместо stdout](ch12-06-writing-to-stderr-instead-of-stdout.md)
 
-## Думать на Rust
+## Думать на Ржавчины
 
-- [Функциональные возможности языка: итераторы и замыкания](ch13-00-functional-features.md)
+- [Полезные  возможности языка: повторители и замыкания](ch13-00-functional-features.md)
 
     - [Замыкания: анонимные функции, которые захватывают своё окружение](ch13-01-closures.md)
-    - [Обработка последовательности элементов с помощью итераторов](ch13-02-iterators.md)
-    - [Улучшение нашего проекта с вводом/выводом](ch13-03-improving-our-io-project.md)
-    - [Сравнение производительности: циклы и итераторы](ch13-04-performance.md)
+    - [Обработка последовательности переменных с помощью повторителей](ch13-02-iterators.md)
+    - [Улучшение нашего дела с вводом/выводом](ch13-03-improving-our-io-project.md)
+    - [Сравнение производительности: круговороты и повторители](ch13-04-performance.md)
 
 - [Подробнее о Cargo и Crates.io](ch14-00-more-about-cargo.md)
 
-    - [Настройка билдов с помощью профилей выпуска](ch14-01-release-profiles.md)
-    - [Публикация крейта на Crates.io](ch14-02-publishing-to-crates-io.md)
+    - [Настройка сборок с помощью профилей выпуска](ch14-01-release-profiles.md)
+    - [Обнародование ящика на Crates.io](ch14-02-publishing-to-crates-io.md)
     - [Рабочие области Cargo](ch14-03-cargo-workspaces.md)
-    - [Установка бинарных файлов с Crates.io с помощью `cargo install`](ch14-04-installing-binaries.md)
-    - [Расширение возможностей Cargo путём добавления пользовательских команд](ch14-05-extending-cargo.md)
+    - [Установка двоичных файлов с Crates.io с помощью `cargo install`](ch14-04-installing-binaries.md)
+    - [Расширение возможностей Cargo путём добавления пользовательских приказов](ch14-05-extending-cargo.md)
 
 - [Умные указатели](ch15-00-smart-pointers.md)
 
     - [Использование `Box` для указания на данные в куче](ch15-01-box.md)
-    - [Работа с умными указателями как с обычными ссылками с помощью трейта `Deref`](ch15-02-deref.md)
-    - [Выполнение кода при очистке с помощью трейта `Drop`](ch15-03-drop.md)
+    - [Работа с умными указателями как с обычными ссылками с помощью сущности `Deref`](ch15-02-deref.md)
+    - [Выполнение рукописи при очистке с помощью сущности `Drop`](ch15-03-drop.md)
     - [`Rc`, умный указатель с подсчётом ссылок](ch15-04-rc.md)
     - [`RefCell` и внутренняя изменяемость](ch15-05-interior-mutability.md)
-    - [Ссылочные циклы могут привести к утечке памяти](ch15-06-reference-cycles.md)
+    - [Ссылочные круговороты могут привести к утечке памяти](ch15-06-reference-cycles.md)
 
-- [Безбоязненный параллелизм](ch16-00-concurrency.md)
+- [Безбоязненный одновременность](ch16-00-concurrency.md)
 
-    - [Использование потоков для параллельного выполнения кода](ch16-01-threads.md)
+    - [Использование потоков для одновременного выполнения рукописи](ch16-01-threads.md)
     - [Пересылка сообщений для передачи данных между потоками](ch16-02-message-passing.md)
-    - [Параллелизм с общим состоянием](ch16-03-shared-state.md)
-    - [Расширяемый параллелизм с помощью трейтов `Sync` и `Send`](ch16-04-extensible-concurrency-sync-and-send.md)
+    - [Одновременность с общим состоянием](ch16-03-shared-state.md)
+    - [Расширяемый одновременность с помощью сущностей `Sync` и `Send`](ch16-04-extensible-concurrency-sync-and-send.md)
 
-- [Возможности объектно-ориентированного программирования Rust](ch17-00-oop.md)
+- [Возможности предметно-направленного программирования Ржавчина](ch17-00-oop.md)
 
-    - [Характеристики объектно-ориентированных языков](ch17-01-what-is-oo.md)
-    - [Использование трейт-объектов, допускающих значения разных типов](ch17-02-trait-objects.md)
-    - [Реализация шаблона объектно-ориентированного проектирования](ch17-03-oo-design-patterns.md)
+    - [Свойства предметно-направленных языков](ch17-01-what-is-oo.md)
+    - [Использование сущность-предметов, допускающих значения разных видов данных](ch17-02-trait-objects.md)
+    - [Выполнение образца данных предметно-направленной разработки](ch17-03-oo-design-patterns.md)
 
-## Продвинутые темы
+## Продвинутые сути
 
-- [Шаблоны и сопоставление](ch18-00-patterns.md)
+- [Образцы и сопоставление](ch18-00-patterns.md)
 
-    - [Все места, где могут использоваться шаблоны](ch18-01-all-the-places-for-patterns.md)
-    - [Опровержимость: может ли шаблон не соответствовать](ch18-02-refutability.md)
-    - [Синтаксис шаблона](ch18-03-pattern-syntax.md)
+    - [Все места, где могут использоваться образцы](ch18-01-all-the-places-for-patterns.md)
+    - [Опровержимость: может ли образец данных не соответствовать](ch18-02-refutability.md)
+    - [Правила написания образца](ch18-03-pattern-syntax.md)
 
 - [Расширенные возможности](ch19-00-advanced-features.md)
 
-    - [Небезопасный код в Rust](ch19-01-unsafe-rust.md)
-    - [Продвинутые типажи](ch19-03-advanced-traits.md)
-    - [Продвинутые типы](ch19-04-advanced-types.md)
+    - [Небезопасная рукопись в Ржавчине](ch19-01-unsafe-rust.md)
+    - [Продвинутые сущности](ch19-03-advanced-traits.md)
+    - [Продвинутые виды данных](ch19-04-advanced-types.md)
     - [Продвинутые функции и замыкания](ch19-05-advanced-functions-and-closures.md)
     - [Макросы](ch19-06-macros.md)
 
-- [Финальный проект: создание многопоточного веб-сервера](ch20-00-final-project-a-web-server.md)
+- [Конечный дело: создание многопоточного сетевого-отдельного вычислителя](ch20-00-final-project-a-web-server.md)
 
-    - [Создание однопоточного веб-сервера](ch20-01-single-threaded.md)
-    - [Превращение нашего однопоточного сервера в многопоточный сервер](ch20-02-multithreaded.md)
+    - [Создание однопоточного сетевого-отдельного вычислителя](ch20-01-single-threaded.md)
+    - [Превращение нашего однопоточного отдельного вычислителя в многопоточный отдельный вычислитель](ch20-02-multithreaded.md)
     - [	Мягкое завершение работы и очистка](ch20-03-graceful-shutdown-and-cleanup.md)
 
 - [Приложения](appendix-00.md)
 
     - [А — Ключевые слова](appendix-01-keywords.md)
-    - [B — Операторы и символы](appendix-02-operators.md)
-    - [C — Выводимые трейты](appendix-03-derivable-traits.md)
-    - [D — Полезные инструменты разработки](appendix-04-useful-development-tools.md)
-    - [E — Редакции](appendix-05-editions.md)
+    - [B — Приказчики и знаки](appendix-02-operators.md)
+    - [C — Выводимые сущности](appendix-03-derivable-traits.md)
+    - [D — Полезные средства разработки](appendix-04-useful-development-tools.md)
+    - [E — Издания](appendix-05-editions.md)
     - [F — Переводы книги](appendix-06-translation.md)
-    - [G — Как создаётся Rust и «Nightly Rust»](appendix-07-nightly-rust.md)
+    - [G — Как создаётся Ржавчина и «Ночное издание Ржавчины»](appendix-07-nightly-rust.md)
diff --git a/rustbook-ru/src/appendix-00.md b/rustbook-ru/src/appendix-00.md
index e61333579..7c38cc5db 100644
--- a/rustbook-ru/src/appendix-00.md
+++ b/rustbook-ru/src/appendix-00.md
@@ -1,3 +1,3 @@
-# Дополнительная информация
+# Дополнительные сведения
 
-Следующие разделы содержат справочные материалы, которые могут оказаться полезными в вашем путешествии по Rust.
+Следующие разделы содержат справочные сведения, которые могут оказаться полезными в вашем путешествии по Ржавчине.
diff --git a/rustbook-ru/src/appendix-01-keywords.md b/rustbook-ru/src/appendix-01-keywords.md
index 0e6bcc290..ba8f3b294 100644
--- a/rustbook-ru/src/appendix-01-keywords.md
+++ b/rustbook-ru/src/appendix-01-keywords.md
@@ -1,54 +1,54 @@
 ## Приложение A: Ключевые слова
 
-Следующий список содержит ключевые слова, зарезервированные для текущего или будущего использования в языке Rust. Как таковые их нельзя использовать в качестве идентификаторов (за исключением сырых идентификаторов, которые мы обсудим в разделе [«Сырые идентификаторы]»). Идентификаторы — это имена функций, переменных, параметров, полей структур, модулей, крейтов, констант, макросов, статических значений, атрибутов, типов, свойств или времён жизни.
+Следующий список содержит ключевые слова, забронированные для текущего или будущего использования в языке Ржавчина. Как таковые их нельзя использовать в качестве определителей (за исключением сырых определителей, которые мы обсудим в разделе [«Сырые определители]»). определители — это имена функций, переменных, свойств, полей стопок, разделов, ящиков, постоянных переменных, макросов, постоянных переменных, способов, видов данных, сущностей или времён жизни.
 
 ### Используемые в настоящее время ключевые слова
 
 Ниже приведён список используемых в настоящее время ключевых слов с их описанием.
 
--  `as` — выполнить примитивное преобразование, уточнить конкретную характеристику, которую содержит объект, или переименовать элемент в выражении `use`
-- `async` — возврат `Future` вместо блокировки текущего потока
-- `await` — остановка выполнения до готовности результата `Future`
-- `break` — немедленный выход из цикла
-- `const` — определение константного элемента или неизменяемого сырого указателя
-- `continue` — досрочный переход к следующей итерации цикла
-- `crate` — ссылка на корень пакета в пути к модулю
-- `dyn` — динамическая отсылка к типажу объекта
-- `else` — альтернативные ветви для конструкций управления потока `if` и `if let`
+-  `as` — использовать простое преобразование, уточнить определенное свойство, которое содержит предмет, или переименовать элемент в выражении `use`
+- `async` — возврат `Future` вместо запрета текущего потока
+- `await` — остановка выполнения до готовности итога `Future`
+- `break` — немедленный выход из круговорота
+- `const` — определение постоянной переменной или неизменяемого сырого указателя
+- `continue` — досрочный переход к следующему повторению круговорота
+- `crate` — ссылка на корень дополнения в пути к разделу
+- `dyn` — изменяемая отсылка к сущности предмета
+- `else` — иные  ветви для устройств управления условиями `if` и `if let`
 - `enum` — определение перечислений
 - `extern` — связывание внешней функции или переменной
-- `false` — логический ложный литерал
-- `fn` — определение функции или типа указателя на функцию
-- `for` — циклически перебирать элементы из итератора, реализовывать признак или указывать время жизни с более высоким рейтингом.
-- `if` — ветвление на основе результата условного выражения
-- `impl` — реализация встроенной функциональности или функциональности типажа
-- `in` — часть синтаксиса цикла `for`
+- `false` — разновидность разумного вида данных со значением `ложь`
+- `fn` — определение функции или вида указателя на функцию
+- `for` — замкнутый перебор значений в круговороте.
+- `if` — условный приказчик на основе ветвления из представленных условий
+- `impl` — использование встроенных способов или возможностей сущности
+- `in` — часть правил написания круговорота `for`
 - `let` — объявление (связывание) переменной
-- `loop` — безусловный цикл
-- `match` — сопоставление значения с шаблонами
-- `mod` — определение модуля
-- `move` — перекладывание владения на замыкание всеми захваченными элементами
-- `mut` — обозначение изменчивости в ссылках, сырах указателей и привязках к шаблону
-- `pub` — модификатор публичной доступность полей структур, блоков `impl` и модулей
+- `loop` — безусловный круговорот
+- `match` — сопоставление значения с образцами данных
+- `mod` — определение раздела
+- `move` — перекладывание владения на замыкание всеми захваченными переменными
+- `mut` — обозначение изменяемости в  разных видах данных, в том числе в переменных, ссылках, сырых указателей и привязках к образцу данных
+- `pub` — измениие открытого доступа для полей стопок, разделов `impl` и разделов
 - `ref` — привязка по ссылке
-- `return` — возвращает результат из функции
-- `Self` — псевдоним для определяемого или реализуемого типа
-- `self` — объект текущего метода или модуля
-- `static` — глобальная переменная или время жизни, продолжающееся на протяжении всего выполнения программы
-- `struct` — определение структуры
-- `super` — родительский модуль текущего модуля
-- `trait` — определение типажа
-- `true` — логический истинный литерал
-- `type` — определение псевдонима типа или связанного типа
+- `return` — возвращает итог из функции
+- `Self` — псевдоним для определяемого или исполняемого вида данных
+- `self` — предмет текущего способа или раздела
+- `static` — вездесущая переменная или время жизни, продолжающееся на протяжении всего выполнения программы
+- `struct` — определение стопки
+- `super` — родительское раздел имеющегося
+- `trait` — определение сущности
+- `true` — разновидность разумного вида данных со значением `истина`
+- `type` — определение псевдонима вида данных или связанного вида данных
 - `union` - определить [объединение]; является ключевым словом только при использовании в объявлении объединения
-- `unsafe` — обозначение небезопасного кода, функций, типажей и их реализаций
+- `unsafe` — обозначение небезопасной рукописи, функций, сущностей и их выполнений
 - `use` — ввод имён в область видимости
-- `where` — ограничение типа
-- `while` — условный цикл, основанный на результате выражения
+- `where` — ограничение вида данных
+- `while` — условный круговорот, основанный на итоге выражения
 
-### Ключевые слова, зарезервированные для будущего использования
+### Ключевые слова, забронированные для будущего использования
 
-Следующие ключевые слова ещё не имеют никакой функциональности, но зарезервированы Rust для возможного использования в будущем.
+Следующие ключевые слова ещё не имеют никакой возможности, но забронированы Ржавчиной для возможного использования в будущем.
 
 - `abstract`
 - `become`
@@ -64,11 +64,11 @@
 - `virtual`
 - `yield`
 
-### Сырые идентификаторы
+### Сырые определители
 
-*Сырые идентификаторы* — это синтаксис, позволяющий использовать ключевые слова там, где обычно они не могут быть. Для создания и использования сырого идентификатора к ключевому слову добавляется префикс `r#`.
+*Сырые определители* — это правила написания, позволяющие использовать ключевые слова там, где обычно они не могут быть. Для создания и использования сырого определителя к ключевому слову добавляется приставка `r#`.
 
-Например, ключевое слово `match`. Если вы попытаетесь скомпилировать следующую функцию, использующую в качестве имени `match`:
+Например, ключевое слово `match`. Если вы попытаетесь собрать следующую функцию, использующую в качестве имени `match`:
 
 Файл: src/main.rs
 
@@ -88,7 +88,7 @@ error: expected identifier, found keyword `match`
   |    ^^^^^ expected identifier, found keyword
 ```
 
-Ошибка говорит о том, что вы не можете использовать ключевое слово `match` в качестве идентификатора функции. Чтобы получить возможность использования слова `match` в качестве имени функции, нужно использовать синтаксис «сырых идентификаторов», например так:
+Ошибка говорит о том, что вы не можете использовать ключевое слово `match` в качестве определителя функции. Чтобы получить возможность использования слова `match` в качестве имени функции, нужно использовать правила написания «сырых определителей», например так:
 
 Файл: src/main.rs
 
@@ -102,11 +102,11 @@ fn main() {
 }
 ```
 
-Этот код скомпилируется без ошибок. Обратите внимание, что префикс `r#` в определении имени функции указан так же, как он указан в месте её вызова в `main`.
+Эта рукопись собирается без ошибок. Обратите внимание, что приставка `r#` в определении имени функции указана так же, как она указана в месте её вызова в `main`.
 
-Сырые идентификаторы позволяют вам использовать любое слово, которое вы выберете, в качестве идентификатора, даже если это слово окажется зарезервированным ключевым словом. Это даёт нам больше свободы в выборе имён идентификаторов, а также позволяет нам интегрироваться с программами, написанными на языке, где эти слова не являются ключевыми. Кроме того, необработанные идентификаторы позволяют вам использовать библиотеки, написанные в версии Rust, отличной от используемой в вашем крейте. Например, `try` не является ключевым словом в выпуске 2015 года, но является в выпуске 2018 года. Если вы зависите от библиотеки, написанной с использованием версии 2015 года и имеющей функцию `try`, вам потребуется использовать синтаксис сырого идентификатора, в данном случае `r#try`, для вызова этой функции из кода версии 2018 года. См. [Приложение E] для получения дополнительной информации о редакциях Rust.
+Сырые определители позволяют вам использовать любое слово, которое вы выберете, в качестве определителя, даже если это слово окажется забронированным ключевым словом. Это даёт нам больше свободы в выборе имён определителей, а также позволяет нам встраиваться с программами, написанными на языке, где эти слова не являются ключевыми. Кроме того, необработанные определители позволяют вам использовать библиотеки, написанные в исполнениях Ржавчины, отличной от используемой в вашем ящике. Например, `try` не является ключевым словом в выпуске 2015 года, но является в выпуске 2018 года. Если вы зависите от библиотеки, написанной с использованием исполнения 2015 года и имеющей функцию `try`, вам потребуется использовать правила написания сырого определителя, в данном случае `r#try`, для вызова этой функции из рукописи исполнения 2018 года. См. [Приложение E] для получения дополнительных сведений о изданиях Ржавчины.
 
 
-[«Сырые идентификаторы]: #raw-identifiers
+[«Сырые определители]: #raw-identifiers
 [объединение]: ../reference/items/unions.html
 [Приложение E]: appendix-05-editions.html
\ No newline at end of file
diff --git a/rustbook-ru/src/appendix-02-operators.md b/rustbook-ru/src/appendix-02-operators.md
index a0b835dce..165468fff 100644
--- a/rustbook-ru/src/appendix-02-operators.md
+++ b/rustbook-ru/src/appendix-02-operators.md
@@ -1,57 +1,57 @@
-## Дополнение Б: Операторы и обозначения
+## Дополнение Б: Отдельные вычислители и обозначения
 
-Это дополнение содержит глоссарий синтаксиса Rust, включая операторы и другие обозначения, которые появляются сами по себе или в контексте путей, обобщений, типажей, макросов, атрибутов, комментариев, кортежей и скобок.
+Это дополнение содержит свод правил написания Ржавчины, включая приказчики и другие обозначения, которые появляются сами по себе или в среде путей, обобщений, сущностей, макросов, свойств, примечаний, упорядоченных рядов и скобок.
 
-### Операторы
+### Приказчики
 
-Таблица Б-1 содержит операторы языка Rust, пример появления оператора, короткое объяснение, возможность перегрузки оператора. Если оператор можно перегрузить, то показан типаж, с помощью которого его можно перегрузить.
+Таблица Б-1 содержит приказчики языка Ржавчина, пример появления приказчика, короткое объяснение, возможность перегрузки приказчика. Если приказчик можно перегрузить, то показана сущность, с помощью которого его можно перегрузить.
 
-Таблица Б-1: Операторы
+Таблица Б-1: Приказчики
 
-Оператор | Пример | Объяснение | Перегружаемость
+Приказчик | Пример | Объяснение | Перегружаемость
 --- | --- | --- | ---
 `!` | `ident!(...)`, `ident!{...}`, `ident![...]` | Вызов макроса |
-`!` | `!expr` | Побитовое или логическое отрицание | `Not`
+`!` | `!expr` | Побитовое или разумное отрицание | `Not`
 `!=` | `expr != expr` | Сравнение "не равно" | `PartialEq`
 `%` | `expr % expr` | Остаток от деления | `Rem`
 `%=` | `var %= expr` | Остаток от деления и присваивание | `RemAssign`
 `&` | `&expr`, `&mut expr` | Заимствование |
-`&` | `&type`, `&mut type`, `&'a type`, `&'a mut type` | Указывает что данный тип заимствуется |
+`&` | `&type`, `&mut type`, `&'a type`, `&'a mut type` | Указание что данный вид данных заимствуется |
 `&` | `expr & expr` | Побитовое И | `BitAnd`
 `&=` | `var &= expr` | Побитовое И и присваивание | `BitAndAssign`
-`&&` | `expr && expr` | Логическое И |
+`&&` | `expr && expr` | Разумное И |
 `*` | `expr * expr` | Арифметическое умножение | `Mul`
 `*=` | `var *= expr` | Арифметическое умножение и присваивание | `MulAssign`
 `*` | `*expr` | Разыменование ссылки | `Deref`
-`*` | `*const type`, `*mut type` | Указывает, что данный тип является сырым указателем |
-`+` | `trait + trait`, `'a + trait` | Соединение ограничений типа |
+`*` | `*const type`, `*mut type` | Указывает, что данный вид данных является сырым указателем |
+`+` | `trait + trait`, `'a + trait` | Соединение ограничений вида |
 `+` | `expr + expr` | Арифметическое сложение | `Add`
 `+=` | `var += expr` | Арифметическое сложение и присваивание | `AddAssign`
-`,` | `expr, expr` | Разделитель аргументов и элементов |
+`,` | `expr, expr` | Разделитель переменных и значений |
 `-` | `- expr` | Арифметическое отрицание | `Neg`
 `-` | `expr - expr` | Арифметическое вычитание | `Sub`
 `-` | `var -= expr` | Арифметическое вычитание и присваивание | `SubAssign`
 `->` | `fn(...) -> type`, &vert;...&vert; -> type | ... |
-`.` | `expr.ident` | Доступ к элементу |
-`..` | `..`, `expr..`, `..expr`, `expr..expr` | Указывает на диапазон чисел, исключая правый | `PartialOrd`
-`..=` | `..=expr`, `expr..=expr` | Указывает на диапазон чисел, включая правый | `PartialOrd`
-`..` | `..expr` | Синтаксис обновления структуры |
+`.` | `expr.ident` | Доступ к переменной |
+`..` | `..`, `expr..`, `..expr`, `expr..expr` | Указывает на ряд чисел, исключая правый | `PartialOrd`
+`..=` | `..=expr`, `expr..=expr` | Указывает на ряд чисел, включая правый | `PartialOrd`
+`..` | `..expr` | правила написания обновления стопки |
 `..` | `variant(x, ..)`, `struct_type { x, .. }` | Привязка «И все остальное» |
-`...` | `expr...expr` | (Устарело, используйте новый синтаксис `..=`) Используется при определении инклюзивного диапазона |
+`...` | `expr...expr` | (Устарело, используйте новое правило написания `..=`) Используется при определении инклюзивного ряда|
 `/` | `expr / expr` | Арифметическое деление | `Div`
 `/=` | `var /= expr` | Арифметическое деление и присваивание | `DivAssign`
-`:` | `pat: type`, `ident: type` | Ограничения типов |
-`:` | `ident: expr` | Инициализация поля структуры |
-`:` | `'a: loop {...}` | Метка цикла |
-`;` | `expr;` | Признак конца инструкции и элемента |
-`;` | `[...; len]` | Часть синтаксиса массива фиксированного размера |
+`:` | `pat: type`, `ident: type` | Ограничения видов |
+`:` | `ident: expr` | Объявление поля стопки |
+`:` | `'a: loop {...}` | Метка круговорота |
+`;` | `expr;` | Признак конца указания и переменной |
+`;` | `[...; len]` | Часть правил написания массива конечного размера |
 `<<` | `expr << expr` | Битовый сдвиг влево | `Shl`
 `<<=` | `var <<= expr` | Битовый сдвиг влево и присваивание | `ShlAssign`
 `<` | `expr < expr` | Сравнение "меньше чем" | `PartialOrd`
 `<=` | `expr <= expr` | Сравнение "меньше или равно" | `PartialOrd`
-`=` | `var = expr`, `ident = type` | Присваивание/эквивалентность |
+`=` | `var = expr`, `ident = type` | Присваивание/равнозначность |
 `==` | `expr == expr` | Сравнение "равно" | `PartialEq`
-`=>` | `pat => expr` | Часть синтаксиса конструкции match |
+`=>` | `pat => expr` | Часть правил написания стопки match |
 `>` | `expr > expr` | Сравнение "больше чем" | `PartialOrd`
 `>=` | `expr >= expr` | Сравнение "больше или равно" | `PartialOrd`
 `>>` | `expr >> expr` | Битовый сдвиг вправо | `Shr`
@@ -59,136 +59,136 @@
 `@` | `ident @ pat` | Pattern binding |
 `^` | `expr ^ expr` | Побитовое исключающее ИЛИ | `BitXor`
 `^=` | `var ^= expr` | Побитовое исключающее ИЛИ и присваивание | `BitXorAssign`
-&vert; | pat &vert; pat | Альтернативные шаблоны |
+&vert; | pat &vert; pat | Иные образцы |
 &vert; | expr &vert; expr | Побитовое ИЛИ | `BitOr`
 &vert;= | var &vert;= expr | Побитовое ИЛИ и присваивание | `BitOrAssign`
-&vert;&vert; | expr &vert;&vert; expr | Короткое логическое ИЛИ |
+&vert;&vert; | expr &vert;&vert; expr | Короткое разумное ИЛИ |
 `?` | `expr?` | Возврат ошибки |
 
-### Обозначения не-операторы
+### Обозначения не-приказчики
 
-Следующий список содержит все символы, которые не работают как операторы; то есть они не ведут себя как вызов функции или метода.
+Следующий список содержит все знаки, которые не работают как приказчики; то есть они не ведут себя как вызов функции или способа.
 
-Таблица Б-2 показывает символы, которые появляются сами по себе и допустимы в различных местах.
+Таблица Б-2 показывает знаки, которые появляются сами по себе и допустимы в различных местах.
 
-Таблица Б-2: Автономный синтаксис
+Таблица Б-2: Независимые правила написания
 
 Обозначение | Объяснение
 --- | ---
-`'ident` | Именованное время жизни или метка цикла
-`...u8`, `...i32`, `...f64`, `...usize`, etc. | Числовой литерал определённого типа
-`"..."` | Строковый литерал
-`r"..."`, `r#"..."#`, `r##"..."##`, etc. | Необработанный строковый литерал, в котором не обрабатываются escape-символы
-`b"..."` | Строковый литерал байтов; создаёт массив байтов вместо строки
-`br"..."`, `br#"..."#`, `br##"..."##`, etc. | Необработанный строковый байтовый литерал, комбинация необработанного и байтового литерала
-`'...'` | Символьный литерал
-`b'...'` | ASCII байтовый литерал
+`'ident` | Именованное время жизни или метка круговорота
+`...u8`, `...i32`, `...f64`, `...usize`, etc. | Числовая запись определённого вида данных
+`"..."` | Строковый запись
+`r"..."`, `r#"..."#`, `r##"..."##`, etc. | Необработанная строковая запись, в котором не обрабатываются escape-знаки
+`b"..."` | Строковый запись байтов; создаёт массив байтов вместо строки
+`br"..."`, `br#"..."#`, `br##"..."##`, etc. | Необработанная строковая байтовый запись, сочетание необработанной и байтовой записи
+`'...'` | Знаковая запись
+`b'...'` | ASCII байтовая запись
 &vert;...&vert; expr | Замыкание
-`!` | Всегда пустой тип для расходящихся функций
-`_` | «Игнорируемое» связывание шаблонов; также используется для читабельности целочисленных литералов
+`!` | Всегда пустой вид для расходящихся функций
+`_` | «Пренебрегаемое» связывание образцов; также используется для удобства чтения целочисленных записей
 
-Таблица Б-3 показывает обозначения которые появляются в контексте путей иерархии модулей
+Таблица Б-3 показывает обозначения, которые появляются в среде путей упорядочивания разделов
 
-Таблица Б-3. Синтаксис, связанный с путями
+Таблица Б-3. Правила написания, связанный с путями
 
 Обозначение | Объяснение
 --- | ---
 `ident::ident` | Путь к пространству имён
-`::path` | Путь относительно корня крейта (т. е. явный абсолютный путь)
-`self::path` | Путь относительно текущего модуля (т. е. явный относительный путь).
-`super::path` | Путь относительно родительского модуля текущего модуля
-`type::ident`, `::ident` | Ассоциированные константы, функции и типы
-`::...` | Ассоциированный элемент для типа, который не может быть назван прямо (например `<&T>::...`, `<[T]>::...`, etc.)
-`trait::method(...)` | Устранение неоднозначности вызова метода путём именования типажа, который определяет его
-`type::method(...)` | Устранение неоднозначности путём вызова метода через имя типа, для которого он определён
-`::method(...)` | Устранение неоднозначности вызова метода путём именования типажа и типа
+`::path` | Путь относительно корня ящика (т. е. явный безусловный путь)
+`self::path` | Путь относительно текущего раздела (т. е. явный относительный путь).
+`super::path` | Путь относительно родительского раздела текущего раздела
+`type::ident`, `::ident` | Сопряженные постоянные переменные, функции и виды данных
+`::...` | Сопряженная переменная для вида данных, который не может быть назван прямо (например `<&T>::...`, `<[T]>::...`, etc.)
+`trait::method(...)` | Устранение неоднозначности вызова способа путём именования сущности, который определяет его
+`type::method(...)` | Устранение неоднозначности путём вызова способа через имя вида данных, для которого он определён
+`::method(...)` | Устранение неоднозначности вызова способа путём именования сущности и вида данных
 
-Таблица Б-4 показывает обозначения которые появляются в контексте использования обобщённых типов параметров
+Таблица Б-4 показывает обозначения, которые появляются в среде использования обобщённых видов свойств
 
 Таблица Б-4: Обобщения
 
 Обозначение | Объяснение
 --- | ---
-`path<...>` | Определяет параметры для обобщённых параметров в типе (e.g., `Vec`)
-`path::<...>`, `method::<...>` | Определяет параметры для обобщённых параметров, функций, или методов в выражении. Часто называют turbofish (например `"42".parse::()`)
+`path<...>` | Определяет свойства для обобщённых свойств в виде (e.g., `Vec`)
+`path::<...>`, `method::<...>` | Определяет свойства для обобщённых свойств, функций, или способов в выражении. Часто называют turbofish (например `"42".parse::()`)
 `fn ident<...> ...` | Определение обобщённой функции
-`struct ident<...> ...` | Определение обобщённой структуры
+`struct ident<...> ...` | Определение обобщённой стопки
 `enum ident<...> ...` | Объявление обобщённого перечисления
-`impl<...> ...` | Определение обобщённой реализации
+`impl<...> ...` | Определение обобщённого выполнения
 `for<...> type` | Высокоуровневое связывание времени жизни
-`type` | Обобщённый тип где один или более ассоциированных типов имеют определённое присваивание (например `Iterator`)
+`type` | Обобщённый вид где один или более сопряженных видов имеют определённое присваивание (например `Iterator`)
 
-Таблица Б-5 показывает обозначения которые появляются в контексте использования обобщённых типов параметров с ограничениями типов
+Таблица Б-5 показывает обозначения, которые появляются в среде использования обобщённых видов свойств с ограничениями видов
 
-Таблица Б-5: Ограничения типов
+Таблица Б-5: Ограничения видов
 
 Обозначение | Объяснение
 --- | ---
-`T: U` | Обобщённый параметр `T` ограничивается до типов которые реализуют типаж `U`
-`T: 'a` | Обобщённый тип `T` должен существовать не меньше чем `'a` (то есть тип не может иметь ссылки с временем жизни меньше чем `'a`)
-`T: 'static` | Обобщённый тип `T` не имеет заимствованных ссылок кроме имеющих время жизни `'static`
+`T: U` | Обобщённое свойство `T` ограничивается до видов, которые используют сущность `U`
+`T: 'a` | Обобщённый вид данных `T` должен существовать не меньше чем `'a` (то есть вид данных не может иметь ссылки с временем жизни меньше чем `'a`)
+`T: 'static` | Обобщённый вид данных `T` не имеет заимствованных ссылок кроме имеющих время жизни `'static`
 `'b: 'a` | Обобщённое время жизни `'b` должно быть не меньше чем `'a`
-`T: ?Sized` | Позволяет обобщённым типам параметра иметь динамический размер
-`'a + trait`, `trait + trait` | Соединение ограничений типов
+`T: ?Sized` | Позволяет обобщённым видам данных свойства иметь изменяемый размер
+`'a + trait`, `trait + trait` | Соединение ограничений видов
 
-Таблица Б-6 показывает обозначения, которые появляются в контексте вызова или определения макросов и указания атрибутов элемента.
+Таблица Б-6 показывает обозначения, которые появляются в среде вызова или определения макросов и указания свойств переменной.
 
-Таблица Б-6: Макросы и атрибуты
+Таблица Б-6: Макросы и свойства
 
 Обозначение | Объяснение
 --- | ---
-`#[meta]` | Внешний атрибут
-`#![meta]` | Внутренний атрибут
+`#[meta]` | Внешнее свойство
+`#![meta]` | Внутреннее свойство
 `$ident` | Подстановка в макросе
 `$ident:kind` | Захват макроса
 `$(…)…` | Повторение макроса
 `ident!(...)`, `ident!{...}`, `ident![...]` | Вызов макроса
 
-Таблица Б-7 показывает обозначения, которые создают комментарии.
+Таблица Б-7 показывает обозначения, которые создают примечания.
 
-Таблица Б-7: Комментарии
+Таблица Б-7: Примечания
 
 Обозначение | Объяснение
 --- | ---
-`//` | Однострочный комментарий
-`//!` | Внутренний однострочный комментарий документации
-`///` | Внешний однострочный комментарий документации
-`/*...*/` | Многострочный комментарий
-`/*!...*/` | Внутренний многострочный комментарий документации
-`/**...*/` | Внешний многострочный комментарий документации
+`//` | Однострочный примечание
+`//!` | Внутренний однострочный примечание пособия
+`///` | Внешний однострочный примечание пособия
+`/*...*/` | Многострочный примечание
+`/*!...*/` | Внутренний многострочный примечание пособия
+`/**...*/` | Внешний многострочный примечание пособия
 
-Таблица Б-8 показывает обозначения, которые появляются в контексте использования кортежей.
+Таблица Б-8 показывает обозначения, которые появляются в среде использования упорядоченных рядов.
 
-Таблица Б-8: Кортежи
+Таблица Б-8: Упорядоченные ряды
 
 Обозначение | Объяснение
 --- | ---
-`()` | Пустой кортеж, он же пустой тип. И литерал и тип.
+`()` | Пустой упорядоченный ряд, он же пустой вид. И запись и вид.
 `(expr)` | Выражение в скобках
-`(expr,)` | Кортеж с одним элементом выражения
-`(type,)` | Кортеж с одним элементом типа
-`(expr, ...)` | Выражение кортежа
-`(type, ...)` | Тип кортежа
-`(type, ...)` | Выражение вызова функции; также используется для инициализации структур-кортежей и вариантов-кортежей перечисления
-`expr.0`, `expr.1`, etc. | Взятие элемента по индексу в кортеже
+`(expr,)` | Упорядоченный ряд с одной переменной выражения
+`(type,)` | Упорядоченный ряд с одной переменной вида
+`(expr, ...)` | Выражение упорядоченного ряда
+`(type, ...)` | Вид упорядоченного ряда
+`(type, ...)` | Выражение вызова функции; также используется для объявления стопок-упорядоченных рядов и исходов-упорядоченных рядов перечисления
+`expr.0`, `expr.1`, etc. | Взятие переменной по порядковому указателю в упорядоченном ряде
 
-Таблица Б-9 показывает контексты, в которых используются фигурные скобки.
+Таблица Б-9 показывает среды, в которых используются узорчатые скобки.
 
-Таблица Б-9: Фигурные скобки
+Таблица Б-9: Узорчатые скобки
 
-Контекст | Объяснение
+Среда | Объяснение
 --- | ---
-`{...}` | Выражение блока
-`Type {...}` | `struct` литерал
+`{...}` | Выражение раздела
+`Type {...}` | `struct` запись
 
-Таблица Б-10 показывает контексты, в которых используются квадратные скобки.
+Таблица Б-10 показывает среды, в которых используются квадратные скобки.
 
 Таблица Б-10: Квадратные скобки
 
-Контекст | Объяснение
+Среда | Объяснение
 --- | ---
-`[...]` | Литерал массива
-`[expr; len]` | Литерал массива, содержащий `len` копий `expr`
-`[type; len]` | Массив, содержащий `len` экземпляров типа `type`
-`expr[expr]` | Взятие по индексу в коллекции. Возможна перегрузка (`Index`, `IndexMut`)
-`expr[..]`, `expr[a..]`, `expr[..b]`, `expr[a..b]` | Взятие среза коллекции по индексу, используется `Range`, `RangeFrom`, `RangeTo`, или `RangeFull` как "индекс"
+`[...]` | Запись массива
+`[expr; len]` | Запись массива, содержащий `len` повторов `expr`
+`[type; len]` | Массив, содержащий `len` образцов вида данных `type`
+`expr[expr]` | Взятие по порядковому указателю в собрании. Возможна перегрузка (`Index`, `IndexMut`)
+`expr[..]`, `expr[a..]`, `expr[..b]`, `expr[a..b]` | Взятие среза собрания по порядковому указателю, используется `Range`, `RangeFrom`, `RangeTo`, или `RangeFull` как "порядковый указатель"
diff --git a/rustbook-ru/src/appendix-03-derivable-traits.md b/rustbook-ru/src/appendix-03-derivable-traits.md
index 30ab33bd0..01eed284c 100644
--- a/rustbook-ru/src/appendix-03-derivable-traits.md
+++ b/rustbook-ru/src/appendix-03-derivable-traits.md
@@ -1,88 +1,88 @@
-## Дополнение В: Выводимые типажи
+## Дополнение В: Выводимые сущности
 
-Во многих частях книги мы обсуждали атрибут `derive`, которые Вы могли применить к объявлению структуры или перечисления. Атрибут `derive` генерирует код по умолчанию для реализации типажа, который вы указали в  `derive`.
+Во многих частях книги мы обсуждали свойство `derive`, которые Вы могли применить к объявлению стопки или перечисления. Свойство `derive` порождает рукопись по умолчанию для использования сущности, который вы указали в  `derive`.
 
-В этом дополнении, мы расскажем про все типажи, которые вы можете использовать в атрибуте `derive`. Каждая секция содержит:
+В этом дополнении, мы расскажем про все сущности, которые вы можете использовать в свойстве `derive`. Каждая раздел содержит:
 
-- Операции и методы, добавляемые типажом
-- Как представлена реализация типажа через `derive`
-- Что реализация типажа рассказывает про тип
-- Условия, в которых разрешено или запрещено реализовывать типаж
-- Примеры ситуаций, которые требуют наличие типажа
+- Действия и способы, добавляемые сущностью
+- Как представлена использование сущности через `derive`
+- Что использование сущности рассказывает про вид
+- Условия, в которых разрешено или запрещено использовать сущность
+- Примеры случаев, которые требуют наличие сущности
 
-Если Вам понадобилось поведение отличное от поведения при реализации через `derive`, обратитесь к [документации по стандартной библиотеке](../std/index.html) чтобы узнать как вручную реализовать типаж.
+Если Вам понадобилось поведение отличное от поведения при использовании через `derive`, обратитесь к [пособия по встроенной библиотеке](../std/index.html) чтобы узнать как вручную использовать сущность.
 
-Перечисленные здесь типажи являются единственными, определёнными стандартной библиотекой, которые могут быть реализованы в ваших типах с помощью `derive`. Другие типажи, определённые в стандартной библиотеке, не имеют ощутимого поведения по умолчанию, поэтому вам решать, как реализовать их для достижения ваших целей.
+Перечисленные здесь сущности являются единственными, определёнными встроенной библиотекой, которые могут быть выполнены в ваших видах с помощью `derive`. Другие сущности, определённые во встроенной библиотеке, не имеют ощутимого поведения по умолчанию, поэтому вам решать, как использовать их для достижения ваших целей.
 
-Пример типажа, который нельзя реализовать через derive - `Display`, который обрабатывает форматирование для конечных пользователей. Вы всегда должны сами рассмотреть лучший способ для отображения типа конечному пользователю. Какие части типа должны быть разрешены для просмотра конечному пользователю? Какие части они найдут подходящими? Какой формат вывода для них будет самым подходящим? Компилятор Rust не знает ответы на эти вопросы, поэтому он не может подобрать подходящее стандартное поведение.
+Пример сущности, которую нельзя использовать через derive - `Display`, который обрабатывает разметку для конечных пользователей. Вы всегда должны сами рассмотреть лучший способ для отображения вида данных конечному пользователю. Какие части видов данных должны быть разрешены для просмотра конечному пользователю? Какие части они найдут подходящими? Какой вид вывода для них будет самым подходящим? Сборщик Ржавчины не знает ответы на эти вопросы, поэтому он не может подобрать подходящее обычное поведение.
 
-Список типов, реализуемых через derive, в этом дополнении не является исчерпывающим: библиотеки могут реализовывать `derive` для их собственных типажей, составляя свои списки типажей, которые Вы можете использовать с помощью `derive`. Реализация `derive` включает в себя использование процедурных макросов, которые были рассмотрены в разделе ["Макросы"] главы 19.
+Список видов, используемых через derive, в этом дополнении не является исчерпывающим: библиотеки могут использовать `derive` для их собственных сущностей, составляя свои списки сущностей, которые Вы можете использовать с помощью `derive`. Использование `derive` включает в себя использование процедурных макросов, которые были рассмотрены в разделе ["Макросы"] Главы 19.
 
 ### `Debug` для отладочного вывода
 
-Типаж `Debug` включает отладочное форматирование в форматируемых строках, которые вы можете указать с помощью `:?` внутри `{}` фигурных скобок.
+Сущность `Debug` включает отладочную разметку в размеченных строках, которые вы можете указать с помощью `:?` внутри `{}` узорчатых скобок.
 
-Типаж `Debug` позволяет Вам напечатать объекты типа с целью отладки, поэтому Вы и другие программисты, использующие Ваш тип, смогут проверить объект в определённой точке выполнения программы.
+Сущность `Debug` позволяет Вам вывести предметы видов данных с целью отладки, поэтому Вы и другие программисты, использующие Ваш вид, смогут проверить предмет в определённой точке выполнения программы.
 
-Типаж `Debug` обязателен в некоторых случаях. Например, при использовании макроса `assert_eq!`. Этот макрос печатает значения входных аргументов, если они не совпадают. Это позволяет программистам увидеть, почему эти объекты не равны.
+Сущность `Debug` обязателен в некоторых случаях. Например, при использовании макроса `assert_eq!`. Этот макрос выводит значения входных переменных, если они не совпадают. Это позволяет программистам увидеть, почему эти предметы не равны.
 
 ### `PartialEq` и `Eq` для сравнения равенства
 
-Типаж `PartialEq` позволяет Вам сравнить объекты одного типа на эквивалентность, и включает для них использование операторов `==` и `!=`.
+Сущность `PartialEq` позволяет Вам сравнить предметы одного вида данных на равнозначность, и включает для них использование приказчиков `==` и `!=`.
 
-Использование `PartialEq` реализует метод `eq`. Когда `PartialEq` используют для структуры, два объекта равны если равны *все* поля объектов, и объекты не равны, если хотя бы одно поле отлично. Когда используется для перечислений, каждый вариант равен себе, и не равен другим вариантам.
+Использование `PartialEq` использует способ `eq`. Когда `PartialEq` используют для стопки, два предмета равны если равны *все* поля предметов, и предметы не равны, если хотя бы одно поле отлично. Когда используется для перечислений, каждый исход равен себе, и не равен другим исходам.
 
-Типаж `PartialEq` обязателен в некоторых случаях. Например для макроса `assert_eq!`, где необходимо сравнивать два объекта одного типа на эквивалентность.
+Сущность `PartialEq` обязателен в некоторых случаях. Например для макроса `assert_eq!`, где необходимо сравнивать два предмета одного вида данных на равнозначность.
 
-Типаж `Eq` не имеет методов. Он сигнализирует что каждое значение аннотированного типа равно самому себе. Типаж `Eq` может быть применён только для типов реализующих типаж `PartialEq`, хотя не все типы, которые реализуют `PartialEq` могут реализовывать `Eq`. Примером являются числа с плавающей запятой: реализация чисел с плавающей запятой говорит, что два экземпляра со значениями не-число (`NaN`) не равны друг другу.
+Сущность `Eq` не имеет способов. Он указывает что каждое значение определенного вида данных равно самому себе. Сущность `Eq` может быть применён только для видов использующих сущность `PartialEq`, хотя не все виды, которые используют `PartialEq` могут использовать `Eq`. Примером являются числа с плавающей запятой: использование чисел с плавающей запятой говорит, что два образца данных со значениями не-число (`NaN`) не равны друг другу.
 
-Типаж `Eq`необходим в некоторых случаях. Например, для ключей в `HashMap`. Поэтому `HashMap` может сказать, что два ключа являются одним и тем же.
+Сущность `Eq`необходим в некоторых случаях. Например, для ключей в `HashMap`. Поэтому `HashMap` может сказать, что два ключа являются одним и тем же.
 
 ### `PartialOrd` и `Ord` для сравнения порядка
 
-Типаж `PartialOrd` позволяет Вам сравнить объекты одного типа с помощью сортировки. Тип, реализующий `PartialOrd` может использоваться с операторами `<`, `>`, `<=`, и `>=`. Вы можете реализовать типаж `PartialOrd` только для типов, реализующих `PartialEq`.
+Сущность `PartialOrd` позволяет Вам сравнить предметы одного вида данных с помощью упорядочивания. Вид, использующий `PartialOrd` может использоваться с приказчиками `<`, `>`, `<=`, и `>=`. Вы можете использовать сущность `PartialOrd` только для видов, использующих `PartialEq`.
 
-Использование `PartialOrd` реализует метод `partial_cmp`, который возвращает `Option` который является `None` когда значения не выстраивают порядок. Примером значения, которое не может быть упорядочено, не являются числом (`NaN`) значение с плавающей запятой. Вызов `partial_cmp` с любым числом с плавающей запятой и значением `NaN` вернёт `None`.
+Использование `PartialOrd` использует способ `partial_cmp`, который возвращает `Option` который является `None` когда значения не выстраивают порядок. Примером значения, которое не может быть упорядочено, не являются числом (`NaN`) значение с плавающей запятой. Вызов `partial_cmp` с любым числом с плавающей запятой и значением `NaN` вернёт `None`.
 
-Когда используется для структур, `PartialOrd` сравнивает два объекта путём сравнения значений каждого поля в порядке, в котором поля объявлены в структуре. Когда используется для перечислений, то варианты перечисления объявленные ранее будут меньше чем варианты объявленные позже.
+Когда используется для стопок, `PartialOrd` сравнивает два предмета путём сравнения значений каждого поля в порядке, в котором поля объявлены в стопке. Когда используется для перечислений, то исходы перечисления объявленные ранее будут меньше чем исходы объявленные позже.
 
-Например, типаж `PartialOrd` может потребоваться для метода `gen_range` из `rand` крейта который генерирует случайные значения в заданном диапазоне (который определён выражением диапазона).
+Например, сущность `PartialOrd` может потребоваться для способа `gen_range` из `rand` ящика, который порождает случайные значения в заданном ряде (который определён выражением ряда).
 
-Типаж `Ord` позволяет знать, для двух значений аннотированного типа всегда будет существовать валидный порядок. Типаж `Ord` реализовывает метод `cmp`, который возвращает `Ordering` а не `Option` потому что валидный порядок всегда будет существовать. Вы можете применить типаж  `Ord` только для типов, реализовывающих типаж `PartialOrd` и `Eq` (`Eq` также требует `PartialEq`). При использовании на структурах или перечислениях, `cmp` имеет такое же поведение, как и `partial_cmp` в`PartialOrd`.
+Сущность `Ord` позволяет знать, для двух значений определенного вида данных всегда будет существовать действительный порядок. Сущность `Ord` использует способ `cmp`, который возвращает `Ordering` а не `Option` потому что действительный порядок всегда будет существовать. Вы можете применить сущность  `Ord` только для видов, использующих сущность `PartialOrd` и `Eq` (`Eq` также требует `PartialEq`). При использовании на стопках или перечислениях, `cmp` имеет такое же поведение, как и `partial_cmp` в`PartialOrd`.
 
-Типаж `Ord` необходим в некоторых случаях. Например, сохранение значений в `BTreeSet`, типе данных, который хранит информацию на основе порядка отсортированных данных.
+Сущность `Ord` необходим в некоторых случаях. Например, сохранение значений в `BTreeSet`, виде данных, который хранит сведения на основе порядка упорядоченных данных.
 
-### `Clone` и `Copy` для дублирования значений
+### `Clone` и `Copy` для повторения значений
 
-Типаж `Clone` позволяет вам явно создать глубокую копию значения, а также процесс дублирования может вызывать специальный код и копировать данные с кучи. Более детально про `Clone` смотрите в секции ["Способы взаимодействия переменных и данных: клонирование"](ch04-01-what-is-ownership.html#ways-variables-and-data-interact-clone) в разделе 4.
+Сущность `Clone` позволяет вам явно создать глубокую повтор значения, а также этап повторения может вызывать особую рукопись и воспроизводить данные с кучи. Более подробно про `Clone` смотрите в разделы ["Способы взаимодействия переменных и данных: удваивание"](ch04-01-what-is-ownership.html#ways-variables-and-data-interact-clone) в разделе 4.
 
-Использование `Clone` реализует метод `clone`, который в случае реализации на всем типе, вызывает `clone`для каждой части данных типа. Это подразумевает, что все поля или значения в типе также должны реализовывать `Clone` для использования `Clone`.
+Использование `Clone` использует способ `clone`, который в случае выполнения на всем виде, вызывает `clone`для каждой части данных вида. Это подразумевает, что все поля или значения в виде данных также должны использовать `Clone` для использования `Clone`.
 
-Типаж `Clone` необходим в некоторых случаях. Например, для вызова метода `to_vec` для среза. Срез не владеет данными, содержащимися в нем, но вектор значений, возвращённый из `to_vec` должен владеть этими объектами, поэтому `to_vec` вызывает `clone` для всех данных. Таким образом, тип хранящийся в срезе, должен реализовывать `Clone`.
+Сущность `Clone` необходим в некоторых случаях. Например, для вызова способа `to_vec` для среза. Срез не владеет данными, содержащимися в нем, но вектор значений, возвращённый из `to_vec` должен владеть этими предметами, поэтому `to_vec` вызывает `clone` для всех данных. Таким образом, вид хранящийся в срезе, должен использовать `Clone`.
 
-Типаж `Copy` позволяет дублировать значения копируя только данные, которые хранятся на стеке, произвольный код не требуется. Смотрите секцию ["Стековые данные: Копирование"](ch04-01-what-is-ownership.html#stack-only-data-copy) в разделе 4 для большей информации о `Copy`.
+Сущность `Copy` позволяет повторять значения повторяя только данные, которые хранятся в обойме, произвольная рукопись не требуется. Смотрите раздел ["Данные из обоймы: Повторение"](ch04-01-what-is-ownership.html#stack-only-data-copy) в разделе 4 для больших сведений о `Copy`.
 
-Типаж `Copy` не содержит методов для предотвращения перегрузки этих методов программистами, иначе бы это нарушило соглашение, что никакой произвольный код не запускается. Таким образом все программисты могут предполагать, что копирование значений будет происходить быстро.
+Сущность `Copy` не содержит способов для предотвращения перегрузки этих способов программистами, иначе бы это нарушило соглашение, что никакой произвольная рукопись не запускается. Таким образом все программисты могут предполагать, что повторение значений будет происходить быстро.
 
-Вы можете вывести `Copy` для любого типа все части которого реализуют `Copy`. Тип который реализует `Copy` должен также реализовывать `Clone`, потому что тип реализующий `Copy` имеет тривиальную реализацию `Clone` который выполняет ту же задачу, что и `Copy`.
+Вы можете вывести `Copy` для любого вида данных все части которого используют `Copy`. Вид, который использует `Copy` должен также использовать `Clone`, потому что вид использующий `Copy` имеет обыкновенную использование `Clone` который использует ту же задачу, что и `Copy`.
 
-Типаж `Copy` нужен очень редко; типы, реализовывающие `Copy` имеют небольшую оптимизацию, то есть для него не нужно вызывать метод `clone`, который делает код более кратким.
+Сущность `Copy` нужна очень редко; виды, использующие `Copy` имеют небольшую переработку, то есть для него не нужно вызывать способ `clone`, который делает рукопись более кратким.
 
-Все, что вы делаете с `Copy` можно также делать и с `Clone`, но код может быть медленнее и требовать вызов метода `clone` в некоторых местах.
+Все, что вы делаете с `Copy` можно также делать и с `Clone`, но рукопись может быть медленнее и требовать вызов способа `clone` в некоторых местах.
 
-### `Hash` для превращения значения в значение фиксированного размера
+### `Hash` для превращения значения в значение конечного размера
 
-Типаж `Hash` позволяет превратить значение произвольного размера в значение фиксированного размера с использованием хеш-функции. Использование `Hash` реализует метод `hash`. При реализации через derive, метод `hash` комбинирует результаты вызова `hash` на каждой части данных типа, то есть все поля или значения должны реализовывать `Hash` для использования `Hash` с помощью derive.
+Сущность `Hash` позволяет превратить значение произвольного размера в значение конечного размера с использованием хеш-функции. Использование `Hash` использует способ `hash`. При использовании через derive, способ `hash` сочетает итоги вызова `hash` на каждой части данных вида, то есть все поля или значения должны использовать `Hash` для использования `Hash` с помощью derive.
 
-Типаж `Hash` необходим в некоторых случаях. Например, для хранения ключей в `HashMap`, для их более эффективного хранения.
+Сущность `Hash` необходим в некоторых случаях. Например, для хранения ключей в `HashMap`, для их более качественного хранения.
 
 ### `Default` для значений по умолчанию
 
-Типаж `Default` позволяет создавать значение по умолчанию для типа. Использование `Default` реализует функцию `default`. Стандартная реализация метода `default` вызовет функцию `default` на каждой части данных типа, то есть для использования `Default` через derive, все поля и значения типа данных должны также реализовывать `Default`.
+Сущность `Default` позволяет создавать значение по умолчанию для вида. Использование `Default` использует функцию `default`. Обычная использование способа `default` вызовет функцию `default` на каждой части данных вида, то есть для использования `Default` через derive, все поля и значения вида данных должны также использовать `Default`.
 
-Функция `Default::default`часто используется в комбинации с синтаксисом обновления структуры, который мы обсуждали в секции ["Создание экземпляра структуры из экземпляра другой структуры с помощью синтаксиса обновления структуры"](ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax) главы 5. Вы можете настроить несколько полей для структуры, а для остальных полей установить значения с помощью ..Default::default().
+Функция `Default::default`часто используется в сочетания с правилами написания обновления стопки, который мы обсуждали в разделы ["Создание образца данных стопки из образца данных другой стопки с помощью правил написания обновления стопки"](ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax) Главы 5. Вы можете настроить несколько полей для стопки, а для остальных полей установить значения с помощью ..Default::default().
 
-Типаж `Default` необходим в некоторых случаях. Например, для метода `unwrap_or_default` у типа `Option`. Если значение `Option` будет `None`, метод `unwrap_or_default` вернёт результат вызова функции `Default::default` для типа `T`, хранящегося в `Option`.
+Сущность `Default` необходим в некоторых случаях. Например, для способа `unwrap_or_default` у вида данных `Option`. Если значение `Option` будет `None`, способ `unwrap_or_default` вернёт итог вызова функции `Default::default` для вида данных `T`, хранящегося в `Option`.
 
 
 ["Макросы"]: ch19-06-macros.html#macros
\ No newline at end of file
diff --git a/rustbook-ru/src/appendix-04-useful-development-tools.md b/rustbook-ru/src/appendix-04-useful-development-tools.md
index 4eb34bc73..d56db30b5 100644
--- a/rustbook-ru/src/appendix-04-useful-development-tools.md
+++ b/rustbook-ru/src/appendix-04-useful-development-tools.md
@@ -1,10 +1,10 @@
 ## Дополнение Г - Средства разработки
 
-В этом дополнении мы расскажем про часто используемые средства разработки, предоставляемые Rust. Мы рассмотрим автоматическое форматирование, быстрый путь исправления предупреждений, линтер, и интеграцию с IDE.
+В этом дополнении мы расскажем про часто используемые средства разработки, предоставляемые Ржавчина. Мы рассмотрим принудительную разметку, быстрый путь исправления предупреждений, линтер, и встраивание с IDE.
 
-### Автоматическое форматирование с `rustfmt`
+### Принудительное изменение с `rustfmt`
 
-Инструмент `rustfmt` переформатирует ваш код в соответствии со стилем кода сообщества. Многие совместные проекты используют `rustfmt`, чтобы предотвратить споры о том, какой стиль использовать при написании Rust: все форматируют свой код с помощью этого инструмента.
+Средство `rustfmt` размечает вашу рукопись в соответствии со правилами исполнения рукописи, принятым сообществом Ржавчины. Многие совместные дела используют `rustfmt`, чтобы предотвратить споры о том, какое исполнение использовать при написании Ржавчины: все размечают свою рукопись с помощью этого средства.
 
 Для установки `rustfmt`, введите следующее:
 
@@ -12,17 +12,17 @@
 $ rustup component add rustfmt
 ```
 
-Эта команда установит `rustfmt` и `cargo-fmt`, также как Rust даёт Вам одновременно `rustc` и `cargo`. Для форматирования проекта, использующего Cargo, введите следующее:
+Этот приказ установит `rustfmt` и `cargo-fmt`, также как Ржавчина даёт Вам одновременно `rustc` и `cargo`. Для разметки дела, использующего Cargo, введите следующее:
 
 ```console
 $ cargo fmt
 ```
 
-Эта команда отформатирует весь код на языке Rust в текущем крейте. Будет изменён только стиль кода, семантика останется прежней. Для большей информации о `rustfmt`, смотрите [документацию].
+Этот приказ разметит всю рукопись на языке Ржавчина в текущем ящике. Будет изменено только исполнение рукописи, смысл останется прежним. Для больших сведений о `rustfmt`, смотрите [пособие].
 
-### Исправление кода с `rustfix`
+### Исправление рукописи с `rustfix`
 
-Инструмент rustfix включён в установку Rust и может автоматически исправлять предупреждения компилятора с очевидным способом исправления проблемы, скорее всего, подходящим вам. Вероятно, вы уже видели предупреждения компилятора. Например, рассмотрим этот код:
+Средство rustfix включён в установку Ржавчина и может самостоятельно исправлять предупреждения сборщика с очевидным способом исправления сбоев, скорее всего, подходящим вам. Вероятно, вы уже видели предупреждения сборщика. Например, рассмотрим эту рукопись:
 
 Файл: src/main.rs
 
@@ -36,7 +36,7 @@ fn main() {
 }
 ```
 
-Мы вызываем функцию `do_something` 100 раз, но никогда не используем переменную `i` в теле цикла `for`. Rust предупреждает нас об этом:
+Мы вызываем функцию `do_something` 100 раз, но никогда не используем переменную `i` в теле круговорота `for`. Ржавчина предупреждает нас об этом:
 
 ```console
 $ cargo build
@@ -52,7 +52,7 @@ warning: unused variable: `i`
     Finished dev [unoptimized + debuginfo] target(s) in 0.50s
 ```
 
-Предупреждение предлагает нам использовать `_i` как имя переменной: нижнее подчёркивание в начале идентификатора предполагает, что мы его не используем. Мы можем автоматически применить это предположение с помощью `rustfix`, запустив команду `cargo fix`:
+Предупреждение предлагает нам использовать `_i` как имя переменной: нижнее подчёркивание в начале определителя предполагает, что мы его не используем. Мы можем самостоятельно применить это предположение с помощью `rustfix`, запустив приказ `cargo fix`:
 
 ```console
 $ cargo fix
@@ -61,7 +61,7 @@ $ cargo fix
     Finished dev [unoptimized + debuginfo] target(s) in 0.59s
 ```
 
-Когда посмотрим в *src/main.rs* снова, мы увидим что `cargo fix` изменил наш код:
+Когда посмотрим в *src/main.rs* снова, мы увидим что `cargo fix` изменил нашу рукопись:
 
 Файл: src/main.rs
 
@@ -75,13 +75,13 @@ fn main() {
 }
 ```
 
-Переменная цикла `for` теперь носит имя `_i`, и предупреждение больше не появляется.
+Переменная круговорота `for` теперь носит имя `_i`, и предупреждение больше не появляется.
 
-Также Вы можете использовать команду `cargo fix` для перемещения вашего кода между различными редакциями Rust. Редакции будут рассмотрены в дополнении Д.
+Также Вы можете использовать приказ `cargo fix` для перемещения вашей рукописи между различными изданиями Ржвчины. Издания будут рассмотрены в дополнении Д.
 
 ### Больше проверок с Clippy
 
-Инструмент Clippy является коллекцией проверок (lints) для анализа Вашего кода, поэтому Вы можете найти простые ошибки и улучшить ваш Rust код.
+Средство Clippy является собранием проверок (lints) для оценки вашей рукописи, поэтому Вы можете найти простые ошибки и улучшить ваш Ржавчина рукопись.
 
 Для установки Clippy, введите следующее:
 
@@ -89,13 +89,13 @@ fn main() {
 $ rustup component add clippy
 ```
 
-Для запуска проверок Clippy’s для проекта Cargo, введите следующее:
+Для запуска проверок Clippy’s для дела Cargo, введите следующее:
 
 ```console
 $ cargo clippy
 ```
 
-Например, скажем что Вы хотите написать программу, в которой будет использоваться приближенная математическая константа, такая как число Пи, как в следующей программе:
+Например, скажем что Вы хотите написать программу, в которой будет использоваться приближенная математическая постоянное значение, такая как число Пи, как в следующей программе:
 
 Файл: src/main.rs
 
@@ -107,7 +107,7 @@ fn main() {
 }
 ```
 
-Запуск `cargo clippy` для этого проекта вызовет следующую ошибку:
+Запуск `cargo clippy` для этого дела вызовет следующую ошибку:
 
 ```text
 error: approximate value of `f{32, 64}::consts::PI` found
@@ -121,7 +121,7 @@ error: approximate value of `f{32, 64}::consts::PI` found
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
 ```
 
-Эта ошибка сообщает вам, что в Rust уже определена более точная константа `PI`, и что ваша программа будет более корректной, если вы вместо неё будете использовать эту константу. Затем вы должны изменить свой код, чтобы использовать константу `PI`. Следующий код не приводит к ошибкам или предупреждениям от Clippy:
+Эта ошибка сообщает вам, что в Ржавчине уже определена более точная постоянное значение `PI`, и что ваша программа будет более правильной, если вы вместо неё будете использовать эту постоянное значение. Затем вы должны изменить свою рукопись, чтобы использовать постоянное значение `PI`. Следующая рукопись не приводит к ошибкам или предупреждениям от Clippy:
 
 Файл: src/main.rs
 
@@ -133,15 +133,15 @@ fn main() {
 }
 ```
 
-Для большей информации о Clippy смотрите [документацию](https://github.com/rust-lang/rustfmt).
+Для больших сведений о Clippy смотрите [пособие](https://github.com/rust-lang/rustfmt).
 
-### Интеграция с IDE с помощью `rust-analyzer`
+### Встраивание с IDE с помощью `rust-analyzer`
 
-Чтобы облегчить интеграцию с IDE, сообщество Rust рекомендует использовать [`rust-analyzer`]. Этот инструмент представляет собой набор ориентированных на компилятор утилит, которые используют [Language Server Protocol], который является спецификацией для взаимодействия IDE и языков программирования друг с другом. Разные клиенты могут использовать `rust-analyzer`, например [подключаемый модуль анализатора Rust для Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
+Чтобы облегчить встраивание с IDE, сообщество Ржавчина советует использовать [`rust-analyzer`]. Это средство представляет собой набор направленных на сборщик утилит, которые используют [Language Server Protocol], который является сводом требований для взаимодействия IDE и языков программирования друг с другом. Разные конечные потребители могут использовать `rust-analyzer`, например [подключаемый раздел оценщика Ржавчина для Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
 
-Посетите домашнюю страницу проекта rust-analyzer для получения инструкций по установке, затем установите поддержку языкового сервера в конкретной среде IDE. Ваша IDE получит такие возможности, как автозаполнение, переход к определению и встроенные ошибки.
+Посетите домашнюю страницу дела rust-analyzer для получения указаний по установке, затем установите поддержку языкового отдельного вычислителя в  среде IDE. Ваша IDE получит такие возможности, как самозаполнение, переход к определению и встроенные ошибки.
 
 
-[документацию]: https://github.com/rust-lang/rustfmt
+[пособие]: https://github.com/rust-lang/rustfmt
 [Language Server Protocol]: http://langserver.org/
 [`rust-analyzer`]: https://rust-analyzer.github.io
\ No newline at end of file
diff --git a/rustbook-ru/src/appendix-05-editions.md b/rustbook-ru/src/appendix-05-editions.md
index 2068f38be..5300db5f4 100644
--- a/rustbook-ru/src/appendix-05-editions.md
+++ b/rustbook-ru/src/appendix-05-editions.md
@@ -1,25 +1,25 @@
-## Приложение E - Редакции языка
+## Приложение E - Издания языка
 
-В главе 1, можно увидеть, что команда `cargo new` добавляет некоторые мета-данные о редакции языка в файл *Cargo.toml*. Данное приложение рассказывает, что они означают.
+В главе 1, можно увидеть, что приказ `cargo new` добавляет некоторые мета-данные о издания языка в файл *Cargo.toml*. Данное приложение рассказывает, что они означают.
 
-Язык Rust и его компилятор имеют шестинедельный цикл выпуска, означающий, что пользователи постоянно получают новые функции. В других языках обычно выпускают большие обновления, но редко. Команда Rust выпускает меньшие обновления, но более часто. Через некоторое время все эти небольшие изменения накапливаются. Между релизами обычно сложно оглянуться назад и сказать "Ого, язык сильно изменился между версиями Rust 1.10 и Rust 1.31!"
+Язык Ржавчина и его сборщик имеют шестинедельный круговорот выпуска, означающий, что пользователи постоянно получают новые функции. В других языках обычно выпускают большие обновления, но редко. Объединение Ржавчина выпускает меньшие обновления, но более часто. Через некоторое время все эти небольшие изменения накапливаются. Между исполнениями обычно сложно оглянуться назад и сказать "Ого, язык сильно изменился между исполнениями Ржавчина 1.10 и Ржавчина 1.31!"
 
-Каждые два или три года, команда Rust выпускает новую редакцию языка *(Rust edition)*. Каждая редакция объединяет все новые особенности, которые попали в язык с новыми пакетами, с полной, обновлённой документацией и инструментарием. Новые редакции поставляются как часть шестинедельного процесса релизов.
+Каждые два или три года, объединение Ржавчина выпускает новую издание языка *(Ржавчина edition)*. Каждая издание объединяет все новые особенности, которые попали в язык с новыми дополнениями, с полной, обновлённой пособием и набором средств. Новые издания поставляются как часть шестинедельного этапа исполнений.
 
-Для разных людей редакции служат разным целям:
+Для разных людей издания служат разным целям:
 
-- Для активных пользователей новая редакция приносит все инкрементальные изменения в удобный и понятный пакет.
-- Для тех, кто языком не пользуется, новая реакция является сигналом, что некоторые важные улучшения, на которые возможно надо взглянуть ещё раз, попали в язык.
-- Для тех кто разрабатывает на Rust, новая редакция даёт некоторую точку отсчёта для проекта в целом.
+- Для неугомонных пользователей новая издание приносит все инкрементальные изменения в удобное и понятное дополнение.
+- Для тех, кто языком не пользуется, новая реакция является знаком, что некоторые важные улучшения, на которые возможно надо взглянуть ещё раз, попали в язык.
+- Для тех кто разрабатывает на Ржавчине, новая издание даёт некоторую точку отсчёта для дела в целом.
 
-На момент написания доступны две редакции Rust: Rust 2015 и Rust 2018. Данная книга написана с использованием идиом редакции Rust 2018.
+На мгновение написания доступны два издания: Ржавчина 2015 и Ржавчина 2018. Данная книга написана с использованием устойчивых выражений издания Ржавчины 2018.
 
-Ключ `edition` в конфигурационном файле  *Cargo.toml* отображает, какую редакцию компилятор должен использовать для вашего кода. Если ключа нет, то для обратной совместимости компилятор Rust использует редакцию `2015`.
+Ключ `edition` в настроечном файле  *Cargo.toml* отображает, какое издание сборщик должен использовать для вашей рукописи. Если ключа нет, то для обратной совместимости сборщик Ржавчины использует издание `2015`.
 
-Любой проект может выбрать редакцию отличную от редакции по умолчанию, которая равна 2015. Редакции могут содержать несовместимые изменения, включая новые ключевые слова, которые могут конфликтовать с идентификаторами в коде. Однако, пока вы не переключитесь на новую редакцию, ваш код будет продолжать компилироваться даже после обновления используемой версии компилятора.
+Любой дело может выбрать издание отличную от издания по умолчанию, которая равна 2015. Издания могут содержать несовместимые изменения, включая новые ключевые слова, которые могут враждовать с определителями в рукописи. Однако, пока вы не переключитесь на новую издание, ваша рукопись будет продолжать собираться даже после обновления используемой исполнения сборщика.
 
-Все версии компилятора Rust поддерживают любую редакцию, которая предшествовала выпуску текущей, и они могут линковать пакеты любой поддерживаемой редакции. Изменения редакций действуют только на способ начального разбора компилятором исходного кода. Поэтому, если вы используете 2015 редакцию, а одна из ваших зависимостей использует 2018, ваш проект будет скомпилирован и сможет пользоваться этой зависимостью. Обратная ситуация, когда ваш проект использует Rust 2018, а зависимость использует Rust 2015, работает таким же образом.
+Все исполнения сборщика Ржавчины поддерживают любое издание, которое предшествовало выпуску текущего, и они могут линковать дополнения любой поддерживаемой издания. Изменения изданий действуют только на способ начального разбора сборщиком исходной рукописи. Поэтому, если вы используете издание 2015, а одно из ваших дополнений использует издание 2018, ваше дело будет собрано и сможет пользоваться этим дополнением. Обратный случай, когда ваше дело использует издание Ржавчины 2018, а дополнение использует издание Ржавчины 2015, работает таким же образом.
 
-Внесём ясность: большая часть возможностей будет доступна во всех редакциях. Разработчики, использующие любую редакцию Rust, будут продолжать получать улучшения по мере выпуска новых релизов. Однако в некоторых случаях, в основном, когда добавляются новые ключевые слова, некоторые новые возможности могут быть доступны только в последних редакциях. Нужно переключить редакцию, чтобы воспользоваться новыми возможностями.
+Внесём ясность: большая часть возможностей будет доступна во всех изданиях. Разработчики, использующие любое издание Ржавчина, будут продолжать получать улучшения по мере выпуска новых исполнений. Однако в некоторых случаях, в основном, когда добавляются новые ключевые слова, некоторые новые возможности могут быть доступны только в последних изданиях. Нужно перейти на новое издание, чтобы воспользоваться новыми возможностями.
 
-Для получения больше деталей, есть полная книга [*Edition Guide*](https://doc.rust-lang.org/stable/edition-guide/) про редакции, в которой перечисляются различия между редакциями и объясняется, как автоматически обновить свой код на новую редакцию с помощью команды `cargo fix`.
+Для получения больше подробностей, есть полная книга [*Edition Guide*](https://doc.rust-lang.org/stable/edition-guide/) про издания, в которой перечисляются различия между изданиями и объясняется, как самостоятельно обновить свою рукопись на новую издание с помощью приказов `cargo fix`.
diff --git a/rustbook-ru/src/appendix-06-translation.md b/rustbook-ru/src/appendix-06-translation.md
index 64d50972a..73f1d7b33 100644
--- a/rustbook-ru/src/appendix-06-translation.md
+++ b/rustbook-ru/src/appendix-06-translation.md
@@ -1,6 +1,6 @@
 ## Приложение Е: Переводы книги
 
-Для ресурсов на языках, отличных от английского. Большинство из них все ещё в разработке; см. [ярлык «Переводы»](https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations), чтобы помочь или сообщить нам о новом переводе!
+Для источниковов на языках, отличных от английского. Большинство из них все ещё в разработке; см. [ярлык «Переводы»](https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations), чтобы помочь или сообщить нам о новом переводе!
 
 - [Português](https://github.com/rust-br/rust-book-pt-br) (BR)
 - [Português](https://github.com/nunojesus/rust-book-pt-pt) (PT)
diff --git a/rustbook-ru/src/appendix-07-newest-features.md b/rustbook-ru/src/appendix-07-newest-features.md
index 3118817e6..e90d75ba1 100644
--- a/rustbook-ru/src/appendix-07-newest-features.md
+++ b/rustbook-ru/src/appendix-07-newest-features.md
@@ -1,13 +1,9 @@
-# Приложение Г- Новый функционал
+# Приложение Г- Новый возможности
+Это приложение описывает возможности, которые были добавлены в безотказное исполнение в Ржавчине со времени написания данной книги.
 
-Это приложение описывает функционал, которые был добавлен в стабильную версию Rust
-с момента написания данной книги.
+## Быстрое объявление поля стопки
 
-## Быстрая инициализация поля структуры
-
-Мы можем инициировать данные структуры (struct, enum, union) с помощью именованных
-полей. Формат `fieldname: fieldname`. Это конструкция уменьшает код инициализации
-структуры.
+Мы можем объявить данные стопки (struct, enum, union) с помощью именованных полей. Вид данных `fieldname: fieldname`. Это устройство уменьшает рукопись объявления стопки.
 
 ```rust
 #[derive(Debug)]
@@ -36,10 +32,10 @@ fn main() {
 
 ## Returning from loops
 
-Одна из функций оператора цикла `loop` - это отслеживание логический операций,
-таких как проверка завершил ли поток свою работы или нет. Но, бывают также ситуации,
-когда Вам необходимо вернуть значение из цикла. Если вы добавите оператор `break`,
-вы сможете использовать оператора цикла `loop`, как анонимную функцию, которая
+Одна из функций приказчика круговорота `loop` - это отслеживание разумный действий,
+таких как проверка завершил ли поток свою работы или нет. Но, бывают также исходы,
+когда Вам необходимо вернуть значение из круговорота. Если вы добавите приказчик `break`,
+вы сможете использовать приказчика круговорота `loop`, как анонимную функцию, которая
 возвращает значение:
 
 ```rust
diff --git a/rustbook-ru/src/appendix-07-nightly-rust.md b/rustbook-ru/src/appendix-07-nightly-rust.md
index 491f5d972..8bf03562f 100644
--- a/rustbook-ru/src/appendix-07-nightly-rust.md
+++ b/rustbook-ru/src/appendix-07-nightly-rust.md
@@ -1,30 +1,30 @@
-## Дополнение Ё - Как создаётся Rust и “Nightly Rust”
+## Дополнение Ё - Как создаётся Ржавчина и “Ночное издание Ржавчины”
 
-Это дополнение рассказывает как создаётся Rust, и как это влияет на Вас как на разработчика.
+Это дополнение рассказывает как создаётся Ржавчина, и как это влияет на Вас как на разработчика.
 
-### Стабильность без стагнации
+### Безотказность без застоя
 
-Как язык, Rust *много* заботиться о стабильности Вашего кода. Мы хотим чтобы Rust был прочным фундаментом, вашей опорой, и если бы все постоянно менялось, это было бы невозможно. В то же время, если мы не можем экспериментировать с различными возможностями, мы не можем обнаружить важные проблемы до релиза, когда мы не можем их изменить.
+Как язык, Ржавчина *много* заботиться о безотказности вашей рукописи. Мы хотим чтобы Ржавчина была прочной основой, вашей опорой, и если бы все постоянно менялось, это было бы невозможно. В то же время, если мы не можем проводить опыты с различными возможностями, мы не можем обнаружить важные сбои до исполнения, когда мы не можем их изменить.
 
-Нашим решением проблемы является “стабильность без стагнации”, и наш руководящий принцип: Вы никогда не должны бояться перехода на новую стабильную версию Rust. Каждое обновление должно быть безболезненным, но также должно добавлять новые функции, меньше дефектов и более быструю скорость компиляции.
+Нашим решением возникновения сбоев является “безотказность без застоя”, и наш руководящий принцип: Вы никогда не должны бояться перехода на новую безотказное исполнение Ржавчины. Каждое обновление должно быть безболезненным, но также должно добавлять новые функции, меньше дефектов и более быструю скорость сборки.
 
-### Ту-ту! Каналы выпуска и поездка на поезде
+### Ту-ту! потоки выпуска и поездка на поезде
 
-Разработка языка Rust работает по принципу *расписания поездов*. То есть, вся разработка совершается в ветке `master` Rust репозитория. Выпуски следуют модели последовательного выпуска продукта (software release train), которая была использована Cisco IOS и другими программными продуктами. Есть три *канала выпуска* Rust:
+Разработка языка Ржавчина работает по принципу *расписания поездов*. То есть, вся разработка совершается в ветке `master` Ржавчина хранилища. Выпуски следуют подходы последовательного выпуска продукта (software release train), которая была использована Cisco IOS и другими программными продуктами. Есть три *потока выпуска* Ржавчина:
 
 - Ночной (Nightly)
 - Бета (Beta)
-- Стабильный (Stable)
+- Безотказное (Stable)
 
-Большинство Rust разработчиков используют стабильную версию, но те кто хотят попробовать экспериментальные новые функции, должны использовать Nightly или Beta.
+Большинство Ржавчина разработчиков используют безотказное исполнение, но те кто хотят попробовать предварительные  новые функции, должны использовать Nightly или Beta.
 
-Приведём пример, как работает процесс разработки и выпуска новых версий. Давайте предположим, что команда Rust работает над версией Rust 1.5. Его релиз состоялся в декабре 2015 года, но это даст реалистичность номера версии. Была добавлена новая функциональность в Rust: новые коммиты в ветку `master`. Каждую ночь выпускается новая ночная версия Rust. Каждый день является днём выпуска ночной версии и эти выпуски создаются нашей структурой автоматически. По мере того как идёт время, наши выпуски выглядят так:
+Приведём пример, как работает этап разработки и выпуска новых исполнений. Давайте предположим, что объединение Ржавчина работает над исполнением Ржавчина 1.5. Его исполнение состоялся в декабре 2015 года, но это даст достоверный номера исполнения. Была добавлена новая возможность в Ржавчине: новые изменения в ветку `master`. Каждую ночь выпускается новая ночная исполнение Ржавчины. Каждый день является днём выпуска ночного исполнения и эти выпуски создаются нашим устройством самостоятельно . По мере того как идёт время, наши выпуски выглядят так:
 
 ```text
 nightly: * - - * - - *
 ```
 
-Каждые шесть недель наступает время подготовки новой Beta версии! Ветка `beta` Rust репозитория ответвляется от ветки `master`, используемой версией Nightly. Теперь мы имеем два выпуска:
+Каждые шесть недель наступает время подготовки новой Beta исполнения! Ветка `beta` Ржавчина хранилища ответвляется от ветки `master`, используемой исполнением Nightly. Теперь мы имеем два выпуска:
 
 ```text
 nightly: * - - * - - *
@@ -32,7 +32,7 @@ nightly: * - - * - - *
 beta:                *
 ```
 
-Многие пользователи Rust не используют активно бета-версию, но тестируют бета-версию в их системе CI для помощи Rust обнаружить проблемы обратной совместимости. В это время каждую ночь выпускается новая версия Nightly:
+Многие пользователи Ржавчины не используют постоянно бета-исполнение, но проверяют бета-исполнение в их системе CI для помощи Ржавчине обнаружить сбои обратной совместимости. В это время каждую ночь выпускается новое исполнение Nightly:
 
 ```text
 nightly: * - - * - - * - - * - - *
@@ -40,7 +40,7 @@ nightly: * - - * - - * - - * - - *
 beta:                *
 ```
 
-Предположим, что была найдена регрессия. Хорошо, что мы можем протестировать бета-версию перед тем как регрессия попала в стабильную версию! Исправление отправляется в ветку `master`, поэтому версия nightly исправлена и затем исправление также направляется в ветку `beta`, и происходит новый выпуск бета-версии:
+Предположим, что была найдена отступление. Хорошо, что мы можем проверять бета-исполнение перед тем как отступление попала в безотказное исполнение! Исправление отправляется в ветку `master`, поэтому исполнение nightly исправлена и затем исправление также направляется в ветку `beta`, и происходит новый выпуск бета-исполнения:
 
 ```text
 nightly: * - - * - - * - - * - - * - - *
@@ -48,7 +48,7 @@ nightly: * - - * - - * - - * - - * - - *
 beta:                * - - - - - - - - *
 ```
 
-Через шесть недель после выпуска бета-версии, наступает время для выпуска стабильной версии! Ветка `stable` создаётся из ветки `beta`:
+Через шесть недель после выпуска бета-исполнения, наступает время для выпуска безотказного исполнения! Ветка `stable` создаётся из ветки `beta`:
 
 ```text
 nightly: * - - * - - * - - * - - * - - * - * - *
@@ -58,7 +58,7 @@ beta:                * - - - - - - - - *
 stable:                                *
 ```
 
-Ура! Rust 1.5 выпущена! Но мы также забыли про одну вещь: так как прошло шесть недель, мы должны выпустить бета-версию *следующей*  версии Rust 1.6. Поэтому после ответвления ветки `stable` из ветки `beta`, следующая версия `beta` ответвляется снова от `nightly`:
+Ура! Ржавчина 1.5 выпущена! Но мы также забыли про одну вещь: так как прошло шесть недель, мы должны выпустить бета-исполнение *следующей*  исполнения Ржавчины 1.6. Поэтому после ответвления ветки `stable` из ветки `beta`, следующая исполнение `beta` ответвляется снова от `nightly`:
 
 ```text
 nightly: * - - * - - * - - * - - * - - * - * - *
@@ -68,29 +68,29 @@ beta:                * - - - - - - - - *       *
 stable:                                *
 ```
 
-Это называется “модель поезда” (train model), потому что каждые шесть недель выпуск “покидает станцию”, но ему все ещё нужно пройти канал beta, чтобы попасть в стабильную версию.
+Это называется “прообраз поезда” (train model), потому что каждые шесть недель выпуск “покидает станцию”, но ему все ещё нужно пройти поток beta, чтобы попасть в безотказное исполнение.
 
-Rust выпускается каждые шесть недель, как часы. Если вы знаете дату одного выпуска Rust, вы знаете дату выпуска следующего: это шесть недель позднее. Хорошим аспектом выпуска версий каждые шесть недель является то, что следующий поезд прибывает скоро. Если какая-то функция не попадает в релиз, не надо волноваться: ещё один выпуск произойдёт очень скоро! Это помогает снизить давление в случае если функция возможно не отполирована к дате выпуска.
+Ржавчина выпускается каждые шесть недель, как часы. Если вы знаете дату одного выпуска Ржавчина, вы знаете дату выпуска следующего: это шесть недель позднее. Хорошей особенностью выпуска исполнений каждые шесть недель является то, что следующий поезд прибывает скоро. Если какая-то функция не попадает в исполнение, не надо волноваться: ещё один выпуск произойдёт очень скоро! Это помогает снизить давление в случае если функция возможно не отполирована к дате выпуска.
 
-Благодаря этому процессу, вы всегда можете посмотреть следующую версию Rust и убедиться, что на неё легко будет перейти: если бета-выпуск будет работать не так как ожидалось, вы можете сообщить об этом разработчикам и он будет исправлен перед выпуском стабильной версии! Поломки в бета-версии случаются относительно редко, но `rustc` все ещё является частью программного обеспечения, поэтому дефекты все ещё существуют.
+Благодаря этому этапу, вы всегда можете посмотреть следующую исполнение Ржавчины и убедиться, что на неё легко будет перейти: если бета-выпуск будет работать не так как ожидалось, вы можете сообщить об этом разработчикам и он будет исправлен перед выпуском безотказного исполнения! Поломки в бета-исполнения случаются относительно редко, но `rustc` все ещё является частью программного обеспечения, поэтому дефекты все ещё существуют.
 
-### Нестабильные функции
+### Ненадежные функции
 
-У этой модели выпуска есть ещё один плюс: нестабильные функции. Rust использует технику называемую “флаги функционала” (feature flags) для определения функций, которые были включены в выпуске. Если новая функция находится в активной разработке, она попадает в ветку `master`, и поэтому попадает в ночную версию, но с *флагом функции* (feature flag). Если как пользователь, вы хотите попробовать работу такой функции, находящейся в разработке, вы должны использовать ночную версию Rust и указать в вашем исходном коде определённый флаг.
+У этого подхода выпуска есть ещё одно достоинство: ненадежные функции. Ржавчина использует технику называемую “клейма возможностей” (feature flags) для определения функций, которые были включены в выпуске. Если новая функция находится в усиленной разработке, она попадает в ветку `master`, и поэтому попадает в ночную исполнение, но с *клеймом функции* (feature flag). Если как пользователь, вы хотите попробовать работу такой функции, находящейся в разработке, вы должны использовать ночную исполнение Ржавчины и указать в вашем исходной рукописи определённый клеймо.
 
-Если вы используете бета или стабильную версию Rust, Вы не можете использовать флаги функций. Этот ключевой момент позволяет использовать на практике новые возможности перед их стабилизацией. Это может использоваться желающими идти в ногу со временем, а другие могут использовать стабильную версию и быть уверенными что их код не сломается. Стабильность без стагнации.
+Если вы используете бета или безотказное исполнение Ржавчины, Вы не можете использовать клейма функций. Это ключевое мгновение позволяет использовать в действительности новые возможности перед их отладкой. Это может использоваться желающими идти в ногу со временем, а другие могут использовать безотказное исполнение и быть уверенными что их рукопись не сломается. Безотказность без застоя.
 
-Эта книга содержит информацию только о стабильных возможностях, так как разрабатываемые возможности продолжают меняться в процессе и несомненно они будут отличаться в зависимости от того, когда эта книга написана и когда эти возможности будут включены в стабильные сборки. Вы можете найти информацию о возможностях ночной версии в интернете.
+Эта книга содержит сведения только о безотказных возможностях, так как разрабатываемые возможности продолжают меняться в этапе и несомненно они будут отличаться в зависимости от того, когда эта книга написана и когда эти возможности будут включены в безотказные сборки. Вы можете найти сведения о возможностях ночного исполнения в мировой сети.
 
-### Rustup и роль ночной версии Rust
+### Rustup и значение ночного исполнения Ржавчины
 
-Rustup делает лёгким изменение между различными каналами Rust, на глобальном или локальном для проекта уровне. По умолчанию устанавливается стабильная версия Rust. Для установки ночной версии выполните команду:
+Rustup делает лёгким изменение между различными потоками Ржавчина, на вездесущем или местном для дела уровне. По умолчанию устанавливается безотказное исполнение Ржавчины. Для установки ночного исполнения выполните приказ:
 
 ```console
 $ rustup toolchain install nightly
 ```
 
-Вы можете также увидеть все установленные *инструменты разработчика (toolchains)* (версии Rust и ассоциированные компоненты) с помощью `rustup`. Это пример вывода у одного из авторов Rust с компьютером на Windows:
+Вы можете также увидеть все установленные *средства разработчика (toolchains)* (исполнения Ржавчины и сопряженные составляющие) с помощью `rustup`. Это пример вывода у одного из составителей Ржавчина с компьютером на Windows:
 
 ```powershell
 > rustup toolchain list
@@ -99,21 +99,21 @@ beta-x86_64-pc-windows-msvc
 nightly-x86_64-pc-windows-msvc
 ```
 
-Как видите, стабильный набор инструментов (toolchain) используется по умолчанию. Большинство пользователей Rust используют стабильные версии большую часть времени. Возможно, вы захотите использовать стабильную большую часть времени, но использовать каждую ночную версию в конкретном проекте, потому что заботитесь о передовых возможностях. Для этого вы можете использовать команду `rustup override` в каталоге этого проекта, чтобы установить ночной набор инструментов, должна использоваться команда `rustup`, когда вы находитесь в этом каталоге:
+Как видите, включенный набор средств (toolchain) используется по умолчанию. Большинство пользователей Ржавчина используют безотказные исполнения большую часть времени. Возможно, вы захотите использовать безотказную большую часть времени, но использовать каждую ночную исполнение в определенном деле, потому что заботитесь о передовых возможностях. Для этого вы можете использовать приказ `rustup override` в папке этого дела, чтобы установить ночной набор средств, должна использоваться приказ `rustup`, когда вы находитесь в этом папке:
 
 ```console
 $ cd ~/projects/needs-nightly
 $ rustup override set nightly
 ```
 
-Теперь каждый раз, когда вы вызываете `rustc` или `cargo` внутри *~/projects/needs-nightly*, `rustup` будет следить за тем, чтобы вы используете ночную версию Rust, а не стабильную по умолчанию. Это очень удобно, когда у вас есть множество Rust проектов!
+Теперь каждый раз, когда вы вызываете `rustc` или `cargo` внутри *~/projects/needs-nightly*, `rustup` будет следить за тем, чтобы вы используете ночную исполнение Ржавчины, а не безотказную по умолчанию. Это очень удобно, когда у вас есть множество Ржавчина дел!
 
-### Процесс RFC и команды
+### Этап RFC и приказы
 
-Итак, как вы узнаете об этих новых возможностях? Модель разработки Rust следует *процессу запроса комментариев (RFC - Request For Comments)*. Если хотите улучшить Rust, вы можете написать предложение, которое называется RFC.
+Итак, как вы узнаете об этих новых возможностях? Прообраз разработки Ржавчина следует *этапу запроса примечаний (RFC - Request For Comments)*. Если хотите улучшить Ржавчина, вы можете написать предложение, которое называется RFC.
 
-Любой может написать RFC для улучшения Rust, предложения рассматриваются и обсуждаются командой Rust, которая состоит из множества тематических подгрупп. На [веб-сайте Rust](https://www.rust-lang.org/governance) есть полный список команд, который включает команды для каждой области проекта: дизайн языка, реализация компилятора, инфраструктура, документация и многое другое. Соответствующая команда читает предложение и комментарии, пишет некоторые собственные комментарии и в конечном итоге, приходит к согласию принять или отклонить эту возможность.
+Любой может написать RFC для улучшения Ржавчины. Предложения рассматриваются и обсуждаются объединением Ржавчина, которое состоит из множества связанных между собой общностей и общин. На [сайте Ржавчины в сети](https://www.rust-lang.org/governance) есть полный список приказов, который включает приказы для каждой области дела: внешний вид языка, использование сборщика, инфраустройства, пособие и многое другое. Соответствующий приказ считывает предложение и примечания, пишет некоторые собственные примечания и в конечном итоге, приходит к выводу принять или отклонить эту возможность.
 
-Если новая возможность принята и кто-то может реализовать её, то задача открывается в репозитории Rust. Человек реализующий её, вполне может не быть тем, кто предложил эту возможность! Когда реализация готова, она попадает в `master` ветвь с флагом функции, как мы обсуждали в разделе ["Нестабильных функциях"](#unstable-features).
+Если новая возможность принята и кто-то может использовать её, то задача открывается в хранилища Ржавчина. Человек выполняющий её, вполне может не быть тем, кто предложил эту возможность! Когда исполнение готово, оно попадает в `master` ветвь с клеймом функции, как мы обсуждали в разделе ["Небезотказных функциях"](#unstable-features).
 
-Через некоторое время, разработчики Rust использующие ночные выпуски, смогут опробовать новую возможность, члены команды обсудят её, как она работает в ночной версии и решат, должна ли она попасть в стабильную версию Rust или нет. Если принимается решение двигать её вперёд, ограничение функции с помощью флага убирается и функция теперь считается стабильной! Она едет в новую  стабильную версию Rust.
+Через некоторое время, разработчики Ржавчина использующие ночные выпуски, смогут опробовать новую возможность, участники сообщества обсудят её, как она работает в ночном исполнении и решат, должна ли она попасть в безотказное исполнение Ржавчины или нет. Если принимается решение двигать её вперёд, ограничение функции с помощью клейма убирается и функция теперь считается безотказной! Она едет в новое  безотказное исполнение Ржавчины.
diff --git a/rustbook-ru/src/ch00-00-introduction.md b/rustbook-ru/src/ch00-00-introduction.md
index 7627894ba..d00cc7227 100644
--- a/rustbook-ru/src/ch00-00-introduction.md
+++ b/rustbook-ru/src/ch00-00-introduction.md
@@ -1,90 +1,105 @@
 # Введение
 
-> Примечание. Это издание книги такое же, как и [Язык программирования Rust], доступное в печатном и электронном формате от [No Starch Press].
+> Примечание. Это издание книги такое же, как и [Язык программирования Ржавчина], доступное в печатном и электронном виде от [No Starch Press].
 
-Добро пожаловать в *The Rust Programming Language*, вводную книгу о Rust. Язык программирования Rust помогает создавать быстрые, более надёжные приложения. Хорошая эргономика и низкоуровневый контроль часто являются противоречивыми требованиями для дизайна языков программирования; Rust бросает вызов этому конфликту. Благодаря сбалансированности мощных технических возможностей c большим удобством разработки, Rust предоставляет возможности управления низкоуровневыми элементами (например, использование памяти) без трудностей, традиционно связанных с таким контролем.
+Добро пожаловать в *Язык программирования Ржавчина*, вводную книгу о Ржавчине. 
+Язык программирования Ржавчина помогает создавать быстрые, более надёжные приложения. 
+Хорошее удобство и низкоуровневое управление часто являются противоречивыми требованиями 
+для внешнего вида языков программирования; Ржавчина бросает вызов этой вражде. 
+Благодаря уравновешенности мощных технических возможностей c большим удобством 
+разработки, Ржавчина предоставляет возможности управления низкоуровневыми элементами (например, использование памяти) без трудностей, привычно связанных с таким управлением.
 
-## Кому подходит Rust
 
-Rust идеально подходит для многих людей по целому ряду причин. Давайте рассмотрим несколько наиболее важных групп.
 
-### Команды разработчиков
 
-Rust зарекомендовал себя как продуктивный инструмент для совместной работы больших команд разработчиков с разным уровнем знаний в области системного программирования. Низкоуровневый код подвержен различным трудноуловимым ошибкам, которые в большинстве других языков могут быть обнаружены только с помощью тщательного тестирования и проверки кода опытными разработчиками. В Rust компилятор играет роль привратника, отказываясь компилировать код с этими неуловимыми ошибками, включая ошибки параллелизма. Работая вместе с компилятором, команда может сфокусироваться на работе над логикой программы, а не над поиском ошибок.
+## Кому подходит Ржавчина
 
-Rust также привносит современные инструменты разработчика в мир системного программирования:
+Ржавчина наилучше подходит для многих людей по целому ряду причин. Давайте рассмотрим
+несколько наиболее важных обстоятельств.
 
-- Cargo, входящий в комплект менеджер зависимостей и инструмент сборки, делает добавление, компиляцию и управление зависимостями безболезненным и согласованным в рамках всей экосистемы Rust.
-- Инструмент форматирования Rustfmt обеспечивает единый стиль кодирования для всех разработчиков.
-- Rust Language Server обеспечивает интеграцию с интегрированной средой разработки (IDE) для автодополнения кода и встроенных сообщений об ошибках.
+### Объединения разработчиков
 
-Благодаря применению этих и других инструментов в экосистеме Rust разработчики способны продуктивно работать при написании кода системного уровня.
+Ржавчина  показала себя как высокопроизводительное средство для совместной работы больших 
+объединений разработчиков по количеству человек с разным уровнем знаний в области системного программирования. Низкоуровневую рукопись подвержена различным трудноуловимым ошибкам, 
+которые в большинстве других языков могут быть обнаружены только с помощью тщательной 
+самопроверки и проверки рукописи опытными разработчиками. В Ржавчине сборщик играет 
+значение привратника, отказываясь собирать рукопись с этими неуловимыми ошибками, включая 
+ошибки одновременности. Работая вместе с сборщиком, приказ может сосредоточиться на работе 
+над ходом мыслей программы, а не над поиском ошибок.
 
-### Студенты
+Ржавчина также привносит современные средства разработчика в мир системного программирования:
 
-Rust полезен для студентов и тех, кто заинтересован в изучении  системных концепций. Используя Rust, многие люди узнали о таких темах, как разработка операционных систем. Сообщество радушно и с удовольствием ответит на вопросы начинающих. Благодаря усилиям — таким, как эта книга — команды Rust хотят сделать концепции систем более доступными для большего числа людей, особенно для новичков в программировании.
+- Cargo, управленец дополнений входящий в состав и дополнительно как средство сборки, использует добавление, сборку и управление дополнениями безболезненным и согласованным в рамках всего внутреннего устройства Ржавчины.
+- Средство разметки Rustfmt обеспечивает единое исполнение внешнего вида рукописей для всех разработчиков.
+- Ржавчина Language Server обеспечивает взаимодействие со встроенной средой разработки (IDE) для самодополнения рукописи и встроенных сообщений об ошибках.
 
-### Компании
+Благодаря применению этих и других средств в внутреннем устройстве Ржавчины разработчики способны производительно работать при написании рукописи системного уровня.
 
-Сотни больших и малых компаний используют Rust в промышленных условиях для решения различных задач, включая инструменты командной строки, веб-сервисы, инструменты DevOps, встраиваемые устройства, анализ и транскодирование аудио и видео, криптовалюты, биоинформатику, поисковые системы, приложения Интернета вещей, машинное обучение и даже основные части веб-браузера Firefox.
+### Учащиеся
+
+Ржавчина полезна для учащихся и тех, кто увлечен в изучении  системных подходов. Используя Ржавчина многие люди узнали о таких вопросах, как разработка операционных систем. Сообщество радушно и с удовольствием ответит на вопросы начинающих. Благодаря усилиям — таким, как эта книга — приказы Ржавчина хотят сделать подходы систем более доступными для большего числа людей, особенно для новичков в программировании.
+
+### Предприятия
+
+Сотни больших и малых предприятий используют Ржавчину в промышленных условиях для решения различных задач, включая средства приказной строки, сетевые-сервисы, средства DevOps, встраиваемые устройства, оценка и транскодирование аудио и видео, криптовалюты, биоинформатику, поисковые системы, приложения Интернета вещей, машинное обучение и даже основные части сетевого-обозревателя Firefox.
 
 ### Разработчики Open Source
 
-Rust предназначен для людей, которые хотят развивать язык программирования Rust, сообщество, инструменты для разработчиков и библиотеки. Мы будем рады, если вы внесёте свой вклад в развитие языка Rust.
+Ржавчина предназначена для людей, которые хотят развивать язык программирования Ржавчина, само сообщество, средства для разработчиков и библиотеки. Мы будем рады, если вы внесёте свой вклад в развитие языка Ржавчины.
 
-### Люди, ценящие скорость и стабильность
+### Люди, ценящие скорость и безотказность
 
-Rust предназначен для любителей скорости и стабильности в языке. Под скоростью мы подразумеваем как быстродействие программы на Rust, так и быстроту, с которой Rust позволяет писать программы. Проверки компилятора Rust обеспечивают стабильность за счёт функциональных дополнений и рефакторинга. Это выгодно отличается от хрупкого унаследованного кода в языках без таких проверок, который разработчики часто боятся изменять. Благодаря обеспечению абстракций с нулевой стоимостью, высокоуровневых возможностей, компилируемых в низкоуровневый код такой же быстрый, как и написанный вручную, Rust стремится сделать безопасный код ещё и быстрым.
+Ржавчина предназначена для любителей скорости и безотказности в языке. Под скоростью мы подразумеваем как быстродействие программы на Ржавчине, так и быстроту, с которой Ржавчина позволяет писать программы. Проверки сборщика Ржавчины обеспечивают безотказность за счёт большого количества полезных дополнений и переработки рукописи. Это выгодно отличается от хрупкого унаследованной рукописи в языках без таких проверок, которую разработчики часто боятся изменять. Благодаря обеспечению абстракций с нулевой стоимостью, высокоуровневых возможностей, собираемых в низкоуровневую рукопись - производительность такая же быстрая, как и написанная вручную, Ржавчина стремится сделать безопасную рукопись ещё и быстрой.
 
-Язык Rust надеется поддержать и многих других пользователей; перечисленные здесь - лишь самые значимые заинтересованные лица. В целом, главная цель Rust - избавиться от компромиссов, на которые программисты шли десятилетиями, обеспечив безопасность *и* производительность, скорость *и* эргономичность. Попробуйте Rust и убедитесь, подойдут ли вам его решения.
+Язык Ржавчина надеется поддержать и многих других пользователей; перечисленные здесь - лишь самые значимые увлеченные лица. В целом, главная цель Ржавчина - избавиться от соглашений, на которые программисты шли десятилетиями, обеспечив безопасность *и* производительность, скорость *и* удобство. Попробуйте Ржавчину и убедитесь, подойдут ли вам его решения.
 
 ## Для кого эта книга
 
-В этой книге предполагается, что вы писали код на другом языке программирования, но не оговаривается, на каком именно. Мы постарались сделать материал доступным для широкого круга людей с разным уровнем подготовки в области программирования. Мы не будем тратить время на обсуждение *сути понятия* программирования или как его понимать. Если вы совсем новичок в программировании, рекомендуем прочитать книгу, посвящённую введению в программирование.
+В этой книге предполагается, что вы писали рукописи на другом языке программирования, но не оговаривается, на каком именно. Мы постарались сделать пособие доступным для широкого круга людей с разным уровнем подготовки в области программирования. Мы не будем тратить время на обсуждение *сути понятия* программирования или как его понимать. Если вы совсем новичок в программировании, советуем прочитать книгу, посвящённую введению в программирование.
 
 ## Как использовать эту книгу
 
-В целом, книга предполагает, что вы будете читать последовательно от начала до конца. Более поздние главы опираются на концепции, изложенные в предыдущих главах, а предыдущие главы могут не углубляться в детали конкретной темы, так как в последующих главах они будут рассматриваться более подробно.
+В целом, книга предполагает, что вы будете читать последовательно от начала до конца. Более поздние Главы опираются на подходы, изложенные в предыдущих главах, а предыдущие Главы могут не углубляться в подробности  сути, так как в последующих главах они будут рассматриваться более подробно.
 
-В этой книге вы найдёте два вида глав: главы о концепциях и главы с проектом. В главах о концепциях вы узнаете о каком-либо аспекте Rust. В главах проекта мы будем вместе создавать небольшие программы, применяя то, что вы уже узнали. Главы 2, 12 и 20 - это главы проекта; остальные - главы о концепциях.
+В этой книге вы найдёте два вида глав: Главы о самих используемых подходах и Главы с применением этих знаний на деле. В главах о подходах вы узнаете о каком-либо особенности Ржавчины. В главах дела мы будем вместе создавать небольшие программы, применяя то, что вы уже узнали. Главы 2, 12 и 20 - это Главы дела; остальные - Главы о подходах.
 
-Глава 1 объясняет, как установить Rust, как написать программу "Hello, world!" и как использовать Cargo, менеджер пакетов и инструмент сборки Rust. Глава 2 - это практическое введение в написание программы на Rust, в которой вам предлагается создать игру для угадывания чисел. Здесь мы рассмотрим концепции на высоком уровне, а в последующих главах будет предоставлена дополнительная информация. Если вы хотите сразу же приступить к работе, глава 2 - самое подходящее место для этого. В главе 3 рассматриваются возможности Rust, схожие с возможностями других языков программирования, а в главе 4 вы узнаете о системе владения Rust. Если вы особенно дотошный ученик и предпочитаете изучить каждую деталь, прежде чем переходить к следующей, возможно, вы захотите пропустить главу 2 и сразу перейти к главе 3, вернувшись к главе 2, когда захотите поработать над проектом, применяя изученные детали.
+Глава 1 объясняет, как установить Ржавчину, как написать программу "Hello, world!" и как использовать Cargo, управленец дополнений и средство сборки Ржавчины. Глава 2 - это опытное введение в написание программы на Ржавчине в которой вам предлагается создать игру для угадывания чисел. Здесь мы рассмотрим подходы на высоком уровне, а в последующих главах будут предоставлены дополнительные сведения. Если вы хотите сразу же приступить к работе, глава 2 - самое подходящее место для этого. В главе 3 рассматриваются возможности Ржавчины схожие с возможностями других языков программирования, а в главе 4 вы узнаете о устройстве владения Ржавчины. Если вы особенно дотошный ученик и предпочитаете изучить каждую подробность, прежде чем переходить к следующей, возможно, вы захотите пропустить главу 2 и сразу перейти к главе 3, вернувшись к главе 2, когда захотите поработать над делом, применяя изученные подробности.
 
-Глава 5 описывает структуры и методы, а глава 6 охватывает перечисления, выражения `match` и конструкции управления потоком `if let`. Вы будете использовать структуры и перечисления для создания пользовательских типов в Rust.
+Глава 5 описывает стопки и способы, а глава 6 охватывает перечисления, выражения `match` и стопки управления потоком `if let`. Вы будете использовать стопки и перечисления для создания пользовательских видов данных в Ржавчине.
 
-В главе 7 вы узнаете о системе модулей Rust, о правилах организации приватности вашего кода и его публичном интерфейсе прикладного программирования (API). В главе 8 обсуждаются некоторые распространённые структуры данных - коллекции, которые предоставляет стандартная библиотека, такие как векторы, строки и HashMaps. В главе 9 рассматриваются философия и методы обработки ошибок в Rust.
+В главе 7 вы узнаете о устройстве разделов Ржавчины, о правилах согласования закрытости вашей рукописи и её открытой внешней оболочке прикладного программирования (API). В главе 8 обсуждаются некоторые распространённые стопки данных - собрания, которые предоставляет обычная библиотека, такие как векторы, строки и HashMaps. В главе 9 рассматриваются мировоззрение и способы обработки ошибок в Ржавчине.
 
-В главе 10 рассматриваются шаблонные типы данных, типажи и времена жизни, позволяющие написать код, который может использоваться разными типами. Глава 11 посвящена тестированию, которое даже с гарантиями безопасности в Rust необходимо для обеспечения правильной логики вашей программы. В главе 12 мы создадим собственную реализацию подмножества функциональности инструмента командной строки `grep`, предназначенного для поиска текста в файлах. Для этого мы будем использовать многие концепции, которые обсуждались в предыдущих главах.
+В главе 10 рассматриваются образцовые виды данных, сущности и времена жизни, позволяющие написать рукопись, которая может использоваться разными видами данных. Глава 11 посвящена проверке, которое даже с заверениями безопасности в Ржавчине необходимо для обеспечения правильной хода мыслей вашей программы. В главе 12 мы создадим собственное исполнене подмножества возможности средства приказной строки `grep`, предназначенного для поиска писания в файлах. Для этого мы будем использовать многие подходы, которые обсуждались в предыдущих главах.
 
-В главе 13 рассматриваются замыкания и итераторы: особенности Rust, пришедшие из функциональных языков программирования. В главе 14 мы более подробно рассмотрим Cargo и поговорим о лучших методах распространения ваших библиотек среди других разработчиков. В главе 15 обсуждаются умные указатели, которые предоставляет стандартная библиотека, и типажи, обеспечивающие их функциональность.
+В главе 13 рассматриваются замыкания и повторители: особенности Ржавчины, пришедшие из других полезных языков программирования. В главе 14 мы более подробно рассмотрим Cargo и поговорим о лучших способах распространения ваших библиотек среди других разработчиков. В главе 15 обсуждаются умные указатели, которые предоставляет обычная библиотека, и сущности, обеспечивающие их возможность.
 
-В главе 16 мы рассмотрим различные модели параллельного программирования и поговорим о возможности Rust для безбоязненного многопоточно программирования. В главе 17 рассматривается сравнение идиом Rust с принципами объектно-ориентированного программирования, которые наверняка вам знакомы.
+В главе 16 мы рассмотрим различные подходы одновременного программирования и поговорим о возможности Ржавчины для безбоязненного многопоточно программирования. В главе 17 рассматривается сравнение устойчивых выражений Ржавчины с принципами предметно-направленного программирования, которые наверняка вам знакомы.
 
-Глава 18 - это справочник по шаблонам и сопоставлению с образцами, которые являются мощными способами выражения идей в программах на Rust. Глава 19 содержит множество интересных дополнительных тем, включая небезопасный Rust, макросы и многое другое о времени жизни, типажах, типах, функциях и замыканиях.
+Глава 18 - это справочник по образцам данных и сопоставлению с образцами данных, которые являются мощными способами выражения мыслей в программах на Ржавчине. Глава 19 содержит множество важных дополнительных тем, включая небезопасный язык Ржавчина, макросы и многое другое о времени жизни, сущностях, видах данных, функциях и замыканиях.
 
-В главе 20 мы завершим проект, в котором реализуем низкоуровневый многопоточный веб-сервер!
+В главе 20 мы завершим дело, в котором выполняем низкоуровневый многопоточный сетевой-отдельный вычислитель!
 
-Наконец, некоторые приложения содержат полезную информацию о языке в более справочном формате. В приложении A рассматриваются ключевые слова Rust, в приложении B — операторы и символы Rust, в приложении C — производные типажи, предоставляемые стандартной библиотекой, в приложении D — некоторые полезные инструменты разработки, а в приложении E — издания Rust. В приложении F вы найдёте переводы книги, а в приложении G мы расскажем о том, как создаётся Rust и что такое nightly Rust.
+Наконец, некоторые приложения содержат полезные сведения о языке в более справочном виде. В приложении A рассматриваются ключевые слова Ржавчины, в приложение B  — приказчики и знаки Ржавчины в приложении C — производные сущности, предоставляемые встроенной библиотекой, в приложении D — некоторые полезные средства разработки, а в приложении E — издания Ржавчины. В приложении F вы найдёте переводы книги, а в приложении G мы расскажем о том, как создаётся Ржавчина и что такое ночное издание Ржавчины.
 
-Нет неправильного способа читать эту книгу: если вы хотите пропустить главу - сделайте это! Возможно, вам придётся вернуться к предыдущим главам, если возникнет недопонимание. Делайте все, как вам удобно.
+Нет неправильного способа прочтения этой книгу: если вы хотите пропустить главу - сделайте это! Возможно, вам придётся вернуться к предыдущим главам, если возникнет недопонимание. Делайте все, как вам удобно.
 
 
 
-Важной частью процесса обучения Rust является изучение того, как читать сообщения об ошибках, которые отображает компилятор: они приведут вас к работающему коду. Мы изучим много примеров, которые не компилируются и отображают ошибки в сообщениях компилятора в разных ситуациях. Знайте, что если вы введёте и запустите случайный пример, он может не скомпилироваться! Убедитесь, что вы прочитали окружающий текст, чтобы понять, не предназначен ли пример, который вы пытаетесь запустить, для демонстрации ошибки. Ferris также поможет вам различить код, который не предназначен для работы:
+Важной частью этапа обучения Ржавчины является изучение того, как читать сообщения об ошибках, которые отображает сборщик: они приведут вас к работающей рукописи. Мы изучим много примеров, которые не собираются и отображают ошибки в сообщениях сборщика в разных случаях. Знайте, что если вы введёте и запустите случайный пример, он может не собраться! Убедитесь, что вы прочитали окружающий писание,  чтобы понять, не предназначен ли пример, который вы пытаетесь запустить, для отображения ошибки. Ferris также поможет вам различить рукопись, которая не предназначена для работы:
 
 Ferris | Пояснения
 --- | ---
-Ferris with a question mark | Этот код не компилируется!
-Феррис вскидывает руки | Этот код вызывает панику!
-Феррис с одним когтем вверх, пожимая плечами | Этот код не приводит к желаемому поведению.
+Ferris with a question mark | Эта рукопись не собирается!
+Феррис вскидывает руки | Эта рукопись вызывает сбой!
+Феррис с одним когтем вверх, пожимая плечами | Эта рукопись не приводит к желаемому поведению.
 
-В большинстве случаев мы приведём вас к правильной версии любого кода, который не компилируется.
+В большинстве случаев мы приведём вас к правильному исполнению любой рукописи, которая не собирается.
 
-## Исходные коды
+## Исходные рукописи
 
-Файлы с исходным кодом, используемым в этой книге, можно найти на [GitHub].
+Файлы с исходной рукописью, используемым в этой книге, можно найти на [GitHub].
 
 
-[Язык программирования Rust]: https://nostarch.com/rust-programming-language-2nd-edition
+[Язык программирования Ржавчина]: https://nostarch.com/rust-programming-language-2nd-edition
 [No Starch Press]: https://nostarch.com/
 [GitHub]: https://github.com/rust-lang/book/tree/main/src
\ No newline at end of file
diff --git a/rustbook-ru/src/ch01-00-getting-started.md b/rustbook-ru/src/ch01-00-getting-started.md
index 1a47499d7..f91255d38 100644
--- a/rustbook-ru/src/ch01-00-getting-started.md
+++ b/rustbook-ru/src/ch01-00-getting-started.md
@@ -1,7 +1,7 @@
 # Начало работы
 
-Начнём наше путешествие в Rust! Нужно много всего изучить, но каждое путешествие с чего-то начинается. В этой главе мы обсудим:
+Начнём наше путешествие в Ржавчину! Нужно много всего изучить, но каждое путешествие с чего-то начинается. В этой главе мы обсудим:
 
-- установку Rust на Linux, macOS и Windows,
-- написание программы, печатающей `Hello, world!`,
-- использование `cargo`, менеджера пакетов и системы сборки в одном лице для Rust.
+- установку Ржавчина на Linux, macOS и Windows,
+- написание программы, выводящей `Hello, world!`,
+- использование `cargo`, управленца дополнений и системы сборки в одном лице для Ржавчины.
diff --git a/rustbook-ru/src/ch01-00-introduction.md b/rustbook-ru/src/ch01-00-introduction.md
index 46057883f..a6bd130ef 100644
--- a/rustbook-ru/src/ch01-00-introduction.md
+++ b/rustbook-ru/src/ch01-00-introduction.md
@@ -1,40 +1,22 @@
 # Введение
-Добро пожаловать! Это книга о языке программирования Rust.
-Rust - это язык программирования, с помощью которого можно создавать безопасные,
-быстрые и многопоточные приложения. Безопасность, скорость и многопоточность —
-это три кита вашего Rust-приложения. Семантический дизайн языка позволяет создавать
-программы, объединяющие воедино высокую производительность, контроль над используемыми
-ресурсами и абстракции высокого уровня. Rust объединяет в себе черты низкоуровневых
-и высокоуровневых языков программирования. Системные программисты по достоинству
-оценят безопасность языковых конструкций, а прикладные программисты получат возможность
-создавать производительные решения. Код программ читается свободно, поэтому писать
-на нём удобно.
+Добро пожаловать! Это книга о языке программирования Ржавчина.
+Ржавчина - это язык программирования, с помощью которого можно создавать безопасные, быстрые и многопоточные приложения. Безопасность, скорость и многопоточность — это три кита вашего Ржавчина-приложения. Смысловой внешний вид языка позволяет создавать программы, объединяющие воедино высокую производительность, управление над используемыми мощностями и абстракции высокого уровня. Ржавчина объединяет в себе возможности низкоуровневых и высокоуровневых языков программирования. Системные программисты по достоинству оценят безопасность языковых устройств, а прикладные программисты получат возможность создавать производительные решения. Рукопись программ читается свободно, поэтому писать на нём удобно.
 
-Компилятор производит работу по статическому анализу кода, оптимизации использования
-ресурсов. Это позволяет повысить производительность работы программ и заранее
-оптимизировать объём используемых системных ресурсов. Благодаря этим особенностям
-Rust — это удобный инструмент для создания решений в следующих прикладных областях:
-приложения с предопределёнными жёсткими квотами ресурсов - кодеки, драйверы устройств,
-драйверы баз данных и даже встроенные системы. Rust весьма удобен для создания
-веб-приложений. Менеджер пакетов [crates.io] позволяет создавать высоконагруженные
-решения без неизбежных расходов многослойных, высокоуровневых альтернатив. Просто
-отпустите Вашу фантазию в полёт и создавайте приложения!
+Сборщик производит работу по постоянному оценке рукописи, переработки использования мощностей. Это позволяет повысить производительность работы программ и заранее перерабатывать размер используемых системных мощностей. Благодаря этим особенностям - Ржавчина является удобным средством для создания решений в следующих прикладных областях:
+приложения с предопределёнными жёсткими квотами мощностей - кодеки, драйверы устройств,
+драйверы хранилищ данных и даже встроенные системы. Ржавчина весьма удобен для создания
+сетевых-приложений. Управленец дополнений [crates.io] позволяет создавать высоконагруженные
+решения без неизбежных расходов многослойных, высокоуровневых иных решений. Просто
+отпустите Ваше воображение в полёт и создавайте приложения!
 
 [crates.io]: https://crates.io/
 
-Эта книга будет полезна программистам, которые уже имеют теоретическую подготовку и
-практический опыт в программировании. Очень даже возможно, что после внимательного
-прочтения этой книги, написания и отладки кода, понимания основных шаблонов проектирования,
-обретения навыков комфортной работы с языковыми конструкциями Вы полюбите писать
-на Rust. Небольшие учебные примеры научат использовать потенциал Rust. Также Вы
-научитесь пользоваться инструментальными средствами — дополнительными программами
-и технологиями, благодаря которым продуктивность работы будет увеличиваться.
+Эта книга будет полезна программистам, которые уже имеют достаточную подготовку и большой опыт в программировании. Очень даже возможно, что после внимательного прочтения этой книги, написания и отладки рукописи, понимания основных образцов разработки, обретения навыков комфортной работы с языковыми устройствами Вы полюбите писать на Ржавчине. Небольшие учебные примеры научат использовать возможности Ржавчины. Также Вы научитесь пользоваться имеющимися средствами — дополнительными программами и технологиями, благодаря которым производительность работы будет увеличиваться.
 
 ## Доработка книги
 
 Если вы найдете ошибку, неточность, пожалуйста внесите исправление с помощью возможностей
-[GitHub]. [CONTRIBUTING.md] — это файл, в котором описаны основные правила
-внесения изменений.
+[GitHub]. [CONTRIBUTING.md] — это файл, в котором описаны основные правила внесения изменений.
 
 [GitHub]: https://github.com/ruRust/rust_book_2ed
 [CONTRIBUTING.md]: https://github.com/ruRust/rust_book_2ed/blob/ru_version/CONTRIBUTING.md
diff --git a/rustbook-ru/src/ch01-01-installation.md b/rustbook-ru/src/ch01-01-installation.md
index f0f378766..fee0d04ec 100644
--- a/rustbook-ru/src/ch01-01-installation.md
+++ b/rustbook-ru/src/ch01-01-installation.md
@@ -1,66 +1,66 @@
 ## Установка
 
-Первым шагом является установка Rust. Мы загрузим Rust, используя инструмент командной строки `rustup`, предназначенный для управлениями версиями Rust и другими связанными с ним инструментами. Вам понадобится интернет-соединение для его загрузки.
+Первым шагом является установка Ржавчины. Мы загрузим Ржавчину, используя средство приказной строки `rustup`, предназначенное для управлениями исполнениями Ржавчина и другими связанными с ним средствами. Вам понадобится соединение с мировой сетью для его загрузки.
 
-> Примечание: если вы по каким-то причинам предпочитаете не использовать rustup, пожалуйста, посетите [страницу «Другие методы установки Rust»] для получения дополнительных опций.
+> Примечание: если вы по каким-то причинам предпочитаете не использовать rustup, пожалуйста, посетите [страницу «Другие способы установки Ржавчины»] для получения дополнительных возможностей.
 
-Следующие шаги устанавливают последнюю стабильную версию компилятора Rust. Благодаря гарантиям стабильности Rust все примеры в книге, которые компилируются, будут компилироваться и в новых версиях Rust. Вывод может немного отличаться в разных версиях, поскольку Rust часто улучшает сообщения об ошибках и предупреждения. Другими словами, любая новая, стабильная версия Rust, которую вы установите с помощью этих шагов, должна работать с содержимым этой книги так, как ожидается.
+Следующие шаги устанавливают последнее безотказное исполнение сборщика Ржавчины. Благодаря заверениям безотказности Ржавчины, все примеры в книге, которые собираются, будут собираться и в новых исполнениях Ржавчины. Вывод может немного отличаться в разных исполнениях, поскольку Ржавчина часто улучшает сообщения об ошибках и предупреждения. Другими словами, любое новое, безотказное исполнение Ржавчины, которую вы установите с помощью этих шагов, должна работать с содержимым этой книги так, как ожидается.
 
-> ### Условные обозначения командной строки
+> ### Условные обозначения приказной строки
 >
-> В этой главе и во всей книге мы будем демонстрировать некоторые команды, используемые в терминале. Строки, которые вы должны вводить в терминале, начинаются с `$`. Вам не нужно вводить символ `$`; это подсказка командной строки, отображаемая для обозначения начала каждой команды. Строки, которые не начинаются с `$`, обычно показывают вывод предыдущей команды. Кроме того, в примерах, специфичных для PowerShell, будет использоваться `>`, а не `$`.
+> В этой главе и во всей книге мы будем выполнять некоторые приказы, используемые в окне вызова. Строки, которые вы должны вводить в окне вызова, начинаются с `$`. Вам не нужно вводить знак `$`; это подсказка приказной строки, отображаемая для обозначения начала каждого приказа. Строки, которые не начинаются с `$`, обычно показывают вывод предыдущего приказа. Кроме того, в примерах, своеобразных для PowerShell, будет использоваться `>`, а не `$`.
 
 ### Установка `rustup` на Linux или macOS
 
-Если вы используете Linux или macOS, пожалуйста, выполните следующую команду:
+Если вы используете Linux или macOS, пожалуйста, выполните следующий приказ:
 
 ```console
 $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
 ```
 
-Команда загружает сценарий и запускает установку инструмента `rustup`, который устанавливает последнюю стабильную версию Rust. Вам может быть предложено ввести пароль. Если установка прошла успешно, появится следующая строка:
+Приказ загружает заранее рассчитанный замысел и запускает установку средства `rustup`, которое устанавливает последнее безотказное исполнение Ржавчины. Вам может быть предложено ввести пароль. Если установка прошла успешно, появится следующая строка:
 
 ```text
-Rust is installed now. Great!
+Ржавчина is installed now. Great!
 ```
 
-Вам также понадобится *компоновщик (linker)* — программа, которую Rust использует для объединения своих скомпилированных выходных данных в один файл. Скорее всего, он у вас уже есть. При возникновении ошибок компоновки, вам следует установить компилятор C, который обычно будет включать в себя и компоновщик. Компилятор C также полезен, потому что некоторые распространённые пакеты Rust зависят от кода C и нуждаются в компиляторе C.
+Вам также понадобится *составитель (linker)* — программа, которую Ржавчина использует для объединения своих собранных выходных данных в один файл. Скорее всего, он у вас уже есть. При возникновении ошибок объединения, вам следует установить сборщик C, который обычно будет включать в себя и составитель. Сборщик C также полезен, потому что некоторые распространённые дополнения Ржавчина зависят от рукописи C и нуждаются в сборщике C.
 
-На macOS вы можете получить компилятор C, выполнив команду:
+На macOS вы можете получить сборщик C, выполнив приказ:
 
 ```console
 $ xcode-select --install
 ```
 
-Пользователи Linux, как правило, должны устанавливать GCC или Clang в соответствии с документацией их дистрибутива. Например, при использовании Ubuntu можно установить пакет `build-essential`.
+Пользователи Linux, как правило, должны устанавливать GCC или Clang в соответствии с пособием их установочного набора. Например, при использовании Ubuntu можно установить дополнение `build-essential`.
 
 ### Установка `rustup` на Windows
 
-На Windows перейдите по адресу [https://www.rust-lang.org/tools/install] и следуйте инструкциям по установке Rust. На определённом этапе установки вы получите сообщение, предупреждающее, что вам также понадобятся инструменты сборки MSVC для Visual Studio 2013 или более поздней версии.
+На Windows перейдите по адресу [https://www.rust-lang.org/tools/install] и следуйте указаниям по установке Ржавчины. На определённом этапе установки вы получите сообщение, предупреждающее, что вам также понадобятся средства сборки MSVC для Visual Studio 2013 или более поздней исполнения.
 
-Чтобы получить инструменты сборки, вам потребуется установить [Visual Studio 2022]. На вопрос о том, какие компоненты необходимо установить, выберите:
+Чтобы получить средства сборки, вам потребуется установить [Visual Studio 2022]. На вопрос о том, какие составляющие необходимо установить, выберите:
 
 - “Desktop Development with C++”
 - The Windows 10 or 11 SDK
-- Английский языковой пакет вместе с любым другим языковым пакетом по вашему выбору.
+- Английский (языковое дополнение) вместе с любым другим языковым дополнением по вашему выбору.
 
-В остальной части этой книги используются команды, которые работают как в *cmd.exe*, так и в PowerShell. При наличии специфических различий мы объясним, что необходимо сделать в таких случаях.
+В остальной части этой книги используются приказы, которые работают как в *cmd.exe*, так и в PowerShell. При наличии отличительных различий мы объясним, что необходимо сделать в таких случаях.
 
 ### Устранение возможных ошибок
 
-Чтобы проверить, правильно ли у вас установлен Rust, откройте оболочку и введите эту строку:
+Чтобы проверить, правильно ли у вас установлена Ржавчина, откройте оболочку и введите эту строку:
 
 ```console
 $ rustc --version
 ```
 
-Вы должны увидеть номер версии, хэш фиксации и дату фиксации для последней стабильной версии, которая была выпущена, в следующем формате:
+Вы должны увидеть номер исполнения, хэш определения и дату определения для последней безотказного исполнения, которое было выпущено, в следующем виде:
 
 ```text
 rustc x.y.z (abcabcabc yyyy-mm-dd)
 ```
 
-Если вы видите эту информацию, вы успешно установили Rust! Если вы не видите эту информацию, убедитесь, что Rust находится в вашей системной переменной `%PATH%` следующим образом:
+Если вы видите эти сведения, вы успешно установили Ржавчины! Если вы не видите эти сведения, убедитесь, что Ржавчина находится в вашей системной папке переменной `%PATH%` следующим образом:
 
 В Windows CMD:
 
@@ -80,30 +80,30 @@ rustc x.y.z (abcabcabc yyyy-mm-dd)
 $ echo $PATH
 ```
 
-Если все было сделано правильно, но Rust все ещё не работает, есть несколько мест, где вам могут помочь. Узнайте, как связаться с другими Rustaceans (так мы себя называем) на [странице сообщества].
+Если все было сделано правильно, но Ржавчина все ещё не работает, есть несколько мест, где вам могут помочь. Узнайте, как связаться с другими Rustaceans (так мы себя называем) на [странице сообщества].
 
 ### Обновление и удаление
 
-После установки Rust с помощью `rustup` обновление до новой версии не составит труда. В командной оболочке запустите следующий скрипт обновления:
+После установки Ржавчины с помощью `rustup` обновление до нового исполнения не составит труда. В приказной оболочке запустите следующий приказ для обновления:
 
 ```console
 $ rustup update
 ```
 
-Чтобы удалить Rust и `rustup`, выполните следующую команду:
+Чтобы удалить Ржавчину и `rustup`, выполните следующий приказ:
 
 ```console
 $ rustup self uninstall
 ```
 
-### Локальная документация
+### Местное пособие
 
-Установка Rust также включает локальную копию документации, чтобы вы могли читать её в автономном режиме. Выполните `rustup doc`, чтобы открыть локальную документацию в браузере.
+Установка Ржавчины также включает местное пособие, чтобы вы могли читать его в без доступа к мировой сети. Выполните `rustup doc`, чтобы открыть местное пособие в обозревателе.
 
-Если стандартная библиотека предоставляет тип или функцию, а вы не знаете, что она делает или как её использовать, воспользуйтесь документацией интерфейса прикладного программирования (API), чтобы это узнать!
+Если обычная библиотека предоставляет вид данных или функцию, а вы не знаете, что она делает или как её использовать, воспользуйтесь пособием внешней оболочки прикладного программирования (API), чтобы это узнать!
 
 
-[страницу «Другие методы установки Rust»]: https://forge.rust-lang.org/infra/other-installation-methods.html
+[страницу «Другие способы установки Ржавчины»]: https://forge.rust-lang.org/infra/other-installation-methods.html
 [https://www.rust-lang.org/tools/install]: https://www.rust-lang.org/tools/install
 [Visual Studio 2022]: https://visualstudio.microsoft.com/downloads/
 [странице сообщества]: https://www.rust-lang.org/community
\ No newline at end of file
diff --git a/rustbook-ru/src/ch01-02-hello-world.md b/rustbook-ru/src/ch01-02-hello-world.md
index cf20cd677..b37602650 100644
--- a/rustbook-ru/src/ch01-02-hello-world.md
+++ b/rustbook-ru/src/ch01-02-hello-world.md
@@ -1,15 +1,15 @@
 ## Привет, мир!
 
-Теперь, когда вы установили Rust, пришло время написать свою первую программу на Rust. Традиционно при изучении нового языка принято писать небольшую программу, которая печатает на экране текст `Привет, мир!`, поэтому мы сделаем то же самое!
+Теперь, когда вы установили Ржавчину пришло время написать свою первую программу на Ржавчине. Привычно при изучении нового языка принято писать небольшую программу, которая выводит на экране писание `Привет, мир!`, поэтому мы сделаем то же самое!
 
->  Примечание: Эта книга предполагает наличие базового навыка работы с командной строкой. Rust не предъявляет особых требований к тому, каким инструментарием вы пользуетесь для редактирования или хранения вашего кода, поэтому если вы предпочитаете использовать интегрированную среду разработки (IDE) вместо командной строки, смело используйте вашу любимую IDE. Многие IDE сейчас в той или иной степени поддерживают Rust; подробности можно узнать из документации к IDE. Команда Rust сосредоточилась на обеспечении отличной поддержки IDE с помощью `rust-analyzer`. Более подробную информацию смотрите в [Приложении D](appendix-04-useful-development-tools.md).
+>  Примечание: Эта книга предполагает наличие достаточного навыка работы с приказной строкой. Ржавчина не предъявляет особых требований к тому, каким набором средств вы пользуетесь для изменения или хранения вашей рукописи, поэтому если вы предпочитаете использовать встроенную среду разработки (IDE) вместо приказной строки, смело используйте вашу любимую IDE. Многие IDE сейчас в той или иной степени поддерживают Ржавчину; подробности можно узнать из пособия к IDE. Объединение Ржавчина сосредоточилось на обеспечении отличной поддержки IDE с помощью `rust-analyzer`. Более подробные сведения смотрите в [Приложении D](appendix-04-useful-development-tools.md).
 >
 
-### Создание папки проекта
+### Создание папки дела
 
-Прежде всего начнём с создания директории, в которой будем сохранять наш код на языке Rust. На самом деле не важно, где сохранять наш код. Однако, для упражнений и проектов, обсуждаемых в данной книге, мы советуем создать директорию *projects* в вашем домашнем каталоге, там же и хранить в будущем код программ из книги.
+Прежде всего начнём с создания папки, в которой будем сохранять нашу рукопись на языке Ржавчина. На самом деле не важно, где сохранять нашу рукопись. Однако, для упражнений и дел, обсуждаемых в данной книге, мы советуем создать папку *projects* в вашем домашней папке, там же и хранить в будущем рукопись программ из книги.
 
-Откройте терминал и введите следующие команды для того, чтобы создать директорию projects для хранения кода разных проектов, и, внутри неё, директорию hello_world для проекта “Привет, мир!”.
+Откройте окно вызова и введите следующие приказы для того, чтобы создать папку projects для хранения рукописи разных дел, и, внутри неё, папку hello_world для дела “Привет, мир!”.
 
 Для Linux, macOS и PowerShell на Windows, введите:
 
@@ -29,11 +29,11 @@ $ cd hello_world
 > cd hello_world
 ```
 
-### Написание и запуск первой Rust программы
+### Написание и запуск первой  программы на Ржавчине
 
-Затем создайте новый исходный файл и назовите его *main.rs*. Файлы Rust всегда заканчиваются расширением *.rs*. Если вы используете более одного слова в имени файла, принято разделять их символом подчёркивания. Например, используйте *hello_world.rs* вместо *helloworld.rs*.
+Затем создайте новый исходный файл и назовите его *main.rs*. Файлы Ржавчина всегда заканчиваются расширением *.rs*. Если вы используете более одного слова в имени файла, принято разделять их знаком подчёркивания. Например, используйте *hello_world.rs*  вместо *helloworld.rs*.
 
-Теперь откроем файл *main.rs* для редактирования и введём следующие строки кода:
+Теперь откроем файл *main.rs* для изменения и введём следующие строки рукописи:
 
 Название файла: main.rs
 
@@ -43,9 +43,9 @@ fn main() {
 }
 ```
 
-Листинг 1-1: Программа, которая печатает Привет, мир!
+Приложение 1-1: Программа, которая выводит Привет, мир!
 
-Сохраните файл и вернитесь в окно терминала в каталог *~/projects/hello_world*. В Linux или macOS введите следующие команды для компиляции и запуска файла:
+Сохраните файл и вернитесь в окно окна вызова в папку *~/projects/hello_world*. В Linux или macOS введите следующие приказы для сборки и запуска файла:
 
 ```console
 $ rustc main.rs
@@ -53,7 +53,7 @@ $ ./main
 Привет, мир!
 ```
 
-В Windows, введите команду `.\main.exe` вместо `./main`:
+В Windows, введите приказ `.\main.exe` вместо `./main`:
 
 ```powershell
 > rustc main.rs
@@ -61,13 +61,13 @@ $ ./main
 Привет, мир!
 ```
 
-Независимо от вашей операционной системы, строка `Привет, мир!` должна быть выведена на терминал. Если вы не видите такого вывода, обратитесь к разделу ["Устранение неполадок"], чтобы узнать, как получить помощь.
+Независимо от вашей операционной системы, строка `Привет, мир!` должна быть выведена на окно вызова. Если вы не видите такого вывода, обратитесь к разделу ["Устранение неполадок "], чтобы узнать, как получить помощь.
 
-Если напечаталось `Привет, мир!`, то примите наши поздравления! Вы написали программу на Rust, что делает вас Rust программистом — добро пожаловать!
+Если вы получили в окне вывода `Привет, мир!`, то примите наши поздравления! Вы написали программу на Ржавчине, что делает вас "Ржавым программистом" — добро пожаловать!
 
-### Анатомия программы на Rust
+### Устройство программы на Ржавчине
 
-Давайте рассмотрим «Привет, мир!» программу в деталях. Вот первая часть головоломки:
+Давайте рассмотрим «Привет, мир!» программу в подробностях. Вот первая часть головоломки:
 
 ```rust
 fn main() {
@@ -75,42 +75,42 @@ fn main() {
 }
 ```
 
-Эти строки определяют функцию с именем `main`. Функция `main` особенная: это всегда первый код, который запускается в каждой исполняемой программе Rust. Первая строка объявляет функцию с именем `main`, которая не имеет параметров и ничего не возвращает. Если бы были параметры, они бы заключались в круглые скобки `()`.
+Эти строки определяют функцию с именем `main`. Функция `main` особенная: это всегда первое что указано в любом деле, которое создается в каждой вновьсозданном деле в языке Ржавчина. Первая строка объявляет функцию с именем `main`, которая не имеет свойств и ничего не возвращает. Если бы были свойства, они бы заключались в круглые скобки `()`.
 
-Тело функции заключено в `{}`. Rust требует фигурных скобок вокруг всех тел функций. Хороший стиль — поместить открывающую фигурную скобку на ту же строку, что и объявление функции, добавив между ними один пробел.
+Тело функции заключено в `{}`. Ржавчина требует узорчатых скобок вокруг всех тел функций. Принятое внешнее исполнение — поместить открывающую узорчатую скобку на ту же строку, что и объявление функции, добавив между ними один пробел.
 
->  Примечание: Если хотите придерживаться стандартного стиля во всех проектах Rust, вы можете использовать инструмент автоматического форматирования под названием `rustfmt` для форматирования кода в определённом стиле (подробнее о `rustfmt` в [Приложении D](appendix-04-useful-development-tools.md). Команда Rust включила этот инструмент в стандартный дистрибутив Rust, как `rustc`, поэтому он уже должен быть установлен на вашем компьютере!
+>  Примечание: Если хотите придерживаться принятого внешнего исполнения во всех делах Ржавчина вы можете использовать средство принудительной разметки под названием `rustfmt` для разметки рукописи в определённом исполнении (подробнее о `rustfmt` в [Приложении D](appendix-04-useful-development-tools.md). Объединение Ржавчины включила это средство в обычный установочный набор Ржавчина, как `rustc`, поэтому он уже должен быть установлен на вашем компьютере!
 >
 
-Тело функции `main` содержит следующий код:
+Тело функции `main` содержит следующую рукопись:
 
 ```rust
     println!("Привет, мир!");
 ```
 
-Эта строка делает всю работу в этой маленькой программе: печатает текст на экран. Можно заметить четыре важных детали.
+Эта строка делает всю работу в этой маленькой программе: выводит писание на экран. Можно заметить четыре важных подробности.
 
-Во-первых, стиль Rust предполагает отступ в четыре пробела, а не табуляцию.
+Во-первых, исполнение Ржавчины предполагает отступ в четыре пробела, а не табуляцию.
 
-Во-вторых, `println!` вызывается макрос Rust. Если бы вместо него была вызвана функция, она была бы набрана как `println` (без `!`). Более подробно мы обсудим макросы Rust в главе 19. Пока достаточно знать, что использование `!` подразумевает вызов макроса вместо обычной функции, и что макросы не всегда подчиняются тем же правилам как функции.
+Во-вторых, `println!` вызывается макрос Ржавчины. Если бы вместо него была вызвана функция, она была бы набрана как `println` (без `!`). Более подробно мы обсудим макросы Ржавчина в главе 19. Пока достаточно знать, что использование `!` подразумевает вызов макроса вместо обычной функции, и что макросы не всегда подчиняются тем же правилам как функции.
 
-В-третьих, вы видите строку `"Привет, мир!"`. Мы передаём её в качестве аргумента макросу `println!`, и она выводится на экран.
+В-третьих, вы видите строку `"Привет, мир!"`. Мы передаём её в качестве переменной макросу `println!`, и она выводится на экран.
 
-В-четвёртых, мы завершаем строку точкой с запятой (`;`), которая указывает на окончание этого выражения и возможность начала следующего. Большинство строк кода Rust заканчиваются точкой с запятой.
+В-четвёртых, мы завершаем строку точкой с запятой (`;`), которая указывает на окончание этого выражения и возможность начала следующего. Большинство строк рукописи Ржавчины заканчиваются точкой с запятой.
 
-### Компиляция и запуск - это отдельные шаги
+### Сборка и запуск - это отдельные шаги
 
-Вы только что запустили впервые созданную программу, поэтому давайте рассмотрим каждый шаг этого процесса.
+Вы только что запустили впервые созданную программу, поэтому давайте рассмотрим каждый шаг этого этапа.
 
-Перед запуском программы на Rust вы должны скомпилировать её с помощью компилятора Rust, введя команду `rustc` и передав ей имя вашего исходного файла, например:
+Перед запуском программы на Ржавчине вы должны собрать её с помощью сборщика Ржавчины, введя приказ `rustc` и передав ему имя вашего исходного файла, например:
 
 ```console
 $ rustc main.rs
 ```
 
-Если у вас есть опыт работы с C или C++, вы заметите, что это похоже на `gcc` или `clang`. После успешной компиляции Rust выводит двоичный исполняемый файл.
+Если у вас есть опыт работы с C или C++, вы заметите, что это похоже на `gcc` или `clang`. После успешной сборки Ржавчина выводит двоичный исполняемый файл.
 
-В Linux, macOS и PowerShell в Windows вы можете увидеть исполняемый файл, введя команду `ls` в оболочке:
+В Linux, macOS и PowerShell в Windows вы можете увидеть исполняемый файл, введя приказ `ls` в оболочке:
 
 ```console
 $ ls
@@ -126,18 +126,18 @@ main.pdb
 main.rs
 ```
 
-Это показывает исходный код файла с расширением *.rs*, исполняемый файл (*main.exe* на Windows, но *main* на всех других платформах) и, при использовании Windows, файл, содержащий отладочную информацию с расширением *.pdb*. Отсюда вы запускаете файлы *main* или *main.exe*, например:
+Это показывает исходную рукопись файла с расширением *.rs*, исполняемый файл (*main.exe* на Windows, но *main* на всех других площадках) и, при использовании Windows, файл, содержащий отладочные сведения с расширением *.pdb*. Отсюда вы запускаете файлы *main* или *main.exe*, например:
 
 ```console
 $ ./main # для Linux
 > .\main.exe # для Windows
 ```
 
-Если ваш *main.rs* — это ваша программа «Привет, мир!», эта строка выведет в терминал `Привет, мир!`.
+Если ваш *main.rs* — это ваша программа «Привет, мир!», эта строка выведет в окно вызова `Привет, мир!`.
 
-Если вы лучше знакомы с динамическими языками, такими как Ruby, Python или JavaScript, возможно, вы не привыкли компилировать и запускать программу как отдельные шаги. Rust — это предварительно *скомпилированный* язык, то есть вы можете скомпилировать программу и передать исполняемый файл кому-то другому, и он сможет запустить его даже без установленного Rust. Если вы даёте кому-то файл *.rb* , *.py* или *.js*, у него должна быть установлена реализация Ruby, Python или JavaScript (соответственно). Но в этих языках вам нужна только одна команда для компиляции и запуска вашей программы. В дизайне языков программирования всё — компромисс.
+Если вы лучше знакомы с изменяемыми языками, такими как Ruby, Python или JavaScript, возможно, вы не привыкли собирать и запускать программу как отдельные шаги. Ржавчина — это предварительно *собранный* язык, то есть вы можете собрать программу и передать исполняемый файл кому-то другому, и он сможет запустить его даже без установленного на личном компьютере языка Ржавчина. Если вы даёте кому-то файл *.rb* , *.py* или *.js*, у него должна быть установлена исполнение Ruby, Python или JavaScript (соответственно). Но в этих языках вам нужен только один приказ для сборки и запуска вашей программы. Во внешнем виде всех языков программирования всё является неким условным соглашением.
 
-Компиляция с помощью `rustc` подходит для простых программ, но по мере роста вашего проекта вы захотите управлять всеми параметрами и упростить передачу кода. Далее мы познакомим вас с инструментом Cargo, который поможет вам писать программы из реального мира на Rust.
+Сборка с помощью `rustc` подходит для простых программ, но по мере роста вашего дела вы захотите управлять всеми свойствами и упростить передачу рукописи. Далее мы познакомим вас с средством Cargo, который поможет вам писать программы из существующего мира на Ржавчине.
 
 
-["Устранение неполадок"]: ch01-01-installation.html#troubleshooting
\ No newline at end of file
+["Устранение неполадок "]: ch01-01-installation.html#troubleshooting
\ No newline at end of file
diff --git a/rustbook-ru/src/ch01-03-hello-cargo.md b/rustbook-ru/src/ch01-03-hello-cargo.md
index f021319be..9c391c757 100644
--- a/rustbook-ru/src/ch01-03-hello-cargo.md
+++ b/rustbook-ru/src/ch01-03-hello-cargo.md
@@ -1,35 +1,35 @@
 ## Привет, Cargo!
 
-Cargo - это система сборки и менеджер пакетов Rust. Большая часть разработчиков используют данный инструмент для управления проектами, потому что Cargo выполняет за вас множество задач, таких как сборка кода, загрузка библиотек, от которых зависит ваш код, и создание этих библиотек. (Мы называем библиотеки, которые нужны вашему коду, *зависимостями*.)
+Cargo - это средство сборки и управленец дополнений Ржавчины. Большая часть разработчиков используют данное средство для управления делами, потому что Cargo использует за вас множество задач, таких как сборка рукописи, загрузка библиотек, от которых зависит ваша рукопись, и создание этих библиотек. (Мы называем библиотеки, которые нужны вашей рукописи, *дополнениями*.)
 
-Самые простые программы на Rust, подобные той, которую мы написали, не имеют никаких зависимостей. Если бы мы сделали проект «Hello, world!» с Cargo, он бы использовал только ту часть Cargo, которая отвечает за компиляцию вашего кода. По мере написания более сложных программ на Rust вы будете добавлять зависимости, а если вы начнёте проект с использованием Cargo, добавлять зависимости станет намного проще.
+Самые простые программы на Ржавчине, подобные той, которую мы написали, не имеют никаких дополнений. Если бы мы сделали дело «Hello, world!» с Cargo, он бы использовал только ту часть Cargo, которая отвечает за сборку вашей рукописи. По мере написания более сложных программ на Ржавчине вы будете добавлять дополнения, а если вы начнёте дело с использованием Cargo, добавлять дополнения станет намного проще.
 
-Поскольку значительное число проектов Rust используют Cargo, оставшаяся часть книги подразумевает, что вы тоже используете Cargo. Cargo входит в комплект поставки Rust, если вы использовали официальные программы установки, рассмотренные в разделе ["Установка"]. Если вы установили Rust другим способом, проверьте, установлен ли Cargo, введя в терминале следующее:
+Поскольку значительное число дел, написанных на языке Ржавчина используют Cargo, оставшаяся часть книги подразумевает, что вы тоже используете Cargo. Cargo входит в состав поставки Ржавчины если вы скачали установочный набор напрямую от разрабочиков, рассмотрен в разделе ["Установка"]. Если вы установили Ржавчину другим способом, проверьте, установлен ли Cargo, введя в окне вызова следующее:
 
 ```console
 $ cargo --version
 ```
 
-Если команда выдала номер версии, то значит Cargo установлен. Если вы видите ошибку, вроде `command not found` ("команда не найдена"), загляните в документацию для использованного вами способа установки, чтобы выполнить установку Cargo отдельно.
+Если приказ выдал номер исполнения, то значит Cargo установлен. Если вы видите ошибку, вроде `command not found` ("приказ не найден"), загляните в пособие для использованного вами способа установки, чтобы выполнить установку Cargo отдельно.
 
-### Создание проекта с помощью Cargo
+### Создание своего дела с помощью Cargo
 
-Давайте создадим новый проект с помощью Cargo и посмотрим, как он отличается от нашего начального проекта "Hello, world!". Перейдите обратно в папку *projects* (или любую другую, где вы решили сохранять код). Затем, в любой операционной системе, запустите команду:
+Давайте создадим новое дело с помощью Cargo и посмотрим, как оно отличается от нашего начального дела "Hello, world!". Перейдите обратно в папку *projects* (или любую другую, где вы решили сохранять рукопись). Затем, в любой операционной системе, запустите приказ:
 
 ```console
 $ cargo new hello_cargo
 $ cd hello_cargo
 ```
 
-Первая команда создаёт новый каталог и проект с именем *hello_cargo*. Мы назвали наш проект *hello_cargo*, и Cargo создаёт свои файлы в каталоге с тем же именем.
+Первый приказ создаёт новую папку и дело с именем *hello_cargo*. Мы назвали наше дело  *hello_cargo*, и Cargo создаёт свои файлы в папке с тем же именем.
 
-Перейдём в каталог *hello_cargo* и посмотрим файлы. Увидим, что Cargo сгенерировал два файла и одну директорию: файл  *Cargo.toml* и каталог *src* с файлом *main.rs* внутри.
+Перейдём в папку *hello_cargo* и посмотрим файлы. Увидим, что Cargo создал два файла и одну папку: файл  *Cargo.toml* и папка *src* с файлом *main.rs* внутри.
 
-Кроме того, cargo инициализировал новый репозиторий Git вместе с файлом *.gitignore*. Файлы Git не будут сгенерированы, если вы запустите `cargo new` в существующем репозитории Git; вы можете изменить это поведение, используя `cargo new --vcs=git`.
+Кроме того, cargo объявил новое хранилище Git вместе с файлом *.gitignore*. Файлы Git не будут созданы, если вы запустите `cargo new` в существующем хранилище Git; вы можете изменить это поведение, используя `cargo new --vcs=git`.
 
-> Примечание. Git — это распространённая система контроля версий. Вы можете изменить `cargo new`, чтобы использовать другую систему контроля версий или не использовать систему контроля версий, используя флаг `--vcs`. Запустите `cargo new --help`, чтобы увидеть доступные параметры.
+> Примечание. Git — это распространённое средство управления исполнениями. Вы можете изменить `cargo new`, чтобы использовать другую систему управления исполнений или не использовать систему управления исполнений, используя клеймо `--vcs`. Запустите `cargo new --help`, чтобы увидеть доступные свойства.
 
-Откройте файл *Cargo.toml* в любом текстовом редакторе. Он должен выглядеть как код в листинге 1-2.
+Откройте файл *Cargo.toml* в любом письменном редакторе. Он должен выглядеть как рукопись в приложении 1-2.
 
 Файл: Cargo.toml
 
@@ -44,15 +44,15 @@ edition = "2021"
 [dependencies]
 ```
 
-Листинг 1-2: Содержимое файла Cargo.toml, сгенерированное командой cargo new
+Приложение 1-2: Содержимое файла Cargo.toml, созданное приказом cargo new
 
-Это файл в формате [*TOML*](https://github.com/toml-lang/toml) (*Tom’s Obvious, Minimal Language*), который является форматом конфигураций Cargo.
+Это файл в виде[*TOML*](https://github.com/toml-lang/toml) (*Tom’s Obvious, Minimal Language*), который является видом настроек Cargo.
 
-Первая строка, `[package]`, является заголовочной секцией, которая указывает что следующие инструкции настраивают пакет. По мере добавления больше информации в данный файл, будет добавляться больше секций и инструкций (строк).
+Первая строка, `[package]`, является заголовочным разделом, которая указывает что следующие указания настраивают дополнение. По мере добавления больше сведений в данный файл, будет добавляться больше разделов и указаний (строк).
 
-Следующие три строки задают информацию о конфигурации, необходимую Cargo для компиляции вашей программы: имя, версию и редакцию Rust, который будет использоваться. Мы поговорим о ключе `edition` в [Приложении E].
+Следующие три строки задают сведения о настройке, необходимую Cargo для сборки вашей программы: имя, исполнение и издание Ржавчина, который будет использоваться. Мы поговорим о ключе `edition` в [Приложении E].
 
-Последняя строка, `[dependencies]` является началом секции для списка любых зависимостей вашего проекта. В Rust, это внешние пакеты кода, на которые ссылаются ключевым словом *crate*. Нам не нужны никакие зависимости в данном проекте, но мы будем использовать их в первом проекте главы 2, так что нам пригодится данная секция зависимостей потом.
+Последняя строка, `[dependencies]` является началом раздела для списка любых дополнений вашего дела. В Ржавчине, это внешние дополнения рукописи, на которые ссылаются ключевым словом *crate*. Нам не нужны никакие дополнения в данном деле, но мы будем использовать их в первом деле Главы 2, так что нам пригодится данный раздел дополнений потом.
 
 Откройте файл *src/main.rs* и загляните в него:
 
@@ -64,15 +64,15 @@ fn main() {
 }
 ```
 
-Cargo сгенерировал для вас программу "Hello, world!", подобную той, которую мы написали в Листинге 1-1! Пока что различия между нашим предыдущим проектом и проектом, сгенерированным при помощи Cargo, заключаются в том, что Cargo поместил исходный код в каталог *src*, и у нас есть конфигурационный файл *Cargo.toml* в верхнем каталоге проекта.
+Cargo создал для вас программу "Hello, world!", подобную той, которую мы написали в Приложении 1-1! Пока что различия между нашим предыдущим делом и делом, созданным при помощи Cargo, заключаются в том, что Cargo поместил исходную рукопись в папку *src*, и у нас есть настроечный файл *Cargo.toml* в верхней папке дела.
 
-Cargo ожидает, что ваши исходные файлы находятся внутри каталога *src*. Каталог верхнего уровня проекта предназначен только для файлов README, информации о лицензии, файлы конфигурации и чего то ещё не относящего к вашему коду. Использование Cargo помогает организовывать проект. Есть место для всего и все находится на своём месте.
+Cargo ожидает, что ваши исходные файлы находятся внутри папки *src*. Папка верхнего уровня дела предназначена только для файлов README, сведений о лицензии, файлы настроек и чего то ещё не относящего к вашей рукописи. Использование Cargo помогает создавать дело. Есть место для всего и все находится на своём месте.
 
-Если вы начали проект без использования Cargo, как мы делали для "Hello, world!" проекта, то можно конвертировать его в проект с использованием Cargo. Переместите код в подкаталог *src* и создайте соответствующий файл *Cargo.toml* в папке.
+Если вы создали дело без использования Cargo, как мы делали для "Hello, world!" дела, то можно преобразовывать его в дело с использованием Cargo. Один из простых способов получить этот файл *Cargo.toml* — запустить `cargo init`, который автоматически его создаст.
 
-### Сборка и запуск Cargo проекта
+### Сборка и запуск дела через Cargo
 
-Посмотрим, в чем разница при сборке и запуске программы "Hello, world!" с помощью Cargo. В каталоге *hello_cargo* соберите проект следующей командой:
+Посмотрим, в чем разница при сборке и запуске программы "Hello, world!" с помощью Cargo. В папке *hello_cargo* соберите дело следующим приказом:
 
 ```console
 $ cargo build
@@ -80,16 +80,16 @@ $ cargo build
     Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs
 ```
 
-Эта команда создаёт исполняемый файл в *target/debug/hello_cargo* (или *target\debug\hello_cargo.exe* в Windows), а не в вашем текущем каталоге. Поскольку стандартная сборка является отладочной, Cargo помещает двоичный файл в каталог с именем *debug*. Вы можете запустить исполняемый файл с помощью этой команды:
+Этот приказ создаёт исполняемый файл в *target/debug/hello_cargo* (или *target\debug\hello_cargo.exe* в Windows), а не в вашем текущем папке. Поскольку обычная сборка является отладочной, Cargo помещает двоичный файл в папке с именем *debug*. Вы можете запустить исполняемый файл с помощью этого приказа:
 
 ```console
 $ ./target/debug/hello_cargo # or .\target\debug\hello_cargo.exe on Windows
 Hello, world!
 ```
 
-Если все хорошо, то `Hello, world!` печатается в терминале. Запуск команды `cargo build` в первый раз также приводит к созданию нового файла *Cargo.lock* в папке верхнего уровня. Данный файл хранит точные версии зависимостей вашего проекта. Так как у нас нет зависимостей, то файл пустой. Вы никогда не должны менять этот файл вручную: Cargo сам управляет его содержимым для вас.
+Если все хорошо, то `Hello, world!` выводится в окне вызова. Запуск приказа `cargo build` в первый раз также приводит к созданию нового файла *Cargo.lock* в папке верхнего уровня. Данный файл хранит сведения о используемых дополнений вашего дела. Так как у нас нет дополнений, то файл пустой. Вы никогда не должны менять этот файл вручную: Cargo сам управляет его содержимым за вас.
 
-Только что мы собрали проект командой `cargo build` и запустили его из `./target/debug/hello_cargo`. Но мы также можем при помощи команды `cargo run` сразу и скомпилировать код, и затем запустить полученный исполняемый файл всего лишь одной командой:
+Только что мы собрали дело приказом `cargo build` и запустили его из `./target/debug/hello_cargo`. Но мы также можем при помощи приказа `cargo run` сразу и собрать рукопись, и затем запустить полученный исполняемый файл всего лишь одним приказом:
 
 ```console
 $ cargo run
@@ -98,9 +98,10 @@ $ cargo run
 Hello, world!
 ```
 
-Использование `cargo run` более удобно, чем необходимость помнить и запускать `cargo build`, а затем использовать весь путь к бинарному файлу, поэтому большинство разработчиков используют `cargo run`.
 
-Обратите внимание, что на этот раз мы не видели вывода, указывающего на то, что Cargo компилирует `hello_cargo`. Cargo выяснил, что файлы не изменились, поэтому не стал пересобирать, а просто запустил бинарный файл. Если бы вы изменили свой исходный код, Cargo пересобрал бы проект перед его запуском, и вы бы увидели этот вывод:
+Использование `cargo run` более удобно, чем необходимость помнить и запускать `cargo build`, а затем использовать весь путь к двоичному файлу, поэтому большинство разработчиков используют `cargo run`.
+
+Обратите внимание, что на этот раз мы не видели вывода, указывающего на то, что Cargo собирает `hello_cargo`. Cargo выяснил, что файлы не изменились, поэтому не стал пересобирать, а просто запустил двоичный файл. Если бы вы изменили свой исходную рукопись, Cargo пересобрал бы дело перед его запуском, и вы бы увидели этот вывод:
 
 ```console
 $ cargo run
@@ -110,7 +111,7 @@ $ cargo run
 Hello, world!
 ```
 
-Cargo также предоставляет команду, называемую `cargo check`. Эта команда быстро проверяет ваш код, чтобы убедиться, что он компилируется, но не создаёт исполняемый файл:
+Cargo также предоставляет приказ `cargo check`. Этот приказ быстро проверяет вашу рукопись, чтобы убедиться, что она собирается, но не создаёт исполняемый файл:
 
 ```console
 $ cargo check
@@ -118,27 +119,27 @@ $ cargo check
     Finished dev [unoptimized + debuginfo] target(s) in 0.32 secs
 ```
 
-Почему вам не нужен исполняемый файл? Часто `cargo check` выполняется намного быстрее, чем `cargo build`, поскольку пропускает этап создания исполняемого файла. Если вы постоянно проверяете свою работу во время написания кода, использование `cargo check` ускорит процесс информирования вас о том, что ваш проект всё ещё компилируется! Таким образом, многие Rustacean периодически запускают `cargo check`, когда пишут свои программы, чтобы убедиться, что она компилируется. Затем они запускают `cargo build`, когда готовы использовать исполняемый файл.
+Почему вам не нужен исполняемый файл? Часто `cargo check` используется намного быстрее, чем `cargo build`, поскольку пропускает этап создания исполняемого файла. Если вы постоянно проверяете свою работу во время написания рукописи, использование `cargo check` ускорит этап уведомления вас о том, что ваше дело всё ещё собирается! Таким образом, многие Rustacean периодически запускают `cargo check`, когда пишут свои программы, чтобы убедиться, что она собирается. Затем они запускают `cargo build`, когда готовы использовать исполняемый файл.
 
 Давайте подытожим, что мы уже узнали о Cargo:
 
-- Мы можем создать проект с помощью `cargo new`.
-- можно собирать проект, используя команду `cargo build`,
-- можно одновременно собирать и запускать проект одной командой `cargo run`,
-- можно собрать проект для проверки ошибок с помощью `cargo check`, не тратя время на кодогенерацию исполняемого файла,
-- cargo сохраняет результаты сборки не в директорию с исходным кодом, а в отдельный каталог *target/debug*.
+- Мы можем создать дело с помощью `cargo new`.
+- можно собирать дело, используя приказ `cargo build`,
+- можно одновременно собирать и запускать дело одним приказом `cargo run`,
+- можно собрать дело для проверки ошибок с помощью `cargo check`, не тратя время на создание рукописи исполняемого файла,
+- cargo сохраняет итоги сборки не в папку с исходной рукописью, а в отдельную папку *target/debug*.
 
-Дополнительным преимуществом использования Cargo является то, что его команды одинаковы для разных операционных систем. С этой точки зрения, мы больше не будем предоставлять отдельные инструкции для Linux, macOS или Windows.
+Дополнительным преимуществом использования Cargo является то, что его приказы одинаковы для разных операционных систем. С этой точки зрения, мы больше не будем предоставлять отдельные указания для Linux, macOS или Windows.
 
-### Сборка финальной версии (Release)
+### Сборка конечного исполнения (Release)
 
-Когда проект, наконец, готов к релизу, можно использовать команду `cargo build --release` для его компиляции с оптимизацией. Данная команда создаёт исполняемый файл в папке *target/release* в отличии от папки *target/debug*. Оптимизации делают так, что Rust код работает быстрее, но их включение увеличивает время компиляции. По этой причине есть два отдельных профиля: один для разработки, когда нужно осуществлять сборку быстро и часто, и другой, для сборки финальной программы, которую будете отдавать пользователям, которая готова к работе и будет выполняться максимально быстро. Если вы замеряете время выполнения вашего кода, убедитесь, что собрали проект с оптимизацией `cargo build --release` и тестируете исполняемый файл из папки *target/release*.
+Когда дело, наконец, готов к исполнению, можно использовать приказ `cargo build --release` для его сборки с переработкой. Данная приказ создаёт исполняемый файл в папке *target/release* в отличии от папки *target/debug*. Переработки делают так, что Ржавчина рукопись работает быстрее, но их включение увеличивает время сборки. По этой причине есть два отдельных профиля: один для разработки, когда нужно осуществлять сборку быстро и часто, и другой, для сборки конечной программы, которую будете отдавать пользователям, которая готова к работе и будет выполняться сверх быстро. Если вы замеряете время выполнения вашей рукописи, убедитесь, что собрали дело с переработкой `cargo build --release` и проверяете исполняемый файл из папки *target/release*.
 
-### Cargo как Конвенция
+### Cargo как Условие
 
-В простых проектах Cargo не даёт больших преимуществ по сравнению с использованием `rustc`, но он проявит себя, когда ваши программы станут более сложными. Когда программы вырастают до нескольких файлов или нуждаются в зависимостях, гораздо проще позволить Cargo координировать сборку.
+В простых делах Cargo не даёт больших преимуществ по сравнению с использованием `rustc`, но он проявит себя, когда ваши программы станут более сложными. Когда программы вырастают до нескольких файлов или нуждаются в зависимостях, гораздо проще позволить Cargo согласовывать сборку.
 
-Не смотря на то, что проект `hello_cargo` простой, теперь он  использует большую часть реального инструментария, который вы будете повседневно использовать в вашей карьере, связанной с Rust. Когда потребуется работать над проектами размещёнными в сети, вы сможете просто использовать следующую последовательность команд для получения кода с помощью Git, перехода в каталог проекта, сборку проекта:
+Не смотря на то, что дело `hello_cargo` простой, теперь он  использует большую часть существующего набора средств, который вы будете повседневно использовать в вашем развитии, связанной с Ржавчиной. Когда потребуется работать над делами размещёнными в сети, вы сможете просто использовать следующую последовательность приказов для получения рукописи с помощью Git, перехода в папку дела, сборку дела:
 
 ```console
 $ git clone example.org/someproject
@@ -146,21 +147,21 @@ $ cd someproject
 $ cargo build
 ```
 
-Для получения дополнительной информации о Cargo ознакомьтесь с [его документацией] .
+Для получения дополнительных сведений о Cargo ознакомьтесь с [его пособием] .
 
 ## Итоги
 
-Теперь вы готовы начать своё Rust путешествие! В данной главе вы изучили как:
+Теперь вы готовы начать своё Ржавчина путешествие! В данной главе вы изучили как:
 
-- установить последнюю стабильную версию Rust, используя `rustup`,
-- обновить Rust до последней версии,
-- открыть локально установленную документацию,
-- написать и запустить программу типа "Hello, world!", используя напрямую компилятор `rustc`,
-- создать и запустить новый проект, используя соглашения и команды Cargo.
+- установить последнее безотказное исполнение Ржавчины, используя `rustup`,
+- обновить Ржавчина до последней исполнения,
+- открыть местно установленную пособие,
+- написать и запустить программу вида "Hello, world!", используя напрямую сборщик `rustc`,
+- создать и запустить новое дело, используя соглашения и приказы Cargo.
 
-Это отличное время для создания более существенной программы, чтобы привыкнуть читать и писать код на языке Rust. Итак, в главе 2 мы построим программу для игры в угадай число. Если вы предпочитаете начать с изучения того, как работают общие концепции программирования в Rust, обратитесь к главе 3, а затем вернитесь к главе 2.
+Это отличное время для создания более существенной программы, чтобы привыкнуть читать и писать рукопись на языке Ржавчина. Итак, в главе 2 мы построим программу для игры в угадай число. Если вы предпочитаете начать с изучения того, как работают общие подходы программирования в Ржавчине, обратитесь к главе 3, а затем вернитесь к главе 2.
 
 
 ["Установка"]: ch01-01-installation.html#installation
 [Приложении E]: appendix-05-editions.html
-[его документацией]: https://doc.rust-lang.org/cargo/
\ No newline at end of file
+[его пособием]: https://doc.rust-lang.org/cargo/
\ No newline at end of file
diff --git a/rustbook-ru/src/ch02-00-guessing-game-tutorial.md b/rustbook-ru/src/ch02-00-guessing-game-tutorial.md
index 0c6386018..a0ec9224f 100644
--- a/rustbook-ru/src/ch02-00-guessing-game-tutorial.md
+++ b/rustbook-ru/src/ch02-00-guessing-game-tutorial.md
@@ -1,19 +1,19 @@
 # Программируем игру в загадки
 
-Давайте окунёмся в Rust, вместе поработав над практическим проектом! В этой главе вы познакомитесь с несколькими общими концепциями Rust, показав, как использовать их в реальной программе. Вы узнаете о `let` , `match`, методах, ассоциированных функциях, внешних контейнерах и многом другом! В следующих главах мы рассмотрим эти идеи более подробно. В этой главе вы просто попрактикуетесь в основах.
+Давайте окунёмся в Ржавчине, вместе поработав над опытным делом! В этой главе вы познакомитесь с несколькими общими подходами Ржавчина показав, как использовать их в существующей программе. Вы узнаете о `let` , `match`, способах, сопряженных функциях, внешних дополнениях и многом другом! В следующих главах мы рассмотрим эти мысли более подробно. В этой главе вы просто примените в основах.
 
-Мы реализуем классическую для начинающих программистов задачу — игру в загадки. Вот как это работает: программа генерирует случайное целое число в диапазоне от 1 до 100. Затем она предлагает игроку его угадать. После ввода числа программа укажет, меньше или больше было загаданное число. Если догадка верна, игра напечатает поздравительное сообщение и завершится.
+Мы выполняем привычную для начинающих программистов задачу — игру в загадки. Вот как это работает: программа порождает случайное целое число в ряде от 1 до 100. Затем она предлагает игроку его угадать. После ввода числа программа укажет, меньше или больше было загаданное число. Если догадка верна, игра выведет поздравительное сообщение и завершится.
 
-## Настройка нового проекта
+## Настройка нового дела
 
-Для настройки нового проекта перейдите в каталог *projects*, который вы создали в главе 1, и создайте новый проект с использованием Cargo, как показано ниже:
+Для настройки нового дела перейдите в папку *projects*, которую вы создали в главе 1, и создайте новое дело с использованием Cargo, как показано ниже:
 
 ```console
 $ cargo new guessing_game
 $ cd guessing_game
 ```
 
-Первая команда, `cargo new`, принимает в качестве первого аргумента имя проекта (`guessing_game`). Вторая команда изменяет каталог на новый каталог проекта.
+Первый приказ, `cargo new`, принимает в качестве первой переменной имя дела (`guessing_game`). Второй приказ изменяет папку на новую папку дела.
 
 Загляните в созданный файл *Cargo.toml*:
 
@@ -40,19 +40,19 @@ cd ../../..
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs}}
 ```
 
-Теперь давайте скомпилируем программу «Hello, world!» и сразу на этом же этапе запустим её с помощью команды `cargo run`:
+Теперь давайте соберем программу «Hello, world!» и сразу на этом же этапе запустим её с помощью приказов `cargo run`:
 
 ```console
 {{#include ../listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt}}
 ```
 
-Команда `run` пригодится, когда необходимо ускоренно выполнить итерацию проекта. Именно так мы собираемся делать в этом проекте, быстро тестируя каждую итерацию, прежде чем перейти к следующей.
+Приказ `run` пригодится, когда необходимо ускоренно выполнить повторение дела. Именно так мы собираемся делать в этом деле, быстро проверяя каждую повторение, прежде чем перейти к следующей.
 
-Снова откройте файл *src/main.rs*. Весь код вы будете писать в нем.
+Снова откройте файл *src/main.rs*. всю рукопись вы будете писать в нем.
 
 ## Обработка догадки
 
-Первая часть программы запрашивает ввод данных пользователем, обрабатывает их и проверяет, что они в ожидаемой форме. Начнём с того, что позволим игроку ввести догадку. Вставьте код из листинга 2-1 в *src/main.rs*.
+Первая часть программы запрашивает ввод данных пользователем, обрабатывает их и проверяет, что они в ожидаемой виде. Начнём с того, что позволим игроку ввести догадку. Вставьте рукопись из приложения 2-1 в *src/main.rs*.
 
 Файл: src/main.rs
 
@@ -60,17 +60,17 @@ cd ../../..
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:all}}
 ```
 
-Листинг 2-1: код, который получает догадку от пользователя и выводит её на экран
+Приложение 2-1: Рукопись, которая получает догадку от пользователя и выводит её на экран
 
-Этот код содержит много информации, поэтому давайте рассмотрим его построчно. Чтобы получить пользовательский ввод и затем вывести результат, нам нужно включить в область видимости библиотеку ввода/вывода `io`. Библиотека `io` является частью стандартной библиотеки, известной как `std`:
+Эта рукопись содержит много сведений, поэтому давайте рассмотрим её построчно. Чтобы получить пользовательский ввод и затем вывести итог, нам нужно включить в область видимости библиотеку ввода/вывода `io`. Библиотека `io` является частью встроенной библиотеки, известной как `std`:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:io}}
 ```
 
-По умолчанию в Rust есть набор элементов, определённых в стандартной библиотеке, которые он добавляет в область видимости каждой программы. Этот набор называется *прелюдией*, и вы можете изучить его содержание [в документации стандартной библиотеки].
+По умолчанию в Ржавчине есть рукопись (содержимое), определённых во встроенной библиотеке, которые он добавляет в область видимости каждой программы. Этот набор называется *встроенным*, и вы можете изучить его содержание [в пособии встроенной библиотеки].
 
-Если тип, который требуется использовать, отсутствует в прелюдии, его нужно явно ввести в область видимости с помощью оператора `use`. Использование библиотеки `std::io` предоставляет ряд полезных функциональных возможностей, включая способность принимать пользовательский ввод.
+Если вид данных, который требуется использовать, отсутствует во встроенном наборе, его нужно явно ввести в область видимости с помощью приказчика `use`. Использование библиотеки `std::io` предоставляет ряд полезных полезных возможностей, включая способность принимать пользовательский ввод.
 
 Как уже отмечалось в главе 1, функция `main` является точкой входа в программу:
 
@@ -78,7 +78,7 @@ cd ../../..
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:main}}
 ```
 
-Ключевое слово `fn` объявляет новую функцию, круглые скобки `()` показывают, что у функции нет входных параметров, фигурная скобка `{` - обозначение начала тела функции.
+Ключевое слово `fn` объявляет новую функцию, круглые скобки `()` показывают, что у функции нет входных свойств, узорчатая скобка `{` - обозначение начала тела функции.
 
 Также в главе 1 упоминалось, что `println!` — это макрос, который выводит строку на экран:
 
@@ -86,7 +86,7 @@ cd ../../..
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:print}}
 ```
 
-Этот код показывает информацию о ходе игры и запрашивает пользовательский ввод.
+Эта рукопись показывает сведения о ходе игры и запрашивает пользовательский ввод.
 
 ### Хранение значений с помощью переменных
 
@@ -96,89 +96,89 @@ cd ../../..
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:string}}
 ```
 
-Вот теперь программа становится интереснее! В этой маленькой строке на самом деле происходит очень многое. Для создания переменной мы используем оператор `let`. Вот ещё один пример:
+Вот теперь программа становится важнее! В этой маленькой строке на самом деле происходит очень многое. Для создания переменной мы используем приказчик `let`. Вот ещё один пример:
 
 ```rust,ignore
 let apples = 5;
 ```
 
-Эта строка создаёт новую переменную с именем `apples` и привязывает её к значению 5. В Rust переменные неизменяемы по умолчанию, то есть как только мы присвоим переменной значение, оно не изменится. Мы подробно обсудим эту концепцию в разделе ["Переменные и изменчивость".] в главе 3. Чтобы сделать переменную изменяемой, мы добавляем `mut` перед её именем:
+Эта строка создаёт новую переменную с именем `apples` и привязывает её к значению 5. В Ржавчине переменные неизменяемы по умолчанию, то есть как только мы присвоим переменной значение, оно не изменится. Мы подробно обсудим этот подход в разделе ["Переменные и изменчивость".] в главе 3. Чтобы сделать переменную изменяемой, мы добавляем `mut` перед её именем:
 
 ```rust,ignore
 let apples = 5; // неизменяемая
 let mut bananas = 5; // изменяемая
 ```
 
->  Примечание: сочетание знаков `//` начинает комментарий, который продолжается до конца строки. Rust игнорирует всё, что находится в комментариях. Мы обсудим комментарии более подробно в [Главе 3].
+>  Примечание: сочетание знаков `//` начинает примечание, которое продолжается до конца строки. Ржавчина пренебрегает всё, что находится в примечаниях. Мы обсудим примечания более подробно в [Главе 3].
 >
 
-Возвращаясь к программе игры "Угадайка" — теперь вы знаете, что `let mut guess` предоставит изменяемую переменную с именем `guess`. Знак равенства (`=`) сообщает Rust, что сейчас нужно связать что-то с этой переменной. Справа от знака равенства находится значение, связанное с `guess`, которое является результатом вызова функции `String::new`, возвращающей новый экземпляр `String`. `String` — это тип строки, предоставляемый стандартной библиотекой, который является расширяемым фрагментом текста в кодировке UTF-8.
+Возвращаясь к программе игры "Угадайка" — теперь вы знаете, что `let mut guess` предоставит изменяемую переменную с именем `guess`. Знак равенства (`=`) сообщает Ржавчине, что сейчас нужно связать что-то с этой переменной. Справа от знака равенства находится значение, связанное с `guess`, которое является итогом вызова функции `String::new`, возвращающей новый образец данных `String`. `String` — это вид данных `строка`, предоставляемый встроенной библиотекой, который является расширяемым отрывком писания в представлении UTF-8.
 
-Синтаксис `::` в строке `::new` указывает, что `new` является ассоциированной функцией типа `String`. *Ассоциированная функция* — это функция, реализованная для типа, в данном случае `String`. Функция `new` создаёт новую пустую строку. Функцию `new` можно встретить во многих типах, это типичное название для функции, которая создаёт новое значение какого-либо типа.
+Правила написания `::` в строке `::new` указывают, что `new` является сопряженной функцией вида данных `String`. *Сопряженная функция* — это функция, используемая для вида данных, в данном случае `String`. Функция `new` создаёт новую пустую строку. Функцию `new` можно встретить во многих видах данных, это привычное название для функции, которая создаёт новое значение какого-либо вида данных.
 
-В конечном итоге строка `let mut guess = String::new();` создала изменяемую переменную, которая связывается с новым пустым экземпляром `String`. Фух!
+В конечном итоге строка `let mut guess = String::new();` создала изменяемую переменную, которая связывается с новым пустым образцом `String`. Фух!
 
 ### Получение пользовательского ввода
 
-Напомним: мы подключили функциональность ввода/вывода из стандартной библиотеки с помощью `use std::io;` в первой строке программы. Теперь мы вызовем функцию `stdin` из модуля `io`, которая позволит нам обрабатывать пользовательский ввод:
+Напомним: мы подключили возможность ввода/вывода из встроенной библиотеки с помощью `use std::io;` в первой строке программы. Теперь мы вызовем функцию `stdin` из раздела `io`, которая позволит нам обрабатывать пользовательский ввод:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:read}}
 ```
 
-Если бы мы не импортировали библиотеку `io` с помощью `use std::io` в начале программы, мы все равно могли бы использовать эту функцию, записав её вызов как `std::io::stdin`. Функция `stdin` возвращает экземпляр [`std::io::Stdin`], который является типом, представляющим дескриптор стандартного ввода для вашего терминала.
+Если бы мы не подключили библиотеку `io` с помощью `use std::io` в начале программы, мы все равно могли бы использовать эту функцию, записав её вызов как `std::io::stdin`. Функция `stdin` возвращает образец [`std::io::Stdin`], который является видом данных, представляющим указатель принятого ввода для вашего окна вызова.
 
-Далее строка `.read_line(&mut guess)` вызывает метод [`read_line`] на дескрипторе стандартного ввода для получения ввода от пользователя. Мы также передаём `&mut guess` в качестве аргумента `read_line`, сообщая ему, в какой строке хранить пользовательский ввод. Главная задача `read_line` — принять все, что пользователь вводит в стандартный ввод, и сложить это в строку (не переписывая её содержимое), поэтому мы передаём эту строку в качестве аргумента. Строковый аргумент должен быть изменяемым, чтобы метод мог изменить содержимое строки.
+Далее строка `.read_line(&mut guess)` вызывает способ [`read_line`] на указатель принятой переменной для получения ввода от пользователя. Мы также передаём `&mut guess` в качестве переменной `read_line`, сообщая ему, в какой строке хранить пользовательский ввод. Главная задача `read_line` — принять все, что пользователь вводит в обычный ввод, и сложить это в строку (не переписывая её содержимое), поэтому мы передаём эту строку в качестве переменной. Строковая переменная должна быть изменяемая, чтобы при вызове способа можно изменить содержимое строки в переменной `mut guess`.
 
-Символ `&` указывает, что этот аргумент является *ссылкой*, которая предоставляет возможность нескольким частям вашего кода получить доступ к одному фрагменту данных без необходимости копировать эти данные в память несколько раз. Ссылки — это сложная функциональная возможность, а одним из главных преимуществ Rust является безопасность и простота использования ссылок. Чтобы дописать эту программу, вам не понадобится знать много таких подробностей. Пока вам достаточно знать, что ссылки, как и переменные, по умолчанию неизменяемы. Соответственно, чтобы сделать её изменяемой, нужно написать `&mut guess`, а не `&guess`. (В главе 4 ссылки будут описаны более подробно).
+Знак `&` указывает, что эта переменная является *ссылкой*, которая предоставляет возможность нескольким частям вашей рукописи получить доступ к одному отрывку данных без необходимости воспроизводить эти данные в память несколько раз. Ссылки — это сложная и очень полезная возможность, так одним из главных преимуществ Ржавчины является безопасность и простота использования ссылок. Чтобы дописать эту программу, вам не понадобится знать много таких подробностей. Пока вам достаточно знать, что ссылки, как и переменные, по умолчанию неизменяемы. Соответственно, чтобы сделать её изменяемой, нужно написать `&mut guess`, а не `&guess`. (В главе 4 ссылки будут описаны более подробно).
 
 
 
 
 
-### Обработка потенциального сбоя с помощью типа `Result`
+### Обработка возможного сбоя с помощью способа `Result`
 
-Мы всё ещё работаем над этой строкой кода. Сейчас мы обсуждаем третью строку, но обратите внимание, что она по-прежнему является частью одной логической строки. Следующая часть — метод:
+Мы всё ещё работаем над этой строкой рукописи. Сейчас мы обсуждаем третью строку, но обратите внимание, что она по-прежнему является частью одной разумной строки. Следующая часть — способ:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:expect}}
 ```
 
-Мы могли бы написать этот код так:
+Мы могли бы написать эту рукопись так:
 
 ```rust,ignore
 io::stdin().read_line(&mut guess).expect("Failed to read line");
 ```
 
-Однако одну длинную строку трудно читать, поэтому лучше разделить её. При вызове метода с помощью синтаксиса `.method_name()` часто целесообразно вводить новую строку и другие пробельные символы, чтобы разбить длинные строки. Теперь давайте обсудим, что делает эта строка.
+Однако одну длинную строку трудно читать, поэтому лучше разделить её. При вызове способа с помощью правил написания `.method_name()` часто целесообразно вводить новую строку и другие пробельные знаки, чтобы разбить длинные строки. Теперь давайте обсудим, что делает эта строка.
 
-Как упоминалось ранее, `read_line` помещает всё, что вводит пользователь, в строку, которую мы ему передаём, но также возвращает значение `Result`. `Result` — это [*перечисление*], часто называемое *enum*, то есть тип, который может находиться в одном из нескольких возможных состояний. Мы называем каждое такое состояние *вариантом*.
+Как упоминалось ранее, `read_line` помещает всё, что вводит пользователь, в строку, которую мы ему передаём, но также возвращает значение `Result`. `Result` — это [*перечисление*], часто называемое *enum*, то есть вид данных, который может находиться в одном из нескольких возможных состояний. Мы называем каждое такое состояние *исходом*.
 
-В [Главе 6](ch06-00-enums.html) рассмотрим перечисления более подробно. Задачей типов `Result` является кодирование информации для обработки ошибок.
+В [Главе 6](ch06-00-enums.html) рассмотрим перечисления более подробно. Задачей видов `Result` является кодирование сведений для обработки ошибок.
 
-Вариантами `Result` являются `Ok` и `Err`. Вариант `Ok` указывает, что операция завершилась успешно, а внутри `Ok` находится успешно сгенерированное значение. Вариант `Err` означает, что операция не удалась, а `Err` содержит информацию о причинах неудачи.
+Исходами `Result` являются `Ok` и `Err`. Исход `Ok` указывает, что действие завершилось успешно, а внутри `Ok` находится успешно преобразованное значение. Исход `Err` означает, что действие не удалось (завершилось с ошибкой), а `Err` содержит сведения о причинах сбоя.
 
-Значения типа `Result`, как и значения любого типа, имеют определённые для них методы. У экземпляра `Result` есть [метод `expect`], который можно вызвать. Если этот экземпляр `Result` является значением `Err`, `expect` вызовет сбой программы и отобразит сообщение, которое вы передали в качестве аргумента. Если метод `read_line` возвращает `Err`, то это, скорее всего, результат ошибки базовой операционной системы. Если экземпляр `Result` является значением `Ok`, `expect` возьмёт возвращаемое значение, которое удерживает `Ok`, и вернёт вам только это значение, чтобы вы могли его использовать далее. В данном случае это значение представляет собой количество байтов, введённых пользователем.
+Значения вида данных `Result`, как и значения любого вида данных, имеют определённые для них способы. У образца данных `Result` есть [способ `expect`], который можно вызвать. Если этот образец данных `Result` является значением `Err`, `expect` вызовет сбой программы и отобразит сообщение, которое вы передали в качестве значения в описании `expect`. Если способ `read_line` возвращает `Err`, то это, скорее всего, итог ошибки основной операционной системы. Если образец данных `Result` является значением `Ok`, `expect` возьмёт возвращаемое значение, которое удерживает `Ok`, и вернёт вам только это значение, чтобы вы могли его использовать далее. В данном случае это значение представляет собой количество байтов, введённых пользователем.
 
-Если не вызвать `expect`, программа скомпилируется, но будет получено предупреждение:
+Если не вызвать `expect`, программа собирается, но будет получено предупреждение:
 
 ```console
 {{#include ../listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt}}
 ```
 
-Rust предупреждает о неиспользованном значении `Result`, возвращаемого из `read_line`, показывая, что программа не учла возможность возникновения ошибки.
+Ржавчина предупреждает о неиспользованном значении `Result`, возвращаемого из `read_line`, показывая, что программа не учла возможность возникновения ошибки.
 
-Правильный способ убрать предупреждение — это написать обработку ошибок, но в нашем случае мы просто хотим аварийно завершить программу при возникновении проблемы, поэтому используем `expect`. О способах восстановления после ошибок вы узнаете в [главе 9].
+Правильный способ убрать предупреждение — это написать обработку ошибок, но в нашем случае мы просто хотим со сбоем завершить программу при возникновении сбоев (ошибок), поэтому используем `expect`. О способах восстановления после ошибок вы узнаете в [главе 9].
 
-### Вывод значений с помощью заполнителей `println!`
+### Вывод значений с помощью исполнителей `println!`
 
-Кроме закрывающей фигурной скобки, в коде на данный момент есть ещё только одно место для обсуждения:
+Кроме закрывающей узорчатой скобки, в рукописи на данное мгновение есть ещё только одно место для обсуждения:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs:print_guess}}
 ```
 
-Этот код выводит строку, которая теперь содержит ввод пользователя. Набор фигурных скобок `{}` является заполнителем: думайте о `{}` как о маленьких клешнях краба, которые удерживают значение на месте. При печати значения переменной имя переменной может заключаться в фигурные скобки. При печати результата вычисления выражения поместите пустые фигурные скобки в строку формата, затем после строки формата укажите список выражений, разделённых запятыми, которые будут напечатаны в каждом заполнителе пустой фигурной скобки в том же порядке. Печать переменной и результата выражения одним вызовом `println!` будет выглядеть так:
+Эта рукопись выводит строку, которая теперь содержит ввод пользователя. Набор узорчатых скобок `{}` является исполнителем: думайте о `{}` как о маленьких клешнях краба, которые удерживают значение на месте. При выводе значения переменной имя переменной может заключаться в узорчатые скобки. При выводе итога вычисления выражения поместите пустые узорчатые скобки в строку вида, затем после строки вида данных укажите список выражений, разделённых запятыми, которые будут выведены в каждом исполнителе пустой узорчатой скобки в том же порядке. вывод переменной и итога выражения одним вызовом `println!` будет выглядеть так:
 
 ```rust
 let x = 5;
@@ -187,11 +187,11 @@ let y = 10;
 println!("x = {x} and y + 2 = {}", y + 2);
 ```
 
-Этот код выведет `x = 5 and y + 2 = 12`.
+Эта рукопись выведет `x = 5 and y + 2 = 12`.
 
-### Тестирование первой части
+### Проверка первой части
 
-Давайте протестируем первую часть игры. Запустите её используя `cargo run`:
+Давайте проверим первую часть игры. Запустите её используя `cargo run`:
 
  и [его экосистему] которые мы обсудим в главе 14, сейчас это все что вам нужно знать. Cargo позволяет очень легко повторно использовать библиотеки, поэтому Rust разработчики имеют возможность писать меньшие проекты, которые скомпонованы из многих пакетов.
+Можно много рассказать про [Cargo] и [его внутреннее устройство] которые мы обсудим в главе 14, сейчас это все что вам нужно знать. Cargo позволяет очень легко повторно использовать библиотеки, поэтому Ржавчина разработчики имеют возможность писать меньшие дела, которые составлены из многих дополнений.
 
-### Генерация случайного числа
+### Создание случайного числа
 
-Давайте начнём использовать `rand`, чтобы сгенерировать число для угадывания. Следующим шагом будет обновление *src/main.rs*, как показано в листинге 2-3.
+Давайте начнём использовать `rand`, чтобы создать число для угадывания. Следующим шагом будет обновление *src/main.rs*, как показано в приложении 2-3.
 
 Файл: src/main.rs
 
@@ -335,15 +335,15 @@ rand = "0.9.0"
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs:all}}
 ```
 
-Листинг 2-3: Добавление кода который генерирует случайное число
+Приложение 2-3: Добавление рукописи, которая порождает случайное число
 
-Сначала мы добавляем строку `use rand::Rng`. Типаж `Rng` определяет методы, реализующие генераторы случайных чисел, и этот типаж должен быть в области видимости, чтобы эти методы можно было использовать. В главе 10 мы рассмотрим типажи подробно.
+Сначала мы добавляем строку `use rand::Rng`. Сущность `Rng` определяет способы, использующие породителями случайных чисел, и эта сущность должна быть в области видимости, чтобы эти способы можно было использовать. В главе 10 мы рассмотрим сущности подробно.
 
-Затем мы добавляем две строки посередине. В первой строке мы вызываем функцию `rand::thread_rng`, дающую нам генератор случайных чисел, который мы собираемся использовать: тот самый, который является локальным для текущего потока выполнения и запускается операционной системой. Затем мы вызываем его метод `gen_range`. Этот метод определяется `Rng`, который мы включили в область видимости с помощью оператора `use rand::Rng`. Метод `gen_range` принимает в качестве аргумента выражение диапазона и генерирует случайное число в этом диапазоне. Тип используемого выражения диапазона принимает форму `start..=end` и включает нижнюю и верхнюю границы, поэтому, чтобы запросить число от 1 до 100, нам нужно указать `1..=100`.
+Затем мы добавляем две строки посередине. В первой строке мы вызываем функцию `rand::thread_rng`, дающую нам породитель случайных чисел, который мы собираемся использовать: тот самый, который является местным для текущего потока выполнения и запускается операционной системой. Затем мы вызываем его способ `gen_range`. Этот способ определяется дополнением `Rng`, которое мы включили в область видимости с помощью приказчика `use rand::Rng`. Способ `gen_range` принимает в качестве переменной выражение числового ряда и порождает случайное число в этом ряде. Вид данных используемого выражения числового ряда принимает разновидность `start..=end` и включает нижнюю и верхнюю границы, поэтому, чтобы запросить число от 1 до 100, нам нужно указать `1..=100`.
 
-> Примечание: непросто сразу разобраться, какие типажи использовать, какие методы и функции вызывать из пакета, поэтому каждый пакет имеет документацию с инструкциями по его использованию. Ещё одной замечательной особенностью Cargo является выполнение команды `cargo doc --open`, которая локально собирает документацию, предоставляемую всеми вашими зависимостями, и открывает её в браузере. К примеру, если интересна другая функциональность из пакета `rand`, запустите `cargo doc --open` и нажмите `rand` в боковой панели слева.
+> Примечание: непросто сразу разобраться, какие сущности использовать, какие способы и функции вызывать из дополнения, поэтому каждое дополнение имеет пособие с указаниями по его использованию. Ещё одной замечательной особенностью Cargo является использование приказов `cargo doc --open`, которые собирают самостоятельное отдельное пособие (не требующего подключение к мировой сети), предоставляемое всеми вашими дополнениями, и открывает его в обозревателе. К примеру, если вы хотите узнать все возможности из дополнения `rand`, запустите приказ `cargo doc --open` и нажмите на вкладку `rand` в боковой панели слева.
 
-Во второй новой строке мы увидим загаданное число. Во время разработки программы полезно иметь возможность её протестировать, но в финальной версии мы это удалим. Конечно, ведь это совсем не похоже на игру, если программа печатает ответ сразу после запуска!
+Во второй новой строке мы увидим загаданное число. Во время разработки программы полезно иметь возможность её проверять, но в конечном исполнения мы это удалим. Конечно, ведь это совсем не похоже на игру, если программа выводит ответ сразу после запуска!
 
 Попробуйте запустить программу несколько раз:
 
@@ -376,11 +376,11 @@ Please input your guess.
 You guessed: 5
 ```
 
-Вы должны получить разные случайные числа, и все они должны быть числами в диапазоне от 1 до 100. Отличная работа!
+Вы должны получить разные случайные числа, и все они должны быть числами в ряде от 1 до 100. Отличная работа!
 
-## Сравнение догадки с секретным числом
+## Сравнение догадки с тайным числом
 
-Теперь, когда у нас есть пользовательский ввод и случайное число, мы можем сравнить их. Этот шаг показан в листинге 2-4. Учтите, что этот код ещё не скомпилируется, подробнее мы объясним дальше.
+Теперь, когда у нас есть пользовательский ввод и случайное число, мы можем сравнить их. Этот шаг показан в приложении 2-4. Учтите, что эта рукопись ещё не собирается, подробнее мы объясним дальше.
 
 Имя файла: src/main.rs
 
@@ -388,19 +388,19 @@ You guessed: 5
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs:here}}
 ```
 
-Листинг 2-4: Обработка возможных возвращаемых значений при сравнении двух чисел
+Приложение 2-4: Обработка возможных возвращаемых значений при сравнении двух чисел
 
-Сначала добавим ещё один оператор `use`, который вводит тип с именем `std::cmp::Ordering` в область видимости из стандартной библиотеки. Тип `Ordering` является ещё одним перечислением и имеет варианты `Less`, `Greater` и `Equal`. Это три возможных исхода при сравнении двух величин.
+Сначала добавим ещё один приказчик `use`, который подключает дополнение с именем `std::cmp::Ordering` в область видимости из встроенной библиотеки. Способ `Ordering` является ещё одним перечислением и имеет исходы `Less`, `Greater` и `Equal`. Это три возможных исхода при сравнении двух величин.
 
-После чего ниже добавляем пять новых строк, использующих тип `Ordering`. Метод `cmp` сравнивает два значения и может вызываться для всего, что можно сравнить. Он принимает ссылку на все, что требуется сравнить: здесь сравнивается `guess` с `secret_number`. В результате возвращается вариант перечисления `Ordering`, которое мы ввели в область видимости с помощью оператора `use`. Для принятия решения о том, что делать дальше, мы используем выражение [`match`], определяющее, какой вариант Ordering был возвращён из вызова `cmp` со значениями `guess` и `secret_number`.
+После чего ниже добавляем пять новых строк, использующих способ `Ordering`. Способ `cmp` сравнивает два значения и может вызываться для всего, что можно сравнить. Он принимает ссылку на все, что требуется сравнить: здесь сравнивается `guess` с `secret_number`. В итоге возвращается исход перечисления способа `Ordering`, которое мы ввели в область видимости с помощью приказчика `use`. Для принятия решения о том, что делать дальше, мы используем выражение [`match`], определяющее, какой исход способа Ordering был возвращён из вызова способа `cmp` со значениями `guess` и `secret_number`.
 
-Выражение `match` состоит из *веток (arms)*. Ветка состоит из *шаблона* для сопоставления и кода, который будет запущен, если значение, переданное в `match`, соответствует шаблону этой ветки. Rust принимает значение, заданное `match`, и по очереди просматривает шаблон каждой ветки. Шаблоны и конструкция `match` — это мощные возможности Rust, позволяющие выразить множество ситуаций, с которыми может столкнуться ваш код, и гарантировать их обработку. Эти возможности будут подробно раскрыты в главе 6 и главе 18 соответственно.
+Выражение `match` состоит из *веток (arms)*. Ветка состоит из *образца* для сопоставления и указания, которое будет выполнено, если значение, переданное в функцию `match`, соответствует образцу данных (условию) этой ветки. Ржавчина принимает значение, полученное из выражения `guess.cmp(&secret_number)` и переданное в функцию `match`, и по очереди просматривает образец данных (условие) каждой ветки. Образцы (условия) и функция `match` — это мощные возможности Ржавчины, позволяющие выразить множество случаев, с которыми может столкнуться ваша рукопись, и обеспечить их обработку. Эти возможности будут подробно раскрыты в главе 6 и главе 18 соответственно.
 
-Давайте рассмотрим пример с выражением `match`, которое мы здесь используем. Скажем, пользователь угадал 50, а случайно сгенерированное секретное число на этот раз — 38.
+Давайте рассмотрим пример с выражением `match`, которое мы здесь используем. Скажем, пользователь указал число 50, а случайно созданное тайное число на этот раз — 38.
 
-Когда код сравнивает 50 с 38, метод `cmp` вернёт `Ordering::Greater`, поскольку 50 больше, чем 38. Выражение `match` получит значение `Ordering::Greater` и начнёт проверять шаблон в каждой ветке. Он просмотрит шаблон первой ветки, `Ordering::Less`, и увидит, что значение `Ordering::Greater` не соответствует `Ordering::Less`, поэтому проигнорирует код этой ветки и перейдёт к следующей. Шаблон следующей ветки — `Ordering::Greater`, который *соответствует* `Ordering::Greater`! Код этой ветки будет выполнен и напечатает `Too big!` на экран. Выражение `match` заканчивается после первого успешного совпадения, поэтому в этом сценарии оно не будет рассматривать последнюю ветку.
+Когда рукопись сравнивает 50 с 38, способ `cmp` вернёт `Ordering::Greater`, поскольку 50 больше, чем 38. Выражение `match` получит значение `Ordering::Greater` и начнёт проверять образец данных в каждой ветке. Он просмотрит образец данных первой ветки, `Ordering::Less`, и увидит, что значение `Ordering::Greater` не соответствует `Ordering::Less`, поэтому пренебрегает условием (образцом) этой ветки и перейдёт к следующей (следующему условию). Образец данных (условие) следующей ветки — `Ordering::Greater`, который *соответствует* `Ordering::Greater`! Указание этой ветки будет выполнено и выведет `Too big!` на экран. Выражение `match` заканчивается после первого успешного совпадения, поэтому оно не будет далее производить сравнения, в нашем случае с последней веткой.
 
-Однако код в листинге 2-4 всё ещё не скомпилируется. Давайте попробуем:
+Однако рукопись в приложении 2-4 всё ещё не собирается. Давайте попробуем:
 
  преобразует строку в другой тип. Здесь мы используем его для преобразования строки в число. Нам нужно сообщить Rust точный числовой тип, который мы хотим получить, используя `let guess: u32`. Двоеточие ( `:` ) после `guess` говорит Rust, что мы аннотируем тип переменной. В Rust есть несколько встроенных числовых типов; `u32`, показанный здесь, представляет собой 32-битное целое число без знака. Это хороший выбор по умолчанию для небольшого положительного числа. Вы узнаете о других типах чисел в главе 3.
+Способ [`parse` (только для строк)] преобразует строку в другой вид данных. Здесь мы используем его для преобразования строки в число. Нам нужно сообщить Ржавчине точный числовой вид данных, который мы хотим получить, используя `let guess: u32`. Двоеточие ( `:` ) после `guess` говорит Ржавчине, что мы определяем вид данных переменной. В Ржавчине есть несколько встроенных числовых видов данных; `u32`, показанный здесь, представляет собой 32-битное целое число без знака. Это хороший выбор по умолчанию для небольшого положительного числа. Вы узнаете о других числовых видах данных в главе 3.
 
-Кроме того, аннотация u32 в этом примере программы и сравнение с secret_number означает, что Rust сделает вывод, что secret_number должен быть u32. Итак, теперь сравнение будет между двумя значениями одного типа!
+Кроме того, изложение u32 в этом примере программы и сравнение с secret_number означает, что Ржавчина сделает вывод, что secret_number должен быть u32. Итак, теперь сравнение будет между двумя значениями одного вида данных!
 
-Метод `parse` будет работать только с символами, которые логически могут быть преобразованы в числа, и поэтому легко может вызвать ошибки. Если, например, строка содержит `A👍%`, преобразовать её в число невозможно. Так как метод `parse` может потерпеть неудачу, он возвращает тип `Result` — так же как и метод `read_line` (обсуждалось ранее в разделе «Обработка потенциальной ошибки с помощью типа `Result`»). Мы будем точно так же обрабатывать данный Result, вновь используя метод `expect`. Если `parse` вернёт вариант `Result` `Err`, так как не смог создать число из строки, вызов `expect` аварийно завершит игру и отобразит переданное ему сообщение. Если `parse` сможет успешно преобразовать строку в число, он вернёт вариант `Result` `Ok`, а `expect` вернёт число, полученное из значения `Ok`.
+Способ `parse` будет работать только со знаками, которые могут быть преобразованы в числа, и поэтому легко может вызвать ошибки. Если, например, строка содержит знаки `A👍%`, преобразовать её в число невозможно. Так как способ `parse` может потерпеть неудачу, он возвращает вид данных `Result` — так же как и способ `read_line` (обсуждалось ранее в разделе «Обработка возможной ошибки с помощью способа `Result`»). Мы будем точно так же обрабатывать данный Result, вновь используя способ `expect`. Если `parse` вернёт исход `Result` `Err`, так как не смог создать число из строки, вызов `expect` со сбоем завершит игру и отобразит переданное ему сообщение. Если `parse` сможет успешно преобразовать строку в число, он вернёт исход `Result` `Ok`, а `expect` вернёт число, полученное из значения `Ok`.
 
 Давайте запустим программу теперь:
 
@@ -458,13 +458,13 @@ You guessed: 76
 Too big!
 ```
 
-Хорошо! Несмотря на то, что были добавлены пробелы в строке ввода, программа всё равно поняла, что пользователь имел в виду число 76. Запустите программу несколько раз, чтобы проверить разное поведение при различных типах ввода: задайте число правильно, задайте слишком большое число и задайте слишком маленькое число.
+Хорошо! Несмотря на то, что были добавлены пробелы в строке ввода, программа всё равно поняла, что пользователь имел в виду число 76. Запустите программу несколько раз, чтобы проверить разное поведение при различных случаях ввода: задайте число правильно, задайте слишком большое число и задайте слишком маленькое число.
 
-Сейчас у нас работает большая часть игры, но пользователь может сделать только одну догадку. Давайте изменим это, добавив цикл!
+Сейчас у нас работает большая часть игры, но пользователь может сделать только одну догадку. Давайте изменим это, добавив круговорот!
 
-## Возможность нескольких догадок с помощью циклов
+## Возможность нескольких догадок с помощью круговоротов
 
-Ключевое слово `loop` создаёт бесконечный цикл. Мы добавляем цикл, чтобы дать пользователям больше шансов угадать число:
+Ключевое слово `loop` создаёт бесконечный круговорот. Мы добавляем круговорот, чтобы дать пользователям больше возможностей угадать число:
 
 Имя файла: src/main.rs
 
@@ -472,9 +472,9 @@ Too big!
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs:here}}
 ```
 
-Как видите, мы переместили всё, начиная с подсказки ввода догадки, в цикл. Не забудьте добавить ещё по четыре пробела на отступы строк внутри цикла и запустите программу снова. Теперь программа будет бесконечно запрашивать ещё одну догадку, что фактически создаёт новую проблему. Похоже, пользователь не сможет выйти из игры!
+Как видите, мы переместили всё, начиная с подсказки ввода догадки, в круговорот. Не забудьте добавить ещё по четыре пробела на отступы строк внутри круговорота и запустите программу снова. Теперь программа будет бесконечно запрашивать ещё одну догадку, что в действительности создаёт новую неполадку. Похоже, пользователь не сможет выйти из игры!
 
-Пользователь может прервать выполнение программы с помощью сочетания клавиш ctrl+c. Но есть и другой способ спастись от этого ненасытного монстра, о котором говорилось при обсуждении `parse` в [«Сравнение догадки с секретным числом»](#comparing-the-guess-to-the-secret-number): если пользователь введёт нечисловой ответ, программа завершится аварийно. Мы можем воспользоваться этим, чтобы позволить пользователю выйти из игры, как показано здесь:
+Пользователь может прервать выполнение программы с помощью сочетания клавиш ctrl+c. Но есть и другой способ спастись от этого ненасытного монстра, о котором говорилось при обсуждении `parse` в [«Сравнение догадки с тайным числом»](#comparing-the-guess-to-the-secret-number): если пользователь введёт нечисловой ответ, программа завершится со сбоем. Мы можем воспользоваться этим, чтобы позволить пользователю выйти из игры, как показано здесь:
 
  src/main.rs:4:5   | 2 |     let x = 5;   |         - first assignment to `x` 3 |     println!("The value of x is: {}", x); 4 |     x = 6;   |     ^^^^^ cannot assign twice to immutable variable
 ```
 
-В этом примере показано, как компилятор помогает находить ошибки в ваших программах. Ошибки компилятора могут расстраивать, но в действительности они означают, что программа пока не делает правильно то, что вы ожидаете; это *не значит*, что вы плохой программист! Даже опытные Rustaceans иногда сталкиваются с ошибками компилятора.
+В этом примере показано, как сборщик помогает находить ошибки в ваших программах. Ошибки сборщика могут расстраивать, но в действительности они означают, что программа пока не делает правильно то, что вы ожидаете; это *не значит*, что вы плохой программист! Даже опытные Rustaceans иногда сталкиваются с ошибками сборщика.
 
 Вы получили сообщение об ошибке `cannot assign twice to immutable variable `x``, потому что попытались присвоить новое значение неизменяемой переменной `x`.
 
-Важно, чтобы при попытке изменить значение, объявленное неизменяемым, выдавались ошибки времени компиляции, так как подобная ситуация может привести к сбоям. Если одна часть нашего кода функционирует исходя из уверенности в неизменяемости значения, а другая часть изменяет это значение, то велика вероятность , что первая часть не выполнит своего предназначения. Причину такой ошибки бывает трудно отследить, особенно если вторая часть кода изменяет значение лишь *изредка*. Компилятор Rust предоставляет гарантию, что если объявить значение неизменяемым, то оно действительно не изменится, а значит, не нужно следить за этим самим. Таким образом, ваш код становится проще для понимания.
+Важно, чтобы при попытке изменить значение, объявленное неизменяемым, выдавались ошибки времени сборки, так как подобный случай может привести к сбоям. Если одна часть нашей рукописи исполняется исходя из уверенности в неизменяемости значения, а другая часть изменяет это значение, то велика вероятность , что первая часть не выполнит своего предназначения. Причину такой ошибки бывает трудно отследить, особенно если вторая часть рукописи изменяет значение лишь *изредка*. Сборщик Ржавчины предоставляет заверение, что если объявить значение неизменяемым, то оно действительно не изменится, а значит, не нужно следить за этим самим. Таким образом, ваша рукопись становится проще для понимания.
 
-Однако изменяемость может быть очень полезной и может сделать код более удобным для написания. Хотя переменные по умолчанию неизменяемы, их можно сделать изменяемыми, добавив `mut` перед именем переменной, как это было сделано в [Главе 2]. Добавление `mut` также передаёт будущим читателям кода намерение, обозначая, что другие части кода будут изменять значение этой переменной.
+Однако изменяемость может быть очень полезной и может сделать рукопись более удобной для написания. Хотя переменные по умолчанию неизменяемы, их можно сделать изменяемыми, добавив `mut` перед именем переменной, как это было сделано в [Главе 2]. Добавление `mut` также передаёт будущим читателям рукописи намерение, обозначая, что другие части рукописи будут изменять значение этой переменной.
 
-Например, изменим *src/main.rs* на следующий код:
+Например, изменим *src/main.rs* на следующую рукопись:
 
 Имя файла: src/main.rs
 
@@ -39,39 +38,39 @@ error[E0384]: cannot assign twice to immutable variable `x`  --> src/main.rs:4:5
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs}}
 ```
 
-Запустив программу, мы получим результат:
+Запустив программу, мы получим итог:
 
 ```console
 {{#include ../listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt}}
 ```
 
-Нам разрешено изменить значение, связанное с x, с 5 на 6 при помощи mut. В конечном счёте, решение об использовании изменяемости остаётся за вами и зависит от вашего мнения о наилучшем варианте в данной конкретной ситуации.
+Нам разрешено изменить значение, связанное с x, с 5 на 6 при помощи mut. В конечном счёте, решение об использовании изменяемости остаётся за вами и зависит от вашего мнения о наилучшем исходе в данном именно случае.
 
-### Константы
+### Постоянные переменные
 
-Подобно неизменяемым переменным, *константы* — это значения, которые связаны с именем и не могут изменяться, но между константами и переменными есть несколько различий.
+Подобно неизменяемым переменным, *постоянные переменные* — это значения, которые связаны с именем и не могут изменяться, но между постоянными переменными и переменными есть несколько различий.
 
-Во-первых, нельзя использовать `mut` с константами. Константы не просто неизменяемы по умолчанию — они неизменяемы всегда. Для объявления констант используется ключевое слово `const` вместо `let`, а также тип значения *должен быть* указан в аннотации. Мы рассмотрим типы и аннотации типов в следующем разделе [«Типы данных».], так что не беспокойтесь о деталях прямо сейчас. Просто знайте, что вы всегда должны аннотировать тип.
+Во-первых, нельзя использовать `mut` с постоянными переменными. Постоянные переменные не просто неизменяемы по умолчанию — они неизменяемы всегда. Для объявления постоянных переменных используется ключевое слово `const` вместо `let`, а также вид данных значения *должен быть* указан в изложении. Мы рассмотрим виды данных и изложение в следующем разделе [«Виды данных».], так что не беспокойтесь о подробностях прямо сейчас. Просто знайте, что вы всегда должны определять вид данных.
 
-Константы можно объявлять в любой области видимости, включая глобальную, благодаря этому они полезны для значений, которые нужны во многих частях кода.
+Постоянные переменные можно объявлять в любой области видимости, включая вездесущую, благодаря этому они полезны для значений, которые нужны во многих частях рукописи.
 
-Последнее отличие в том, что константы могут быть заданы только константным выражением, но не результатом вычисленного во время выполнения значения.
+Последнее отличие в том, что постоянные переменные могут быть заданы только постоянным выражением, но не итогом вычисленного во время выполнения значения.
 
-Вот пример объявления константы:
+Вот пример объявления постоянные переменные:
 
 ```rust
 const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3;
 ```
 
-Имя константы - `THREE_HOURS_IN_SECONDS`, а её значение устанавливается как результат умножения 60 (количество секунд в минуте) на 60 (количество минут в часе) на 3 (количество часов, которые нужно посчитать в этой программе). Соглашение Rust для именования констант требует использования всех заглавных букв с подчёркиванием между словами. Компилятор может вычислять ограниченный набор операций во время компиляции, позволяющий записать это значение более понятным и простым для проверки способом, чем установка этой константы в значение 10 800. Дополнительную информацию о том, какие операции можно использовать при объявлении констант, см. в разделе [Раздел справки Rust по вычислениям констант].
+Имя постоянных переменных - `THREE_HOURS_IN_SECONDS`, а её значение устанавливается как итог умножения 60 (количество секунд в минуте) на 60 (количество минут в часе) на 3 (количество часов, которые нужно посчитать в этой программе). Установленный порядок в Ржавчине для именования постоянных переменных требует использования всех заглавных букв с подчёркиванием между словами. Сборщик может вычислять ограниченный набор действий во время сборки, позволяющий записать это значение более понятным и простым для проверки способом, чем установка этой постоянной переменной значение в 10 800. Дополнительные сведения о том, какие действия можно использовать при объявлении постоянных переменных, см. в разделе [Раздел справки Ржавчина по вычислениям постоянных переменных].
 
-Константы существуют в течение всего времени работы программы в пределах области, в которой они были объявлены. Это свойство делает константы полезными для значений в домене вашего приложения, о которых могут знать несколько частей программы, например, максимальное количество очков, которое может заработать любой игрок в игре, или скорость света.
+Постоянные переменные существуют в течение всего времени работы программы в пределах области, в которой они были объявлены. Это свойство делает постоянные переменные полезными для значений в области владения вашего приложения, о которых могут знать несколько частей программы, например, наибольшее количество очков, которое может заработать любой игрок в игре, или скорость света.
 
-Обозначение жёстко закодированных значений, используемых в программе, как константы полезно для передачи смысла этого значения будущим сопровождающим кода. Это также позволяет иметь единственное место в коде, которое нужно будет изменить, если в будущем потребуется обновить значение.
+Обозначение строго определенных значений, используемых в программе, именуемых как постоянные переменные -  полезно для передачи смысла этого значения будущим сопровождающим рукописи. Это также позволяет иметь единственное место в рукописи, которое нужно будет изменить, если в будущем потребуется обновить значение.
 
 ### Затенение (переменных)
 
-Как было показано в уроке по игре в Угадайка в [главе 2](ch02-00-guessing-game-tutorial.html#comparing-the-guess-to-the-secret-number), можно объявить новую переменную с тем же именем, как и у существующей переменной. Rustaceans говорят, что первая переменная *затеняется* второй, то есть вторая переменная - это то, что увидит компилятор, когда вы будете использовать имя переменной. По сути, вторая переменная затеняет первую, принимая любое использование имени переменной на себя до тех пор, пока либо она сама не станет тенью, либо не закончится область видимости. Мы можем затенять переменную, используя то же имя переменной и повторяя использование ключевого слова `let` следующим образом:
+Как было показано в уроке по игре в Угадайка в [главе 2](ch02-00-guessing-game-tutorial.html#comparing-the-guess-to-the-secret-number), можно объявить новую переменную с тем же именем, как и у существующей переменной. Rustaceans говорят, что первая переменная *затеняется* второй, то есть вторая переменная - это то, что увидит сборщик, когда вы будете использовать имя переменной. По сути, вторая переменная затеняет первую, принимая любое использование имени переменной на себя до тех пор, пока либо она сама не станет тенью, либо не закончится область видимости. Мы можем затенять переменную, используя то же имя переменной и повторяя использование ключевого слова `let` следующим образом:
 
 Имя файла: src/main.rs
 
@@ -79,35 +78,35 @@ const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3;
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs}}
 ```
 
-Эта программа сначала привязывает `x` к значению `5`. Затем она создаёт новую переменную `x`, повторяя `let x =`, беря исходное значение и добавляя `1`, чтобы значение `x` стало равным `6`. Затем во внутренней области видимости, созданной с помощью фигурных скобок, третий оператор `let` также затеняет `x` и создаёт новую переменную, умножая предыдущее значение на `2`, чтобы дать `x` значение `12`. Когда эта область заканчивается, внутреннее затенение заканчивается, и `x` возвращается к значению `6`. Запустив эту программу, она выведет следующее:
+Эта программа сначала привязывает `x` к значению `5`. Затем она создаёт новую переменную `x`, повторяя `let x =`, беря исходное значение и добавляя `1`, чтобы значение `x` стало равным `6`. Затем во внутренней области видимости, созданной с помощью узорчатых скобок, третий приказчик `let` также затеняет `x` и создаёт новую переменную, умножая предыдущее значение на `2`, чтобы дать `x` значение `12`. Когда эта область заканчивается, внутреннее затенение заканчивается, и `x` возвращается к значению `6`. Запустив эту программу, она выведет следующее:
 
 ```console
 {{#include ../listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt}}
 ```
 
-Затенение отличается от объявления переменной с помощью `mut`, так как мы получим ошибку компиляции, если случайно попробуем переназначить значение без использования ключевого слова `let`. Используя `let`, можно выполнить несколько превращений над значением, при этом оставляя переменную неизменяемой, после того как все эти превращения завершены.
+Затенение отличается от объявления переменной с помощью `mut`, так как мы получим ошибку сборки, если случайно попробуем переназначить значение без использования ключевого слова `let`. Используя `let`, можно выполнить несколько превращений над значением, при этом оставляя переменную неизменяемой, после того как все эти превращения завершены.
 
-Другой разницей между `mut` и затенением является то, что мы создаём совершенно новую переменную, когда снова используем слово `let` (ещё одну). Мы можем даже изменить тип значения, но снова использовать прежнее имя. К примеру, наша программа спрашивает пользователя, сколько пробелов он хочет разместить между некоторым текстом, запрашивая символы пробела, но мы на самом деле хотим сохранить данный ввод как число:
+Другой разницей между `mut` и затенением является то, что мы создаём совершенно новую переменную, когда снова используем слово `let` (ещё одну). Мы можем даже изменить вид данных значения, но снова использовать прежнее имя. К примеру, наша программа спрашивает пользователя, сколько пробелов он хочет разместить между некоторым писанием, запрашивая знаки пробела, но мы на самом деле хотим сохранить данный ввод как число:
 
 ```rust
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs:here}}
 ```
 
-Первая переменная `spaces` — является строковым типом, а вторая переменная `spaces` — числовым типом. Таким образом, затенение избавляет нас от необходимости придумывать разные имена, такие как `spaces_str` и `spaces_num`. Вместо этого мы можем повторно использовать более простое имя `spaces`. Однако, если мы попытаемся использовать для этого `mut`, как показано далее, то получим ошибку времени компиляции:
+Первая переменная `spaces` — является строковым видом данных, а вторая переменная `spaces` — числовым видом данных. Таким образом, затенение избавляет нас от необходимости придумывать разные имена, такие как `spaces_str` и `spaces_num`. Вместо этого мы можем повторно использовать более простое имя `spaces`. Однако, если мы попытаемся использовать для этого `mut`, как показано далее, то получим ошибку времени сборки:
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs:here}}
 ```
 
-Ошибка говорит, что не разрешается менять тип переменной:
+Ошибка говорит, что не разрешается менять вид данных переменной:
 
 ```console
 {{#include ../listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt}}
 ```
 
-Теперь, когда мы изучили, как работают переменные, давайте рассмотрим различные типы данных, которые они могут иметь.
+Теперь, когда мы изучили, как работают переменные, давайте рассмотрим различные виды данных, которые они могут иметь.
 
 
-[«Типы данных».]: ch03-02-data-types.html#data-types
+[«Виды данных».]: ch03-02-data-types.html#data-types
 [Главе 2]: ch02-00-guessing-game-tutorial.html#storing-values-with-variables
-[Раздел справки Rust по вычислениям констант]: ../reference/const_eval.html
\ No newline at end of file
+[Раздел справки Ржавчина по вычислениям постоянных переменных]: ../reference/const_eval.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch03-02-data-types.md b/rustbook-ru/src/ch03-02-data-types.md
index 7416c4808..d64ae7dcb 100644
--- a/rustbook-ru/src/ch03-02-data-types.md
+++ b/rustbook-ru/src/ch03-02-data-types.md
@@ -1,30 +1,30 @@
-## Типы Данных
+## Виды Данных
 
-Каждое значение в Rust относится к определённому *типу данных*, который указывает на вид данных, что позволяет Rust знать, как работать с этими данными. Мы рассмотрим два подмножества типов данных: скалярные и составные.
+Каждое значение в Ржавчине относится к определённому *виду данных*, который указывает на вид данных данных, что позволяет Ржавчине знать, как работать с этими данными. Мы рассмотрим два подмножества видов данных: одиночные и составные.
 
-Не забывайте, что Rust является *статически типизированным* (statically typed) языком. Это означает, что он должен знать типы всех переменных во время компиляции. Обычно компилятор может предположить, какой тип используется (вывести его), основываясь на значении и на том, как мы с ним работаем. В случаях, когда может быть выведено несколько типов, необходимо добавлять аннотацию типа вручную. Например, когда мы конвертировали `String` в число с помощью вызова `parse` в разделе [«Сравнение предположения с загаданным номером»](ch02-00-guessing-game-tutorial.html#comparing-the-guess-to-the-secret-number) главы 2, мы должны добавить такую аннотацию:
+Не забывайте, что Ржавчина является *постоянным строго определенным* (statically typed) языком. Это означает, что он должен знать виды данных всех переменных во время сборки. Обычно сборщик может предположить, какой вид данных используется (вывести его), основываясь на значении и на том, как мы с ним работаем. В случаях, когда может быть выведено несколько видов данных, необходимо добавлять изложение вида данных вручную. Например, когда мы преобразовали `String` в число с помощью вызова `parse` в разделе [«Сравнение предположения с загаданным номером»](ch02-00-guessing-game-tutorial.html#comparing-the-guess-to-the-secret-number) Главы 2, мы должны добавить такое изложение:
 
 ```rust
 let guess: u32 = "42".parse().expect("Not a number!");
 ```
 
-Если мы не добавим аннотацию типа `: u32`, показанную в предыдущем коде, Rust отобразит следующую ошибку, которая означает, что компилятору нужно от нас больше информации, чтобы узнать, какой тип мы хотим использовать:
+Если мы не добавим изложение вида данных `: u32`, показанную в предыдущем рукописи, Ржавчина отобразит следующую ошибку, которая означает, что сборщику нужно от нас больше сведений, чтобы узнать, какой вид данных мы хотим использовать:
 
 ```console
 {{#include ../listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt}}
 ```
 
-В будущем вы увидите различные аннотации для разных типов данных.
+В будущем вы увидите различные изложении для разных видов данных.
 
-### Скалярные типы данных
+### Одиночные виды данных
 
-*Скалярный* тип представляет собой единичное значение. В Rust есть четыре основных скалярных типа: целочисленный, числа с плавающей точкой, логический и символы. Вы наверняка знакомы с этими типами по другим языкам программирования. Давайте разберёмся, как они работают в Rust.
+*Одиночный* вид данных представляет собой единичное значение. В Ржавчине есть четыре основных одиночных вида данных: целочисленный, числа с плавающей точкой, разумный и знаки. Вы наверняка знакомы с этими видами данных по другим языкам программирования. Давайте разберёмся, как они работают в Ржавчине.
 
-#### Целочисленные типы
+#### Целочисленные виды данных
 
-Целочисленный тип (*integer*) — это число без дробной части. В главе 2 мы использовали один целочисленный тип — тип `u32`. Такое объявление типа указывает, что значение, с которым оно связано, должно быть целым числом без знака (типы целых чисел со знаком начинаются с `i` вместо `u`), которое занимает 32 бита памяти. В Таблице 3-1 показаны встроенные целочисленные типы в Rust. Мы можем использовать любой из этих вариантов для объявления типа целочисленного значения.
+Целочисленный вид данных (*integer*) — это число без дробной части. В главе 2 мы использовали один целочисленный вид данных — вид данных `u32`. Такое объявление вида данных указывает, что значение, с которым оно связано, должно быть целым числом без знака (виды данных целых чисел со знаком начинаются с `i` вместо `u`), которое занимает 32 бита памяти. В Таблице 3-1 показаны встроенные целочисленные виды данных в Ржавчине. Мы можем использовать любой из этих исходов для объявления вида данных целочисленного значения.
 
-Таблица 3-1: целочисленные типы в Rust
+Таблица 3-1: целочисленные виды данных в Ржавчине
 
 Длина | Со знаком | Без знака
 --- | --- | ---
@@ -35,17 +35,17 @@ let guess: u32 = "42".parse().expect("Not a number!");
 128 бит | `i128` | `u128`
 архитектурно-зависимая | `isize` | `usize`
 
-Каждый вариант может быть как со знаком, так и без знака и имеет явный размер. Такая характеристика типа как *знаковый* и *беззнаковый* определяет возможность числа быть отрицательным. Другими словами, должно ли число иметь знак (знаковое) или оно всегда будет только положительным и, следовательно, может быть представлено без знака (беззнаковое). Это похоже на написание чисел на бумаге: когда знак имеет значение, число отображается со знаком плюс или со знаком минус; однако, когда можно с уверенностью предположить, что число положительное, оно отображается без знака. Числа со знаком хранятся с использованием [дополнительного кода].
+Каждый исход может быть как со знаком, так и без знака и имеет заранее определенный размер. Такое свойство вида данных как *знаковый* и *беззнаковый* определяет возможность числа быть отрицательным. Другими словами, должно ли число иметь знак (знаковое) или оно всегда будет только положительным и, следовательно, может быть представлено без знака (беззнаковое). Это похоже на написание чисел на бумаге: когда знак имеет значение, число отображается со знаком + или со знаком - , однако, когда можно с уверенностью предположить, что число положительное, оно отображается без знака. Числа со знаком хранятся с использованием [дополнительного рукописи].
 
-Каждый вариант со знаком может хранить числа от -(2 n - 1 ) до 2 n - 1 - 1 включительно, где *n* — количество битов, которые использует этот вариант. Таким образом, `i8` может хранить числа от -(2 7 ) до 2 7 - 1, что равно значениям от -128 до 127. Варианты без знака могут хранить числа от 0 до 2 n - 1, поэтому `u8` может хранить числа от 0 до 2 8 - 1, что равно значениям от 0 до 255.
+Каждый исход со знаком может хранить числа от -(2 n - 1 ) до 2 n - 1 - 1 включительно, где *n* — количество битов, которые использует этот исход. Таким образом, `i8` может хранить числа от -(2 7 ) до 2 7 - 1, что равно значениям от -128 до 127. Исходы без знака могут хранить числа от 0 до 2 n - 1, поэтому `u8` может хранить числа от 0 до 2 8 - 1, что равно значениям от 0 до 255.
 
-Кроме того, типы `isize` и `usize` зависят от архитектуры компьютера, на котором выполняется программа, и обозначаются в таблице как "arch": 64 бита, если используется 64-битная архитектура, и 32 бита, если используется 32-битная архитектура.
+Кроме того, виды данных `isize` и `usize` зависят от архитектуры компьютера, на котором выполняется программа, и обозначаются в таблице как "arch": 64 бита, если используется 64-битная архитектура, и 32 бита, если используется 32-битная архитектура.
 
-Вы можете записывать целочисленные литералы в любой из форм, показанных в таблице 3-2. Заметьте, что числовые литералы, имеющие несколько числовых типов, допускают использование суффикса типа, например `57u8`, для обозначения типа. Числовые литералы также могут использовать `_` в качестве визуального разделителя для облегчения чтения числа, например `1_000`, который будет иметь такое же значение, как если бы было задано `1000`.
+Вы можете записывать целочисленные записи в любой из разновидностей, показанных в таблице 3-2. Заметьте, что числовые записи, имеющие несколько числовых видов данных, допускают использование вставки вида данных, например `57u8`, для обозначения вида данных. Числовые записи также могут использовать `_` в качестве внешнего разделителя для облегчения чтения числа, например `1_000`, который будет иметь такое же значение, как если бы было задано `1000`.
 
-Таблица 3-2: Целочисленные литералы в Rust
+Таблица 3-2: Целочисленные записи в Ржавчине
 
-Числовой литерал | Пример
+Числовая запись | Пример
 --- | ---
 Десятичный | `98_222`
 Шестнадцатеричный | `0xff`
@@ -53,20 +53,20 @@ let guess: u32 = "42".parse().expect("Not a number!");
 Двоичный | `0b1111_0000`
 Байт (только `u8`) | `b'A'`
 
-Как же узнать, какой тип целого числа использовать? Если вы не уверены, значения по умолчанию в Rust, как правило, подходят для начала: целочисленные типы по умолчанию `i32`. Основной случай, в котором вы должны использовать `isize` или `usize`, — это индексация какой-либо коллекции.
+Как же узнать, какой вид данных целого числа использовать? Если вы не уверены, значения по умолчанию в Ржавчине, как правило, подходят для начала: целочисленные виды данных по умолчанию `i32`. Основной случай, в котором вы должны использовать `isize` или `usize`, — это упорядочивание какого-либо собрания.
 
->  Целочисленное переполнение Допустим, имеется переменная типа `u8`, которая может хранить значения от 0 до 255. Если попытаться изменить переменную на значение вне этого диапазона, например, 256, произойдёт *целочисленное переполнение*, что может привести к одному из двух вариантов поведения. Если выполняется компиляция в режиме отладки, Rust включает проверку на целочисленное переполнение, приводящую вашу программу к *панике* во время выполнения, когда возникает такое поведение. Rust использует термин *паника(panicking)*, когда программа завершается с ошибкой. Мы обсудим панику более подробно в разделе ["Неустранимые ошибки с `panic!`"] в главе 9. . При компиляции в режиме release с флагом `--release`, Rust *не* включает проверки на целочисленное переполнение, которое вызывает панику. Вместо этого, в случае переполнения, Rust выполняет *обёртывание второго дополнения*. Проще говоря, значения, превышающие максимальное значение, которое может хранить тип, "оборачиваются" к минимальному из значений, которые может хранить тип. В случае `u8` значение 256 становится 0, значение 257 становится 1, и так далее. Программа не запаникует, но переменная будет иметь значение, которое, вероятно, не будет соответствовать вашим ожиданиям. Полагаться на поведение обёртывания целочисленного переполнения считается ошибкой. Для явной обработки возможности переполнения существует семейство методов, предоставляемых стандартной библиотекой для примитивных числовых типов:
->  - Обёртывание во всех режимах с помощью методов `wrapping_*`, таких как `wrapping_add`.
-> - Возврат значения `None` при переполнении с помощью методов `checked_*`.
-> - Возврат значения и логический индикатор, указывающий, произошло ли переполнение при использовании методов `overflowing_*`.
-> - Насыщение минимальным или максимальным значением с помощью методов `saturating_*`.
+>  Целочисленное переполнение Допустим, имеется переменная вида данных `u8`, которая может хранить значения от 0 до 255. Если попытаться изменить переменную на значение вне этого ряда, например, 256, произойдёт *целочисленное переполнение*, что может привести к одному из двух исходов поведения. Если выполняется сборка в режиме отладки, Ржавчина включает проверку на целочисленное переполнение, приводящую вашу программу к *сбое* во время выполнения, когда возникает такое поведение. Ржавчина использует понятие *сбой (panicking)*, когда программа завершается с ошибкой. Мы обсудим сбой более подробно в разделе ["Неустранимые ошибки с `panic!`"] в главе 9 . При сборке в режиме release с клеймом `--release`, Ржавчина *не* включает проверки на целочисленное переполнение, которое вызывает сбой. Вместо этого, в случае переполнения, Ржавчина использует *обёртывание второго дополнения*. Проще говоря, значения, превышающие наибольшее значение, которое может хранить вид данных, "оборачиваются" к наименьшему из значений, которые может хранить вид данных. В случае `u8` значение 256 становится 0, значение 257 становится 1, и так далее. Программа не вызовет сбой, но переменная будет иметь значение, которое, вероятно, не будет соответствовать вашим ожиданиям. Полагаться на поведение обёртывания целочисленного переполнения считается ошибкой. Для явной обработки возможности переполнения существует семейство способов, предоставляемых встроенной библиотекой для простых числовых видов данных:
+>  - Обёртывание во всех режимах с помощью способов `wrapping_*`, таких как `wrapping_add`.
+> - Возврат значения `None` при переполнении с помощью способов `checked_*`.
+> - Возврат значения и разумный показатель, указывающий, произошло ли переполнение при использовании способов `overflowing_*`.
+> - Насыщение наименьшим или наибольшим значением с помощью способов `saturating_*`.
 >
 
 #### Числа с плавающей запятой
 
-Также в Rust есть два примитивных типа для чисел с плавающей запятой, представляющих собой числа с десятичной точкой. Типы с плавающей точкой в Rust - это f32 и f64, размер которых составляет 32 бита и 64 бита соответственно. По умолчанию используется тип f64, поскольку на современных процессорах он работает примерно с той же скоростью, как и f32, но обладает большей точностью. Все типы с плавающей запятой являются знаковыми.
+Также в Ржавчине есть два простых вида данных для чисел с плавающей запятой, представляющих собой числа с десятичной точкой. Виды данных с плавающей точкой в Ржавчине - это f32 и f64, размер которых составляет 32 бита и 64 бита соответственно. По умолчанию используется вид данных f64, поскольку на современных процессорах он работает примерно с той же скоростью, как и f32, но обладает большей точностью. Все виды данных с плавающей запятой являются знаковыми.
 
-Вот пример, демонстрирующий числа с плавающей запятой в действии:
+Вот пример, отображающий числа с плавающей запятой в действии:
 
 Файл: src/main.rs
 
@@ -74,11 +74,11 @@ let guess: u32 = "42".parse().expect("Not a number!");
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs}}
 ```
 
-Числа с плавающей запятой представлены в соответствии со стандартом IEEE-754. Тип `f32` является плавающей запятой одинарной точности, а `f64` - двойной точности.
+Числа с плавающей запятой представлены в соответствии со исполнением IEEE-754. Вид данных `f32` является плавающей запятой одинарной точности, а `f64` - двойной точности.
 
-#### Числовые операции
+#### Числовые действия
 
-Rust поддерживает основные математические операции, привычные для всех типов чисел: сложение, вычитание, умножение, деление и остаток. Целочисленное деление обрезает значение в направлении нуля до ближайшего целого числа. Следующий код показывает, как можно использовать каждую числовую операцию в инструкции `let`:
+Ржавчина поддерживает основные математические действия, привычные для всех числовых видов данных: сложение, вычитание, умножение, деление и остаток. Целочисленное деление обрезает значение в направлении нуля до ближайшего целого числа. Следующая рукопись показывает, как можно использовать каждое числовое действие в указании `let`:
 
 Файл: src/main.rs
 
@@ -86,11 +86,11 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs}}
 ```
 
-Каждое выражение в этих инструкциях использует математический оператор и вычисляется в одно значение, которое связывается с переменной. [Приложении B](appendix-02-operators.html) содержит список всех операторов, которые предоставляет Rust.
+Каждое выражение в этих указаниях использует математический приказчик и вычисляется в одно значение, которое связывается с переменной. [Приложение B ](appendix-02-operators.html) содержит список всех приказчиков, которые предоставляет Ржавчина.
 
-#### Логический тип данных
+#### Разумный вид данных
 
-Как и в большинстве других языков программирования, логический тип в Rust имеет два возможных значения: `true` и `false`. Значения логических типов имеют размер в один байт. Логический тип в Rust задаётся с помощью `bool`. Например:
+Как и в большинстве других языков программирования, разумный вид данных в Ржавчине имеет два возможных значения: `true` и `false`. Значения разумных видов данных имеют размер в один байт. Разумный вид данных в Ржавчине задаётся с помощью `bool`. Например:
 
 Файл: src/main.rs
 
@@ -98,11 +98,11 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs}}
 ```
 
-Основной способ использования логических значений - это использование условий, таких как выражение `if`. Мы рассмотрим, как выражения `if` работают в Rust в разделе ["Поток управления"].
+Основной способ использования разумных значений - это использование условий, таких как выражение `if`. Мы рассмотрим, как выражения `if` работают в Ржавчине в разделе ["Поток управления"].
 
-#### Символьный тип данных
+#### Знаковый вид данных
 
-Тип `char` в Rust является самым примитивным алфавитным типом языка. Вот несколько примеров объявления значений `char`:
+Вид данных `char` в Ржавчине является самым простым алфавитным видом языка. Вот несколько примеров объявления значений `char`:
 
 Файл: src/main.rs
 
@@ -110,17 +110,17 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs}}
 ```
 
-Заметьте, мы указываем литералы `char` с одинарными кавычками, в отличие от строковых литералов, для которых используются двойные кавычки. Тип `char` в Rust имеет размер четыре байта и представляет собой скалярное значение Unicode, а значит, может представлять собой не только ASCII. Акцентированные буквы, китайские, японские и корейские символы, эмодзи и пробелы нулевой ширины - все это допустимые значения типа `char` в Rust. Скалярные значения Unicode находятся в диапазоне от `U+0000` до `U+D7FF` и от `U+E000` до `U+10FFFF` включительно. Однако "символ" не является понятием в Unicode, поэтому ваше человеческое представление о том, что такое "символ", может не совпадать с тем, что такое `char` в Rust. Мы подробно обсудим эту тему в главе 8 "Хранение текста в кодировке UTF-8 с помощью строк".
+Заметьте, мы указываем записи `char` с одинарными кавычками, в отличие от строковых записей, для которых используются двойные кавычки. Вид данных `char` в Ржавчине имеет размер четыре байта и представляет собой одиночное значение Unicode, а значит, может представлять собой не только ASCII. Акцентированные буквы, китайские, японские и корейские знаки, эмодзи и пробелы нулевой ширины - все это допустимые значения вида данных `char` в Ржавчине. Одиночные значения Unicode находятся в ряде от `U+0000` до `U+D7FF` и от `U+E000` до `U+10FFFF` включительно. Однако "знак" не является понятием в Unicode, поэтому ваше человеческое представление о том, что такое "знак", может не совпадать с тем, что такое `char` в Ржавчине. Мы подробно обсудим эту тему в главе 8 "Хранение писания в представлении UTF-8 с помощью строк".
 
-### Составные типы данных
+### Составные виды данных
 
-*Составные типы* могут группировать различные значения в один тип. В Rust есть два примитивных составных типа: кортежи и массивы.
+*Составные виды данных* могут объединять различные значения в один вид данных. В Ржавчине есть два простых составных вида данных: упорядоченные ряды и массивы.
 
-#### Кортежи
+#### Упорядоченные ряды
 
-*Кортеж*- это универсальный способ объединения нескольких значений с различными типами в один составной тип. Кортежи имеют фиксированную длину: после объявления они не могут увеличиваться или уменьшаться в размерах.
+*Упорядоченный ряд*- это гибкий способ объединения нескольких значений с различными видами данных в один составной вид данных. Упорядоченные ряды имеют конечную длину: после объявления они не могут увеличиваться или уменьшаться в размерах.
 
-Мы создаём кортеж, записывая список значений, разделённых запятыми, внутри круглых скобок. Каждая позиция в кортеже имеет тип, причём типы различных значений в кортеже не обязательно должны быть одинаковыми. В этом примере мы добавили необязательные аннотации типов:
+Мы создаём упорядоченный ряд, записывая список значений, разделённых запятыми, внутри круглых скобок. Каждое значение в упорядоченном ряде имеет вид данных, причём виды данных различных значений в упорядоченном ряде не обязательно должны быть одинаковыми. В этом примере мы добавили необязательные изложения видов данных:
 
 Файл: src/main.rs
 
@@ -128,7 +128,7 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs}}
 ```
 
-Переменная `tup` связана со всем кортежем, поскольку кортеж является одним составным элементом. Чтобы получить отдельные значения из кортежа, можно использовать сопоставление с образцом для деструктуризации значения кортежа, например, так:
+Переменная `tup` связана со всем упорядоченным рядом, поскольку упорядоченный ряд является одной составной переменной. Чтобы получить отдельные значения из упорядоченного ряда, можно использовать сопоставление с образцом для разъединения значения упорядоченного ряда, например, так:
 
 Файл: src/main.rs
 
@@ -136,9 +136,9 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs}}
 ```
 
-Эта программа сначала создаёт кортеж и связывает его с переменной `tup`. Затем с помощью шаблона `let` берётся `tup` и превращается в три отдельные переменные, `x`, `y` и `z`. Это называется *деструктуризацией*, поскольку разбивает единый кортеж на три части. Наконец, программа печатает значение `y`, которое равно `6.4`.
+Эта программа сначала создаёт упорядоченный ряд и связывает его с переменной `tup`. Затем с помощью образца `let` берётся `tup` и превращается в три отдельные переменные, `x`, `y` и `z`. Это называется *разъединением*, поскольку разбивает единый упорядоченный ряд на три части. Наконец, программа выводит значение `y`, которое равно `6.4`.
 
-Мы также можем получить доступ к элементу кортежа напрямую, используя точку (`.`), за которой следует индекс значения, требуемого для доступа. Например:
+Мы также можем получить доступ к переменной упорядоченного ряда напрямую, используя точку (`.`), за которой следует порядковый указатель значения, требуемого для доступа. Например:
 
 Файл: src/main.rs
 
@@ -146,13 +146,13 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs}}
 ```
 
-Эта программа создаёт кортеж `x`, а затем обращается к каждому элементу кортежа, используя соответствующие индексы. Как и в большинстве языков программирования, первый индекс в кортеже равен 0.
+Эта программа создаёт упорядоченный ряд `x`, а затем обращается к каждой переменной упорядоченного ряда, используя соответствующие порядковые указатели. Как и в большинстве языков программирования, первый порядковый указатель в упорядоченном ряде равен 0.
 
-Кортеж, не имеющий значений, имеет специальное имя  *единичный тип (unit)*. Это значение и соответствующий ему тип записываются как `()` и представляет собой пустое значение или пустой возвращаемый тип. Выражения неявно возвращают значение единичного типа, если не возвращают никакого другого значения.
+Упорядоченный ряд, не имеющий значений, имеет особое имя  *единичный вид данных (unit)*. Это значение и соответствующий ему вид данных записываются как `()` и представляет собой пустое значение или пустой возвращаемый вид данных. Выражения неявно возвращают значение единичного вида данных, если не возвращают никакого другого значения.
 
 #### Массивы
 
-Другим способом создания коллекции из нескольких значений является массив *array*. В отличие от кортежа, каждый элемент массива должен иметь один и тот же тип. В отличие от массивов в некоторых других языках, массивы в Rust имеют фиксированную длину.
+Другим способом создания собрания из нескольких значений является массив *array*. В отличие от упорядоченного ряда, каждая переменная массива должен иметь один и тот же вид данных. В отличие от массивов в некоторых других языках, массивы в Ржавчине имеют конечную длину.
 
 Мы записываем значения в массиве в виде списка, разделённого запятыми, внутри квадратных скобок:
 
@@ -162,34 +162,34 @@ Rust поддерживает основные математические оп
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs}}
 ```
 
-Массивы удобно использовать, если данные необходимо разместить в стеке, а не в куче (мы подробнее обсудим стек и кучу в [Главе 4]) или если требуется, чтобы количество элементов всегда было фиксированным. Однако массив не так гибок, как вектор. *Вектор* - это аналогичный тип коллекции, предоставляемый стандартной библиотекой, который *может* увеличиваться или уменьшаться в размере. Если вы не уверены, что лучше использовать - массив или вектор, то, скорее всего, вам следует использовать вектор. Более подробно векторы рассматриваются в [Главе 8].
+Массивы удобно использовать, если данные необходимо разместить в обойме, а не в куче (мы подробнее обсудим обойму и кучу в [Главе 4]) или если требуется, чтобы количество переменных всегда было конечным. Однако массив не так гибок, как вектор. *Вектор* - это подобный вид собрания, предоставляемый встроенной библиотекой, который *может* увеличиваться или уменьшаться в размере. Если вы не уверены, что лучше использовать - массив или вектор, то, скорее всего, вам следует использовать вектор. Более подробно векторы рассматриваются в [Главе 8].
 
-Однако массивы более полезны, когда вы знаете, что количество элементов не нужно будет изменять. Например, если бы вы использовали названия месяцев в программе, вы, вероятно, использовали бы массив, а не вектор, потому что вы знаете, что он всегда будет содержать 12 элементов:
+Однако массивы более полезны, когда вы знаете, что количество переменных не нужно будет изменять. Например, если бы вы использовали названия месяцев в программе, вы, вероятно, использовали бы массив, а не вектор, потому что вы знаете, что он всегда будет содержать 12 переменных:
 
 ```rust
 let months = ["January", "February", "March", "April", "May", "June", "July",
               "August", "September", "October", "November", "December"];
 ```
 
-Тип массива записывается следующим образом: в квадратных скобках обозначается тип элементов массива, а затем, через точку с запятой, количество элементов. Например:
+Вид массива записывается следующим образом: в квадратных скобках обозначается вид данных переменных массива, а затем, через точку с запятой, количество переменных. Например:
 
 ```rust
 let a: [i32; 5] = [1, 2, 3, 4, 5];
 ```
 
-Здесь `i32` является типом каждого элемента массива. После точки с запятой указано число `5`, показывающее, что массив содержит 5 элементов.
+Здесь `i32` является видом данных каждой переменной массива. После точки с запятой указано число `5`, показывающее, что массив содержит 5 переменных.
 
-Вы также можете инициализировать массив, содержащий одно и то же значение для каждого элемента, указав это значение вместо типа. Следом за этим так же следует точка с запятой, а затем — длина массива в квадратных скобках, как показано здесь:
+Вы также можете объявить массив, содержащий одно и то же значение для каждой переменной, указав это значение вместо вида данных. Следом за этим так же следует точка с запятой, а затем — длина массива в квадратных скобках, как показано здесь:
 
 ```rust
 let a = [3; 5];
 ```
 
-Массив в переменной `a` будет включать `5` элементов, значение которых будет равно `3`. Данная запись аналогична коду `let a = [3, 3, 3, 3, 3];`, но является более краткой.
+Массив в переменной `a` будет включать `5` переменных, значение которых будет равно `3`. Данная запись подобна рукописи `let a = [3, 3, 3, 3, 3];`, но является более краткой.
 
-##### Доступ к элементам массива
+##### Доступ к переменным массива
 
-Массив — это единый фрагмент памяти известного фиксированного размера, который может быть размещён в стеке. Вы можете получить доступ к элементам массива с помощью индексации, например:
+Массив — это единый отрывок памяти известного конечного размера, который может быть размещён в обойме. Вы можете получить доступ к переменным массива с помощью упорядочивания, например:
 
 Файл: src/main.rs
 
@@ -197,11 +197,11 @@ let a = [3; 5];
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs}}
 ```
 
-В этом примере переменная с именем first получит значение 1, потому что это значение находится по индексу [0] в массиве. Переменная с именем second получит значение 2 по индексу [1] в массиве.
+В этом примере переменная с именем first получит значение 1, потому что это значение находится по порядковому указателю [0] в массиве. Переменная с именем second получит значение 2 по порядковому указателю [1] в массиве.
 
-##### Некорректный доступ к элементу массива
+##### Неправильный доступ к переменной массива
 
-Давайте посмотрим, что произойдёт, если попытаться получить доступ к элементу массива, находящемуся за его пределами. Допустим, вы запускаете данный код, похожий на игру в угадывание из Главы 2, чтобы получить от пользователя индекс массива:
+Давайте посмотрим, что произойдёт, если попытаться получить доступ к переменной массива, находящемуся за его пределами. Допустим, вы запускаете данная рукопись, похожий на игру в угадывание из Главы 2, чтобы получить от пользователя порядковый указатель массива:
 
 Файл: src/main.rs
 
@@ -209,7 +209,7 @@ let a = [3; 5];
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs}}
 ```
 
-Этот код успешно компилируется. Если запустить этот код с помощью `cargo run` и ввести `0`, `1`, `2`, `3` или `4`, программа напечатает соответствующее значение по данному индексу в массиве. Если вместо этого ввести число за пределами массива, например, `10`, то программа выведет следующее:
+Эта рукопись успешно собирается. Если запустить эту рукопись с помощью `cargo run` и ввести `0`, `1`, `2`, `3` или `4`, программа выведет соответствующее значение по данному порядковому указателю в массиве. Если вместо этого ввести число за пределами границ массива, например, `10`, то программа выведет следующее:
 
  Главы 2, чтобы выйти из программы, когда пользователь выиграл игру, угадав правильное число.
+К счастью, Ржавчина также предоставляет способ выйти из круговорота с помощью приказа. Ключевое слово `break` нужно поместить в круговорот, чтобы указать программе, когда следует прекратить выполнение круговорота. Напоминаем, мы делали так в игре "Угадайка" в разделе ["Выход после правильной догадки"](ch02-00-guessing-game-tutorial.html#quitting-after-a-correct-guess) Главы 2, чтобы выйти из программы, когда пользователь выиграл игру, угадав правильное число.
 
-Мы также использовали `continue` в игре "Угадайка", которое указывает программе в цикле пропустить весь оставшийся код в данной итерации цикла и перейти к следующей итерации.
+Мы также использовали `continue` в игре "Угадайка", которое указывает программе в круговороте пропустить всю оставшуюся рукопись в данном повторении круговорота и перейти к следующему повторению.
 
-#### Возвращение значений из циклов
+#### Возвращение значений из круговоротов
 
-Одно из применений `loop` - это повторение операции, которая может закончиться неудачей, например, проверка успешности выполнения потоком своего задания. Также может понадобиться передать из цикла результат этой операции в остальную часть кода. Для этого можно добавить возвращаемое значение после выражения `break`, которое используется для остановки цикла. Это значение будет возвращено из цикла, и его можно будет использовать, как показано здесь:
+Одно из применений `loop` - это повторение действия, которое может закончиться неудачей, например, проверка успешности выполнения потоком своего задания. Также может понадобиться передать из круговорота итог этого действия в остальную часть рукописи. Для этого можно добавить возвращаемое значение после выражения `break`, которое используется для остановки круговорота. Это значение будет возвращено из круговорота, и его можно будет использовать, как показано здесь:
 
 ```rust
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs}}
 ```
 
-Перед циклом мы объявляем переменную с именем `counter` и инициализируем её значением `0`. Затем мы объявляем переменную с именем `result` для хранения значения, возвращаемого из цикла. На каждой итерации цикла мы добавляем `1` к переменной `counter`, а затем проверяем, равняется ли `10` переменная `counter`. Когда это происходит, мы используем ключевое слово `break` со значением `counter * 2`. После цикла мы ставим точку с запятой для завершения инструкции, присваивающей значение `result`. Наконец, мы выводим значение в `result`, равное в данном случае 20.
+Перед круговоротом мы объявляем переменную с именем `counter` и объявим её значением `0`. Затем мы объявляем переменную с именем `result` для хранения значения, возвращаемого из круговорота. На каждом повторении круговорота мы добавляем `1` к переменной `counter`, а затем проверяем, равняется ли `10` переменная `counter`. Когда это происходит, мы используем ключевое слово `break` со значением `counter * 2`. После круговорота мы ставим точку с запятой для завершения указания, присваивающей значение `result`. Наконец, мы выводим значение в `result`, равное в данном случае 20.
 
-#### Метки циклов для устранения неоднозначности между несколькими циклами
+#### Метки круговоротов для устранения неоднозначности между несколькими круговоротами
 
-Если у вас есть циклы внутри циклов, `break` и `continue` применяются к самому внутреннему циклу в этой цепочке. При желании вы можете создать *метку цикла*, которую вы затем сможете использовать с `break` или `continue` для указания, что эти ключевые слова применяются к помеченному циклу, а не к самому внутреннему циклу. Метки цикла должны начинаться с одинарной кавычки. Вот пример с двумя вложенными циклами:
+Если у вас есть круговороты внутри круговоротов, `break` и `continue` применяются к самому внутреннему круговороту в этой цепочке. При желании вы можете создать *метку круговорота*, которую вы затем сможете использовать с `break` или `continue` для указания, что эти ключевые слова применяются к помеченному круговороту, а не к самому внутреннему круговороту. Метки круговорота должны начинаться с одинарной кавычки. Вот пример с двумя вложенными круговоротами:
 
 ```rust
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/src/main.rs}}
 ```
 
-Внешний цикл имеет метку `'counting_up`, и он будет считать от 0 до 2. Внутренний цикл без метки ведёт обратный отсчёт от 10 до 9. Первый `break`, который не содержит метку, выйдет только из внутреннего цикла. Инструкция `break 'counting_up;` завершит внешний цикл. Этот код напечатает:
+Внешний круговорот имеет метку `'counting_up`, и он будет считать от 0 до 2. Внутренний круговорот без метки ведёт обратный отсчёт от 10 до 9. Первый `break`, который не содержит метку, выйдет только из внутреннего круговорота. Указание `break 'counting_up;` завершит внешний круговорот. Эта рукопись выведет:
 
 ```console
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt}}
 ```
 
-#### Циклы с условием `while`
+#### Круговороты с условием `while`
 
-В программе часто требуется проверить состояние условия в цикле. Пока условие истинно, цикл выполняется. Когда условие перестаёт быть истинным, программа вызывает `break`, останавливая цикл. Такое поведение можно реализовать с помощью комбинации `loop`, `if`, `else` и `break`. При желании попробуйте сделать это в программе. Это настолько распространённый паттерн, что в Rust реализована встроенная языковая конструкция для него, называемая цикл `while`. В листинге 3-3 мы используем `while`, чтобы выполнить три цикла программы, производя каждый раз обратный отсчёт, а затем, после завершения цикла, печатаем сообщение и выходим.
+В программе часто требуется проверить состояние условия в круговороте. Пока условие истинно, круговорот выполняется. Когда условие перестаёт быть истинным, программа вызывает `break`, останавливая круговорот. Такое поведение можно выполнить с помощью сочетания `loop`, `if`, `else` и `break`. При желании попробуйте сделать это в программе. Это настолько распространённый образец, что в Ржавчине имеется встроенный круговорот `while`. В приложении 3-3 мы используем `while`, чтобы выполнить три круговорота программы, производя каждый раз обратный отсчёт, а затем, после завершения круговорота, выводим                                                                                                                                                                                                                                                                                                            сообщение и выходим.
 
 Имя файла: src/main.rs
 
@@ -192,13 +192,13 @@ again!
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/listing-03-03/src/main.rs}}
 ```
 
-Листинг 3-3: Использование цикла while для выполнения кода, пока условие истинно
+Приложение 3-3: Использование круговорота while для выполнения рукописи, пока условие истинно
 
-Эта конструкция устраняет множество вложений, которые потребовались бы при использовании `loop`, `if`, `else` и `break`, и она более понятна. Пока условие вычисляется в `true`, код выполняется; в противном случае происходит выход из цикла.
+В данном исполнении круговорота while возможно существенно сократить размер рукописи, который потребовался бы при использовании круговоротов `loop`, `if`, `else` и `break`, и оно более понятно. Пока условие вычисляется в `true`, рукопись выполняется; в противном случае происходит выход из круговорота.
 
-#### Цикл по элементам коллекции с помощью `for`
+#### Круговорот по переменным собрания с помощью `for`
 
-Для перебора элементов коллекции, например, массива, можно использовать конструкцию `while`. Например, цикл в листинге 3-4 печатает каждый элемент массива `a`.
+Для перебора переменных собрания, например, массива, можно использовать круговорот `while`. Например, круговорот в приложении 3-4 выводит каждая переменная массива `a`.
 
 Имя файла: src/main.rs
 
@@ -206,19 +206,19 @@ again!
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/listing-03-04/src/main.rs}}
 ```
 
-Листинг 3-4: Перебор каждого элемента коллекции с помощью цикла while
+Приложение 3-4: Перебор каждой переменной собрания с помощью круговорота while
 
-Этот код выполняет перебор элементов массива. Он начинается с индекса `0`, а затем циклически выполняется, пока не достигнет последнего индекса в массиве (то есть, когда `index < 5` уже не является истиной). Выполнение этого кода напечатает каждый элемент массива:
+Эта рукопись использует перебор переменных массива. Он начинается с порядкового указателя `0`, а затем замкнуто выполняется, пока не достигнет последнего порядкового указателя в массиве (то есть, когда `index < 5` уже не является истиной). Выполнение этой рукописи выведет каждая переменная массива:
 
 ```console
 {{#include ../listings/ch03-common-programming-concepts/listing-03-04/output.txt}}
 ```
 
-Все пять значений массива появляются в терминале, как и ожидалось. Поскольку `index` в какой-то момент достигнет значения `5`, цикл прекратит выполнение перед попыткой извлечь шестое значение из массива.
+Все пять значений массива появляются в окне вызова, как и ожидалось. Поскольку `index` в какое-то мгновение достигнет значения `5`, круговорот прекратит выполнение перед попыткой извлечь шестое значение из массива.
 
-Однако такой подход чреват ошибками; мы можем вызвать панику в программе, если значение индекса или условие проверки неверны. Например, если изменить определение массива `a` на четыре элемента, но забыть обновить условие на `while index < 4`, код вызовет панику. Также это медленно, поскольку компилятор добавляет код времени выполнения для обеспечения проверки нахождения индекса в границах массива на каждой итерации цикла.
+Однако такой подход чреват ошибками; мы можем вызвать сбой в программе, если значение порядкового указателя или условие проверки неверны. Например, если изменить определение массива `a` на четыре элемента, но забыть обновить условие на `while index < 4`, рукопись вызовет сбой. Также это медленно, поскольку сборщик добавляет в рукопись вычисление значения времени выполнения для обеспечения проверки нахождения порядкового указателя в границах массива на каждом повторении круговорота.
 
-В качестве более краткой альтернативы можно использовать цикл `for` и выполнять некоторый код для каждого элемента коллекции. Цикл `for` может выглядеть как код в листинге 3-5.
+В качестве более краткого иного решения можно использовать круговорот `for` и выполнять некоторую рукопись для каждой переменной собрания. Круговорот `for` может выглядеть как рукопись в приложении 3-5.
 
 Имя файла: src/main.rs
 
@@ -226,15 +226,15 @@ again!
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/listing-03-05/src/main.rs}}
 ```
 
-Листинг 3-5: Перебор каждого элемента коллекции с помощью цикла for
+Приложение 3-5: Перебор каждой переменной собрания с помощью круговорота for
 
-При выполнении этого кода мы увидим тот же результат, что и в листинге 3-4. Что важнее, теперь мы повысили безопасность кода и устранили вероятность ошибок, которые могут возникнуть в результате выхода за пределы массива или недостаточно далёкого перехода и пропуска некоторых элементов.
+При выполнении этой рукописи мы увидим тот же итог, что и в приложении 3-4. Что важнее, теперь мы повысили безопасность рукописи и устранили вероятность ошибок, которые могут возникнуть в итоге выхода за пределы массива или недостаточно далёкого перехода и пропуска некоторых переменных.
 
-При использовании цикла `for` не нужно помнить о внесении изменений в другой код, в случае изменения количества значений в массиве, как это было бы с методом, использованным в листинге 3-4.
+При использовании круговорота `for` не нужно помнить о внесении изменений в другую рукопись, в случае изменения количества значений в массиве, как это было бы со способом, использованным в приложении 3-4.
 
-Безопасность и компактность циклов `for` делают их наиболее часто используемой конструкцией цикла в Rust. Даже в ситуациях необходимости выполнения некоторого кода определённое количество раз, как в примере обратного отсчёта, в котором использовался цикл `while` из Листинга 3-3, большинство Rustaceans использовали бы цикл `for`. Для этого можно использовать `Range`, предоставляемый стандартной библиотекой, который генерирует последовательность всех чисел, начиная с первого числа и заканчивая вторым числом, но не включая его (т.е. `(1..4)` эквивалентно `[1, 2, 3]` или в общем случае `(start..end)` эквивалентно `[start, start+1, start+2, ... , end-2, end-1]` - прим.переводчика).
+Безопасность и краткость круговоротов `for` делают их наиболее часто используемым круговоротом в Ржавчине. Даже в случаях необходимости выполнения некоторой рукописи определённое количество раз, как в примере обратного отсчёта, в котором использовался круговорот `while` из Приложения 3-3, большинство Rustaceans использовали бы круговорот `for`. Для этого можно использовать `Range`, предоставляемый встроенной библиотекой, который порождает последовательность всех чисел, начиная с первого числа и заканчивая вторым числом, но не включая его (т.е. `(1..4)` равнозначно `[1, 2, 3]` или в общем случае `(start..end)` равнозначно `[start, start+1, start+2, ... , end-2, end-1]` - прим.переводчика).
 
-Вот как будет выглядеть обратный отсчёт с использованием цикла `for` и другого метода, о котором мы ещё не говорили, `rev`, для разворота диапазона:
+Вот как будет выглядеть обратный отсчёт с использованием круговорота `for` и другого способа, о котором мы ещё не говорили, `rev`, для разворота ряда:
 
 Имя файла: src/main.rs
 
@@ -242,14 +242,14 @@ again!
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs}}
 ```
 
-Данный код выглядит лучше, не так ли?
+Данная рукопись выглядит лучше, не так ли?
 
 ## Итоги
 
-Вы справились! Это была объёмная глава: вы узнали о переменных, скалярных и составных типах данных, функциях, комментариях, выражениях `if` и циклах! Для практики работы с концепциями, обсуждаемыми в этой главе, попробуйте создать программы для выполнения следующих действий:
+Вы справились! Это была большая глава: вы узнали о переменных, одиночных и составных видах данных, функциях, примечаниях, выражениях `if` и круговоротах! Для опытов работы со средствами, обсуждаемыми в этой главе, попробуйте создать программы для выполнения следующих действий:
 
-- Конвертация температур между значениями по Фаренгейту к Цельсию.
-- Генерирование n-го числа Фибоначчи.
-- Распечатайте текст рождественской песни "Двенадцать дней Рождества", воспользовавшись повторами в песне.
+- Преобразование температур между значениями по Фаренгейту к Цельсию.
+- Порождение n-го числа Фибоначчи.
+- Выведите писание рождественской песни "Двенадцать дней Рождества", воспользовавшись повторами в песне.
 
-Когда вы будете готовы двигаться дальше, мы поговорим о концепции в Rust, которая *не существует* обычно в других языках программирования: владение.
+Когда вы будете готовы двигаться дальше, мы поговорим о подходах в Ржавчине, которые *не существуют* обычно в других языках программирования: владение.
diff --git a/rustbook-ru/src/ch04-00-understanding-ownership.md b/rustbook-ru/src/ch04-00-understanding-ownership.md
index 5d8a57c44..d3d20975d 100644
--- a/rustbook-ru/src/ch04-00-understanding-ownership.md
+++ b/rustbook-ru/src/ch04-00-understanding-ownership.md
@@ -1,3 +1,3 @@
 # Понимание Владения
 
-Владение - это самая уникальная особенность Rust, которая имеет глубокие последствия для всего языка. Это позволяет Rust обеспечивать безопасность памяти без использования сборщика мусора, поэтому важно понимать, как работает владение. В этой главе мы поговорим о владении, а также о нескольких связанных с ним возможностях: заимствовании, срезах и о том, как Rust раскладывает данные в памяти.
+Владение - не имеющая себе подобных особенность Ржавчины, которая имеет глубокие последствия для всего языка. Это позволяет Ржавчине обеспечивать безопасное управлению памятью без использования сборщика мусора, поэтому важно понимать, как работает владение. В этой главе мы поговорим о владении, а также о нескольких связанных с ним возможностях: заимствовании, срезах и о том, как Ржавчина раскладывает данные в памяти.
diff --git a/rustbook-ru/src/ch04-01-what-is-ownership.md b/rustbook-ru/src/ch04-01-what-is-ownership.md
index 6eef78167..f52d24308 100644
--- a/rustbook-ru/src/ch04-01-what-is-ownership.md
+++ b/rustbook-ru/src/ch04-01-what-is-ownership.md
@@ -1,106 +1,106 @@
 ## Что такое владение?
 
-*Владение* — это набор правил, определяющих, как программа на языке Rust управляет памятью. Все программы так или иначе должны управлять тем, как они используют память компьютера во время работы. Некоторые языки имеют сборщик мусора, регулярно отслеживающий неиспользуемую память во время работы программы; в других языках программист должен явно выделять и освобождать память. В Rust используется третий подход: память управляется через систему владения с набором правил, которые проверяются компилятором. При нарушении любого из правил программа не будет скомпилирована. Ни одна из особенностей системы владения не замедлит работу вашей программы.
+*Владение* — это набор правил, определяющих, как программа на языке Ржавчина управляет памятью. Все программы так или иначе должны управлять тем, как они используют память компьютера во время работы. Некоторые языки имеют сборщик мусора, постоянно отслеживающий неиспользуемую память во время работы программы; в других языках программист должен явно выделять и освобождать память. В Ржавчине используется третий подход: память управляется через систему владения с набором правил, которые проверяются сборщиком. При нарушении любого из правил программа не будет собрана. Ни одна из особенностей системы владения не замедлит работу вашей программы.
 
-Поскольку владение является новой концепцией для многих программистов, требуется некоторое время, чтобы привыкнуть к ней. Хорошая новость заключается в том, что чем больше у вас будет опыта с Rust и с правилами системы владения, тем легче вам будет естественным образом разрабатывать безопасный и эффективный код. Держитесь! Не сдавайтесь!
+Поскольку владение является новым решением для многих программистов, требуется некоторое время, чтобы привыкнуть к нему. Хорошая новость заключается в том, что чем больше у вас будет опыта с Ржавчиной и с правилами системы владения, тем легче вам будет естественным образом разрабатывать безопасной и производительной рукописью. Держитесь! Не сдавайтесь!
 
-Понимание концепции владения даст вам основу для понимания всех остальных особенностей, делающих Rust уникальным. В этой главе вы изучите владение на примерах, которые сфокусированы на наиболее часто используемой структуре данных: строках.
+Понимание подходов владения даст вам основу для понимания всех остальных особенностей, делающих Ржавчина единственным. В этой главе вы изучите владение на примерах, которые сосредоточены на наиболее часто используемой видом данных: строках.
 
-> ### Стек и куча
+> ### Обойма и куча
 >
-> Многие языки программирования не требуют, чтобы вы слишком часто думали о стеке и куче. Но в языках системного программирования, одним из которых является Rust, то, какое значение находится в стеке или в куче, влияет на поведение языка и на принятие вами определённых решений. Владение будет описано через призму стека и кучи позже в этой главе, а пока — краткое пояснение.
+> Многие языки программирования не требуют, чтобы вы слишком часто думали о обойме и куче. Но в языках системного программирования, одним из которых является Ржавчина, то, какое значение находится в обойме или в куче, влияет на поведение языка и на принятие вами определённых решений. Владение будет описано через призму обоймы и кучи позже в этой главе, а пока — краткое пояснение.
 >
-> И стек, и куча — это части памяти, доступные вашему коду для использования во время выполнения. Однако они структурированы по-разному. Стек хранит значения в порядке их получения, а удаляет — в обратном. Это называется *«последним пришёл — первым ушёл»*. Подумайте о стопке тарелок: когда вы добавляете тарелки, вы кладёте их сверху стопки — когда вам нужна тарелка, вы берёте одну так же сверху. Добавление или удаление тарелок посередине или снизу не сработает! Добавление данных называется *помещением в стек*, а удаление — извлечением *из стека*. Все данные, хранящиеся в стеке, должны иметь известный фиксированный размер. Данные, размер которых во время компиляции неизвестен или может измениться, должны храниться в куче.
+> И обойма, и куча — это части памяти, доступные вашей рукописи для использования во время выполнения. Однако они внутренне выстроенны по-разному. Обойма хранит значения в порядке их получения, а удаляет — в обратном. Это называется *«последним пришёл — первым ушёл»*. Подумайте о стопке тарелок: когда вы добавляете тарелки, вы кладёте их сверху стопки — когда вам нужна тарелка, вы берёте одну так же сверху. Добавление или удаление тарелок посередине или снизу не сработает! Добавление данных называется *помещением в обойму*, а удаление — извлечением *из обоймы*. Все данные, хранящиеся в обойме, должны иметь известный определенный размер. Данные, размер которых во время сборки неизвестен или может измениться, должны храниться в куче.
 >
-> Куча устроена менее организованно: когда вы кладёте данные в кучу, вы запрашиваете определённый объём пространства. Операционная система находит в куче свободный участок памяти достаточного размера, помечает его как используемый и возвращает *указатель*, являющийся адресом этого участка памяти. Этот процесс называется *выделением памяти в куче* и иногда сокращается до *выделения памяти* (помещение значений в стек не считается выделением). Поскольку указатель на участок памяти в куче имеет определённый фиксированный размер, его можно расположить в стеке, однако когда вам понадобятся актуальные данные, вам придётся проследовать по указателю. Представьте, что вы сидите в ресторане. Когда вы входите, вы называете количество человек в вашей группе, и персонал находит свободный стол, которого хватит на всех, и ведёт вас туда. Если кто-то из вашей группы опоздает, он может спросить, куда вас посадили, чтобы найти вас.
+> Куча устроена менее согласованно: когда вы кладёте данные в кучу, вы запрашиваете определённый размер пространства. Операционная система находит в куче свободный участок памяти достаточного размера, помечает его как используемый и возвращает *указатель*, являющийся адресом этого участка памяти. Этот этап называется *выделением памяти в куче* и иногда сокращается до *выделения памяти* (помещение значений в обойму не считается выделением). Поскольку указатель на участок памяти в куче имеет определённый размер, его можно расположить в обойме, однако когда вам понадобятся действительные данные, вам придётся проследовать по указателю. Представьте, что вы сидите в ресторане. Когда вы входите, вы называете количество человек в вашем объединении, и человек находит свободный стол, которого хватит на всех, и ведёт вас туда. Если кто-то из вашем объединении опоздает, он может спросить, куда вас посадили, чтобы найти вас.
 >
-> Помещение в стек происходит более быстро, чем выделение памяти в куче, потому что операционная система не должна искать место для размещения информации — это место всегда на верхушке стека. Для сравнения, выделение памяти в куче требует больше работы, потому что операционная система сначала должна найти участок памяти достаточного размера, а затем произвести некоторые действия для подготовки к следующему выделению памяти.
+> Помещение в обойму происходит более быстро, чем выделение памяти в куче, потому что операционная система не должна искать место для размещения сведений — это место всегда на верхушке обоймы. Для сравнения, выделение памяти в куче требует больше работы, потому что операционная система сначала должна найти участок памяти достаточного размера, а затем произвести некоторые действия для подготовки к следующему выделению памяти.
 >
-> Доступ к данным в куче медленнее, чем доступ к данным в стеке, потому что вам нужно следовать по адресу указателя, чтобы добраться туда. Современные процессоры работают быстрее, если они меньше прыгают по памяти. Продолжая аналогию, рассмотрим официанта в ресторане, принимающего заказы со многих столов. Наиболее эффективно будет получить все заказы за одним столом, прежде чем переходить к следующему столу. Получение заказа со стола А, затем со стола В, затем снова одного с А, а затем снова одного с В было бы гораздо более медленным делом. Точно так же процессор может выполнять свою работу лучше, если он работает с данными, которые находятся близко к другим данным (как в стеке), а не далеко (как это может быть в куче).
+> Доступ к данным в куче медленнее, чем доступ к данным в обойме, потому что вам нужно следовать по адресу указателя, чтобы добраться туда. Современные процессоры работают быстрее, если они меньше прыгают по памяти. Продолжая подобие, рассмотрим официанта в ресторане, принимающего заказы со многих столов. Наиболее правильно будет получить все заказы за одним столом, прежде чем переходить к следующему столу. Получение заказа со стола А, затем со стола В, затем снова одного с А, а затем снова одного с В было бы гораздо более медленным делом. Точно так же процессор может выполнять свою работу лучше, если он работает с данными, которые находятся близко к другим данным (как в обойме), а не далеко (как это может быть в куче).
 >
-> Когда ваш код вызывает функцию, значения, переданные в неё (потенциально включающие указатели на данные в куче), и локальные переменные помещаются в стек. Когда функция завершается, эти значения извлекаются из стека.
+> Когда ваша рукопись вызывает функцию, значения, переданные в неё (возможно включающие указатели на данные в куче), и местные переменные помещаются в обойму. Когда функция завершается, эти значения извлекаются из обоймы.
 >
-> Отслеживание того, какие части кода используют какие данные, минимизация количества дублирующихся данных и очистка неиспользуемых данных в куче, чтобы не исчерпать пространство, — все эти проблемы решает владение. Как только вы поймёте, что такое владение, вам не нужно будет слишком часто думать о стеке и куче. Однако знание того, что основная цель владения — управление данными кучи, может помочь объяснить, почему оно работает именно так.
+> Отслеживание того, какие части рукописи используют какие данные, уменьшение количества повторяющихся данных и очистка неиспользуемых данных в куче, чтобы не исчерпать пространство, — все эти сбои решает владение. Как только вы поймёте, что такое владение, вам не нужно будет слишком часто думать о обойме и куче. Однако знание того, что основная цель владения — управление данными кучи, может помочь объяснить, почему оно работает именно так.
 
 ### Правила владения
 
-Во-первых, давайте взглянем на правила владения. Помните об этих правилах, пока мы работаем с примерами, которые их иллюстрируют:
+Во-первых, давайте взглянем на правила владения. Помните об этих правилах, пока мы работаем с примерами, которые их отображают:
 
-- У каждого значения в Rust есть *владелец*,
-- У значения может быть только один владелец в один момент времени,
+- У каждого значения в Ржавчине есть *владелец*,
+- У значения может быть только один владелец в одно мгновение времени,
 - Когда владелец покидает область видимости, значение удаляется.
 
 ### Область видимости переменной
 
-Теперь, когда мы прошли базовый синтаксис Rust, мы не будем включать весь код `fn main() {` в примеры. Поэтому, если вы будете следовать этому курсу, убедитесь, что следующие примеры помещены в функцию `main` вручную. В результате наши примеры будут более лаконичными, что позволит нам сосредоточиться на реальных деталях, а не на шаблонном коде.
+Теперь, когда мы прошли основные правила написания Ржавчины, мы не будем включать всю рукопись `fn main() {` в примеры. Поэтому, если вы будете следовать этому пособию, убедитесь, что следующие примеры помещены в функцию `main` вручную. В итоге наши примеры будут более краткими, что позволит нам сосредоточиться на существующих подробностях, а не на образцовой рукописи.
 
-В качестве первого примера владения мы рассмотрим *область видимости* некоторых переменных. Область видимости — это диапазон внутри программы, для которого допустим элемент. Возьмём следующую переменную:
+В качестве первого примера владения мы рассмотрим *область видимости* некоторых переменных. Область видимости — это раздел внутри программы, для которого допустима переменная. Возьмём следующую переменную:
 
 ```rust
 let s = "hello";
 ```
 
-Переменная `s` относится к строковому литералу, где значение строки жёстко прописано в тексте нашей программы. Переменная действительна с момента её объявления до конца текущей *области видимости*. В листинге 4-1 показана программа с комментариями, указывающими, где допустима переменная `s` .
+Переменная `s` относится к строковой записи, где значение строки жёстко определено  в писании нашей программы. Переменная действительна с места её объявления до конца текущей *области видимости*. В приложении 4-1 показана программа с примечаниями, указывающими, где начало и конец области видимости для переменной `s` .
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-01/src/main.rs:here}}
 ```
 
-Листинг 4-1: переменная и область действия, в которой она допустима
+Приложение 4-1: Переменная и область действия, где она существует
 
-Другими словами, здесь есть два важных момента:
+Другими словами, здесь есть две важных особенности:
 
 - Когда переменная `s` *появляется* в области видимости, она считается действительной,
-- Она остаётся действительной до момента *выхода* за границы этой области.
+-  действительной ровно до конца раздела, за которым следует *выход* за границы этой области.
 
-На этом этапе объяснения взаимосвязь между областями видимости и допустимостью переменных аналогична той, что существует в других языках программирования. Теперь мы будем опираться на это понимание, введя тип `String`.
+На этом этапе объяснения взаимосвязь между областями видимости и допустимостью переменных подобна той, что существует в других языках программирования. Теперь мы будем опираться на это понимание, введя вид данных `String`.
 
-### Тип данных `String`
+### Вид данных `String`
 
-Для демонстрации правил владения нам требуется более сложный тип данных чем те, что мы обсуждали в части ["Типы данных"] Главы 3. Типы, рассмотренные ранее, имеют определённый размер, а значит могут быть размещены на стеке и извлечены из него, когда их область видимости закончится, и могут быть быстро и тривиально скопированы для создания новой, независимой копии, если другой части кода нужно использовать то же самое значение в другой области видимости. Но мы хотим посмотреть на данные, хранящиеся в куче, и выяснить, как Rust узнаёт, когда нужно очистить эти данные, поэтому тип String — отличный пример.
+Для отображения правил владения нам требуется более сложный вид данных чем те, что мы обсуждали в части ["Виды данных"] Главы 3. Виды данных, рассмотренные ранее, имеют определённый размер, а значит могут быть размещены в обойме и извлечены из неё, когда их область видимости закончится, и могут быть быстро и обыкновенно воспроизведены для создания нового, независимого двойника, если другой части рукописи нужно использовать то же самое значение в другой области видимости. Но мы хотим посмотреть на данные, хранящиеся в куче, и выяснить, как Ржавчина узнаёт, когда нужно очистить эти данные, поэтому вид данных String — отличный пример.
 
-Мы сконцентрируемся на тех частях `String`, которые связаны с владением. Эти аспекты также применимы к другим сложным типам данных, независимо от того, предоставлены они стандартной библиотекой или созданы вами. Более подробно мы обсудим `String` в [главе 8].
+Мы сосредоточимся на тех частях `String`, которые связаны с владением. Эти особенности также применимы к другим сложным видам данных, независимо от того, предоставлены они встроенной библиотекой или созданы вами. Более подробно мы обсудим `String` в [главе 8].
 
-Мы уже видели строковые литералы, где строковое значение жёстко прописано в нашей программе. Строковые литералы удобны, но они подходят не для каждой ситуации, где мы можем хотеть использовать текст. Одна из причин заключается в том, что они неизменны. Кроме того, не каждое строковое значение может быть известно во время написания кода: что, если мы захотим принять и сохранить пользовательский ввод? Для таких ситуаций в Rust есть ещё один строковый тип — `String`. Этот тип управляет данными, выделенными в куче, и поэтому может хранить объём текста, который во время компиляции неизвестен. Также вы можете создать `String` из строкового литерала, используя функцию `from`, например:
+Мы уже видели строковые записи, где строковое значение жёстко определено  в нашей программе. Строковые записи удобны, но они подходят не для каждого случая, где мы можем хотеть использовать писание. Одна из причин заключается в том, что они неизменны. Кроме того, не каждое строковое значение может быть известно во время написания рукописи: что, если мы захотим принять и сохранить пользовательский ввод? Для таких случаев в Ржавчине есть ещё один строковый вид данных — `String`. Этот вид данных управляет данными, выделенными в куче, и поэтому может хранить размер писания, который во время сборки неизвестен. Также вы можете создать `String` из строковой записи, используя функцию `from`, например:
 
 ```rust
 let s = String::from("hello");
 ```
 
-Оператор "Двойное двоеточие" `::` позволяет использовать пространство имён данной конкретной функции `from` с типом `String`, а не какое-то иное имя, такое как `string_from`. Мы обсудим этот синтаксис более подробно в разделе [«Синтаксис метода»]. раздел  Главы 5, и в ходе обсуждения пространств имён с модулями в [ «Пути для обращения к элементу в дереве модулей»] в главе 7.
+Приказчик "Двойное двоеточие" `::` позволяет использовать пространство имён данной  функции `from` с видом данных `String`, а не какое-то иное имя, такое как `string_from`. Мы обсудим эти правила написания более подробно в разделе [«Правила написания способов»]. раздел  Главы 5, и в ходе обсуждения пространств имён с разделами в [ «Пути для обращения к переменной в дереве разделов»] в главе 7.
 
-Строка такого типа *может* быть изменяема:
+Строка такого вида *может* быть изменяема:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs:here}}
 ```
 
-В чем же тут разница? Почему строку `String` можно изменить, а литералы — нельзя? Разница заключается в том, как эти два типа работают с памятью.
+В чем же тут разница? Почему строку `String` можно изменить, а записи — нельзя? Разница заключается в том, как эти два вида данных работают с памятью.
 
 ### Память и способы её выделения
 
-В случае строкового литерала мы знаем его содержимое во время компиляции, и оно жёстко прописано в итоговом исполняемом файле. Причина того, что строковые литералы более быстрые и эффективные, в их неизменяемости. К сожалению, нельзя поместить неопределённый кусок памяти в выполняемый файл для текста, размер которого неизвестен при компиляции и может меняться во время выполнения программы.
+В случае строковой записи мы знаем её содержимое во время сборки, и оно жёстко прописано в итоговом исполняемом файле. Причина того, что строковые записи более быстрые и производительные, в их неизменяемости. К сожалению, нельзя поместить неопределённый кусок памяти в выполняемый файл для писания, размер которого неизвестен при сборке и может меняться во время выполнения программы.
 
-Чтобы поддерживать изменяемый, увеличивающийся текст типа `String`, необходимо выделять память в куче для всего содержимого, объем которого неизвестен во время компиляции. Это означает, что:
+Чтобы поддерживать изменяемую, увеличивающуюся переменную вида данных `String`, необходимо выделять память в куче для всего содержимого, размер которого неизвестен во время сборки. Это означает, что:
 
 - Память должна запрашиваться у операционной системы во время выполнения программы,
 - Необходим способ возврата этой памяти операционной системе, когда мы закончили в программе работу со `String`.
 
-Первая часть выполняется нами: когда мы вызываем `String::from`, его реализация запрашивает необходимую память. Это работает довольно похоже во всех языках программирования.
+Первая часть используется нами: когда мы вызываем `String::from`, его выполнение запрашивает необходимую память. Это работает довольно похоже во всех языках программирования.
 
-Однако вторая часть отличается. В языках со *сборщиком мусора (GC)*, память, которая больше не используется, отслеживается и очищается с его помощью — нам не нужно об этом думать. В большинстве языков без сборщика мусора мы обязаны сами определять, когда память больше не используется, и вызывать код для явного её освобождения, точно так же, как мы делали это для её запроса. Правильное выполнение этого процесса исторически было сложной проблемой программирования. Если мы забудем освободить память, она будет потеряна. Если мы сделаем это слишком рано, у нас будет недопустимая переменная. Сделать это дважды — тоже будет ошибкой. Нам нужно соединить ровно один `allocate` ровно с одним `free`.
+Однако вторая часть отличается. В языках со *сборщиком мусора (GC)*, память, которая больше не используется, отслеживается и очищается с его помощью — нам не нужно об этом думать. В большинстве языков без сборщика мусора мы обязаны сами определять, когда память больше не используется, и вызывать рукопись для явного её освобождения, точно так же, как мы делали это для её запроса. Правильное выполнение этого этапа во все времена было сложной неполадкой программирования. Если мы забудем освободить память, она будет потеряна. Если мы сделаем это слишком рано, у нас будет недопустимая переменная. Сделать это дважды — тоже будет ошибкой. Нам нужно соединить ровно один `allocate` ровно с одним `free`.
 
-Rust выбирает другой путь: память автоматически возвращается, как только владеющая памятью переменная выходит из области видимости. Вот версия примера с областью видимости из листинга 4-1, в котором используется тип `String` вместо строкового литерала:
+Ржавчина выбирает другой путь: память самостоятельно возвращается, как только владеющая памятью переменная выходит из области видимости. Вот исполнение примера с областью видимости из приложения 4-1, в котором используется вид данных `String` вместо строковой записи:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs:here}}
 ```
 
-Существует естественный момент, когда мы можем вернуть память, необходимую нашему `String`, обратно распределителю — когда `s` выходит за пределы области видимости. Когда переменная выходит за пределы области видимости, Rust вызывает для нас специальную функцию. Эта функция называется [`drop`], и именно здесь автор `String` может поместить код для возврата памяти. Rust автоматически вызывает `drop` после закрывающей фигурной скобки.
+Существует одна возможность, когда мы можем вернуть память, необходимую нашему `String`, обратно распределителю — когда `s` выходит за пределы области видимости. Когда переменная выходит за пределы области видимости, Ржавчина вызывает для нас особую функцию. Эта функция называется [`drop`], и именно здесь составитель`String` может поместить рукопись для возврата памяти. Ржавчина самостоятельно вызывает `drop` после закрывающей узорчатой скобки.
 
-> Примечание: в C++ этот паттерн освобождения ресурсов в конце времени жизни элемента иногда называется *«Получение ресурса есть инициализация» (англ. Resource Acquisition Is Initialization (RAII))*. Функция `drop` в Rust покажется вам знакомой, если вы использовали шаблоны RAII.
+> Примечание: в C++ этот способ освобождения памяти в конце времени жизни переменной иногда называется *«Получение ресурса есть объявление» (англ. Resource Acquisition Is Initialization (RAII))*. Функция `drop` в Ржавчине покажется вам знакомой, если вы использовали образцы RAII.
 
-Этот шаблон оказывает глубокое влияние на способ написания кода в Rust. Сейчас это может казаться простым, но в более сложных ситуациях поведение кода может быть неожиданным, например когда хочется иметь несколько переменных, использующих данные, выделенные в куче. Изучим несколько таких ситуаций.
+Этот способ оказывает глубокое влияние на способ написания рукописи в Ржавчине. Сейчас это может казаться простым, но в более сложных случаях поведение рукописи может быть неожиданным, например когда хочется иметь несколько переменных, использующих данные, выделенные в куче. Изучим несколько таких случаев.
 
 
 
@@ -108,113 +108,117 @@ Rust выбирает другой путь: память автоматичес
 
 #### Взаимодействие переменных и данных с помощью перемещения
 
-Несколько переменных могут по-разному взаимодействовать с одними и теми же данными в Rust. Давайте рассмотрим пример использования целого числа в листинге 4-2.
+Несколько переменных могут по-разному взаимодействовать с одними и теми же данными в Ржавчине. Давайте рассмотрим пример использования целого числа в приложении 4-2.
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-02/src/main.rs:here}}
 ```
 
-Листинг 4-2. Присвоение целочисленного значения переменной x переменной y
+Приложение 4-2. Присвоение целочисленного значения переменной x переменной y
 
-Мы можем догадаться, что делает этот код: «привязать значение `5` к `x`; затем сделать копию значения в `x` и привязать его к `y`». Теперь у нас есть две переменные: `x` и `y`, и обе равны `5`. Это то, что происходит на самом деле, потому что целые числа — это простые значения с известным фиксированным размером, и эти два значения `5` помещаются в стек.
+Мы можем догадаться, что делает эта рукопись: «привязать значение `5` к `x`; затем сделать повтор значения в `x` и привязать его к `y`». Теперь у нас есть две переменные: `x` и `y`, и обе равны `5`. Это то, что происходит на самом деле, потому что целые числа — это простые значения с известным конечным размером, и эти два значения `5` помещаются в обойму.
 
-Теперь рассмотрим версию с типом `String`:
+Теперь рассмотрим исполнение с видом данных `String`:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs:here}}
 ```
 
-Это выглядит очень похоже, поэтому мы можем предположить, что происходит то же самое: вторая строка сделает копию значения в `s1` и привяжет его к `s2`. Но это не совсем так.
+Это выглядит очень похоже, поэтому мы можем предположить, что происходит то же самое: вторая строка сделает повтор значения в `s1` и привяжет его к `s2`. Но это не совсем так.
 
-Взгляните на рисунок 4-1, чтобы увидеть, что происходит со `String` под капотом. `String` состоит из трёх частей, показанных слева: указатель на память, в которой хранится содержимое строки, длина и ёмкость. Эта группа данных хранится в стеке. Справа — память в куче, которая содержит содержимое.
+Взгляните на рисунок 4-1, чтобы увидеть, что происходит со `String` под капотом. `String` состоит из трёх частей, показанных слева: указатель на память, в которой хранится содержимое строки, длина и ёмкость. Это объединение данных хранится в обойме. Справа — память в куче, которая хранит содержимое.
 
-Two tables: the first table contains the representation of s1 on the<br>stack, consisting of its length (5), capacity (5), and a pointer to the first<br>value in the second table. The second table contains the representation of the<br>string data on the heap, byte by byte.
+Two tables: the first table contains the representation of s1 on the<br>stack, consisting of its length (5), capacity (5), and a pointer to the first<br>value in the second table. The second table contains the representation of the<br>string data on the heap, byte by byte.
 
 Рисунок 4-1: представление в памяти String, содержащей значение "hello", привязанное к s1
 
-Длина — это объём памяти в байтах, который в настоящее время использует содержимое `String`. Ёмкость — это общий объём памяти в байтах, который `String` получил от распределителя. Разница между длиной и ёмкостью имеет значение, но не в этом контексте, поэтому на данный момент можно игнорировать ёмкость.
+Длина — это размер памяти в байтах, которое в настоящее время использует содержимое `String`. Ёмкость — это общий размер памяти в байтах, которое `String` получил от распределителя. Разница между длиной и ёмкостью имеет значение, но не в этой среде, поэтому в данное мгновение можно пренебречь ёмкостью.
 
-Когда мы присваиваем `s1` значению `s2`, данные `String` копируются, то есть мы копируем указатель, длину и ёмкость, которые находятся в стеке. Мы не копируем данные в куче, на которые указывает указатель. Другими словами, представление данных в памяти выглядит так, как показано на рис. 4-2.
+Когда мы присваиваем `s1` значению `s2`, данные `String` повторяются, то есть мы повторяем указатель, длину и ёмкость, которые находятся в обойме. Мы не повторяем данные в куче, на которые указывает указатель. Другими словами, представление данных в памяти выглядит так, как показано на рис. 4-2.
 
-Three tables: tables s1 and s2 representing those strings on the<br>stack, respectively, and both pointing to the same string data on the heap.
+Three tables: tables s1 and s2 representing those strings on the<br>stack, respectively, and both pointing to the same string data on the heap.
 
-Рисунок 4-2: представление в памяти переменной s2, имеющей копию указателя, длины и ёмкости s1
+Рисунок 4-2: представление в памяти переменной s2, имеющей повтор указателя, длины и ёмкости s1
 
-Представление *не* похоже на рисунок 4-3, как выглядела бы память, если бы вместо этого Rust также скопировал данные кучи. Если бы Rust сделал это, операция `s2 = s1` могла бы быть очень дорогой с точки зрения производительности во время выполнения, если бы данные в куче были большими.
+Представление *не* похоже на рисунок 4-3, как выглядела бы память, если бы вместо этого Ржавчина также воспроизвела данные кучи. Если бы Ржавчина сделала это, действие `s2 = s1` могла бы быть очень дорогой с точки зрения производительности во время выполнения, если бы данные в куче были большими.
 
-Two tables: the first table contains the representation of s1 on the<br>stack, consisting of its length (5), capacity (5), and a pointer to the first<br>value in the second table. The second table contains the representation of the<br>string data on the heap, byte by byte.
+Two tables: the first table contains the representation of s1 on the<br>stack, consisting of its length (5), capacity (5), and a pointer to the first<br>value in the second table. The second table contains the representation of the<br>string data on the heap, byte by byte.
 
-Рисунок 4-3: другой вариант того, что может сделать s2 = s1, если Rust также скопирует данные кучи
+Рисунок 4-3: другой исход того, что может сделать s2 = s1, если Ржавчина также воспроизведет данные кучи
 
-Ранее мы сказали, что когда переменная выходит за пределы области видимости, Rust автоматически вызывает функцию `drop` и очищает память в куче для данной переменной. Но на рис. 4.2 оба указателя данных указывают на одно и то же место. Это проблема: когда переменные `s2` и `s1` выходят из области видимости, они обе будут пытаться освободить одну и ту же память в куче. Это известно как *ошибка двойного освобождения (double free)* и является одной из ошибок безопасности памяти, упоминаемых ранее. Освобождение памяти дважды может привести к повреждению памяти, что потенциально может привести к уязвимостям безопасности.
+Ранее мы сказали, что когда переменная выходит за пределы области видимости, Ржавчина самостоятельно вызывает функцию `drop` и очищает память в куче для данной переменной. Но на рис. 4.2 оба указателя данных указывают на одно и то же место. Это неполадка: когда переменные `s2` и `s1` выходят из области видимости, они обе будут пытаться освободить одну и ту же память в куче. Это известно как *ошибка двойного освобождения (double free)* и является одной из ошибок безопасности памяти, упоминаемых ранее. Освобождение памяти дважды может привести к повреждению памяти, что возможно может привести к уязвимостям безопасности.
 
-Чтобы обеспечить безопасность памяти, после строки `let s2 = s1;` , Rust считает `s1` более недействительным. Следовательно, Rust не нужно ничего освобождать, когда `s1` выходит за пределы области видимости. Посмотрите, что происходит, когда вы пытаетесь использовать `s1` после создания `s2` ; это не сработает:
+Чтобы обеспечить безопасное управлению памятью, после строки `let s2 = s1;` , Ржавчина считает `s1` более недействительным. Следовательно, Ржавчине не нужно ничего освобождать, когда `s1` выходит за пределы области видимости. Посмотрите, что происходит, когда вы пытаетесь использовать `s1` после создания `s2` ; это не сработает:
+
+ 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs:here}}
 ```
 
-Вы получите похожую ошибку, потому что Rust не позволяет вам использовать недействительную ссылку:
+
+
+Вы получите похожую ошибку, потому что Ржавчина не позволяет вам использовать недействительную ссылку:
 
 ```console
 {{#include ../listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt}}
 ```
 
-Если вы слышали термины *поверхностное копирование* и *глубокое копирование* при работе с другими языками, концепция копирования указателя, длины и ёмкости без копирования данных, вероятно, звучит как создание поверхностной копии. Но поскольку Rust также аннулирует первую переменную, вместо того, чтобы называть это поверхностным копированием, это называется *перемещением*. В этом примере мы бы сказали, что `s1` был *перемещён* в `s2`. Итак, что на самом деле происходит, показано на рисунке 4-4.
+Если вы слышали понятия *поверхностное повторение* и *глубокое повторение* при работе с другими языками, подход повторения указателя, длины и ёмкости без повторения данных, вероятно, звучит как создание поверхностных повторов. Но поскольку Ржавчина также отменяет первую переменную, вместо того, чтобы называть это поверхностным повторением, это называется *перемещением*. В этом примере мы бы сказали, что `s1` был *перемещён* в `s2`. Итак, что на самом деле происходит, показано на рисунке 4-4.
 
-Три таблицы: таблицы s1 и s2, представляющие эти строки в стеке соответственно, и обе указывающие на одни и те же строковые данные в куче. Таблица s1 выделена серым цветом, потому что s1 больше недействительна; только s2 можно использовать для доступа к данным кучи.
+Три таблицы: таблицы s1 и s2, представляющие эти строки в обойме соответственно, и обе указывающие на одни и те же строковые данные в куче. Таблица s1 выделена серым цветом, потому что s1 больше недействительна; только s2 можно использовать для доступа к данным кучи.
 
 Рисунок 4-4: представление в памяти после того, как s1 был признан недействительным
 
-Это решает нашу проблему! Действительной остаётся только переменная `s2`. Когда она выходит из области видимости, то она одна будет освобождать память в куче.
+Это решает нашу неполадку! Действительной остаётся только переменная `s2`. Когда она выходит из области видимости, то она одна будет освобождать память в куче.
 
-Такой выбор дизайна языка даёт дополнительное преимущество: Rust никогда не будет автоматически создавать «глубокие» копии ваших данных. Следовательно любое такое *автоматическое* копирование можно считать недорогим с точки зрения производительности во время выполнения.
+Такой выбор внешнего вида языка даёт дополнительное преимущество: Ржавчина никогда не будет самостоятельно создавать «глубокие» повторы ваших данных. Следовательно любое такое *самостоятельное* повторение можно считать недорогим с точки зрения производительности во время выполнения.
 
 
 
 
 
-#### Взаимодействие переменных и данных с помощью клонирования
+#### Взаимодействие переменных и данных с помощью удваивания
 
-Если мы *хотим* глубоко скопировать данные кучи `String`, а не только данные стека, мы можем использовать общий метод, называемый `clone`. Мы обсудим синтаксис методов в главе 5, но поскольку методы являются общей чертой многих языков программирования, вы, вероятно, уже встречались с ними.
+Если мы *хотим* глубоко воспроизвести данные кучи `String`, а не только данные обоймы, мы можем использовать общий способ, называемый `clone`. Мы обсудим правила написания способов в главе 5, но поскольку способы являются общей чертой многих языков программирования, вы, вероятно, уже встречались с ними.
 
-Вот пример работы метода `clone`:
+Вот пример работы способа `clone`:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs:here}}
 ```
 
-Это отлично работает и очевидно приводит к поведению, представленному на рисунке 4-3, где данные кучи *были* скопированы.
+Это отлично работает и очевидно приводит к поведению, представленному на рисунке 4-3, где данные кучи *были* воспроизведены.
 
-Когда вы видите вызов `clone`, вы знаете о выполнении некоторого кода, который может быть дорогим. В то же время использование clone является визуальным индикатором того, что тут происходит что-то нестандартное.
+Когда вы видите вызов `clone`, вы знаете о выполнении некоторой рукописи, которая может быть дорогим. В то же время использование clone является внешним показателем того, что тут происходит что-то необычное.
 
-#### Стековые данные: копирование
+#### Данные из обоймы: повторение
 
-Это ещё одна особенность о которой мы ранее не говорили. Этот код, часть которого была показа ранее в листинге 4-2, использует целые числа. Он работает без ошибок:
+Способ о которой мы ранее не говорили. Эта рукопись, часть которой была показа ранее в приложении 4-2, использует целые числа. Она работает без ошибок:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs:here}}
 ```
 
-Но этот код, кажется, противоречит тому, что мы только что узнали: у нас нет вызова `clone`, но `x` всё ещё действителен и не был перемещён в `y`.
+Но эта рукопись, кажется, противоречит тому, что мы только что узнали: у нас нет вызова `clone`, но `x` всё ещё действительна и не была перемещена в `y`.
 
-Причина в том, что такие типы, как целые числа, размер которых известен во время компиляции, полностью хранятся в стеке, поэтому копии фактических значений создаются быстро. Это означает, что нет причин, по которым мы хотели бы предотвратить доступность `x` после того, как создадим переменную `y`. Другими словами, здесь нет разницы между глубоким и поверхностным копированием, поэтому вызов `clone` ничем не отличается от обычного поверхностного копирования, и мы можем его опустить.
+Причина в том, что такие виды данных, как целые числа, размер которых известен во время сборки, полностью хранятся в обойме, поэтому повторы действительных значений создаются быстро. Это означает, что нет причин, по которым мы хотели бы предотвратить доступность `x` после того, как создадим переменную `y`. Другими словами, здесь нет разницы между глубоким и поверхностным повторением, поэтому вызов `clone` ничем не отличается от обычного поверхностного повторения, и мы можем его опустить.
 
-В Rust есть специальная аннотация, называемая типажом `Copy`, которую мы можем размещать на типах, хранящихся в стеке, как и целые числа (подробнее о типах мы поговорим в [главе 10]). Если тип реализует типаж `Copy`, переменные, которые его используют, не перемещаются, а тривиально копируются, что делает их действительными после присвоения другой переменной.
+В Ржавчине есть особое изложение, называемое сущностью `Copy`, которую мы можем размещать в видах данных, хранящихся в обойме, как и целые числа (подробнее о видах данных мы поговорим в [главе 10]). Если вид данных использует сущность `Copy`, переменные, которые его используют, не перемещаются, а обыкновенно повторяются, что делает их действительными после присвоения другой переменной.
 
-Rust не позволит нам аннотировать тип с помощью `Copy`, если тип или любая из его частей реализует `Drop`. Если для типа нужно, чтобы произошло что-то особенное, когда значение выходит за пределы области видимости, и мы добавляем аннотацию `Copy` к этому типу, мы получим ошибку времени компиляции. Чтобы узнать, как добавить аннотацию `Copy` к вашему типу для реализации типажа, смотрите [раздел «Производные типажи»] в приложении С.
+Ржавчина не позволит нам определять вид данных с помощью `Copy`, если вид данных или любая из его частей использует `Drop`. Если для вида данных нужно, чтобы произошло что-то особенное, когда значение выходит за пределы области видимости, и мы добавляем изложение `Copy` к этому виду данных, мы получим ошибку времени сборки. Чтобы узнать, как добавить изложение `Copy` к вашему виду для использования сущности, смотрите [раздел «Производные сущности»] в приложении С.
 
-Но какие же типы реализуют трейт `Copy`? Можно проверить документацию любого типа для уверенности, но как правило любая группа простых скалярных значений может быть реализовывать `Copy`, и никакие типы, которые требуют выделения памяти в куче или являются некоторой формой ресурсов, не реализуют трейта `Copy`. Вот некоторые типы, которые реализуют `Copy`:
+Но какие же виды данных используют сущность `Copy`? Можно проверить пособие для любого вида данных для уверенности, но как правило любое объединение простых одиночных значений может быть использовать `Copy`, и никакие виды данных, которые требуют выделения памяти в куче или являются некоторым видом данных памяти, не используют сущности `Copy`. Вот некоторые виды данных, которые используют `Copy`:
 
-- Все целочисленные типы, такие как `u32`,
-- Логический тип данных `bool`, возможные значения которого `true` и `false`,
-- Все типы с плавающей запятой, такие как `f64`.
-- Символьный тип `char`,
-- Кортежи, но только если они содержат типы, которые также реализуют `Copy`. Например, `(i32, i32)` будет с `Copy`, но кортеж `(i32, String)` уже нет.
+- Все целочисленные виды данных, такие как `u32`,
+- Разумный вид данных `bool`, возможные значения которого `true` и `false`,
+- Все виды данных с плавающей запятой, такие как `f64`.
+- Знаковый вид данных `char`,
+- Упорядоченные ряды, но только если они содержат виды данных, которые также используют `Copy`. Например, `(i32, i32)` будет с `Copy`, но упорядоченный ряд `(i32, String)` уже нет.
 
 ### Владение и функции
 
-Механика передачи значения функции аналогична тому, что происходит при присвоении значения переменной. Передача переменной в функцию приведёт к перемещению или копированию, как и присваивание. В листинге 4-3 есть пример с некоторыми аннотациями, показывающими, где переменные входят в область видимости и выходят из неё.
+Устройство передачи значения функции подобно тому, что происходит при присвоении значения переменной. Передача переменной в функцию приведёт к перемещению или воспроизведению, как и присваивание. В приложении 4-3 есть пример с некоторыми изложениями, показывающими, где переменные входят в область видимости и выходят из неё.
 
 Файл: src/main.rs
 
@@ -222,13 +226,13 @@ Rust не позволит нам аннотировать тип с помощ
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-03/src/main.rs}}
 ```
 
-Листинг 4-3. Функции с аннотированными владельцами и областью действия
+Приложение 4-3. Функции с определенными владельцами и областью действия
 
-Если попытаться использовать `s` после вызова `takes_ownership`, Rust выдаст ошибку времени компиляции. Такие статические проверки защищают от ошибок. Попробуйте добавить код в `main`, который использует переменную `s` и `x`, чтобы увидеть где их можно использовать и где правила владения предотвращают их использование.
+Если попытаться использовать `s` после вызова `takes_ownership`, Ржавчина выдаст ошибку времени сборки. Такие постоянные проверки защищают от ошибок. Попробуйте добавить рукопись в `main`, которая использует переменную `s` и `x`, чтобы увидеть где их можно использовать и где правила владения предотвращают их использование.
 
 ### Возвращение значений и область видимости
 
-Возвращаемые значения также могут передавать право владения. В листинге 4-4 показан пример функции, возвращающей некоторое значение, с такими же аннотациями, как в листинге 4-3.
+Возвращаемые значения также могут передавать право владения. В приложении 4-4 показан пример функции, возвращающей некоторое значение, с такими же изложениями, как в приложении 4-3.
 
 Файл: src/main.rs
 
@@ -236,13 +240,13 @@ Rust не позволит нам аннотировать тип с помощ
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-04/src/main.rs}}
 ```
 
-Листинг 4-4: передача права владения на возвращаемые значения
+Приложение 4-4: Передача права владения на возвращаемые значения
 
-Владение переменной каждый раз следует одному и тому же шаблону: присваивание значения другой переменной перемещает его. Когда переменная, содержащая данные в куче, выходит из области видимости, содержимое в куче будет очищено функцией `drop`, если только данные не были перемещены во владение другой переменной.
+Владение переменной каждый раз следует одному и тому же образцу данных: присваивание значения другой переменной перемещает его. Когда переменная, содержащая данные в куче, выходит из области видимости, содержимое в куче будет очищено функцией `drop`, если только данные не были перемещены во владение другой переменной.
 
 Хотя это работает, получение права владения, а затем возвращение владения каждой функцией немного утомительно. Что, если мы хотим, чтобы функция использовала значение, но не становилась владельцем? Очень раздражает, что всё, что мы передаём, также должно быть передано обратно, если мы хотим использовать это снова, в дополнение к любым данным, полученным из тела функции, которые мы также можем захотеть вернуть.
 
-Rust позволяет нам возвращать несколько значений с помощью кортежа, как показано в листинге 4-5.
+Ржавчина позволяет нам возвращать несколько значений с помощью упорядоченного ряда, как показано в приложении 4-5.
 
 Файл: src/main.rs
 
@@ -250,15 +254,15 @@ Rust позволяет нам возвращать несколько знач
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-05/src/main.rs}}
 ```
 
-Листинг 4-5: возврат права владения на параметры
+Приложение 4-5: Возврат права владения на свойства
 
-Но это слишком высокопарно и многословно для концепции, которая должна быть общей. К счастью для нас, в Rust есть возможность использовать значение без передачи права владения, называемая *ссылками*.
+Но это слишком высокопарно и многословно для подходов, которые должны быть общими. К счастью для нас, в Ржавчине есть возможность использовать значение без передачи права владения, называемое *ссылками*.
 
 
-["Типы данных"]: ch03-02-data-types.html#data-types
+["Виды данных"]: ch03-02-data-types.html#data-types
 [главе 8]: ch08-02-strings.html
 [главе 10]: ch10-02-traits.html
-[раздел «Производные типажи»]: appendix-03-derivable-traits.html
-[«Синтаксис метода»]: ch05-03-method-syntax.html#method-syntax
-[ «Пути для обращения к элементу в дереве модулей»]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
+[раздел «Производные сущности»]: appendix-03-derivable-traits.html
+[«Правила написания способов»]: ch05-03-method-syntax.html#method-syntax
+[ «Пути для обращения к переменной в дереве разделов»]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
 [`drop`]: ../std/ops/trait.Drop.html#tymethod.drop
\ No newline at end of file
diff --git a/rustbook-ru/src/ch04-02-references-and-borrowing.md b/rustbook-ru/src/ch04-02-references-and-borrowing.md
index f8d0803a2..d19c00c51 100644
--- a/rustbook-ru/src/ch04-02-references-and-borrowing.md
+++ b/rustbook-ru/src/ch04-02-references-and-borrowing.md
@@ -1,8 +1,8 @@
 ## Ссылки и заимствование
 
-Проблема с кодом кортежа в листинге 4-5 заключается в том, что мы должны вернуть `String` из вызванной функции, чтобы использовать `String` после вызова `calculate_length`, потому что `String` была перемещена в `calculate_length`. Вместо этого мы можем предоставить ссылку на значение `String`. *Ссылка* похожа на указатель в том смысле, что это адрес, по которому мы можем проследовать, чтобы получить доступ к данным, хранящимся по этому адресу; эти данные принадлежат какой-то другой переменной. В отличие от указателя, ссылка гарантированно указывает на допустимое значение определённого типа в течение всего срока существования этой ссылки.
+Неполадка с рукописью упорядоченного ряда в приложении 4-5 заключается в том, что мы должны вернуть `String` из вызванной функции, чтобы использовать `String` после вызова `calculate_length`, потому что `String` была перемещена в `calculate_length`. Вместо этого мы можем предоставить ссылку на значение переменной `String`. *Ссылка* похожа на указатель в том смысле, что это адрес, по которому мы можем проследовать, чтобы получить доступ к данным, хранящимся по этому адресу; эти данные принадлежат какой-то другой переменной. В отличие от указателя, ссылка обязательно указывает на допустимое значение переменной определённого вида данных в течение всего срока существования этой ссылки.
 
-Вот как вы могли бы определить и использовать функцию `calculate_length`, имеющую ссылку на объект в качестве параметра, вместо того, чтобы брать на себя ответственность за значение:
+Вот как вы могли бы определить и использовать функцию `calculate_length`, имеющую ссылку на предмет в качестве свойства, вместо того, чтобы брать на себя ответственность за значение переменной:
 
 Файл: src/main.rs
 
@@ -10,33 +10,33 @@
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs:all}}
 ```
 
-Во-первых, обратите внимание, что весь код кортежа в объявлении переменной и возвращаемое значение функции исчезли. Во-вторых, обратите внимание, что мы передаём `&s1` в `calculate_length` и в его определении используем `&String`, а не `String`. Эти амперсанды представляют собой *ссылки*, и они позволяют вам ссылаться на некоторое значение, не принимая владение над ним. Рисунок 4-5 изображает эту концепцию.
+Во-первых, обратите внимание, что вся рукопись упорядоченного ряда в объявлении переменной и возвращаемое значение функции исчезли. Во-вторых, обратите внимание, что мы передаём `&s1` в `calculate_length` и в его определении используем `&String`, а не `String`. Эти знаки представляют собой *ссылки*, и они позволяют вам ссылаться на некоторое значение переменной, не принимая владение над ним. Рисунок 4-5 изображает этот подход.
 
 &String s pointing at String s1
 
-Рисунок 4-5: диаграмма для &String s, указывающей на String s1
+Рисунок 4-5: рисунок для &String s, указывающей на String s1
 
-> Примечание: противоположностью ссылки с использованием `&` является *разыменование*, выполняемое с помощью оператора разыменования `*`. Мы увидим некоторые варианты использования оператора разыменования в главе 8 и обсудим детали разыменования в главе 15.
+> Примечание: противоположностью ссылки с использованием `&` является *разыменование*, выполняемое с помощью приказчика разыменования `*`. Мы увидим некоторые исходы использования приказчика разыменования в главе 8 и обсудим подробности разыменования в главе 15.
 
-Давайте подробнее рассмотрим механизм вызова функции:
+Давайте подробнее рассмотрим рычаг вызова функции:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs:here}}
 ```
 
-`&s1` позволяет нам создать ссылку, которая *ссылается* на значение `s1`, но не владеет им. Поскольку она не владеет им, значение, на которое она указывает, не будет удалено, когда ссылка перестанет использоваться.
+`&s1` позволяет нам создать ссылку, которая *ссылается* на значение переменной `s1`, но не владеет им. Поскольку она не владеет им, значением переменной, на которое она указывает, не будет удалено, когда ссылка перестанет использоваться.
 
-Сигнатура функции использует `&` для индикации того, что тип параметра `s` является ссылкой. Добавим объясняющие комментарии:
+Ярлык функции использует `&` для отображения того, что вид свойства `s` является ссылкой. Добавим объясняющие примечания:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs:here}}
 ```
 
-Область действия `s` такая же, как и область действия любого параметра функции, но значение, на которое указывает ссылка, не удаляется, когда `s` перестаёт использоваться, потому что `s` не является его владельцем. Когда функции имеют ссылки в качестве параметров вместо фактических значений, нам не нужно возвращать значения, чтобы вернуть право владения, потому что мы никогда не владели ими.
+Область действия `s` такая же, как и область действия любого свойства функции, но значение переменной, на которое указывает ссылка, не удаляется, когда `s` перестаёт использоваться, потому что `s` не является её владельцем. Когда функции имеют ссылки в качестве свойств вместо действительных значений, нам не нужно возвращать значения, чтобы вернуть право владения, потому что мы никогда не владели ими.
 
-Мы называем процесс создания ссылки *заимствованием*. Как и в реальной жизни, если человек чем-то владеет, вы можете это у него позаимствовать. Когда вы закончите, вы должны вернуть это законному владельцу.
+Мы называем этап создания ссылки *заимствованием*. Как и в существующей жизни, если человек чем-то владеет, вы можете это у него позаимствовать. Когда вы закончите, вы должны вернуть это законному владельцу.
 
-А что произойдёт, если попытаться изменить то, что было позаимствовано? Попробуйте код листинга 4-6 Спойлер: этот код не сработает!
+А что произойдёт, если попытаться изменить то, что было позаимствовано? Попробуйте рукопись приложения 4-6 К сведению: эта рукопись не сработает!
 
 Файл: src/main.rs
 
@@ -44,7 +44,7 @@
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-06/src/main.rs}}
 ```
 
-Листинг 4-6: попытка модификации заимствованной переменной
+Приложение 4-6: попытка изменения заимствованной переменной
 
 Вот ошибка:
 
@@ -56,7 +56,7 @@
 
 ### Изменяемые ссылки
 
-Мы можем исправить код из листинга 4-6, чтобы позволить себе изменять заимствованное значение, с помощью нескольких небольших настроек, которые используют *изменяемую ссылку*:
+Мы можем исправить рукопись из приложения 4-6, чтобы позволить себе изменять заимствованное значение переменной, с помощью нескольких небольших настроек, которые используют *изменяемую ссылку*:
 
 Файл: src/main.rs
 
@@ -64,9 +64,9 @@
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs}}
 ```
 
-Сначала мы меняем `s` на `mut`. Затем мы создаём изменяемую ссылку с помощью `&mut s`, у которой вызываем `change` и обновляем сигнатуру функции, чтобы принять изменяемую ссылку с помощью `some_string: &mut String`. Это даёт понять, что `change` изменит значение, которое заимствует.
+Сначала мы меняем `s` на `mut`. Затем мы создаём изменяемую ссылку с помощью `&mut s`, у которой вызываем `change` и обновляем ярлык функции, чтобы принять изменяемую ссылку с помощью `some_string: &mut String`. Это даёт понять, что `change` изменит значение переменной, которое заимствует.
 
-Изменяемые ссылки имеют одно большое ограничение: если у вас есть изменяемая ссылка на значение, у вас не может быть других ссылок на это же значение. Код, который пытается создать две изменяемые ссылки на `s`, завершится ошибкой:
+Изменяемые ссылки имеют одно большое ограничение: если у вас есть изменяемая ссылка на значение переменной, у вас не может быть других ссылок на это же значение переменной. Рукопись, которая пытается создать две изменяемые ссылки на `s`, завершится ошибкой:
 
 Файл: src/main.rs
 
@@ -80,23 +80,23 @@
 {{#include ../listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt}}
 ```
 
-Эта ошибка говорит о том, что код недействителен, потому что мы не можем заимствовать `s` как изменяемые более одного раза в один момент. Первое изменяемое заимствование находится в `r1` и должно длиться до тех пор, пока оно не будет использовано в `println!`, но между созданием этой изменяемой ссылки и её использованием мы попытались создать другую изменяемую ссылку в `r2`, которая заимствует те же данные, что и `r1`.
+Эта ошибка говорит о том, что рукопись недействительна, потому что мы не можем заимствовать `s` как изменяемую ссылки более одного раза в одно мгновение времени. Первое изменяемое заимствование находится в `r1` и должно длиться до тех пор, пока оно не будет использовано в `println!`, но между созданием этой изменяемой ссылки и её использованием мы попытались создать другую изменяемую ссылку в `r2`, которая заимствует те же данные, что и `r1`.
 
-Ограничение, предотвращающее одновременное использование нескольких изменяемых ссылок на одни и те же данные, допускает изменение, но очень контролируемым образом. Это то, с чем борются новые Rustaceans, потому что большинство языков позволяют изменять значение в любой момент. Преимущество этого ограничения заключается в том, что Rust может предотвратить гонку данных во время компиляции. *Гонка данных* похожа на состояние гонки и происходит, когда возникают следующие три сценария:
+Ограничение, предотвращающее одновременное использование нескольких изменяемых ссылок на одни и те же данные, допускает изменение, но очень сложным управлением. Это то, с чем борются новые Rustaceans, потому что большинство языков позволяют изменять значение переменной в любое мгновение. Преимущество этого ограничения заключается в том, что Ржавчина может предотвратить гонку данных во время сборки. *Гонка данных* похожа на состояние гонки и происходит, когда возникают следующие три обстоятельства:
 
 - Два или больше указателей используют одни и те же данные в одно и то же время,
-- Минимум один указатель используется для записи данных,
-- Отсутствуют механизмы для синхронизации доступа к данным.
+- Самое наименьшее один указатель используется для записи данных,
+- Отсутствуют рычаги для согласования доступа к данным.
 
-Гонки данных вызывают неопределённое поведение, и их может быть сложно диагностировать и исправить, когда вы пытаетесь отследить их во время выполнения. Rust предотвращает такую проблему, отказываясь компилировать код с гонками данных!
+Гонки данных вызывают неопределённое поведение, и их может быть сложно выявить и исправить, когда вы пытаетесь отследить их во время выполнения. Ржавчина предотвращает такую неполадку, отказываясь собирать рукопись с гонками данных!
 
-Как всегда, мы можем использовать фигурные скобки для создания новой области видимости, позволяющей использовать несколько изменяемых ссылок, но не *одновременно*:
+Как всегда, мы можем использовать узорчатые скобки для создания новой области видимости, позволяющей использовать несколько изменяемых ссылок, но не *одновременно*:
 
 ```rust
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs:here}}
 ```
 
-Rust применяет аналогичное правило для комбинирования изменяемых и неизменяемых ссылок. Этот код приводит к ошибке:
+Ржавчина применяет подобное правило для согласования изменяемых и неизменяемых ссылок. Эта рукопись приводит к ошибке:
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs:here}}
@@ -108,25 +108,25 @@ Rust применяет аналогичное правило для комби
 {{#include ../listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt}}
 ```
 
-Вау! У нас *также* не может быть изменяемой ссылки, пока у нас есть неизменяемая ссылка на то же значение.
+Вау! У нас *также* не может быть изменяемой ссылки, пока у нас есть неизменяемая ссылка на то же значение переменной.
 
-Пользователи неизменяемой ссылки не ожидают, что значение внезапно изменится из-под них! Однако разрешены множественные неизменяемые ссылки, потому что никто, кто просто читает данные, не может повлиять на чтение данных кем-либо ещё.
+Пользователи неизменяемой ссылки не ожидают, что значение переменной внезапно изменится из-под них! Однако разрешены множественные неизменяемые ссылки, потому что никто, кто просто считывает данные, не может повлиять на чтение данных кем-либо ещё.
 
-Обратите внимание, что область действия ссылки начинается с того места, где она была введена, и продолжается до последнего использования этой ссылки. Например, этот код будет компилироваться, потому что последнее использование неизменяемых ссылок `println!`, происходит до того, как вводится изменяемая ссылка:
+Обратите внимание, что область действия ссылки начинается с того места, где она была введена, и продолжается до последнего использования этой ссылки. Например, эта рукопись будет собираться, потому что последнее использование неизменяемых ссылок `println!`, происходит до того, как вводится изменяемая ссылка:
 
 ```rust,edition2021
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs:here}}
 ```
 
-Области неизменяемых ссылок `r1` и `r2` заканчиваются после `println!` где они использовались в последний раз, то есть до создания изменяемой ссылки `r3`. Эти области не перекрываются, поэтому этот код разрешён: компилятор может сказать, что ссылка больше не используется в точке перед концом области.
+Области неизменяемых ссылок `r1` и `r2` заканчиваются после `println!` где они использовались в последний раз, то есть до создания изменяемой ссылки `r3`. Эти области не перекрываются, поэтому эта рукопись разрешена: сборщик может сказать, что ссылка больше не используется в точке перед концом области.
 
-Несмотря на то, что ошибки заимствования могут иногда вызывать разочарование, помните, что компилятор Rust заранее указывает на потенциальную ошибку (во время компиляции, а не во время выполнения) и точно показывает, в чем проблема. Тогда вам не придётся выяснять, почему ваши данные оказались не такими, как вы ожидали.
+Несмотря на то, что ошибки заимствования могут иногда вызывать разочарование, помните, что сборщик Ржавчины заранее указывает на вероятную ошибку (во время сборки, а не во время выполнения) и точно показывает, в чем неполадка. Тогда вам не придётся выяснять, почему ваши данные оказались не такими, как вы ожидали.
 
 ### Висячие ссылки
 
-В языках с указателями весьма легко ошибочно создать недействительную (висячую) *(dangling)* ссылку. Ссылку указывающую на участок памяти, который мог быть передан кому-то другому, путём освобождения некоторой памяти при сохранении указателя на эту память. Rust компилятор гарантирует, что ссылки никогда не станут недействительными: если у вас есть ссылка на какие-то данные, компилятор обеспечит что эти данные не выйдут из области видимости прежде, чем из области видимости исчезнет ссылка.
+В языках с указателями весьма легко ошибочно создать недействительную (висячую) *(dangling)* ссылку. Ссылку указывающую на участок памяти, который мог быть передан кому-то другому, путём освобождения некоторой памяти при сохранении указателя на эту память. В Ржавчине сборщик заверяет, что ссылки никогда не станут недействительными: если у вас есть ссылка на какие-то данные, сборщик обеспечит что эти данные не выйдут из области видимости прежде, чем из области видимости исчезнет ссылка.
 
-Давайте попробуем создать висячую ссылку, чтобы увидеть, как Rust предотвращает их появление с помощью ошибки во время компиляции:
+Давайте попробуем создать висячую ссылку, чтобы увидеть, как Ржавчина предотвращает их появление с помощью ошибки во время сборки:
 
 Файл: src/main.rs
 
@@ -140,14 +140,14 @@ Rust применяет аналогичное правило для комби
 {{#include ../listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt}}
 ```
 
-Это сообщение об ошибке относится к особенности языка, которую мы ещё не рассмотрели: времени жизни. Мы подробно обсудим времена жизни в главе 10. Но если вы не обращаете внимания на части, касающиеся времени жизни, сообщение будет содержать ключ к тому, почему этот код является проблемой:
+Это сообщение об ошибке относится к особенностям языка, которуе мы ещё не рассмотрели: время жизни. Мы подробно обсудим времена жизни в главе 10. Но если вы не обращаете внимания на особенности, касающиеся времени жизни, сообщение будет содержать ключ к тому, почему эта рукопись является неверной:
 
 ```text
 this function's return type contains a borrowed value, but there is no value
 for it to be borrowed from
 ```
 
-Давайте подробнее рассмотрим, что именно происходит на каждом этапе нашего кода `dangle`:
+Давайте подробнее рассмотрим, что именно происходит на каждом этапе нашей рукописи `dangle`:
 
 Файл: src/main.rs
 
@@ -155,7 +155,7 @@ for it to be borrowed from
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs:here}}
 ```
 
-Поскольку `s` создаётся внутри `dangle`, когда код `dangle` будет завершён, `s` будет освобождена. Но мы попытались вернуть ссылку на неё. Это означает, что эта ссылка будет указывать на недопустимую `String`. Это нехорошо! Rust не позволит нам сделать это.
+Поскольку `s` создаётся внутри `dangle`, когда рукопись `dangle` будет завершена, `s` будет освобождена. Но мы попытались вернуть ссылку на неё. Это означает, что эта ссылка будет указывать на недопустимую `String`. Это нехорошо! Ржавчина не позволит нам сделать это.
 
 Решением будет вернуть непосредственно `String`:
 
@@ -163,15 +163,15 @@ for it to be borrowed from
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs:here}}
 ```
 
-Это работает без проблем. Владение перемещено, и ничего не освобождено.
+Это работает без неполадок. Владение перемещено, и ничего не освобождено.
 
 ### Правила работы с ссылками
 
 Давайте повторим  все, что мы обсудили про ссылки:
 
-- В любой момент времени у вас может быть *одна* (но не обе) изменяемая ссылка или любое количество неизменяемых ссылок.
+- В любое мгновение времени у вас может быть *одна* (но не обе) изменяемая ссылка или любое количество неизменяемых ссылок.
 - Все ссылки должны быть действительными.
 
-В следующей главе мы рассмотрим другой тип ссылок — срезы.
+В следующей главе мы рассмотрим другой подвид ссылок — срезы.
 
 
diff --git a/rustbook-ru/src/ch04-03-slices.md b/rustbook-ru/src/ch04-03-slices.md
index 2e6b714e1..df04d87ee 100644
--- a/rustbook-ru/src/ch04-03-slices.md
+++ b/rustbook-ru/src/ch04-03-slices.md
@@ -1,16 +1,16 @@
-## Тип срезы
+## Вид данных - Cрезы
 
-*Срезы* позволяют ссылаться на непрерывную последовательность элементов в коллекции, а не на всю коллекцию. Срез является своего рода ссылкой, поэтому он не имеет права владения.
+*Срезы* позволяют ссылаться на непрерывную последовательность переменных в собрании, а не на всё собрание. Срез является своего рода ссылкой, поэтому он не имеет права владения.
 
-Вот небольшая проблема программирования: напишите функцию, которая принимает строку слов, разделённых пробелами, и возвращает первое слово, которое она находит в этой строке. Если функция не находит пробела в строке, вся строка должна состоять из одного слова, поэтому должна быть возвращена вся строка.
+Вот небольшая неполадка программирования: напишите функцию, которая принимает строку слов, разделённых пробелами, и возвращает первое слово, которое она находит в этой строке. Если функция не находит пробела в строке, вся строка должна состоять из одного слова, поэтому должна быть возвращена вся строка.
 
-Давайте рассмотрим, как бы мы написали сигнатуру этой функции без использования срезов, чтобы понять проблему, которую решат срезы:
+Давайте рассмотрим, как бы мы написали ярлык этой функции без использования срезов, чтобы понять неполадку, которую решат срезы:
 
 ```rust,ignore
 fn first_word(s: &String) -> ?
 ```
 
-Функция `first_word` имеет `&String` в качестве параметра. Мы не хотим владения, так что всё в порядке. Но что мы должны вернуть? На самом деле у нас нет способа говорить о *части* строки. Однако мы могли бы вернуть индекс конца слова, обозначенного пробелом. Давайте попробуем, как показано в Листинге 4-7.
+Функция `first_word` имеет `&String` в качестве свойства. Мы не хотим владения, так что всё в порядке. Но что мы должны вернуть? На самом деле у нас нет способа говорить о *части* строки. Однако мы могли бы вернуть порядковый указатель конца слова, обозначенного пробелом. Давайте попробуем, как показано в Приложении 4-7.
 
 Файл: src/main.rs
 
@@ -18,31 +18,31 @@ fn first_word(s: &String) -> ?
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-07/src/main.rs:here}}
 ```
 
-Листинг 4-7. Функция first_word, возвращающая значение индекса байта в параметр String
+Приложение 4-7: Функция first_word, возвращающая значение порядкового указателя байта в свойство String
 
-Поскольку нам нужно просмотреть `String` поэлементно и проверить, является ли значение пробелом, мы преобразуем нашу `String` в массив байтов с помощью метода `as_bytes`.
+Поскольку нам нужно просмотреть в `String` каждый знак и проверить, является ли значение пробелом, мы преобразуем нашу `String` в массив байтов с помощью способа `as_bytes`.
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-07/src/main.rs:as_bytes}}
 ```
 
-Далее, мы создаём итератор по массиву байт используя метод `iter`:
+Далее, мы создаём повторитель  по массиву байт используя способ `iter`:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-07/src/main.rs:iter}}
 ```
 
-Мы обсудим итераторы более подробно в [Главе 13]. На данный момент знайте, что `iter` — это метод, который возвращает каждый элемент в коллекции, а `enumerate` оборачивает результат `iter` и вместо этого возвращает каждый элемент как часть кортежа. Первый элемент кортежа, возвращаемый из `enumerate`, является индексом, а второй элемент — ссылкой на элемент. Это немного удобнее, чем вычислять индекс самостоятельно.
+Мы обсудим повторители более подробно в [Главе 13]. На данное мгновение знайте, что `iter` — это способ, который возвращает каждая переменная в собрании, а `enumerate` оборачивает итог `iter` и вместо этого возвращает каждая переменная как часть упорядоченного ряда. Первая переменная упорядоченного ряда, возвращаемый из `enumerate`, является порядковым указателем, а вторая переменная — ссылкой на переменную. Это немного удобнее, чем вычислять порядковый указатель самостоятельно.
 
-Поскольку метод `enumerate` возвращает кортеж, мы можем использовать шаблоны для деструктурирования этого кортежа. Мы подробнее обсудим шаблоны в [Главе 6.]. В цикле `for` мы указываем шаблон, имеющий `i` для индекса в кортеже и `&item` для одного байта в кортеже. Поскольку мы получаем ссылку на элемент из `.iter().enumerate()`, мы используем `&` в шаблоне.
+Поскольку способ `enumerate` возвращает упорядоченный ряд, мы можем использовать образцы для разъединения этого упорядоченного ряда. Мы подробнее обсудим образцы в [Главе 6]. В круговороте `for` мы указываем образец, имеющий `i` для порядкового указателя в упорядоченном ряде и `&item` для одного байта в упорядоченном ряде. Поскольку мы получаем ссылку на переменную из `.iter().enumerate()`, мы используем `&` в образце.
 
-Внутри цикла `for` мы ищем байт, представляющий пробел, используя синтаксис байтового литерала. Если мы находим пробел, мы возвращаем позицию. В противном случае мы возвращаем длину строки с помощью `s.len()`.
+Внутри круговорота `for` мы ищем байт, представляющий пробел, используя правила написания байтовой записи. Если мы находим пробел, мы возвращаем положение. В противном случае мы возвращаем длину строки с помощью `s.len()`.
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-07/src/main.rs:inside_for}}
 ```
 
-Теперь у нас есть способ узнать индекс байта указывающего на конец первого слова в строке, но есть проблема. Мы возвращаем сам `usize`, но это число имеет значение только в контексте `&String`. Другими словами, поскольку это значение отдельное от `String`, то нет гарантии, что оно все ещё будет действительным в будущем. Рассмотрим программу из листинга 4-8, которая использует функцию `first_word` листинга 4-7.
+Теперь у нас есть способ узнать порядковый указатель байта указывающего на конец первого слова в строке, но есть неполадка. Мы возвращаем сам `usize`, но это число имеет значение только в среде `&String`. Другими словами, поскольку это значение отдельное от `String`, то нет заверения, что оно все ещё будет действительным в будущем. Рассмотрим программу из приложения 4-8, которая использует функцию `first_word` приложения 4-7.
 
 Файл: src/main.rs
 
@@ -50,19 +50,19 @@ fn first_word(s: &String) -> ?
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-08/src/main.rs:here}}
 ```
 
-Листинг 4-8. Сохранение результата вызова функции first_word и последующего изменения содержимого String
+Приложение 4-8: Сохранение итога вызова функции first_word и последующего изменения содержимого String
 
-Данная программа компилируется без ошибок и будет успешно работать, даже после того как мы воспользуемся переменной `word` после вызова `s.clear()`. Так как значение `word` совсем не связано с состоянием переменной `s`, то `word` сохраняет своё значение `5` без изменений. Мы бы могли воспользоваться значением `5` чтобы получить первое слово из переменной `s`, но это приведёт к ошибке, потому что содержимое `s` изменилось после того как мы сохранили `5` в переменной `word` (стало пустой строкой в вызове `s.clear()`).
+Данная программа собирается без ошибок и будет успешно работать, даже после того как мы воспользуемся переменной `word` после вызова `s.clear()`. Так как значение `word` совсем не связано с состоянием переменной `s`, то `word` сохраняет своё значение `5` без изменений. Мы бы могли воспользоваться значением `5` чтобы получить первое слово из переменной `s`, но это приведёт к ошибке, потому что содержимое `s` изменилось после того как мы сохранили `5` в переменной `word` (стало пустой строкой в вызове `s.clear()`).
 
-Необходимость беспокоиться о том, что индекс в переменной `word` не синхронизируется с данными в переменной  `s` является утомительной и подверженной ошибкам! Управление этими индексами становится ещё более хрупким, если мы напишем функцию `second_word`. Её сигнатура могла бы выглядеть так:
+Необходимость беспокоиться о том, что порядковый указатель в переменной `word` не согласуется с данными в переменной  `s` является утомительной и подверженной ошибкам! Управление этими порядковыми указателями становится ещё более хрупким, если мы напишем функцию `second_word`. Её ярлык мог бы выглядеть так:
 
 ```rust,ignore
 fn second_word(s: &String) -> (usize, usize) {
 ```
 
-Теперь мы отслеживаем начальный *и* конечный индекс, и у нас есть ещё больше значений, которые были рассчитаны на основе данных в определённом состоянии, но вообще не привязаны к этому состоянию. У нас есть три несвязанные переменные, которые необходимо синхронизировать.
+Теперь мы отслеживаем начальный *и* конечный порядковый указатель, и у нас есть ещё больше значений, которые были рассчитаны на основе данных в определённом состоянии, но вообще не привязаны к этому состоянию. У нас есть три несвязанные переменные, которые необходимо согласовать.
 
-К счастью в Rust есть решение данной проблемы: строковые срезы.
+К счастью в Ржавчине есть решение данных сбоев: строковые срезы.
 
 ### Строковые срезы
 
@@ -72,15 +72,15 @@ fn second_word(s: &String) -> (usize, usize) {
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs:here}}
 ```
 
-Вместо ссылки на всю `String` `hello` является ссылкой на часть `String`, указанную в дополнительном куске кода `[0..5]`. Мы создаём срезы, используя диапазон в квадратных скобках, указав `[starting_index..ending_index]`, где `starting_index` — это первая позиция, а`ending_index` конечный_индекс — это на единицу больше, чем последняя позиция в срезе. Внутри структура данных среза хранит начальную позицию и длину среза, что соответствует `ending_index` минус `starting_index`. Итак, в случае `let world = &s[6..11];`, `world` будет срезом, содержащим указатель на байт с индексом 6 `s` со значением длины `5`.
+Вместо ссылки на всю `String` `hello` является ссылкой на часть `String`, указанную в дополнительном куске рукописи `[0..5]`. Мы создаём срезы, используя ряд в квадратных скобках, указав `[starting_index..ending_index]`, где `starting_index` — это первое положение, а`ending_index` конечный_порядковый указатель— это на единицу больше, чем последнее положение в срезе. Внутри вида данных среза хранится: начальное положение и длина среза, что соответствует `ending_index` - `starting_index`. Итак, в случае `let world = &s[6..11];`, `world` будет срезом, содержащим указатель на байт с порядковым указателем 6 `s` со значением длины `5`.
 
-Рисунок 4-6 отображает это на диаграмме.
+Рисунок 4-6 отображает это на рисунке.
 
  world containing a pointer to the 6th byte of String s and a length 5
 
 Рисунок 4-6: Строковый срез ссылается на часть String
 
-С синтаксисом Rust `..`, если вы хотите начать с индекса 0, вы можете отбросить значение перед двумя точками. Другими словами, они равны:
+С правилами написания Ржавчины `..`, если вы хотите начать с порядкового указателя 0, вы можете отбросить значение перед двумя точками. Другими словами, они равнозначны:
 
 ```rust
 let s = String::from("hello");
@@ -89,7 +89,7 @@ let slice = &s[0..2];
 let slice = &s[..2];
 ```
 
-Таким же образом, если ваш срез включает последний байт `String`, вы можете отбросить конечный номер. Это означает, что они равны:
+Таким же образом, если ваш срез включает последний байт `String`, вы можете отбросить конечный номер. Это означает, что они равнозначны:
 
 ```rust
 let s = String::from("hello");
@@ -100,7 +100,7 @@ let slice = &s[3..len];
 let slice = &s[3..];
 ```
 
-Вы также можете отбросить оба значения, чтобы получить часть всей строки. Итак, они равны:
+Вы также можете отбросить оба значения, чтобы получить часть всей строки. Итак, они равнозначны:
 
 ```rust
 let s = String::from("hello");
@@ -111,10 +111,10 @@ let slice = &s[0..len];
 let slice = &s[..];
 ```
 
->  Примечание. Индексы диапазона срезов строк должны располагаться на допустимых границах символов UTF-8. Если вы попытаетесь создать фрагмент строки нарушая границы символа в котором больше одного байта, ваша программа завершится с ошибкой. В целях введения срезов строк мы предполагаем, что в этом разделе используется только ASCII; более подробное обсуждение обработки UTF-8 находится в разделе [«Сохранение закодированного текста UTF-8 со строками»]. раздел главы 8.
+>  Примечание. Порядковые указатели ряда срезов строк должны располагаться в допустимых границах знаков UTF-8. Если вы попытаетесь создать отрывок строки нарушая границы знака, в котором больше одного байта, ваша программа завершится с ошибкой. В целях введения срезов строк мы предполагаем, что в этом разделе используется только ASCII; более подробное обсуждение обработки UTF-8 находится в разделе [«Сохранение закодированного писания UTF-8 со строками»] раздел Главы 8.
 >
 
-Давайте используем полученную информацию и перепишем метод `first_word` так, чтобы он возвращал срез. Для обозначения типа "срез строки" существует запись `&str`:
+Давайте используем полученные сведения и перепишем способ `first_word` так, чтобы он возвращал срез. Для обозначения вида данных "срез строки" существует запись `&str`:
 
 Файл: src/main.rs
 
@@ -122,17 +122,17 @@ let slice = &s[..];
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs:here}}
 ```
 
-Мы получаем индекс конца слова так же, как в листинге 4.7, ища первое вхождение пробела. Когда мы находим пробел, мы возвращаем фрагмент строки, используя начало строки и индекс пробела в качестве начального и конечного индексов.
+Мы получаем порядковый указатель конца слова так же, как в приложении 4.7, ища первое вхождение пробела. Когда мы находим пробел, мы возвращаем отрывок строки, используя начало строки и порядковый указатель пробела в качестве начального и конечного порядковых указателей.
 
-Теперь, когда мы вызываем `first_word`, мы возвращаем одно значение, привязанное к базовым данным. Значение состоит из ссылки на начальную точку среза и количества элементов в срезе.
+Теперь, когда мы вызываем `first_word`, мы возвращаем одно значение, привязанное к основным данным. Значение состоит из ссылки на начальную точку среза и количества переменных в срезе.
 
-Аналогичным образом можно переписать и второй метод `second_word`:
+Подобным образом можно переписать и второй способ `second_word`:
 
 ```rust,ignore
 fn second_word(s: &String) -> &str {
 ```
 
-Теперь у нас есть простой API, который гораздо сложнее испортить, потому что компилятор гарантирует, что ссылки в `String` останутся действительными. Помните ошибку в программе в листинге 4-8, когда мы получили индекс до конца первого слова, но затем очистили строку, так что наш индекс стал недействительным? Этот код был логически неправильным, но не показывал немедленных ошибок. Проблемы проявятся позже, если мы попытаемся использовать индекс первого слова с пустой строкой. Срезы делают эту ошибку невозможной и сообщают нам о проблеме с нашим кодом гораздо раньше. Так, использование версии метода `first_word` со срезом вернёт ошибку компиляции:
+Теперь у нас есть простой API, который гораздо сложнее испортить, потому что сборщик заверяет, что ссылки в `String` останутся действительными. Помните ошибку в программе в приложении 4-8, когда мы получили порядковый указатель до конца первого слова, но затем очистили строку, так что наш порядковый указатель стал недействительным? Эта рукопись была разумно неправильной, но не показывала немедленных ошибок. Неполадки проявятся позже, если мы попытаемся использовать порядковый указатель первого слова с пустой строкой. Срезы делают эту ошибку невозможной и сообщают нам о неполадке с нашей рукописью гораздо раньше. Так, использование исполнения способа `first_word` со срезом вернёт ошибку сборки:
 
 Файл: src/main.rs
 
@@ -140,47 +140,47 @@ fn second_word(s: &String) -> &str {
 {{#rustdoc_include ../listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs:here}}
 ```
 
-Ошибка компиляции:
+Ошибка сборки:
 
 ```console
 {{#include ../listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt}}
 ```
 
-Напомним из правил заимствования, что если у нас есть неизменяемая ссылка на что-то, мы не можем также взять изменяемую ссылку. Поскольку для `clear` необходимо обрезать `String`, необходимо получить изменяемую ссылку. `println!` после вызова `clear` использует ссылку в `word`, поэтому неизменяемая ссылка в этот момент всё ещё должна быть активной. Rust запрещает одновременное существование изменяемой ссылки в формате `clear` и неизменяемой ссылки в `word`, и компиляция завершается ошибкой. Rust не только упростил использование нашего API, но и устранил целый класс ошибок во время компиляции!
+Напомним из правил заимствования, что если у нас есть неизменяемая ссылка на что-то, мы не можем также взять изменяемую ссылку. Поскольку для `clear` необходимо обрезать `String`, необходимо получить изменяемую ссылку. `println!` после вызова `clear` использует ссылку в `word`, поэтому неизменяемая ссылка в это мгновение всё ещё должна быть действительной. Ржавчина запрещает одновременное существование изменяемой ссылки в виде`clear` и неизменяемой ссылки в `word`, и сборка завершается ошибкой. Ржавчина не только упростил использование нашего API, но и устранил целое семейство ошибок во время сборки!
 
 
 
 
 
-#### Строковые литералы - это срезы
+#### Строковые записи - это срезы
 
-Напомним, что мы говорили о строковых литералах, хранящихся внутри бинарного файла. Теперь, когда мы знаем чем являются срезы, мы правильно понимаем что такое строковые литералы:
+Напомним, что мы говорили о строковых записях, хранящихся внутри двоичного файла. Теперь, когда мы знаем чем являются срезы, мы правильно понимаем что такое строковые записи:
 
 ```rust
 let s = "Hello, world!";
 ```
 
-Тип `s` здесь `&str`: это срез, указывающий на эту конкретную точку двоичного файла. Вот почему строковые литералы неизменяемы; `&str` — неизменяемая ссылка.
+Вид данных `s` здесь `&str`: это срез, указывающий на эту определенную точку двоичного файла. Вот почему строковые записи неизменяемы; `&str` — неизменяемая ссылка.
 
-#### Строковые срезы как параметры
+#### Строковые срезы как свойства
 
-Знание того, что вы можете брать срезы литералов и `String` значений, приводит нас к ещё одному улучшению `first_word`, и это его сигнатура:
+Знание того, что вы можете брать срезы записей и `String` значений, приводит нас к ещё одному улучшению `first_word`, и это его ярлык:
 
 ```rust,ignore
 fn first_word(s: &String) -> &str {
 ```
 
-Более опытный пользователь Rustacean вместо этого написал бы сигнатуру, показанную в листинге 4.9, потому что это позволяет нам использовать одну и ту же функцию как для значений `&String`, так и для значений `&str`.
+Более опытный пользователь Rustacean вместо этого написал бы ярлык, показанный в приложении 4.9, потому что это позволяет нам использовать одну и ту же функцию как для значений `&String`, так и для значений `&str`.
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch04-understanding-ownership/listing-04-09/src/main.rs:here}}
 ```
 
-Листинг 4-9: Улучшение функции first_word используя тип строкового среза для параметра s
+Приложение 4-9: Улучшение функции first_word используя вид данных строкового среза для свойства s
 
-Если у нас есть фрагмент строки, мы можем передать его напрямую. Если у нас есть `String`, мы можем передать часть `String` или ссылку на `String`. Эта гибкость использует преимущества *приведения deref*, функции, которую мы рассмотрим в [разделе «Неявное приведение Deref с функциями и методами».] раздел главы 15.
+Если у нас есть отрывок строки, мы можем передать его напрямую. Если у нас есть `String`, мы можем передать часть `String` или ссылку на `String`. Эта гибкость использует преимущества *приведения deref*, функции, которую мы рассмотрим в [разделе «Неявное приведение Deref с функциями и способами».] раздел Главы 15.
 
-Определение функции для получения фрагмента строки вместо ссылки на `String` делает наш API более общим и полезным без потери какой-либо функциональности:
+Определение функции для получения отрывка строки вместо ссылки на `String` делает наш API более общим и полезным без потери какой-либо возможности:
 
 Файл: src/main.rs
 
@@ -190,7 +190,7 @@ fn first_word(s: &String) -> &str {
 
 ### Другие срезы
 
-Срезы строк, как вы можете себе представить, специфичны для строк. Но есть и более общий тип среза. Рассмотрим этот массив:
+Срезы строк, как вы можете себе представить, отличительны для строк. Но есть и более общий вид среза. Рассмотрим этот массив:
 
 ```rust
 let a = [1, 2, 3, 4, 5];
@@ -206,16 +206,16 @@ let slice = &a[1..3];
 assert_eq!(slice, &[2, 3]);
 ```
 
-Этот срез имеет тип `&[i32]`. Он работает так же, как и срезы строк, сохраняя ссылку на первый элемент и его длину. Вы будете использовать этот вид фрагмента для всех видов других коллекций. Мы подробно обсудим эти коллекции, когда будем говорить о векторах в главе 8.
+Этот срез имеет вид данных `&[i32]`. Он работает так же, как и срезы строк, сохраняя ссылку на первая переменная и его длину. Вы будете использовать этот вид данных отрывка для всех видов данных других собраний. Мы подробно обсудим эти собрания, когда будем говорить о векторах в главе 8.
 
 ## Итоги
 
-Концепции владения, заимствования и срезов обеспечивают безопасность памяти в программах на Rust во время компиляции. Язык Rust даёт вам контроль над использованием памяти так же, как и другие языки системного программирования, но то, что владелец данных автоматически очищает эти данные, когда владелец выходит за рамки, означает, что вам не нужно писать и отлаживать дополнительный код, чтобы получить этот контроль.
+Подходы владения, заимствования и срезов обеспечивают безопасное управлению памятью в программах на Ржавчине во время сборки. Язык Ржавчина даёт вам управление над использованием памяти так же, как и другие языки системного программирования, но то, что владелец данных самостоятельно очищает эти данные, когда переменная выходит за рамки, означает, что вам не нужно писать и отлаживать дополнительную рукопись, чтобы получить это управление.
 
-Владение влияет на множество других частей и концепций языка Rust. Мы будем говорить об этих концепциях на протяжении оставшихся частей книги. Давайте перейдём к Главе 5 и рассмотрим группировку частей данных в структуры `struct`.
+Владение влияет на множество других частей и подходов языка Ржавчина. Мы будем говорить об этих подходах на протяжении оставшихся частей книги. Давайте перейдём к Главе 5 и рассмотрим объединение частей данных в стопки `struct`.
 
 
 [Главе 13]: ch13-02-iterators.html
-[Главе 6.]: ch06-02-match.html#patterns-that-bind-to-values
-[«Сохранение закодированного текста UTF-8 со строками»]: ch08-02-strings.html#storing-utf-8-encoded-text-with-strings
-[разделе «Неявное приведение Deref с функциями и методами».]: ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
\ No newline at end of file
+[Главе 6]: ch06-02-match.html#patterns-that-bind-to-values
+[«Сохранение закодированного писания UTF-8 со строками»]: ch08-02-strings.html#storing-utf-8-encoded-text-with-strings
+[разделе «Неявное приведение Deref с функциями и способами».]: ch15-02-deref.html#implicit-deref-coercions-with-functions-and-methods
\ No newline at end of file
diff --git a/rustbook-ru/src/ch05-00-structs.md b/rustbook-ru/src/ch05-00-structs.md
index 9da33488f..675d55e28 100644
--- a/rustbook-ru/src/ch05-00-structs.md
+++ b/rustbook-ru/src/ch05-00-structs.md
@@ -1,5 +1,5 @@
-# Использование структур для структурирования связанных данных
+# Использование стопок для внутреннего выстраивания связанных данных
 
-*Структура (struct)* — это пользовательский тип данных, позволяющий назвать и упаковать вместе несколько связанных значений, составляющих значимую логическую группу. Если вы знакомы с объектно-ориентированными языками, *структура* похожа на атрибуты данных объекта. В этой главе мы сравним и сопоставим кортежи со структурами, чтобы опираться на то, что вы уже знаете, и продемонстрируем, когда структуры являются лучшим способом группировки данных.
+*Стопки (struct)* — это пользовательский вид данных, позволяющий назвать и упаковать вместе несколько связанных значений, составляющих  объединение согласованных значений. Если вы знакомы с предметно-направленными языками, *стопки* похожи на свойства данных предмета. В этой главе мы сравним и сопоставим упорядоченные ряды со стопками, чтобы опираться на то, что вы уже знаете, и отобразим, когда стопки являются лучшим способом объединения данных.
 
-Мы продемонстрируем, как определять структуры и создавать их экземпляры. Мы обсудим, как определить ассоциированные функции, особенно ассоциированные функции, называемые *методами*, для указания поведения, ассоциированного с типом структуры. Структуры и перечисления (обсуждаемые в главе 6) являются строительными блоками для создания новых типов в предметной области вашей программы. Они дают возможность в полной мере воспользоваться преимуществами проверки типов во время компиляции Rust.
+Мы рассмотрим, как определять стопки и создавать их образцы. Мы обсудим, как определить сопряженные функции, особенно сопряженные функции, называемые *способами*, для указания поведения, сопряженного с видом данных стопка. Стопки и перечисления (обсуждаемые в главе 6) являются строительными разделами для создания новых видов данных в предметной области вашей программы. Они дают возможность в полной мере воспользоваться преимуществами проверки видов данных во время сборки Ржавчины.
diff --git a/rustbook-ru/src/ch05-01-defining-structs.md b/rustbook-ru/src/ch05-01-defining-structs.md
index 315c38ffd..0133cdceb 100644
--- a/rustbook-ru/src/ch05-01-defining-structs.md
+++ b/rustbook-ru/src/ch05-01-defining-structs.md
@@ -1,8 +1,8 @@
-## Определение и инициализация структур
+## Определение и объявление стопок
 
-Структуры похожи на кортежи, рассмотренные в разделе ["Кортежи"], так как оба хранят несколько связанных значений. Как и кортежи, части структур могут быть разных типов. В отличие от кортежей, в структуре необходимо именовать каждую часть данных для понимания смысла значений. Добавление этих имён обеспечивает большую гибкость структур по сравнению с кортежами: не нужно полагаться на порядок данных для указания значений экземпляра или доступа к ним.
+Стопки похожи на упорядоченные ряды, рассмотренные в разделе ["Упорядоченные ряды"], так как оба хранят несколько связанных значений. Как и упорядоченные ряды, части стопок могут быть разных видов данных. В отличие от упорядоченных рядов, в стопке необходимо именовать каждую часть данных для понимания смысла значений. Добавление этих имён обеспечивает большую гибкость стопок по сравнению с упорядоченнымм рядами: не нужно полагаться на порядок данных для указания значений образца данных или доступа к ним.
 
-Для определения структуры указывается ключевое слово `struct` и её название. Название должно описывать значение частей данных, сгруппированных вместе. Далее, в фигурных скобках для каждой новой части данных поочерёдно определяются имя части данных и её тип. Каждая пара имя: тип называется *полем*. Листинг 5-1 описывает структуру для хранения информации об учётной записи пользователя:
+Для определения стопки указывается ключевое слово `struct` и её название. Название должно описывать значение частей данных, объединенных вместе. Далее, в узорчатых скобках для каждой новой части данных поочерёдно определяются имя части данных и её вид данных. Каждая пара имя: вид данных называется *полем*. Приложение 5-1 описывает стопку для хранения сведений об учётной записи пользователя:
 
 Имя файла: src/main.rs
 
@@ -10,9 +10,9 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs:here}}
 ```
 
-Листинг 5-1: Определение структуры User
+Приложение 5-1: Определение стопки User
 
-После определения структуры можно создавать её *экземпляр*, назначая определённое значение каждому полю с соответствующим типом данных. Чтобы создать экземпляр, мы указываем имя структуры, затем добавляем фигурные скобки и включаем в них пары `ключ: значение` (key: value), где ключами являются имена полей, а значениями являются данные, которые мы хотим сохранить в полях. Нет необходимости чётко следовать порядку объявления полей в описании структуры (но всё-таки желательно для удобства чтения). Другими словами, объявление структуры - это как шаблон нашего типа, в то время как экземпляр структуры использует этот шаблон, заполняя его определёнными данными, для создания значений нашего типа. Например, можно объявить пользователя как в листинге 5-2:
+После определения стопки можно создавать её *образец*, назначая определённое значение каждому полю с соответствующим видом данных. Чтобы создать образец данных, мы указываем имя стопки, затем добавляем узорчатые скобки и включаем в них пары `ключ: значение` (key: value), где ключами являются имена полей, а значениями являются данные, которые мы хотим сохранить в полях. Нет необходимости чётко следовать порядку объявления полей в описании стопки (но всё-таки желательно для удобства чтения). Другими словами, объявление стопки - это как образец данных нашего вида данных, в то время как образец данных стопки использует этот образец данных, заполняя его определёнными данными, для создания значений нашего вида данных. Например, можно объявить пользователя как в приложении 5-2:
 
 Файл: src/main.rs
 
@@ -20,9 +20,9 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs:here}}
 ```
 
-Листинг 5-2: Создание экземпляра структуры User
+Приложение 5-2: Создание образца данных стопки User
 
-Чтобы получить конкретное значение из структуры, мы используем запись через точку. Например, чтобы получить доступ к адресу электронной почты этого пользователя, мы используем `user1.email`. Если экземпляр является изменяемым, мы можем поменять значение, используя точечную нотацию и присвоение к конкретному полю. В Листинге 5-3 показано, как изменить значение в поле `email` изменяемого экземпляра `User`.
+Чтобы получить определенное значение из стопки, мы используем запись через точку. Например, чтобы получить доступ к адресу электронной почты этого пользователя, мы используем `user1.email`. Если образец данных является изменяемым, мы можем поменять значение, используя точечное наставление и присвоение к определенному полю. В Приложении 5-3 показано, как изменить значение в поле `email` изменяемого образца данных `User`.
 
 Файл: src/main.rs
 
@@ -30,11 +30,11 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs:here}}
 ```
 
-Листинг 5-3: Изменение значения в поле email экземпляра User
+Приложение 5-3: Изменение значения в поле email образца данных User
 
-Стоит отметить, что весь экземпляр структуры должен быть изменяемым; Rust не позволяет помечать изменяемыми отдельные поля. Как и для любого другого выражения, мы можем использовать выражение создания структуры в качестве последнего выражения тела функции для неявного возврата нового экземпляра.
+Стоит отметить, что весь образец данных стопки должен быть изменяемым; Ржавчина не позволяет помечать изменяемыми отдельные поля. Как и для любого другого выражения, мы можем использовать выражение создания стопки в качестве последнего выражения тела функции для неявного возврата нового образца.
 
-На листинге 5-4 функция `build_user` возвращает экземпляр `User` с указанным адресом и именем. Поле `active` получает значение `true`, а поле `sign_in_count` получает значение `1`.
+На приложении 5-4 функция `build_user` возвращает образец данных `User` с указанным адресом и именем. Поле `active` получает значение `true`, а поле `sign_in_count` получает значение `1`.
 
 Файл: src/main.rs
 
@@ -42,17 +42,17 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs:here}}
 ```
 
-Листинг 5-4: Функция build_user, которая принимает email и имя пользователя и возвращает экземпляр User
+Приложение 5-4: Функция build_user, которая принимает email и имя пользователя и возвращает образец данных User
 
-Имеет смысл называть параметры функции теми же именами, что и поля структуры, но необходимость повторять `email` и `username` для названий полей и переменных несколько утомительна. Если структура имеет много полей,  повторение каждого имени станет ещё более раздражающим. К счастью, есть удобное сокращение!
+Имеет смысл называть свойства функции теми же именами, что и поля стопки, но необходимость повторять `email` и `username` для названий полей и переменных несколько утомительна. Если стопка имеет много полей,  повторение каждого имени станет ещё более раздражающим. К счастью, есть удобное сокращение!
 
 
 
 
 
-### Использование сокращённой инициализации поля
+### Использование сокращённого объявления поля
 
-Так как имена входных параметров функции и полей структуры являются полностью идентичными в листинге 5-4, возможно использовать синтаксис *сокращённой инициализации поля*, чтобы переписать `build_user` так, чтобы он работал точно также, но не содержал повторений для `username` и `email`, как в листинге 5-5.
+Так как имена входных свойств функции и полей стопки одинаковые в приложении 5-4, возможно использовать согласно правил написания *сокращённое объявление поля*, чтобы переписать `build_user` так, чтобы он работал точно также, но не содержал повторений для `username` и `email`, как в приложении 5-5.
 
 Файл: src/main.rs
 
@@ -60,15 +60,15 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs:here}}
 ```
 
-Листинг 5-5: функция build_user использует сокращённую инициализацию полей, потому что её входные параметры username и email имеют имена аналогичные именам полей структуры
+Приложение 5-5: Функция build_user использует сокращённое объявление полей, потому что её входные свойства username и email имеют одинаковые имена полей стопки
 
-Здесь происходит создание нового экземпляра структуры `User`, которая имеет поле с именем `email`. Мы хотим установить поле структуры `email` значением входного параметра `email` функции `build_user`. Так как поле `email` и входной параметр функции `email` имеют одинаковое название, можно писать просто `email` вместо кода `email: email`.
+Здесь происходит создание нового образца данных стопки `User`, которая имеет поле с именем `email`. Мы хотим установить поле стопки `email` значением входного свойства `email` функции `build_user`. Так как поле `email` и входное свойство функции `email` имеют одинаковое название, можно писать просто `email` вместо рукописи `email: email`.
 
-### Создание экземпляра структуры из экземпляра другой структуры с помощью синтаксиса обновления структуры
+### Создание образца данных стопки из образца данных другой стопки с помощью правил написания обновления стопки
 
-Часто бывает полезно создать новый экземпляр структуры, который включает большинство значений из другого экземпляра, но некоторые из них изменяет. Это можно сделать с помощью *синтаксиса обновления структуры*.
+Часто бывает полезно создать новый образец данных стопки, который включает большинство значений из другого образца, но некоторые из них изменяет. Это можно сделать с помощью *правил написания обновления стопки*.
 
-Сначала в листинге 5-6 показано, как обычно создаётся новый экземпляр `User` в `user2` без синтаксиса обновления. Мы задаём новое значение для `email`, но в остальном используем те же значения из `user1`, которые были заданы в листинге 5-2.
+Сначала в приложении 5-6 показано, как обычно создаётся новый образец данных `User` в `user2` без правил написания обновления. Мы задаём новое значение для `email`, но в остальном используем те же значения из `user1`, которые были заданы в приложении 5-2.
 
 Файл: src/main.rs
 
@@ -76,9 +76,9 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs:here}}
 ```
 
-Листинг 5-6: Создание нового экземпляра User с использованием некоторых значений из экземпляра user1
+Приложение 5-6: Создание нового образца данных User с использованием некоторых значений из образца данных user1
 
-Используя синтаксис обновления структуры, можно получить тот же эффект, используя меньше кода как показано в листинге 5-7. Синтаксис `..` указывает, что оставшиеся поля устанавливаются неявно и должны иметь значения из указанного экземпляра.
+Используя правила написания обновления стопки, можно получить тот же итог, используя меньше рукописи как показано в приложении 5-7. Правила написания `..` указывают, что оставшиеся поля устанавливаются неявно и должны иметь значения из указанного образца данных.
 
 Файл: src/main.rs
 
@@ -86,17 +86,17 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs:here}}
 ```
 
-Листинг 5-7: Использование синтаксиса обновления структуры для установки нового значения email для экземпляра User, но использование остальных значений из экземпляра user1
+Приложение 5-7: Использование правил написания обновления стопки для установки нового значения email для образца данных User, но использование остальных значений из образца данных user1
 
-Код в листинге 5-7 также создаёт экземпляр в `user2`, который имеет другое значение для `email`, но с тем же значением для полей `username`, `active` и `sign_in_count` из `user1`. Оператор `..user1` должен стоять последним для указания на получение значений всех оставшихся полей из соответствующих полей в `user1`, но можно указать значения для любого количества полей в любом порядке, независимо от порядка полей в определении структуры.
+Рукопись в приложении 5-7 также создаёт образец данных в `user2`, который имеет другое значение для `email`, но с тем же значением для полей `username`, `active` и `sign_in_count` из `user1`. Приказчик `..user1` должен стоять последним для указания на получение значений всех оставшихся полей из соответствующих полей в `user1`, но можно указать значения для любого количества полей в любом порядке, независимо от порядка полей в определении стопки.
 
-Стоит отметить, что синтаксис обновления структуры использует `=` как присваивание. Это связано с перемещением данных, как мы видели в разделе [«Взаимодействие переменных и данных с помощью перемещения»]. В этом примере мы больше не можем использовать `user1` после создания `user2`, потому что `String` в поле `username` из `user1` было перемещено в `user2`. Если бы мы задали `user2` новые значения `String` для `email` и `username`, и таким образом, использовали только значения `active` и `sign_in_count` из `user1`, то `user1` всё ещё был бы действительным после создания `user2`. Оба типа `active` и `sign_in_count` реализуют типаж `Copy`, поэтому они ведут себя так, как мы обсуждали в разделе [«Стековые данные: копирование»].
+Стоит отметить, что правила написания обновления стопки используют  знак равенства `=` как присваивание. Это связано с перемещением данных, как мы видели в разделе [«Взаимодействие переменных и данных с помощью перемещения»]. В этом примере мы больше не можем использовать `user1` после создания `user2`, потому что `String` в поле `username` из `user1` было перемещено в `user2`. Если бы мы задали `user2` новые значения `String` для `email` и `username`, и таким образом, использовали только значения `active` и `sign_in_count` из `user1`, то `user1` всё ещё был бы действительным после создания `user2`. Оба вида  данных `active` и `sign_in_count` используют сущность `Copy`, поэтому они ведут себя так, как мы обсуждали в разделе [«Данные из обоймы: повторение»].
 
-### Кортежные структуры: структуры без именованных полей для создания разных типов
+### Упорядоченные в ряд стопки: стопки без именованных полей для создания разных видов данных
 
-Rust также поддерживает структуры, похожие на кортежи, которые называются *кортежные структуры*. Кортежные структуры обладают дополнительным смыслом, который даёт имя структуры, но при этом не имеют имён, связанных с их полями. Скорее, они просто хранят типы полей. Кортежные структуры полезны, когда вы хотите дать имя всему кортежу и сделать кортеж отличным от других кортежей, и когда именование каждого поля, как в обычной структуре, было бы многословным или избыточным.
+Ржавчина также поддерживает стопки, похожие на упорядоченные ряды, которые называются *упорядоченные в ряд стопки*. Упорядоченные в ряд стопки обладают дополнительным смыслом, который даёт имя стопки, но при этом не имеют имён, связанных с их полями. Скорее, они просто хранят виды данных полей. Упорядоченные в ряд стопки полезны, когда вы хотите дать имя всему упорядоченному ряду и сделать упорядоченный ряд отличным от других упорядоченных рядов, и когда именование каждого поля, как в обычной стопке, было бы многословным или избыточным.
 
-Чтобы определить кортежную структуру, начните с ключевого слова `struct` и имени структуры, за которым следуют типы в кортеже. Например, здесь мы определяем и используем две кортежные структуры с именами `Color` и `Point`:
+Чтобы определить упорядоченную в ряд стопку, начните с ключевого слова `struct` и имени стопки, за которым следуют виды данных в упорядоченном ряде. Например, здесь мы определяем и используем две упорядоченные в ряд стопки с именами `Color` и `Point`:
 
 Файл: src/main.rs
 
@@ -104,11 +104,11 @@ Rust также поддерживает структуры, похожие на
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs}}
 ```
 
-Обратите внимание, что значения `black` и `origin` — это разные типы, потому что они являются экземплярами разных кортежных структур. Каждая определяемая вами структура имеет собственный тип, даже если поля внутри структуры могут иметь одинаковые типы. Например, функция, принимающая параметр типа `Color`, не может принимать `Point` в качестве аргумента, даже если оба типа состоят из трёх значений `i32`. В остальном экземпляры кортежных структур похожи на кортежи в том смысле, что вы можете деструктурировать их на отдельные части и использовать `.`, за которой следует индекс для доступа к отдельному значению.
+Обратите внимание, что значения `black` и `origin` — это разные виды данных, потому что они являются образцами данных разных упорядоченных в ряд стопок. Каждая определяемая вами стопка имеет собственный вид данных, даже если поля внутри стопки могут быть одинаковые виды данных. Например, функция, принимающая свойство вида данных `Color`, не может принимать `Point` в качестве переменной, даже если оба вида данных состоят из трёх значений `i32`. В остальном образцы упорядоченных в ряд стопок похожи на упорядоченные ряды в том смысле, что вы можете разъединять их на отдельные части и использовать `.`, за которой следует порядковый указатель для доступа к отдельному значению.
 
-### Единично-подобные структуры: структуры без полей
+### Единично-подобные стопки: стопки без полей
 
-Также можно определять структуры, не имеющие полей! Они называются *единично-подобными структурами*, поскольку ведут себя аналогично `()`, единичному типу, о котором мы говорили в разделе ["Кортежи"](ch03-02-data-types.html#the-tuple-type). Единично-подобные структуры могут быть полезны, когда требуется реализовать типаж для некоторого типа, но у вас нет данных, которые нужно хранить в самом типе. Мы обсудим типажи в главе 10. Вот пример объявления и создание экземпляра единичной структуры с именем `AlwaysEqual`:
+Также можно определять стопки, не имеющие полей! Они называются *единично-подобными стопками*, поскольку ведут себя подобно `()`, единичному виду данных, о котором мы говорили в разделе ["Упорядоченные ряды"](ch03-02-data-types.html#the-tuple-type). Единично-подобные стопки могут быть полезны, когда требуется использовать сущность для некоторого вида данных, но у вас нет данных, которые нужно хранить в самом виде данных. Мы обсудим сущности в главе 10. Вот пример объявления и создание образца данных единичной стопки с именем `AlwaysEqual`:
 
 Файл: src/main.rs
 
@@ -116,13 +116,13 @@ Rust также поддерживает структуры, похожие на
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/src/main.rs}}
 ```
 
-Чтобы определить `AlwaysEqual`, мы используем ключевое слово `struct`, желаемое имя, а затем точку с запятой. Нет необходимости в фигурных или круглых скобках! Затем мы можем получить экземпляр `AlwaysEqual` в переменной `subject` аналогичным образом: используя имя, которое мы определили, без фигурных и круглых скобок. Представим, что в дальнейшем мы реализуем поведение для этого типа таким образом, что каждый экземпляр `AlwaysEqual` всегда будет равен каждому экземпляру любого другого типа, возможно, с целью получения ожидаемого результата для тестирования. Для реализации такого поведения нам не нужны никакие данные! В главе 10 вы увидите, как определять черты и реализовывать их для любого типа, включая единично-подобные структуры.
+Чтобы определить `AlwaysEqual`, мы используем ключевое слово `struct`, желаемое имя, а затем точку с запятой. Нет необходимости в узорчатых или круглых скобках! Затем мы можем получить образец данных `AlwaysEqual` в переменной `subject` подобным образом: используя имя, которое мы определили, без узорчатых и круглых скобок. Представим, что в дальнейшем мы выполняем поведение для этого вида данных таким образом, что каждый образец данных `AlwaysEqual` всегда будет равен каждому образцу любого другого вида данных, возможно, с целью получения ожидаемого итога для проверки. Для выполнения такого поведения нам не нужны никакие данные! В главе 10 вы увидите, как определять черты и использовать их для любого вида данных, включая единично-подобные стопки.
 
-> ### Владение данными структуры
+> ### Владение данными стопки
 >
-> В определении структуры `User` в листинге 5-1 мы использовали владеющий тип `String` вместо типа строковый срез `&str`. Это осознанный выбор, поскольку мы хотим, чтобы каждый экземпляр этой структуры владел всеми своими данными и чтобы эти данные были действительны до тех пор, пока действительна вся структура.
+> В определении стопки `User` в приложении 5-1 мы использовали владеющий вид данных `String` вместо вида данных строковый срез `&str`. Это осознанный выбор, поскольку мы хотим, чтобы каждый образец данных этого стопки владел всеми своими данными и чтобы эти данные были действительны до тех пор, пока действительны все стопки.
 >
-> Структуры также могут хранить ссылки на данные, принадлежащие кому-то другому, но для этого необходимо использовать возможность Rust *время жизни*, которую мы обсудим в главе 10. Время жизни гарантирует, что данные, на которые ссылается структура, будут действительны до тех пор, пока существует структура. Допустим, если попытаться сохранить ссылку в структуре без указания времени жизни, как в следующем примере; это не сработает:
+> Стопки также могут хранить ссылки на данные, принадлежащие кому-то другому, но для этого необходимо использовать возможность Ржавчины *время жизни*, которую мы обсудим в главе 10. Время жизни заверяет, что данные, на которые ссылается стопки, будут действительны до тех пор, пока существует стопки. Допустим, если попытаться сохранить ссылку в стопке без указания времени жизни, как в следующем примере; это не сработает:
 >
 > Файл: src/main.rs
 >
@@ -146,7 +146,7 @@ Rust также поддерживает структуры, похожие на
 > }
 > ```
 >
-> Компилятор будет жаловаться на необходимость определения времени жизни ссылок:
+> Сборщик будет жаловаться на необходимость определения времени жизни ссылок:
 >
 > ```console
 > $ cargo run
@@ -182,7 +182,7 @@ Rust также поддерживает структуры, похожие на
 > error: could not compile `structs` due to 2 previous errors
 > ```
 >
-> В главе 10 мы обсудим, как исправить эти ошибки, чтобы иметь возможность хранить ссылки в структурах, а пока мы исправим подобные ошибки, используя владеющие типы вроде `String` вместо ссылок `&str`.
+> В главе 10 мы обсудим, как исправить эти ошибки, чтобы иметь возможность хранить ссылки в стопках, а пока мы исправим подобные ошибки, используя владеющие виды данных вроде `String` вместо ссылок `&str`.
 
 
 
 
-["Кортежи"]: ch03-02-data-types.html#the-tuple-type
+["Упорядоченные ряды"]: ch03-02-data-types.html#the-tuple-type
 [«Взаимодействие переменных и данных с помощью перемещения»]: ch04-01-what-is-ownership.html#variables-and-data-interacting-with-move
-[«Стековые данные: копирование»]: ch04-01-what-is-ownership.html#stack-only-data-copy
\ No newline at end of file
+[«Данные из обоймы: повторение»]: ch04-01-what-is-ownership.html#stack-only-data-copy
\ No newline at end of file
diff --git a/rustbook-ru/src/ch05-02-example-structs.md b/rustbook-ru/src/ch05-02-example-structs.md
index 461aeec77..4ecd0848a 100644
--- a/rustbook-ru/src/ch05-02-example-structs.md
+++ b/rustbook-ru/src/ch05-02-example-structs.md
@@ -1,8 +1,8 @@
-## Пример использования структур
+## Пример использования стопок
 
-Чтобы понять, когда нам может понадобиться использование структур, давайте напишем программу, которая вычисляет площадь прямоугольника. Мы начнём с использования одиночных переменных, а затем будем улучшать программу до использования структур.
+Чтобы понять, когда нам может понадобиться использование стопок, давайте напишем программу, которая вычисляет площадь прямоугольника. Мы начнём с использования одиночных переменных, а затем будем улучшать программу до использования стопок.
 
-Давайте создадим новый проект программы при помощи Cargo и назовём его *rectangles*. Наша программа будет получать на вход длину и ширину прямоугольника в пикселях и затем рассчитывать площадь прямоугольника. Листинг 5-8 показывает один из коротких вариантов кода, который позволит нам сделать именно то, что надо, в файле проекта *src/main.rs*.
+Давайте создадим новое дело программы при помощи Cargo и назовём его *rectangles*. Наша программа будет получать на вход длину и ширину прямоугольника в точках и затем рассчитывать площадь прямоугольника. Приложение 5-8 показывает один из коротких исходов рукописи, который позволит нам сделать именно то, что надо, в файле дела *src/main.rs*.
 
 Файл: src/main.rs
 
@@ -10,7 +10,7 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs:all}}
 ```
 
-Листинг 5-8: вычисление площади прямоугольника, заданного отдельными переменными ширины и высоты
+Приложение 5-8: вычисление площади прямоугольника, заданного отдельными переменными ширины и высоты
 
 Теперь запустим программу, используя `cargo run`:
 
@@ -18,19 +18,19 @@
 {{#include ../listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt}}
 ```
 
-Этот код успешно вычисляет площадь прямоугольника, вызывая функцию `area` с каждым измерением, но мы можем улучшить его ясность и читабельность.
+Эта рукопись успешно вычисляет площадь прямоугольника, вызывая функцию `area` с каждым измерением, но мы можем улучшить её ясность и удобство чтения.
 
-Проблема данного метода очевидна из сигнатуры `area`:
+Неполадка данного способа очевидна из ярлыки `area`:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs:here}}
 ```
 
-Функция `area` должна вычислять площадь одного прямоугольника, но функция, которую мы написали, имеет два параметра, и нигде в нашей программе не ясно, что эти параметры взаимосвязаны. Было бы более читабельным и управляемым сгруппировать ширину и высоту вместе. В разделе [«Кортежи»] главы 3 мы уже обсуждали один из способов сделать это — использовать кортежи.
+Функция `area` должна вычислять площадь одного прямоугольника, но функция, которую мы написали, имеет два свойства, и нигде в нашей программе не ясно, что эти свойства взаимосвязаны. Было бы более удобным для чтения и управляемым объединять ширину и высоту вместе. В разделе [«Упорядоченные ряды»] Главы 3 мы уже обсуждали один из способов сделать это — использовать упорядоченные ряды.
 
-### Рефакторинг при помощи кортежей
+### Переработка рукописи при помощи упорядоченных рядов
 
-Листинг 5-9 — это другая версия программы, использующая кортежи.
+Приложение 5-9 — это другое исполнение программы, использующее упорядоченные ряды.
 
 Файл: src/main.rs
 
@@ -38,15 +38,15 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs}}
 ```
 
-Листинг 5-9: определение ширины и высоты прямоугольника с помощью кортежа
+Приложение 5-9: Определение ширины и высоты прямоугольника с помощью упорядоченного ряда
 
-С одной стороны, эта программа лучше. Кортежи позволяют добавить немного структуры, и теперь мы передаём только один аргумент. Но с другой стороны, эта версия менее понятна: кортежи не называют свои элементы, поэтому нам приходится индексировать части кортежа, что делает наше вычисление менее очевидным.
+С одной стороны, эта программа лучше. Упорядоченные ряды позволяют добавить немного стопке, и теперь мы передаём только одну переменную. Но с другой стороны, это исполнение менее понятно: упорядоченные ряды не называют свои переменные, поэтому нам приходится упорядочивать части упорядоченного ряда, что делает наше вычисление менее очевидным.
 
-Если мы перепутаем местами ширину с высотой при расчёте площади, то это не имеет значения. Но если мы хотим нарисовать прямоугольник на экране, то это уже будет важно! Мы должны помнить, что ширина  `width` находится в кортеже с индексом `0`, а высота `height` — с индексом `1`. Если кто-то другой поработал бы с кодом, ему бы пришлось разобраться в этом и также помнить про порядок. Легко забыть и перепутать эти значения — и это вызовет ошибки, потому что данный код не передаёт наши намерения.
+Если мы перепутаем местами ширину с высотой при расчёте площади, то это не имеет значения. Но если мы хотим нарисовать прямоугольник на экране, то это уже будет важно! Мы должны помнить, что ширина  `width` находится в упорядоченном ряде с порядковым указателем `0`, а высота `height` — с порядковым указателем `1`. Если кто-то другой поработал бы с рукописью, ему бы пришлось разобраться в этом и также помнить про порядок. Легко забыть и перепутать эти значения — и это вызовет ошибки, потому что данная рукопись не передаёт наши намерения.
 
-### Рефакторинг при помощи структур: добавим больше смысла
+### Переработка рукописи при помощи стопок: добавим больше смысла
 
-Мы используем структуры, чтобы добавить смысл данным при помощи назначения им осмысленных имён . Мы можем переделать используемый кортеж в структуру с единым именем для сущности и частными названиями её частей, как показано в листинге 5-10.
+Мы используем стопки, чтобы добавить смысл данным при помощи назначения им осмысленных имён . Мы можем переделать используемый упорядоченный ряд в стопка с единым именем для сущности и частными названиями её частей, как показано в приложении 5-10.
 
 Файл: src/main.rs
 
@@ -54,17 +54,17 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs}}
 ```
 
-Листинг 5-10: определение структуры Rectangle
+Приложение 5-10: Определение стопки Rectangle
 
-Здесь мы определили структуру и дали ей имя `Rectangle`. Внутри фигурных скобок определили поля как `width` и `height`, оба — типа `u32`. Затем в `main` создали конкретный экземпляр `Rectangle` с шириной в `30` и высотой в `50` единиц.
+Здесь мы определили стопку и дали ей имя `Rectangle` (прямоугольник). Внутри узорчатых скобок определили поля как `width` и `height`, оба — вида данных `u32`. Затем в `main` создали определенный образец данных `Rectangle` (прямоугольник) с шириной в `30` и высотой в `50` единиц.
 
-Наша функция `area` теперь определена с одним параметром, названным `rectangle`, чей тип является неизменяемым заимствованием структуры `Rectangle`. Как упоминалось в главе 4, необходимо заимствовать структуру, а не передавать её во владение. Таким образом функция `main` сохраняет `rect1` в собственности и может использовать её дальше. По этой причине мы и используем `&` в сигнатуре и в месте вызова функции.
+Наша функция `area` теперь определена с одним свойством, названным `rectangle` (прямоугольник), чей вид данных является неизменяемым заимствованием стопки `Rectangle` (прямоугольник). Как упоминалось в главе 4, необходимо заимствовать стопку, а не передавать её во владение. Таким образом функция `main` сохраняет `rect1` в собственности и может использовать её дальше. По этой причине мы и используем `&` в ярлыке и в месте вызова функции.
 
-Функция `area` получает доступ к полям `width` и `height` экземпляра `Rectangle` (обратите внимание, что доступ к полям заимствованного экземпляра структуры не приводит к перемещению значений полей, поэтому вы часто видите заимствования структур). Наша сигнатура функции для `area` теперь говорит именно то, что мы имеем в виду: вычислить площадь `Rectangle`, используя его поля `width` и `height`. Это означает, что ширина и высота связаны друг с другом, и даёт описательные имена значениям, а не использует значения индекса кортежа `0` и `1`. Это торжество ясности.
+Функция `area` получает доступ к полям `width` и `height` образца данных `Rectangle` (обратите внимание, что доступ к полям заимствованного образца данных стопки не приводит к перемещению значений полей, поэтому вы часто видите заимствования стопок). Наш ярлык функции для `area` теперь говорит именно то, что мы имеем в виду: вычислить площадь `Rectangle` (прямоугольник), используя его поля `width` и `height`. Это означает, что ширина и высота связаны друг с другом, и даёт описательные имена значениям, а не использует значения порядкового указателя упорядоченного ряда `0` и `1`. Это торжество ясности.
 
-### Добавление полезной функциональности при помощи выводимых типажей
+### Добавление полезной возможности при помощи выводимых сущностей
 
-Было бы полезно иметь возможность печатать экземпляр `Rectangle` во время отладки программы и видеть значения всех полей. Листинг 5-11 использует макрос [`println!`](https://doc.rust-lang.org/std/macro.println.html), который мы уже использовали в предыдущих главах. Тем не менее, это не работает.
+Было бы полезно иметь возможность выводить образец данных `Rectangle` во время отладки программы и видеть значения всех полей. Приложение 5-11 использует макрос [`println!`](https://doc.rust-lang.org/std/macro.println.html), который мы уже использовали в предыдущих главах. Тем не менее, это не работает.
 
 Файл: src/main.rs
 
@@ -72,37 +72,37 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs}}
 ```
 
-Листинг 5-11: Попытка вывести значения экземпляра Rectangle
+Приложение 5-11: Попытка вывести значения образца данных Rectangle
 
-При компиляции этого кода мы получаем ошибку с сообщением:
+При сборке этой рукописи мы получаем ошибку с сообщением:
 
 ```text
 {{#include ../listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt:3}}
 ```
 
-Макрос `println!` умеет выполнять множество видов форматирования, и по умолчанию фигурные скобки в `println!` означают использование форматирование, известное как типаж `Display`. Его вывод предназначен для непосредственного использования конечным пользователем. Примитивные типы, изученные ранее, по умолчанию реализуют типаж `Display`, потому что есть только один способ отобразить число `1` или любой другой примитивный тип. Но для структур форматирование `println!` менее очевидно, потому что есть гораздо больше способов отображения: Вы хотите запятые или нет? Вы хотите печатать фигурные скобки? Должны ли отображаться все поля? Из-за этой неоднозначности Rust не пытается  угадать, что нам нужно, а структуры не имеют встроенной реализации `Display` для использования в `println!` с заполнителем `{}`.
+Макрос `println!` умеет выполнять множество видов разметки, и по умолчанию узорчатые скобки в `println!` означают использование разметки, известного как сущность `Display`. Его вывод предназначен для непосредственного использования конечным пользователем. Простые виды данных, изученные ранее, по умолчанию используют сущность `Display`, потому что есть только один способ отобразить число `1` или любой другой простой вид данных. Но для  сложных видов данных вывод с разметкой через `println!` менее очевиден, потому что есть гораздо больше способов вывода: Вы хотите запятые или нет? Вы хотите выводить узорчатые скобки? Должны ли отображаться все поля? Из-за этой неоднозначности Ржавчина не пытается  угадать, что нам нужно, а сложные виды данных не имеют встроенного использования `Display` для вывода через `println!` с исполнителем `{}`.
 
-Продолжив чтение текста ошибки, мы найдём полезное замечание:
+Продолжив чтение ошибок нашей рукописи, мы найдём важное замечание:
 
 ```text
 {{#include ../listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt:9:10}}
 ```
 
-Давайте попробуем! Вызов макроса `println!` теперь будет выглядеть так `println!("rect1 is {:?}", rect1);`. Ввод спецификатора `:?` внутри фигурных скобок говорит макросу `println!`, что мы хотим использовать другой формат вывода, известный как `Debug`. Типаж `Debug` позволяет печатать структуру способом, удобным для разработчиков, чтобы видеть значение во время отладки кода.
+Давайте попробуем! Вызов макроса `println!` теперь будет выглядеть так `println!("rect1 is {:?}", rect1);`. Ввод определетеля `:?` внутри узорчатых скобок говорит макросу `println!`, что мы хотим использовать другой вид вывода, известный как `Debug`. Сущность `Debug` позволяет выводить сложные виды данных способом, удобным для разработчиков, чтобы видеть значение во время отладки рукописи.
 
-Скомпилируем код с этими изменениями. Упс! Мы всё ещё получаем ошибку:
+Соберем рукопись с этими изменениями. Упс! Мы всё ещё получаем ошибку:
 
 ```text
 {{#include ../listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt:3}}
 ```
 
-Снова компилятор даёт нам полезное замечание:
+Снова сборщик даёт нам важное замечание:
 
 ```text
 {{#include ../listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt:9:10}}
 ```
 
-Rust *реализует* функциональность для печати отладочной информации, но *не включает (не выводит) её по умолчанию*. Мы должны явно включить эту функциональность для нашей структуры. Чтобы это сделать, добавляем внешний атрибут `#[derive(Debug)]` сразу перед определением структуры, как показано в листинге 5-12.
+Ржавчина *использует* возможность для вывода отладочных сведений , но *не включает (не выводит) её по умолчанию*. Мы должны явно включить эту возможность для нашего сложного вида данных (в данном случае стопки). Чтобы это сделать, добавляем внешнее средство `#[derive(Debug)]` сразу перед определением сложного вида данных, как показано в приложении 5-12.
 
 Файл: src/main.rs
 
@@ -110,7 +110,8 @@ Rust *реализует* функциональность для печати 
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs}}
 ```
 
-Листинг 5-12: добавление атрибута для вывода типажа Debug и печати экземпляра Rectangle с отладочным форматированием
+Приложение 5-12: Добавление средства для вывода сущности Debug и выводе образца данных Rectangle с отладочной разметкой
+
 
 Теперь при запуске программы мы не получим ошибок и увидим следующий вывод:
 
@@ -118,17 +119,17 @@ Rust *реализует* функциональность для печати 
 {{#include ../listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt}}
 ```
 
-Отлично! Это не самый красивый вывод, но он показывает значения всех полей экземпляра, которые определённо помогут при отладке. Когда у нас более крупные структуры, то полезно иметь более простой для чтения вывод; в таких случаях можно использовать код `{:#?}` вместо `{:?}` в строке макроса `println!`. В этом примере использование стиля `{:#?}` приведёт к такому выводу:
+Отлично! Это не самый красивый вывод, но он показывает значения всех полей образца, которые определённо помогут при отладке. Когда у нас более крупные стопки, то полезно иметь более простой для чтения вывод; в таких случаях можно использовать рукопись `{:#?}` вместо `{:?}` в строке макроса `println!`. В этом примере использование исполнения `{:#?}` приведёт к такому выводу:
 
 ```console
 {{#include ../listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt}}
 ```
 
-Другой способ распечатать значение в формате `Debug` — использовать макрос [`dbg!`], который становится владельцем выражения (в отличие от `println!`, принимающего ссылку), печатает номер файла и строки, где происходит вызов макроса `dbg!`, вместе с результирующим значением этого выражения и возвращает владение на значение.
+Другой способ вывести значение в виде`Debug` — использовать макрос [`dbg!`], который становится владельцем выражения (в отличие от `println!`, принимающего ссылку), выводит номер файла и строки, где происходит вызов макроса `dbg!`, вместе с итоговым значением этого выражения и возвращает владение на значение.
 
->  Примечание: при вызове макроса `dbg!` выполняется печать в стандартный поток ошибок (`stderr`), в отличие от `println!`, который использует стандартный поток вывода в консоль (`stdout`). Подробнее о `stderr` и `stdout` мы поговорим в разделе [«Запись сообщений об ошибках в стандартный вывод ошибок вместо стандартного вывода» главы 12].
+>  Примечание: при вызове макроса `dbg!` используется вывод в обычный поток ошибок (`stderr`), в отличие от `println!`, который использует обычный поток вывода в окно вывода (`stdout`). Подробнее о `stderr` и `stdout` мы поговорим в разделе [«Запись сообщений об ошибках в обычный вывод ошибок вместо принятого вывода» Главы 12].
 
-Вот пример, когда нас интересует значение, которое присваивается полю `width`, а также значение всей структуры в `rect1`:
+Вот пример, когда нас важно значение, которое присваивается полю `width`, а также значение всей стопки в `rect1`:
 
 ```rust
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/src/main.rs}}
@@ -140,14 +141,14 @@ Rust *реализует* функциональность для печати 
 {{#include ../listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/output.txt}}
 ```
 
-Мы можем увидеть, что первый отладочный вывод поступил из строки 10 *src/main.rs*, там, где мы отлаживаем выражение `30 * scale`, и его результирующее значение равно 60 (`Debug` форматирование, реализованное для целых чисел, заключается в печати только их значения). Вызов `dbg!` в строке 14 src/main.rs выводит значение &rect1, которое является структурой `Rectangle`. В этом выводе используется красивое форматирование `Debug` типа `Rectangle`. Макрос `dbg!` может быть очень полезен, когда вы пытаетесь понять, что делает ваш код!
+Мы можем увидеть, что первый отладочный вывод поступил из строки 10 *src/main.rs*, там, где мы отлаживаем выражение `30 * scale`, и его итоговое значение равно 60 (`Debug` разметка, выполненная для целых чисел, заключается в выводе только их значения). Вызов `dbg!` в строке 14 src/main.rs выводит значение &rect1, которое является стопкой `Rectangle`. В этом выводе используется красивая разметка `Debug` вида данных `Rectangle`. Макрос `dbg!` может быть очень полезен, когда вы пытаетесь понять, что делает ваша рукопись!
 
-В дополнение к `Debug`, Rust предоставил нам ряд типажей, которые мы можем использовать с атрибутом `derive` для добавления полезного поведения к нашим пользовательским типам. Эти типажи и их поведение перечислены в [приложении C]. Мы расскажем, как реализовать эти трейты с пользовательским поведением, а также как создать свои собственные трейты в главе 10. Кроме того, есть много других атрибутов помимо `derive`; для получения дополнительной информации смотрите [раздел “Атрибуты” справочника Rust](https://doc.rust-lang.org/reference/attributes.html).
+В дополнение к `Debug`, Ржавчина предоставила нам ряд сущностей, которые мы можем использовать со средством `derive` для добавления полезного поведения к нашим пользовательским видам данных. Эти сущности и их поведение перечислены в [приложении C]. Мы расскажем, как использовать эти сущности с пользовательским поведением, а также как создать свои собственные сущности в главе 10. Кроме того, есть много других средств помимо `derive`; для получения дополнительных сведений смотрите [раздел “Свойства” справочника Ржавчины](https://doc.rust-lang.org/reference/attributes.html).
 
-Функция `area` является довольно специфичной: она считает только площадь прямоугольников. Было бы полезно привязать данное поведение как можно ближе к структуре `Rectangle`, потому что наш специфичный код не будет работать с любым другим типом. Давайте рассмотрим, как можно улучшить наш код превращая функцию `area` в метод area, определённый для типа `Rectangle`.
+Функция `area` является довольно отличительной: она считает только площадь прямоугольников. Было бы полезно привязать данное поведение как можно ближе к стопке `Rectangle`, потому что наша отличительная рукопись не будет работать с любым другим видом данных. Давайте рассмотрим, как можно улучшить нашу рукопись превращая функцию `area` в способ area, определённый для вида данных `Rectangle`.
 
 
-[«Кортежи»]: ch03-02-data-types.html#the-tuple-type
+[«Упорядоченные ряды»]: ch03-02-data-types.html#the-tuple-type
 [приложении C]: appendix-03-derivable-traits.md
 [`dbg!`]: ../std/macro.dbg.html
-[«Запись сообщений об ошибках в стандартный вывод ошибок вместо стандартного вывода» главы 12]: ch12-06-writing-to-stderr-instead-of-stdout.html
\ No newline at end of file
+[«Запись сообщений об ошибках в обычный вывод ошибок вместо принятого вывода» Главы 12]: ch12-06-writing-to-stderr-instead-of-stdout.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch05-03-method-syntax.md b/rustbook-ru/src/ch05-03-method-syntax.md
index c8770c87b..8b3b41304 100644
--- a/rustbook-ru/src/ch05-03-method-syntax.md
+++ b/rustbook-ru/src/ch05-03-method-syntax.md
@@ -1,10 +1,10 @@
-## Синтаксис метода
+## Правила написания способов
 
-*Методы* похожи на функции: мы объявляем их с помощью ключевого слова `fn` и имени, они могут иметь параметры и возвращаемое значение, и они содержат код, запускающийся в случае вызова метода. В отличие от функций, методы определяются в контексте структуры (или объекта перечисления или типажа, которые мы рассмотрим в [главе 6)] и [главе 17] соответственно), а их первым параметром всегда является `self`, представляющий собой экземпляр структуры, с которой вызывается этот метод.
+*Способы* похожи на функции: мы объявляем их с помощью ключевого слова `fn` и имени, они могут иметь свойства и возвращаемое значение, и они содержат рукопись, запускающуюся в случае вызова способа. В отличие от функций, способы определяются в среде стопки (или предмета перечисления или сущности, которые мы рассмотрим в [главе 6] и [главе 17] соответственно), а их первым свойством всегда является `self`, представляющее собой образец данных стопки, с которым вызывается этот способ.
 
-### Определение методов
+### Определение способов
 
-Давайте изменим функцию `area` так, чтобы она имела экземпляр `Rectangle` в качестве входного параметра и сделаем её методом `area`, определённым для структуры `Rectangle`, как показано в листинге 5-13:
+Давайте изменим функцию `area` так, чтобы она имела образец данных `Rectangle` в качестве входного свойства и сделаем её способом `area`, определённым для стопки `Rectangle`, как показано в приложении 5-13:
 
 Файл: src/main.rs
 
@@ -12,17 +12,17 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs}}
 ```
 
-Листинг 5-13: Определение метода area для структуры Rectangle
+Приложение 5-13: Определение способа area для стопки Rectangle
 
-Чтобы определить функцию в контексте `Rectangle`, мы создаём блок `impl` (implementation - реализация) для `Rectangle`. Всё в `impl` будет связано с типом `Rectangle`. Затем мы перемещаем функцию `area` внутрь фигурных скобок `impl` и меняем первый (и в данном случае единственный) параметр на `self` в сигнатуре и в теле. В `main`, где мы вызвали функцию `area` и передали `rect1` в качестве аргумента, теперь мы можем использовать *синтаксис метода* для вызова метода `area` нашего экземпляра `Rectangle`. Синтаксис метода идёт после экземпляра: мы добавляем точку, за которой следует имя метода, круглые скобки и любые аргументы.
+Чтобы определить функцию в среде `Rectangle`, мы создаём раздел`impl` (implementation - выполнение) для `Rectangle`. Всё в `impl` будет связано с видом данных - стопкой `Rectangle`. Затем мы перемещаем функцию `area` внутрь узорчатых скобок `impl` и меняем первое (и в данном случае единственное) свойство на `self` в ярлыке и в теле. В `main`, где мы вызвали функцию `area` и передали `rect1` в качестве переменной, теперь мы можем использовать *правила написания способов* для вызова самого способа `area` нашего образца данных `Rectangle`. По правилам написания способов указание самого способа следует после образца: после переменной мы добавляем точку, за которой следует имя способа, круглые скобки и любые переменные, пример: `rect1.area`, где `rect1` - переменная, а `area`- сам способ.
 
-В сигнатуре `area` мы используем `&self` вместо `rectangle: &Rectangle`. `&self` на самом деле является сокращением от `self: &Self`. Внутри блока `impl` тип `Self` является псевдонимом типа, для которого реализован блок `impl`. Методы обязаны иметь параметр с именем `self` типа `Self`, поэтому Rust позволяет вам сокращать его, используя только имя `self` на месте первого параметра. Обратите внимание, что нам по-прежнему нужно использовать `&` перед сокращением `self`, чтобы указать на то, что этот метод заимствует экземпляр `Self`, точно так же, как мы делали это в `rectangle: &Rectangle`. Как и любой другой параметр, методы могут брать во владение `self`, заимствовать неизменяемый `self`, как мы поступили в данном случае, или заимствовать изменяемый `self`.
+В ярлыке способа `area` мы используем `&self` вместо `rectangle: &Rectangle`. Так `&self` на самом деле является сокращением от `self: &Self`. Внутри раздела `impl` вид данных `Self` является псевдонимом вида данных, для которого выполнен раздел`impl`. Способы обязаны иметь свойство с именем `self` вида данных `Self`, поэтому Ржавчина позволяет вам сокращать его, используя только имя `self` на месте первого свойства. Обратите внимание, что нам по-прежнему нужно использовать знак заимствования (ссылки) `&` перед сокращением `self`, чтобы указать на то, что этот способ заимствует образец данных `Self`, точно так же, как мы делали это в `rectangle: &Rectangle`. Как и любое другое свойство, способы могут брать во владение `self`, заимствовать неизменяемый `self`, как мы поступили в данном случае, или заимствовать изменяемый `self`.
 
-Мы выбрали `&self` здесь по той же причине, по которой использовали `&Rectangle` в версии кода с функцией: мы не хотим брать структуру во владение, мы просто хотим прочитать данные в структуре, а не писать в неё. Если бы мы хотели изменить экземпляр, на котором мы вызывали метод силами самого метода, то мы бы использовали `&mut self` в качестве первого параметра. Наличие метода, который берёт экземпляр во владение, используя только `self` в качестве первого параметра, является редким; эта техника обычно используется, когда метод превращает `self` во что-то ещё, и вы хотите запретить вызывающей стороне использовать исходный экземпляр после превращения.
+Мы выбрали `&self` здесь по той же причине, по которой использовали `&Rectangle` в исполнении рукописи с функцией: мы не хотим брать стопку во владение, мы просто хотим получить данные из стопки, а не изменять данные в ней. Если бы мы хотели изменить образец данных,в котором мы вызывали способ силами самого способа, то мы бы использовали `&mut self` в качестве первого свойства. Наличие способа, который берёт образец данных во владение, используя только `self` в качестве первого свойства, является редким; эта техника обычно используется, когда способ превращает `self` во что-то ещё, и вы хотите запретить вызывающей стороне использовать исходный образец данных после превращения.
 
-Основная причина использования методов вместо функций, помимо синтаксиса метода, где нет необходимости повторять тип `self` в сигнатуре каждого метода, заключается в организации кода. Мы поместили все, что мы можем сделать с экземпляром типа, в один `impl` вместо того, чтобы заставлять будущих пользователей нашего кода искать доступный функционал `Rectangle` в разных местах предоставляемой нами библиотеки.
+Основная причина использования способов вместо функций, помимо правил написания способа, где нет необходимости повторять вид данных `self` в ярлыке каждого способа, заключается в согласовании рукописи. Мы пометили все, что мы можем сделать с образцом вида данных, в один раздел `impl` вместо того, чтобы заставлять будущих пользователей нашей рукописи искать доступные возможности `Rectangle` в разных местах предоставляемой нами библиотеки.
 
-Обратите внимание, что мы можем дать методу то же имя, что и одному из полей структуры. Например, для `Rectangle` мы можем определить метод, также названный `width`:
+Обратите внимание, что мы можем дать способу то же имя, что и одному из полей стопки. Например, для `Rectangle` мы можем определить способ, также названный `width`:
 
 Файл: src/main.rs
 
@@ -30,17 +30,17 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/src/main.rs:here}}
 ```
 
-Здесь мы определили, чтобы метод `width` возвращал значение `true`, если значение в поле `width` экземпляра больше `0`, и значение `false`, если значение равно `0`, но мы можем использовать поле в методе с тем же именем для любых целей. В `main`, когда мы ставим после `rect1.width` круглые скобки, Rust знает, что мы имеем в виду метод `width`. Когда мы не используем круглые скобки, Rust понимает, что мы имеем в виду поле `width`.
+Здесь мы определили, чтобы способ `width` возвращал значение `true`, если значение в поле `width` образца данных больше `0`, и значение `false`, если значение равно `0`, но мы можем использовать поле в способе с тем же именем для любых целей. В `main`, когда мы ставим после `rect1.width` круглые скобки `()`, Ржавчина знает, что мы имеем в виду способ `width`. Второй исход - когда мы не используем круглые скобки `()` , Ржавчина понимает, что мы имеем в виду вид данных стопки - а именно поле `width`.
 
-Часто, но не всегда, когда мы создаём методы с тем же именем, что и у поля, мы хотим, чтобы он только возвращал значение одноимённого поля и больше ничего не делал. Подобные методы называются *геттерами*, и Rust не реализует их автоматически для полей структуры, как это делают некоторые другие языки. Геттеры полезны, поскольку вы можете сделать поле приватным, а метод публичным и, таким образом, включить доступ только для чтения к этому полю как часть общедоступного API типа. Мы обсудим, что такое публичность и приватность, и как обозначить поле или метод в качестве публичного или приватного в [главе 7].
+Часто, но не всегда, когда мы создаём способы с тем же именем, что и у поля, мы хотим, чтобы он только возвращал значение одноимённого поля и больше ничего не делал. Подобные способы называются *получателями (getter)*, и Ржавчина не выполняет их самостоятельно для полей стопки, как это делают некоторые другие языки. Получтаели полезны, поскольку вы можете сделать поле закрытым, а способ открытым и, таким образом, включить доступ только для чтения к этому полю как часть общедоступного API вида. Мы обсудим, что такое открытость и закрытость, и как обозначить поле или способ в качестве открытого или закрытого в [главе 7].
 
-> ### Где используется оператор `->`?
+> ### Где используется приказчик `->`?
 >
-> В языках C и C++, используются два различных оператора для вызова методов: используется `.`, если вызывается метод непосредственно у экземпляра структуры и используется `->`, если вызывается метод для указателя на объект. Другими словами, если `object` является указателем, то вызовы метода `object->something()` и ` (*object).something()` являются аналогичными.
+> В языках C и C++, используются два различных приказчика для вызова способов: используется `.`, если вызывается способ непосредственно у образца данных стопки и используется `->`, если вызывается способ для указателя на предмет. Другими словами, если предмет`object` является указателем, то вызовы способа `object->something()` и ` (*object).something()` являются равнозначными.
 >
-> Rust не имеет эквивалента оператора `->`, наоборот, в Rust есть функциональность называемая *автоматическое обращение по ссылке и разыменование* (automatic referencing and dereferencing). Вызов методов является одним из немногих мест в Rust, в котором есть такое поведение.
+> Ржавчина не имеет равнозначного приказчика `->`, наоборот, в Ржавчине есть возможность называемая *самостоятельное обращение по ссылке и разыменование* (automatic referencing and dereferencing). Вызов способов является одним из немногих мест в Ржавчине, в котором есть такое поведение.
 >
-> Вот как это работает: когда вы вызываете метод `object.something()`, Rust автоматически добавляет `&`, `&mut` или  `*`, таким образом, чтобы `object` соответствовал сигнатуре метода. Другими словами, это то же самое:
+> Вот как это работает: когда вы вызываете способ `object.something()`, Ржавчина самостоятельно добавляет `&`, `&mut` или  `*`, таким образом, чтобы предмет `object` соответствовал ярлыку способа. Другими словами, это то же самое:
 >
 > 
 >
@@ -65,11 +65,11 @@
 > (&p1).distance(&p2);
 > ```
 >
-> Первый пример выглядит намного понятнее. Автоматический вывод ссылки работает потому, что методы имеют понятного получателя - тип `self`. Учитывая получателя и имя метода, Rust может точно определить, что в данном случае делает код: читает ли метод (`&self`), делает ли изменение (`&mut self`) или поглощает (`self`). Тот факт, что Rust делает заимствование неявным для принимающего метода, в значительной степени способствует тому, чтобы сделать владение эргономичным на практике.
+> Первый пример выглядит намного понятнее. Самостоятельный вывод ссылки работает потому, что способы имеют понятного получателя - вид данных `self`. Учитывая получателя и имя способа, Ржавчина может точно определить, что в данном случае делает рукопись: считывает ли способ (`&self`), делает ли изменение (`&mut self`) или поглощает (`self`). То обстоятельство, что Ржавчина делает заимствование неявным для принимающего способа, в значительной степени способствует тому, чтобы сделать владение удобным на опыте.
 
-### Методы с несколькими параметрами
+### Способы с несколькими свойствами
 
-Давайте попрактикуемся в использовании методов, реализовав второй метод в структуре `Rectangle`. На этот раз мы хотим, чтобы экземпляр `Rectangle` брал другой экземпляр `Rectangle` и возвращал `true`, если второй `Rectangle` может полностью поместиться внутри `self` (первый `Rectangle`); в противном случае он должен вернуть `false`. То есть, как только мы определим метод `can_hold`, мы хотим иметь возможность написать программу, показанную в Листинге 5-14.
+Давайте применим наши знания по части использовании способов, выполнив второй способ в стопке `Rectangle`. На этот раз мы хотим, чтобы образец данных `Rectangle` брал другой образец данных `Rectangle` и возвращал `true`, если второй `Rectangle` может полностью поместиться внутри `self` (первый `Rectangle`); в противном случае он должен вернуть `false`. То есть, как только мы определим способ `can_hold`, мы хотим иметь возможность написать программу, показанную в Приложении 5-14.
 
 Файл: src/main.rs
 
@@ -77,16 +77,16 @@
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs}}
 ```
 
-Листинг 5-14: Использование ещё не написанного метода can_hold
+Приложение 5-14: Использование ещё не написанного способа can_hold
 
-Ожидаемый результат будет выглядеть следующим образом, т.к. оба размера в экземпляре `rect2` меньше, чем размеры в экземпляре `rect1`, а `rect3` шире, чем `rect1`:
+Ожидаемый итог будет выглядеть следующим образом, т.к. оба размера в образце `rect2` меньше, чем размеры в образце `rect1`, а `rect3` больше, чем `rect1`:
 
 ```text
 Can rect1 hold rect2? true
 Can rect1 hold rect3? false
 ```
 
-Мы знаем, что хотим определить метод, поэтому он будет находится в `impl Rectangle` блоке. Имя метода будет `can_hold`, и оно будет принимать неизменяемое заимствование на другой `Rectangle` в качестве параметра. Мы можем сказать, какой это будет тип параметра, посмотрев на код вызывающего метода: метод `rect1.can_hold(&rect2)` передаёт в него  `&rect2` , который является неизменяемым заимствованием экземпляра `rect2` типа `Rectangle`. В этом есть смысл, потому что нам нужно только читать `rect2` (а не писать, что означало бы, что нужно изменяемое заимствование), и мы хотим, чтобы `main` сохранил право собственности на экземпляр `rect2`, чтобы мы могли использовать его снова после вызов метода `can_hold`. Возвращаемое значение `can_hold` имеет булевый тип, а реализация проверяет, являются ли ширина и высота `self` больше, чем ширина и высота другого `Rectangle` соответственно. Давайте добавим новый метод `can_hold` в `impl` блок из листинга 5-13, как показано в листинге 5-15.
+Мы знаем, что хотим определить способ, поэтому он будет находится в разделе `impl Rectangle` . Имя способа будет `can_hold`, и он будет принимать неизменяемое заимствование на другой `Rectangle` в качестве свойства. Мы можем сказать, какой это будет вид свойства, посмотрев на рукопись вызывающего способа `rect1.can_hold(&rect2)`: сам способ `can_hold` передаёт заимствование на стопку `&rect2` , которое является неизменяемым заимствованием образца данных `rect2` вида данных стопка `Rectangle`. В этом есть смысл, потому что нам нужно только получить данные из стопки `rect2` (а не вносить изменения или владеть ими, что означало бы, что нужно изменяемое заимствование), и мы хотим, чтобы `main` сохранила право собственности на образец данных `rect2`, чтобы мы могли использовать его снова после вызова способа `can_hold`. Возвращаемое значение способом `can_hold` имеет разумный вид данных, а его выполнение (вызов способа) проверяет, являются ли ширина и высота `self` больше, чем ширина и высота другого образца данных - стопки `Rectangle` соответственно. Давайте добавим новый способ `can_hold` в `impl` раздел из приложения 5-13, как показано в приложении 5-15.
 
 Файл: src/main.rs
 
@@ -94,15 +94,15 @@ Can rect1 hold rect3? false
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs:here}}
 ```
 
-Листинг 5-15: Реализация метода can_hold для Rectangle, принимающего другой экземпляр Rectangle в качестве параметра
+Приложение 5-15: Использование способа can_hold для Rectangle, принимающего другой образец данных Rectangle в качестве свойства
 
-Когда мы запустим код с функцией `main` листинга 5-14, мы получим желаемый вывод. Методы могут принимать несколько параметров, которые мы добавляем в сигнатуру после первого  параметра `self`, и эти параметры работают так же, как параметры в функциях.
+Когда мы запустим рукопись с функцией `main` приложения 5-14, мы получим желаемый вывод. Способы могут принимать несколько свойств, которые мы добавляем в ярлык после первого  свойства `self`, и эти свойства работают так же, как свойства в функциях.
 
-### Ассоциированные функции
+### Сопряженные функции
 
-Все функции, определённые в блоке `impl`, называются *ассоциированными функциями*, потому что они ассоциированы с типом, указанным после ключевого слова `impl`. Мы можем определить ассоциированные функции, которые не имеют `self` в качестве первого параметра (и, следовательно, не являются методами), потому что им не нужен экземпляр типа для работы. Мы уже использовали одну подобную функцию: функцию `String::from`, определённую для типа `String`.
+Все функции, определённые в разделе `impl`, называются *сопряженными функциями*, потому что они сопряжены с видом данных, указанным после ключевого слова `impl`. Мы можем определить сопряженные функции, которые не имеют `self` в качестве первого свойства (и, следовательно, не являются способами), потому что им не нужен образец вида данных для работы. Мы уже использовали одну подобную функцию: вызов `String::from` определённой для вида данных `String`.
 
-Ассоциированные функции, не являющиеся методами, часто используются для конструкторов, возвращающих новый экземпляр структуры. Их часто называют `new`, но `new` не является специальным именем и не встроена в язык. Например, мы можем предоставить ассоциированную функцию с именем `square`, которая будет иметь один параметр размера и использовать его как ширину и высоту, что упростит создание квадратного `Rectangle`, вместо того, чтобы указывать одно и то же значение дважды:
+Сопряженные функции, не являющиеся способами, часто используются для строителей, возвращающих новый образец данных стопки. Их часто называют `new`, но `new` не является особым именем и не встроена в язык. Например, мы можем предоставить сопряженную функцию с именем `square`, которая будет иметь одно свойство размера и использовать его как ширину и высоту, что упростит создание квадратного `Rectangle`, вместо того, чтобы указывать одно и то же значение дважды:
 
 Файл: src/main.rs
 
@@ -110,30 +110,30 @@ Can rect1 hold rect3? false
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs:here}}
 ```
 
-Ключевые слова `Self` в возвращаемом типе и в теле функции являются псевдонимами для типа, указанного после ключевого слова `impl`, которым в данном случае является `Rectangle`.
+Ключевые слова `Self` в возвращаемом виде данных и в теле функции являются псевдонимами для вида данных, указанного после ключевого слова `impl`, которым в данном случае является `Rectangle`.
 
-Чтобы вызвать эту связанную функцию, используется синтаксис `::` с именем структуры; например `let sq = Rectangle::square(3);`. Эта функция находится в пространстве имён структуры. Синтаксис `::` используется как для связанных функций, так и для пространств имён, созданных модулями. Мы обсудим модули в [главе 7].
+Чтобы вызвать эту сопряженную функцию, используются правила написания `::` с именем стопки, например `let sq = Rectangle::square(3);`. Эта функция находится в пространстве имён стопки. Правила написания `::` используются как для сопряженных функций, так и для пространств имён, созданных разделами. Мы обсудим разделы в [главе 7].
 
-### Несколько блоков `impl`
+### Несколько разделов `impl`
 
-Каждая структура может иметь несколько `impl`. Например, Листинг 5-15 эквивалентен коду, показанному в листинге 5-16, в котором каждый метод находится в своём собственном блоке `impl`.
+Каждая стопка может иметь несколько `impl`. Например, Приложение 5-15 равнозначно рукописи, указанной в приложении 5-16, в котором каждый способ находится в своём собственном разделе `impl`.
 
 ```rust
 {{#rustdoc_include ../listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs:here}}
 ```
 
-Листинг 5-16: Переписанный Листинга 5-15 с использованием нескольких impl
+Приложение 5-16: Переписанное Приложение 5-15 с использованием нескольких impl
 
-Здесь нет причин разделять методы на несколько `impl`, но это допустимый синтаксис. Мы увидим случай, когда несколько `impl` могут оказаться полезными, в Главе 10, рассматривающей обобщённые типы и свойства.
+Здесь нет причин разделять способы на несколько `impl`, но это допустимые правила написания. Мы увидим случай, когда несколько `impl` могут оказаться полезными, в Главе 10, рассматривающей обобщённые виды данных и свойства.
 
 ## Итоги
 
-Структуры позволяют создавать собственные типы, которые имеют смысл в вашей предметной области. Используя структуры, вы храните ассоциированные друг с другом фрагменты данных и даёте название частям данных, чтобы ваш код был более понятным. Методы позволяют определить поведение, которое имеют экземпляры ваших структур, а ассоциированные функции позволяют привязать функциональность к вашей структуре, не обращаясь к её экземпляру.
+Стопки позволяют создавать собственные виды данных, которые имеют смысл в вашей предметной области. Используя стопки, вы храните сопряженные друг с другом отрывки данных и даёте название частям данных, чтобы ваша рукопись была более понятной. Способы позволяют определить поведение, которое имеют образцы ваших стопок, а сопряженные функции позволяют привязать возможность к вашей стопке, не обращаясь к её образцу данных.
 
-Но структуры — не единственный способ создавать собственные типы: давайте обратимся к перечислениям в Rust, чтобы добавить ещё один инструмент в свой арсенал.
+Но стопки — не единственный способ создавать собственные виды данных: давайте обратимся к перечислениям в Ржавчине, чтобы добавить ещё одно средство в свой набор.
 
 
-[главе 6)]: ch06-00-enums.html
+[главе 6]: ch06-00-enums.html
 [главе 17]: ch17-02-trait-objects.md
 [главе 7]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html#exposing-paths-with-the-pub-keyword
 [главе 7]: ch07-02-defining-modules-to-control-scope-and-privacy.html
diff --git a/rustbook-ru/src/ch06-00-enums.md b/rustbook-ru/src/ch06-00-enums.md
index 30d0d1b48..5dddb2eac 100644
--- a/rustbook-ru/src/ch06-00-enums.md
+++ b/rustbook-ru/src/ch06-00-enums.md
@@ -1,3 +1,3 @@
 # Перечисления и сопоставление с образцом
 
-В этой главе мы рассмотрим *перечисления (enumerations)*, также называемые *enums*. Перечисления позволяют определить тип путём перечисления его возможных *вариантов* . Сначала мы определим и используем перечисление, чтобы показать, как оно может объединить значения и данные. Далее мы рассмотрим особенно полезное перечисление под названием `Option`, которое выражает, что значение может быть либо чем-то, либо ничем. Затем мы рассмотрим, как сопоставление с образцом в выражении `match` позволяет легко запускать разный код для разных значений перечисления. Наконец, мы узнаем, насколько конструкция `if let` удобна и лаконична для обработки перечислений в вашем коде.
+В этой главе мы рассмотрим *перечисления (enumerations)*, также называемые *enums*. Перечисления позволяют определить вид данных путём перечисления его возможных *исходов* . Сначала мы определим и используем перечисление, чтобы показать, как оно может объединить значения и данные. Далее мы рассмотрим особенно полезное перечисление под названием `Option`, которое выражает, что значение может быть либо чем-то, либо ничем. Затем мы рассмотрим, как сопоставление с образцом в выражении `match` позволяет легко запускать разные рукописи для разных значений перечисления. Наконец, мы узнаем, насколько устройство `if let` удобно и кратко для обработки перечислений в вашей рукописи.
diff --git a/rustbook-ru/src/ch06-01-defining-an-enum.md b/rustbook-ru/src/ch06-01-defining-an-enum.md
index e7b4740d4..287103149 100644
--- a/rustbook-ru/src/ch06-01-defining-an-enum.md
+++ b/rustbook-ru/src/ch06-01-defining-an-enum.md
@@ -1,64 +1,64 @@
 ## Определение перечисления
 
-Там, где структуры дают вам возможность группировать связанные поля и данные, например `Rectangle` с его `width` и `height`, перечисления дают вам способ сказать, что значение является одним из возможных наборов значений. Например, мы можем захотеть сказать, что `Rectangle` — это одна из множества возможных фигур, в которую также входят `Circle` и `Triangle`. Для этого Rust позволяет нам закодировать эти возможности в виде перечисления.
+Там, где стопки дают вам возможность объединять связанные поля и данные, например `Rectangle` с его `width` и `height`, перечисления дают вам способ сказать, что значение является одним из возможных наборов значений. Например, мы можем захотеть сказать, что `Rectangle (Прямоугольник)`  — это одна из множества возможных фигур, в которую также входят `Circle (круг)` и `Triangle (треугольник)`. Для этого Ржавчина позволяет нам закодировать эти возможности в виде данных перечисления.
 
-Давайте рассмотрим ситуацию, которую мы могли бы захотеть отразить в коде, и поймём, почему перечисления полезны и более уместны, чем структуры в этом случае. Допустим, нам нужно работать с IP-адресами. В настоящее время для обозначения IP-адресов используются два основных стандарта: четвёртая и шестая версии. Поскольку это единственно возможные варианты IP-адресов, с которыми может столкнуться наша программа, мы можем *перечислить* все возможные варианты, откуда перечисление и получило своё название.
+Давайте рассмотрим случай, который мы могли бы захотеть отразить в рукописи, и поймём, почему перечисления полезны и более уместны, чем стопки в этом случае. Допустим, нам нужно работать с IP-адресами. В настоящее время для обозначения IP-адресов используются два основных исполнения: четвёртое и шестое исполнение. Поскольку это единственно возможные исходы IP-адресов, с которыми может столкнуться наша программа, мы можем *перечислить* все возможные исходы, откуда перечисление и получило своё название.
 
-Любой IP-адрес может быть либо четвёртой, либо шестой версии, но не обеими одновременно. Эта особенность IP-адресов делает структуру данных enum подходящей, поскольку значение enum может представлять собой только один из его возможных вариантов. Адреса как четвёртой, так и шестой версии по своей сути все равно являются IP-адресами, поэтому их следует рассматривать как один и тот же тип, когда в коде обрабатываются задачи, относящиеся к любому типу IP-адресов.
+Любой IP-адрес может быть либо четвёртым, либо шестым исполнением, но не обеими одновременно. Эта особенность IP-адресов делает вид данных enum подходящим, поскольку значение enum может представлять собой только один из его возможных исходов. Адреса как четвёртого, так и шестого исполнения по своей сути все равно являются IP-адресами, поэтому их следует рассматривать как один и тот же вид данных, когда в рукописи обрабатываются задачи, относящиеся к любому виду IP-адресов.
 
-Можно выразить эту концепцию в коде, определив перечисление `IpAddrKind` и составив список возможных видов IP-адресов, `V4` и `V6`. Вот варианты перечислений:
+Можно выразить этот подход в рукописи, определив перечисление `IpAddrKind` и составив список возможных видов IP-адресов, `V4` и `V6`. Вот исходы перечислений:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:def}}
 ```
 
-`IpAddrKind` теперь является пользовательским типом данных, который мы можем использовать в другом месте нашего кода.
+`IpAddrKind` теперь является пользовательским видом данных, который мы можем использовать в другом месте нашей рукописи.
 
 ### Значения перечислений
 
-Экземпляры каждого варианта перечисления `IpAddrKind` можно создать следующим образом:
+Образцы каждого исхода перечисления `IpAddrKind` можно создать следующим образом:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:instance}}
 ```
 
-Обратите внимание, что варианты перечисления находятся в пространстве имён вместе с его идентификатором, а для их обособления мы используем двойное двоеточие. Это удобно тем, что теперь оба значения `IpAddrKind::V4` и `IpAddrKind::V6` относятся к одному типу: `IpAddrKind`. Затем мы можем, например, определить функцию, которая принимает любой из вариантов `IpAddrKind`:
+Обратите внимание, что исходы перечисления находятся в пространстве имён вместе с его определителем, а для их обособления мы используем двойное двоеточие. Это удобно тем, что теперь оба значения `IpAddrKind::V4` и `IpAddrKind::V6` относятся к одному виду: `IpAddrKind`. Затем мы можем, например, определить функцию, которая принимает любой из исходов `IpAddrKind`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:fn}}
 ```
 
-Можно вызвать эту функцию с любым из вариантов:
+Можно вызвать эту функцию с любым из исходов:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:fn_call}}
 ```
 
-Использование перечислений позволяет получить ещё больше преимуществ. Если подумать о нашем типе для IP-адреса, то выяснится, что на данный момент у нас нет возможности хранить собственно сам *IP-адрес*; мы будем знать только его *тип*. Учитывая, что недавно в главе 5 вы узнали о структурах, у вас может возникнуть соблазн решить эту проблему с помощью структур, как показано в листинге 6-1.
+Использование перечислений позволяет получить ещё больше преимуществ. Если подумать о нашем виде для IP-адреса, то выяснится, что на данное мгновение у нас нет возможности хранить собственно сам *IP-адрес*; мы будем знать только его *вид*. Учитывая, что недавно в главе 5 вы узнали о стопках, у вас может возникнуть соблазн решить эту неполадку с помощью стопок, как показано в приложении 6-1.
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs:here}}
 ```
 
-Листинг 6-1. Сохранение данных и IpAddrKind IP-адреса с использованием struct
+Приложение 6-1: Сохранение данных и IpAddrKind IP-адреса с использованием struct
 
-Здесь мы определили структуру `IpAddr`, у которой есть два поля: `kind` типа `IpAddrKind` (перечисление, которое мы определили ранее) и `address` типа `String`. У нас есть два экземпляра этой структуры. Первый - `home`, который является `IpAddrKind::V4` в качестве значения `kind` с соответствующим адресом `127.0.0.1`. Второй экземпляр - `loopback`. Он в качестве значения `kind` имеет другой вариант `IpAddrKind`, `V6`, и с ним ассоциирован адрес `::1`. Мы использовали структуру для объединения значений `kind` и `address` вместе, таким образом тип формата адреса теперь ассоциирован со значением.
+Здесь мы определили стопку `IpAddr`, у которой есть два поля: `kind` вида данных `IpAddrKind` (перечисление, которое мы определили ранее) и `address` вида данных `String`. У нас есть два образца данных этой стопки. Первый - `home`, который является `IpAddrKind::V4` в качестве значения `kind` с соответствующим адресом `127.0.0.1`. Второй образец  данных - `loopback`. Он в качестве значения `kind` имеет другой исход `IpAddrKind`, `V6`, и с ним сопряжен адрес `::1`. Мы использовали виды данных стопка и перечисления для объединения значений `kind` и `address` вместе, таким образом вид адреса теперь сопряжен со значением.
 
-Однако представление этой же концепции с помощью перечисления более лаконично: вместо того, чтобы помещать перечисление в структуру, мы можем поместить данные непосредственно в любой из вариантов перечисления. Это новое определение перечисления `IpAddr` гласит, что оба варианта `V4` и `V6` будут иметь соответствующие значения `String`:
+Представление этого подхода с помощью перечисления в более кратком виде: вместо того, чтобы помещать перечисление в вид данных стопка, мы можем поместить данные непосредственно в любой из исходов перечисления. Это новое определение перечисления `IpAddr` гласит, что оба исхода `V4` и `V6` будут иметь соответствующие значения `String`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs:here}}
 ```
 
-Мы прикрепляем данные к каждому варианту перечисления напрямую, поэтому нет необходимости в дополнительной структуре. Здесь также легче увидеть ещё одну деталь того, как работают перечисления: имя каждого варианта перечисления, который мы определяем, также становится функцией, которая создаёт экземпляр перечисления. То есть `IpAddr::V4()` - это вызов функции, который принимает `String` и возвращает экземпляр типа `IpAddr`. Мы автоматически получаем эту функцию-конструктор, определяемую в результате определения перечисления.
+Мы прикрепляем данные к каждому исходу перечисления напрямую, поэтому нет необходимости в дополнительной стопке. Здесь также легче увидеть ещё одну особенность того, как работают перечисления: имя каждого исхода перечисления, который мы определяем, также становится функцией, которая создаёт образец перечисления. То есть `IpAddr::V4()` - это вызов функции, который принимает `String` и возвращает образец вида данных `IpAddr`. Мы самостоятельно получаем эту функцию-строитель, определяемую в итоге определения перечисления.
 
-Ещё одно преимущество использования перечисления вместо структуры заключается в том, что каждый вариант перечисления может иметь разное количество ассоциированных данных представленных в разных типах. Версия 4 для IP адресов всегда будет содержать четыре цифровых компонента, которые будут иметь значения между 0 и 255. При необходимости сохранить адреса типа `V4` как четыре значения типа `u8`, а также описать адреса типа `V6` как единственное значение типа  `String`, мы не смогли бы с помощью структуры. Перечисления решают эту задачу легко:
+Ещё одно преимущество использования перечисления вместо стопки заключается в том, что каждый исход перечисления может иметь разное количество сопряженных данных представленных в разных видах. Исполнение 4 для IP адресов всегда будет содержать четыре цифровых составляющих, которые будут иметь значения между 0 и 255. При необходимости сохранить адреса вида данных `V4` как четыре значения вида данных `u8`, а также описать адреса вида данных `V6` как единственное значение вида данных  `String`, мы не смогли бы с помощью стопки. Перечисления решают эту задачу легко:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs:here}}
 ```
 
-Мы показали несколько различных способов определения структур данных для хранения IP-адресов четвёртой и шестой версий. Однако, как оказалось, желание хранить IP-адреса и указывать их тип настолько распространено, что в стандартной библиотеке есть определение, которое мы можем использовать! Давайте посмотрим, как стандартная библиотека определяет `IpAddr`: в ней есть точно такое же перечисление с вариантами, которое мы определили и использовали, но она помещает данные об адресе внутрь этих вариантов в виде двух различных структур, которые имеют различные определения для каждого из вариантов:
+Мы показали несколько различных способов определения стопок данных для хранения IP-адресов четвёртого и шестого исполнений. Однако, как оказалось, желание хранить IP-адреса и указывать их вид настолько распространено, что во встроенной библиотеке есть определение, которое мы можем использовать! Давайте посмотрим, как обычная библиотека определяет `IpAddr`: в ней есть точно такое же перечисление с исходами, которое мы определили и использовали, но она помещает данные об адресе внутрь этих исходов в виде двух различных стопок, которые имеют различные определения для каждого из исходов:
 
 ```rust
 struct Ipv4Addr {
@@ -75,60 +75,60 @@ enum IpAddr {
 }
 ```
 
-Этот код иллюстрирует что мы можем добавлять любой тип данных в значение перечисления: строку, число, структуру и пр. Вы даже можете включить в перечисление другие перечисления! Стандартные типы данных не очень сложны, хотя, потенциально, могут быть очень сложными (вложенность данных может быть очень глубокой).
+Эта рукопись отображает что мы можем добавлять любой вид данных в значение перечисления: строку, число, стопку и пр. Вы даже можете включить в перечисление другие перечисления! Обычные виды данных не очень сложны, хотя, возможно, могут быть очень сложными (вложенность данных может быть очень глубокой).
 
-Обратите внимание, что хотя определение перечисления `IpAddr` есть в стандартной библиотеке, мы смогли объявлять и использовать свою собственную реализацию с аналогичным названием без каких-либо конфликтов, потому что мы не добавили определение стандартной библиотеки в область видимости кода. Подробнее об этом поговорим в Главе 7.
+Обратите внимание, что хотя определение перечисления `IpAddr` есть во встроенной библиотеке, мы смогли объявлять и использовать своё собственное исполнение с подобным названием без каких-либо несоответствий, потому что мы не добавили определение встроенной библиотеки в область видимости рукописи. Подробнее об этом поговорим в Главе 7.
 
-Рассмотрим другой пример перечисления в листинге 6-2: в этом примере каждый элемент перечисления имеет свой особый тип данных внутри:
+Рассмотрим другой пример перечисления в приложении 6-2: в этом примере каждая переменная перечисления имеет свой особый вид данных внутри:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs:here}}
 ```
 
-Листинг 6-2. Перечисление Message, в каждом из вариантов которого хранятся разные количества и типы значений.
+Приложение 6-2: Перечисление Message, в каждом из исходов которого хранятся разные количества и виды данных.
 
-Это перечисление имеет 4 элемента:
+Это перечисление имеет 4 составляющих:
 
-- `Quit` - пустой элемент без ассоциированных данных,
-- `Move` имеет именованные поля, как и структура.
-- `Write` - элемент с единственной строкой типа `String`,
-- `ChangeColor` - кортеж из трёх значений типа `i32`.
+- `Quit` - пустая переменная без сопряженных данных,
+- `Move` имеет именованные поля, как и стопки.
+- `Write` - переменная с единственной строкой вида данных `String`,
+- `ChangeColor` - упорядоченный ряд из трёх значений вида данных `i32`.
 
-Определение перечисления с вариантами, такими как в листинге 6-2, похоже на определение значений различных типов внутри структур, за исключением того, что перечисление не использует ключевое слово `struct` и все варианты сгруппированы внутри типа `Message`. Следующие структуры могут содержать те же данные, что и предыдущие варианты перечислений:
+Определение перечисления с исходами, такими как в приложении 6-2, похоже на определение значений различных видов данных внутри стопок, за исключением того, что перечисление не использует ключевое слово `struct` и все исходы объединены внутри вида данных `Message`. Следующие стопки могут содержать те же данные, что и предыдущие исходы перечислений:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs:here}}
 ```
 
-Но когда мы использовали различные структуры, каждая из которых имеет свои собственные типы, мы не могли легко определять функции, которые принимают любые типы сообщений, как это можно сделать с помощью перечисления типа `Message`, объявленного в листинге 6-2, который является единым типом.
+Но когда мы использовали различные стопки, каждая из которых имеет свои собственные виды данных, мы не могли легко определять функции, которые принимают любые виды сообщений, как это можно сделать с помощью перечисления вида данных `Message`, объявленного в приложении 6-2, который является единым видом данных.
 
-Есть ещё одно сходство между перечислениями и структурами: так же, как мы можем определять методы для структур с помощью `impl` блока, мы можем определять и методы для перечисления. Вот пример метода с именем `call`, который мы могли бы определить в нашем перечислении `Message`:
+Есть ещё одно сходство между перечислениями и стопками: так же, как мы можем определять способы для стопок с помощью `impl` раздела, мы можем определять и способы для перечисления. Вот пример способа с именем `call`, который мы могли бы определить в нашем перечислении `Message`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs:here}}
 ```
 
-В теле метода будет использоваться `self` для получения значение того объекта, у которого мы вызвали этот метод. В этом примере мы создали переменную `m`, содержащую значение `Message::Write(String::from("hello"))`, и именно это значение будет представлять `self` в теле метода `call` при выполнении `m.call()`.
+В теле способа будет использоваться `self` для получения значение того предмета. у которого мы вызвали этот способ. В этом примере мы создали переменную `m`, содержащую значение `Message::Write(String::from("hello"))`, и именно это значение будет представлять `self` в теле способа `call` при выполнении `m.call()`.
 
-Теперь посмотрим на другое наиболее часто используемое перечисление из стандартной библиотеки, которое является очень распространённым и полезным: `Option`.
+Теперь посмотрим на другое наиболее часто используемое перечисление из встроенной библиотеки, которое является очень распространённым и полезным: `Option`.
 
-### Перечисление `Option` и его преимущества перед Null-значениями
+### Перечисление `Option` и его преимущества перед Пустыми (Null)-значениями
 
-В этом разделе рассматривается пример использования `Option`, ещё одного перечисления, определённого в стандартной библиотеке. Тип `Option` кодирует очень распространённый сценарий, в котором значение может быть чем-то, а может быть ничем.
+В этом разделе рассматривается пример использования вида данных `Option`, ещё одного перечисления, определённого во встроенной библиотеке. Вид данных `Option` кодирует очень распространённую задумку, в котором значение может быть чем-то, а может быть ничем.
 
-Например, если вы запросите первый элемент из непустого списка, вы получите значение. Если вы запросите первый элемент пустого списка, вы ничего не получите. Выражение этой концепции в терминах системы типов означает, что компилятор может проверить, обработали ли вы все случаи, которые должны были обработать; эта функциональность может предотвратить ошибки, которые чрезвычайно распространены в других языках программирования.
+Например, если вы запросите первая переменная из непустого списка, вы получите значение. Если вы запросите первая переменная пустого списка, вы ничего не получите. Выражение этого подхода в понятиях системы видов означает, что сборщик может проверить, обработали ли вы все исходы, которые должны были обработать; эта возможность может предотвратить ошибки, которые чрезвычайно распространены в других языках программирования.
 
-Дизайн языка программирования часто рассматривается с точки зрения того, какие функции вы включаете в него, но те функции, которые вы исключаете, также важны. Например в Rust нет такого функционала как null значения, однако он есть во многих других языках. *Null значение* - это значение, которое означает, что значения нет. В языках с null значением переменные всегда могут находиться в одном из двух состояний: *нет значения (null)* или *есть значение (not-null)*.
+Устройство языка программирования часто рассматривается с точки зрения того, какие функции вы включаете в него, но те функции, которые вы исключаете, также важны. Например в Ржавчине нет таких возможностей как пустые (null) значения, однако она есть во многих других языках. *Пустое (Null) значение* - это значение, которое означает, что значения нет. В языках с возможностью определения пустых значений переменные всегда могут находиться в одном из двух состояний: *нет значения (пустота/null)* или *есть значение (не пустое/not-null)*.
 
-В своей презентации 2009 года «Null ссылки: ошибка в миллиард долларов» Тони Хоар (Tony Hoare), изобретатель null, сказал следующее:
+В своём докладе 2009 года «Пустые ссылки: ошибка в миллиард долларов» Тони Хоар (Tony Hoare), изобретатель пустолты (null), сказал следующее:
 
-> Я называю это своей ошибкой на миллиард долларов. В то время я разрабатывал первую комплексную систему типов для ссылок на объектно-ориентированном языке. Моя цель состояла в том, чтобы гарантировать, что любое использование ссылок должно быть абсолютно безопасным, с автоматической проверкой компилятором. Но я не мог устоять перед соблазном вставить пустую ссылку просто потому, что это было так легко реализовать. Это привело к бесчисленным ошибкам, уязвимостям и системным сбоям, которые, вероятно, причинили боль и ущерб на миллиард долларов за последние сорок лет.
+> Я называю это своей ошибкой на миллиард долларов. В то время я разрабатывал первую целостную систему видов для ссылок на предметно-направленном языке. Моя цель состояла в том, чтобы обеспечить, что любое использование ссылок должно быть безусловно безопасным, с самостоятельной проверкой сборщиком. Но я не мог устоять перед соблазном вставить пустую ссылку просто потому, что это было так легко выполнить. Это привело к бесчисленным ошибкам, уязвимостям и системным сбоям, которые, вероятно, причинили боль и ущерб на миллиард долларов за последние сорок лет.
 
-Проблема с null значениями заключается в том, что если вы попытаетесь использовать null значение в качестве not-null значения, вы получите ошибку определённого рода. Поскольку свойство null или not-null распространено повсеместно, сделать такую ошибку очень просто.
+Неполадка с пустыми значениями заключается в том, что если вы попытаетесь использовать пустые значение в качестве не пустого  (not-null) значения, вы получите ошибку определённого рода. Поскольку свойство пустота (null) или не пустота (not-null) распространено повсеместно, сделать такую ошибку очень просто.
 
-Тем не менее, концепция, которую null пытается выразить, является полезной: null - это значение, которое в настоящее время по какой-то причине недействительно или отсутствует.
+Тем не менее, подход, которую пустота пытается выразить, является полезным: пустое - это значение, которое в настоящее время по какой-то причине недействительно или отсутствует.
 
-Проблема на самом деле не в концепции, а в конкретной реализации. Таким образом, в Rust нет значений null, но есть перечисление, которое может закодировать концепцию присутствия или отсутствия значения. Это перечисление `Option` , и оно [определено стандартной библиотекой  следующим образом:]
+Неполадка на самом деле не в подходе, а в определенном исполнении. Таким образом, в Ржавчине нет пустых значений, поэтому принят подход в виде перечисления, которое принимает значения наличия  (not-null) или отсутствия (null) самого значения. Это вид данных перечисление `Option` , и оно [определено встроенной библиотекой]  следующим образом:
 
 ```rust
 enum Option {
@@ -137,40 +137,40 @@ enum Option {
 }
 ```
 
-Перечисление `Option` настолько полезно, что оно даже включено в прелюдию; вам не нужно явно вводить его в область видимости. Его варианты также включены в прелюдию: вы можете использовать `Some` и `None` напрямую, без префикса `Option::`. При всём при этом, `Option` является обычным перечислением, а `Some(T)` и `None` представляют собой его варианты.
+Перечисление `Option` настолько полезно, что оно даже включено во встроенный набор; вам не нужно явно вводить его в область видимости. Его исходы также включены во встроенный набор: вы можете использовать `Some` и `None` напрямую, без приставки `Option::`. При всём при этом, `Option` является обычным перечислением, а `Some(T)` и `None` представляют собой его исходы.
 
-`` - это особенность Rust, о которой мы ещё не говорили. Это параметр обобщённого типа, и мы рассмотрим его более подробно в главе 10. На данный момент всё, что вам нужно знать, это то, что `` означает, что вариант `Some` `Option` может содержать один фрагмент данных любого типа, и что каждый конкретный тип, который используется вместо `T` делает общий `Option` другим типом. Вот несколько примеров использования `Option` для хранения числовых и строковых типов:
+`` - это особенность Ржавчины, о которой мы ещё не говорили. Это свойство обобщённого вида данных, и мы рассмотрим его более подробно в главе 10. На данное мгновение всё, что вам нужно знать, это то, что `` означает, что исход `Some` перечисления `Option` может содержать один отрывок любого вида данных, и что каждый определенный вид данных, который используется вместо `T` делает общий `Option` другим видом данных. Вот несколько примеров использования `Option` для хранения числовых и строковых видов данных:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs:here}}
 ```
 
-Тип `some_number` - `Option`. Тип `some_char` - `Option`, это другой тип. Rust может вывести эти типы, потому что мы указали значение внутри варианта `Some`. Для `absent_number` Rust требует, чтобы мы аннотировали общий тип для `Option`: компилятор не может вывести тип, который будет в `Some`, глядя только на значение `None`. Здесь мы сообщаем Rust, что `absent_number` должен иметь тип `Option`.
+Вид данных `some_number` - `Option`. Вид данных `some_char` - `Option`, это другой вид данных. Ржавчина может вывести эти виды данных, потому что мы указали значение внутри исхода `Some`. Для `absent_number` Ржавчина требует, чтобы мы определяли общий вид данных для `Option` : сборщик не может вывести вид данных, который будет в `Some`, глядя только на значение `None`. Здесь мы сообщаем Ржавчине, что `absent_number` должен иметь вид данных `Option`.
 
-Когда есть значение `Some`, мы знаем, что значение присутствует и содержится внутри `Some`. Когда есть значение `None`, это означает то же самое, что и null в некотором смысле: у нас нет действительного значения. Так почему наличие `Option` лучше, чем null?
+Когда есть значение `Some`, мы знаем, что значение присутствует и содержится внутри `Some`. Когда есть значение `None`, это означает то же самое, что и пустота в некотором смысле: у нас нет действительного значения. Так почему наличие `Option` лучше, чем пустота?
 
-Вкратце, поскольку `Option` и `T` (где `T` может быть любым типом) относятся к разным типам, компилятор не позволит нам использовать значение `Option` даже если бы оно было определённо допустимым значением. Например, этот код не будет компилироваться, потому что он пытается добавить `i8` к значению типа `Option`:
+Вкратце, поскольку `Option` и `T` (где `T` может быть любым видом данных) относятся к разным видам данных, сборщик не позволит нам использовать значение `Option` даже если бы оно было определённо допустимым значением. Например, эта рукопись не будет собираться, потому что она пытается добавить `i8` к значению вида данных `Option`:
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/src/main.rs:here}}
 ```
 
-Если мы запустим этот код, то получим такое сообщение об ошибке:
+Если мы запустим эту рукопись, то получим такое сообщение об ошибке:
 
 ```console
 {{#include ../listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt}}
 ```
 
-Сильно! Фактически, это сообщение об ошибке означает, что Rust не понимает, как сложить `i8` и `Option`, потому что это разные типы. Когда у нас есть значение типа наподобие `i8`, компилятор гарантирует, что у нас всегда есть допустимое значение типа. Мы можем уверенно продолжать работу, не проверяя его на null перед использованием. Однако, когда у нас есть значение типа `Option` (где `T` - это любое значение любого типа `T`, упакованное в `Option`, например значение типа `i8` или `String`), мы должны беспокоиться о том, что значение типа T возможно не имеет значения (является вариантом `None`), и компилятор позаботится о том, чтобы мы обработали такой случай, прежде чем мы бы попытались использовать `None` значение.
+Сильно! В действительности, это сообщение об ошибке означает, что Ржавчина не понимает, как сложить `i8` и `Option`, потому что это разные виды данных. Когда у нас есть значение вида данных наподобие `i8`, сборщик заверяет, что у нас всегда есть допустимое значение вида данных. Мы можем уверенно продолжать работу, не проверяя его на пустоту перед использованием. Однако, когда у нас есть значение вида данных `Option` (где `T` - это любое значение любого вида данных `T`, упакованное в `Option`, например значение вида данных `i8` или `String`), мы должны беспокоиться о том, что значение вида данных T возможно не имеет значения (является исходом `None`), и сборщик позаботится о том, чтобы мы обработали такой случай, прежде чем мы бы попытались использовать `None` значение.
 
-Другими словами, вы должны преобразовать `Option` в `T` прежде чем вы сможете выполнять операции с этим `T`. Как правило, это помогает выявить одну из наиболее распространённых проблем с null: предполагая, что что-то не равно null, когда оно на самом деле равно null.
+Другими словами, вы должны преобразовать `Option` в `T` прежде чем вы сможете выполнять действия с этим `T`. Как правило, это помогает выявить одну из наиболее распространённых неполадок с пустотой: предполагая, что что-то не равно пустоте, когда оно на самом деле равно пустоте.
 
-Устранение риска ошибочного предположения касательно не-null значения помогает вам быть более уверенным в своём коде. Чтобы иметь значение, которое может быть null, вы должны явно описать тип этого значения с помощью `Option`. Затем, когда вы используете это значение, вы обязаны явно обрабатывать случай, когда значение равно null. Везде, где значение имеет тип, отличный от `Option`, вы *можете* смело рассчитывать на то, что значение не равно null. Это продуманное проектное решение в Rust, ограничивающее распространение null и увеличивающее безопасность кода на Rust.
+Устранение риска ошибочного предположения касательно не-пустого значения помогает вам быть более уверенным в своей рукописи. Чтобы использовать переменную, значение которой может быть пустотой, вы должны явно описать вид данных этой переменной с помощью `Option`. Затем, когда вы используете эту переменную, вы обязаны явно обрабатывать случай, когда значение равно пустоте. Везде, где значение переменной имеет вид данных, отличный от `Option`, вы *можете* смело рассчитывать на то, что значение не равно пустоте. Это продуманное расчетное решение в Ржавчине ограничивающее распространение пустоты и увеличивающее безопасность рукописи на Ржавчине.
 
-Итак, как же получить значение `T` из варианта `Some`, если у вас на руках есть только объект `Option`, и как можно его, вообще, использовать? Перечисление `Option` имеет большое количество методов, полезных в различных ситуациях; вы можете ознакомиться с ними в [его документации]. Знакомство с методами перечисления `Option` будет чрезвычайно полезным в вашем путешествии с Rust.
+Итак, как же получить значение `T` из исхода `Some`, если у вас на руках есть только предмет `Option`, и как можно его, вообще, использовать? Перечисление `Option` имеет большое количество способов, применимых в различных случаях; вы можете ознакомиться с ними в [его пособии]. Знакомство с способами перечисления `Option` будет чрезвычайно полезным в вашем путешествии с Ржавчиной.
 
-В общем случае, чтобы использовать значение `Option`, нужен код, который будет обрабатывать все варианты перечисления `Option`. Вам понадобится некоторый код, который будет работать только тогда, когда у вас есть значение `Some(T)`, и этому коду разрешено использовать внутри `T`. Также вам понадобится другой код, который будет работать, если у вас есть значение `None`, и у этого кода не будет доступного значения `T`. Выражение match — это конструкция управления потоком выполнения программы, которая делает именно это при работе с перечислениями: она запускает разный код в зависимости от того, какой вариант перечисления имеется, и этот код может использовать данные, находящиеся внутри совпавшего варианта.
+В общем случае, чтобы использовать значение `Option`, нужна рукопись, которая будет обрабатывать все исходы перечисления `Option`. Вам понадобится некоторая рукопись, которая будет работать только тогда, когда у вас есть значение `Some(T)`, и этой рукописи разрешено использовать внутри `T`. Также вам понадобится другая рукопись, которая будет работать, если у вас есть значение `None`, и у этой рукописи не будет доступного значения `T`. Выражение match — это устройство управления потоком выполнения программы, которое делает именно это при работе с перечислениями: оно запускает разные указания в зависимости от того, какой исход перечисления имеется, и это средство может использовать указания, находящиеся внутри совпавшего исхода.
 
 
-[определено стандартной библиотекой  следующим образом:]: ../std/option/enum.Option.html
-[его документации]: ../std/option/enum.Option.html
\ No newline at end of file
+[определено встроенной библиотекой]: ../std/option/enum.Option.html
+[его пособии]: ../std/option/enum.Option.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch06-02-match.md b/rustbook-ru/src/ch06-02-match.md
index f40cf3a6d..f27f69950 100644
--- a/rustbook-ru/src/ch06-02-match.md
+++ b/rustbook-ru/src/ch06-02-match.md
@@ -2,29 +2,29 @@
 
 
 
-## Управляющая конструкция `match`
+## Управляющее средство `match`
 
-В Rust есть чрезвычайно мощный механизм управления потоком, именуемый `match`, который позволяет сравнивать значение с различными шаблонами и затем выполнять код в зависимости от того, какой из шаблонов совпал. Шаблоны могут состоять из литеральных значений, имён переменных, подстановочных знаков и многого другого; в главе 18 рассматриваются все различные виды шаблонов и то, что они делают. Сила match заключается в выразительности шаблонов и в том, что компилятор проверяет, что все возможные случаи обработаны.
+В Ржавчине есть чрезвычайно мощный рычаг управления потоком, именуемый `match`, который позволяет сравнивать значение с различными образцами данных и затем выполнять рукопись в зависимости от того, какой из образцов совпал. Образцы могут состоять из записанных значений, имён переменных, подстановочных знаков и многого другого; в главе 18 рассматриваются все различные виды данных образцов и то, что они делают. Сила match заключается в выразительности образцов и в том, что сборщик проверяет, что все возможные исходы.
 
-Думайте о выражении `match` как о машине для сортировки монет: монеты скользят по дорожке с различными по размеру отверстиями, и каждая монета падает через первое попавшееся отверстие, в которое она поместилась. Таким же образом значения проходят через каждый шаблон в `match`, и при первом же "подходящем" шаблоне значение попадает в соответствующий блок кода, который будет использоваться во время выполнения.
+Думайте о выражении `match` как о машине для упорядочивания монет: монеты скользят по дорожке с различными по размеру отверстиями, и каждая монета падает через первое попавшееся отверстие, в которое она поместилась. Таким же образом значения проходят через каждый образец данных в `match`, и при первом же "подходящем" образце значение попадает в соответствующий раздел рукописи, который будет использоваться во время выполнения.
 
-Говоря о монетах, давайте используем их в качестве примера, используя `match`! Для этого мы напишем функцию, которая будет получать на вход неизвестную монету Соединённых Штатов и, подобно счётной машине, определять, какая это монета, и возвращать её стоимость в центах, как показано в листинге 6-3.
+Говоря о монетах, давайте используем их в качестве примера, используя `match`! Для этого мы напишем функцию, которая будет получать на вход неизвестную монету Соединённых Штатов и, подобно счётной машине, определять, какая это монета, и возвращать её стоимость в центах, как показано в приложении 6-3.
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs:here}}
 ```
 
-Листинг 6-3: Перечисление и выражение match, использующее в качестве шаблонов его варианты
+Приложение 6-3: Перечисление и выражение match, использующее в качестве образцов его исходы
 
-Давайте разберём `match` в функции `value_in_cents`. Сначала пишется ключевое слово `match`, затем следует выражение, которое в данном случае является значением `coin`. Это выглядит очень похоже на условное выражение, используемое в `if`, но есть большая разница: с `if` выражение должно возвращать булево значение, а здесь это может быть любой тип. Тип `coin` в этом примере — перечисление типа Coin, объявленное в строке 1.
+Давайте разберём `match` в функции `value_in_cents`. Сначала пишется ключевое слово `match`, затем следует выражение, которое в данном случае является значением `coin`. Это выглядит очень похоже на условное выражение, используемое в `if`, но есть большая разница: с `if` выражение должно возвращать разумное значение, а здесь это может быть любой вид данных. Вид данных `coin` в этом примере — перечисление вида данныхCoin, объявленное в строке 1.
 
-Далее идут ветки `match`. Ветки состоят из двух частей: шаблон и некоторый код. Здесь первая ветка имеет шаблон, который является значением `Coin::Penny`, затем идёт оператор `=>`, который разделяет шаблон и код для выполнения. Код в этом случае - это просто значение `1`. Каждая ветка отделяется от последующей при помощи запятой.
+Далее идут ветки `match`. Ветки состоят из двух частей: образец данных и некоторая рукопись. Здесь первая ветка имеет образец данных, который является значением `Coin::Penny`, затем идёт приказчик `=>`, который разделяет образец данных и рукопись для выполнения. Рукопись в этом случае - это просто значение `1`. Каждая ветка отделяется от последующей при помощи запятой.
 
-Когда выполняется выражение `match`, оно сравнивает полученное значение с образцом каждого ответвления по порядку. Если образец совпадает со значением, то выполняется код, связанный с этим образцом. Если этот образец не соответствует значению, то выполнение продолжается со следующей ветки, так же, как в автомате по сортировке монет. У нас может быть столько ответвлений, сколько нужно: в листинге 6-3 наш `match` состоит из четырёх ответвлений.
+Когда используется выражение `match`, оно сравнивает полученное значение с образцом каждого ответвления по порядку. Если образец данных совпадает со значением, то выполняется рукопись, связанная с этим образцом. Если этот образец данных не соответствует значению, то выполнение продолжается со следующей ветки, так же, как в устройстве по упорядочиванию монет. У нас может быть столько ответвлений, сколько нужно: в приложении 6-3 наш `match` состоит из четырёх ответвлений.
 
-Код, связанный с каждым ответвлением, является выражением, а полученное значение выражения в соответствующем ответвлении — это значение, которое возвращается для всего выражения `match`.
+Рукопись, связанная с каждым ответвлением, является выражением, а полученное значение выражения в соответствующем ответвлении — это значение, которое возвращается для всего выражения `match`.
 
-Обычно фигурные скобки не используются, если код совпадающей ветви невелик, как в листинге 6-3, где каждая ветвь просто возвращает значение. Если вы хотите выполнить несколько строк кода в одной ветви, вы должны использовать фигурные скобки, а запятая после этой ветви необязательна. Например, следующий код печатает "Lucky penny!" каждый раз, когда метод вызывается с `Coin::Penny`, но при этом он возвращает последнее значение блока - `1`:
+Обычно узорчатые скобки не используются, если рукопись совпадающей ветви невелика, как в приложении 6-3, где каждая ветвь просто возвращает значение. Если вы хотите выполнить несколько строк рукописи в одной ветви, вы должны использовать узорчатые скобки, а запятая после этой ветви необязательна. Например, следующая рукопись выводит "Lucky penny!" каждый раз, когда способ вызывается с `Coin::Penny`, но при этом он возвращает последнее значение раздела - `1`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/src/main.rs:here}}
@@ -32,112 +32,112 @@
 
 ### Образцы, привязывающие значения
 
-Есть ещё одно полезное качество у веток в выражении match: они могут привязываться к частям тех значений, которые совпали с шаблоном. Благодаря этому можно извлекать значения из вариантов перечисления.
+Есть ещё одно полезное качество у веток в выражении match: они могут привязываться к частям тех значений, которые совпали с образцом. Благодаря этому можно извлекать значения из исходов перечисления.
 
-В качестве примера, давайте изменим один из вариантов перечисления так, чтобы он хранил в себе данные. С 1999 по 2008 год Соединённые Штаты чеканили 25 центов с различным дизайном на одной стороне для каждого из 50 штатов. Ни одна другая монета не получила дизайна штата, только четверть доллара имела эту дополнительную особенность. Мы можем добавить эту информацию в наш `enum` путём изменения варианта `Quarter` и включить в него значение `UsState`, как сделано в листинге 6-4.
+В качестве примера, давайте изменим один из исходов перечисления так, чтобы он хранил в себе данные. С 1999 по 2008 год Соединённые Штаты чеканили 25 центов с различным внешнем видом на одной стороне для каждого из 50 штатов. Ни одна другая монета не получила внешнего вида штата, только четверть доллара имела эту дополнительную особенность. Мы можем добавить эти сведения в наш `enum` путём изменения исхода `Quarter` и включить в него значение `UsState`, как сделано в приложении 6-4.
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs:here}}
 ```
 
-Листинг 6-4: Перечисление Coin, в котором вариант Quarter также сохраняет значение UsState
+Приложение 6-4: Перечисление Coin, в котором исход Quarter также сохраняет значение UsState
 
-Представьте, что ваш друг пытается собрать четвертаки всех 50 штатов. Сортируя монеты по типу, мы также будем сообщать название штата, к которому относится каждый четвертак, чтобы, если у нашего друга нет такой монеты, он мог добавить её в свою коллекцию.
+Представьте, что ваш друг пытается собрать четвертаки всех 50 штатов. Упорядочивая монеты по виду, мы также будем сообщать название штата, к которому относится каждый четвертак, чтобы, если у нашего друга нет такой монеты, он мог добавить её в своё собрание.
 
-В выражении match для этого кода мы добавляем переменную с именем `state` в шаблон, который соответствует значениям варианта `Coin::Quarter`. Когда `Coin::Quarter` совпадёт с шаблоном, переменная `state` будет привязана к значению штата этого четвертака. Затем мы сможем использовать `state` в коде этой ветки, вот так:
+В выражении match для этой рукописи мы добавляем переменную с именем `state` в образец данных, который соответствует значениям исхода `Coin::Quarter`. Когда `Coin::Quarter` совпадёт с образцом, переменная `state` будет привязана к значению штата этого четвертака. Затем мы сможем использовать `state` в рукописи этой ветки, вот так:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/src/main.rs:here}}
 ```
 
-Если мы сделаем вызов функции `value_in_cents(Coin::Quarter(UsState::Alaska))`, то `coin` будет иметь значение `Coin::Quarter(UsState::Alaska)`. Когда мы будем сравнивать это значение с каждой из веток, ни одна из них не будет совпадать, пока мы не достигнем варианта `Coin::Quarter(state)`. В этот момент `state` привяжется к значению `UsState::Alaska`. Затем мы сможем использовать эту привязку в выражении `println!`, получив таким образом внутреннее значение варианта `Quarter` перечисления `Coin`.
+Если мы сделаем вызов функции `value_in_cents(Coin::Quarter(UsState::Alaska))`, то `coin` будет иметь значение `Coin::Quarter(UsState::Alaska)`. Когда мы будем сравнивать это значение с каждой из веток, ни одна из них не будет совпадать, пока мы не достигнем исхода `Coin::Quarter(state)`. В это мгновение `state` привяжется к значению `UsState::Alaska`. Затем мы сможем использовать эту привязку в выражении `println!`, получив таким образом внутреннее значение исхода `Quarter` перечисления `Coin`.
 
-### Сопоставление шаблона для `Option`
+### Сопоставление образца данных для `Option`
 
-В предыдущем разделе мы хотели получить внутреннее значение `T` для случая `Some` при использовании `Option`; мы можем обработать тип `Option` используя `match`, как уже делали с перечислением `Coin`! Вместо сравнения монет мы будем сравнивать варианты `Option`, независимо от этого изменения механизм работы выражения `match` останется прежним.
+В предыдущем разделе мы хотели получить внутреннее значение `T` для случая `Some` при использовании `Option`; мы можем обработать вид данных `Option` используя `match`, как уже делали с перечислением `Coin`! Вместо сравнения монет мы будем сравнивать исходы `Option`, независимо от этого изменения рычаг работы выражения `match` останется прежним.
 
-Допустим, мы хотим написать функцию, которая принимает `Option` и если есть значение внутри, то добавляет 1 к существующему значению. Если значения нет, то функция должна возвращать значение `None` и не пытаться выполнить какие-либо операции.
+Допустим, мы хотим написать функцию, которая принимает `Option` и если есть значение внутри, то добавляет 1 к существующему значению. Если значения нет, то функция должна возвращать значение `None` и не пытаться выполнить какие-либо действия.
 
-Такую функцию довольно легко написать благодаря выражению `match`, код будет выглядеть как в листинге 6-5.
+Такую функцию довольно легко написать благодаря выражению `match`, рукопись будет выглядеть как в приложении 6-5.
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs:here}}
 ```
 
-Листинг 6-5: Функция, использующая выражение match для Option<i32>
+Приложение 6-5: Функция, использующая выражение match для Option<i32>
 
-Давайте более подробно рассмотрим первое выполнение `plus_one`. Когда мы вызываем `plus_one(five)`, переменная `x` в теле `plus_one` будет иметь значение `Some(5)`. Затем мы сравниваем это значение с каждой ветвью сопоставления:
+Давайте более подробно рассмотрим первое использование `plus_one`. Когда мы вызываем `plus_one(five)`, переменная `x` в теле `plus_one` будет иметь значение `Some(5)`. Затем мы сравниваем это значение с каждой ветвью сопоставления:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs:first_arm}}
 ```
 
-Значение `Some(5)` не соответствует образцу `None`, поэтому мы продолжаем со следующим ответвлением:
+Значение `Some(5)` не соответствует образцу данных `None`, поэтому мы продолжаем со следующим ответвлением:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs:second_arm}}
 ```
 
-Совпадает ли `Some(5)` с образцом `Some(i)`? Да, это так! У нас такой же вариант. Тогда переменная `i` привязывается к значению, содержащемуся внутри `Some`, поэтому `i` получает значение `5`. Затем выполняется код ассоциированный для данного ответвления, поэтому мы добавляем 1 к значению `i` и создаём новое значение `Some` со значением `6` внутри.
+Совпадает ли `Some(5)` с образцом `Some(i)`? Да, это так! У нас такой же исход. Тогда переменная `i` привязывается к значению, содержащемуся внутри `Some`, поэтому переменная `i` получает значение `5`. Затем выполняется рукопись сопряженная для данного ответвления, поэтому мы добавляем 1 к значению  переменной`i` и создаём новое значение `Some` со значением `6` внутри.
 
-Теперь давайте рассмотрим второй вызов `plus_one` в листинге 6-5, где `x` является `None`. Мы входим в выражение `match` и сравниваем значение с первым ответвлением:
+Теперь давайте рассмотрим второй вызов `plus_one` в приложении 6-5, где `x` является `None`. Мы входим в выражение `match` и сравниваем значение с первым ответвлением:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs:first_arm}}
 ```
 
-Оно совпадает! Для данной ветки шаблон (None) не подразумевает наличие какого-то значения к которому можно было бы что-то добавить, поэтому программа останавливается и возвращает значение которое находится справа от `=>` - т.е. `None`. Так как шаблон первой ветки совпал, то никакие другие шаблоны веток не сравниваются.
+Оно совпадает! Для данной ветки образец  данных (None) не подразумевает наличие какого-то значения к которому можно было бы что-то добавить, поэтому программа останавливается и возвращает значение которое находится справа от `=>` - т.е. `None`. Так как образец данных первой ветки совпал, то никакие другие образцы веток не сравниваются.
 
-Комбинирование `match` и перечислений полезно во многих ситуациях. Вы часто будете видеть подобную комбинацию в коде на Rust: сделать сопоставление значений перечисления используя `match`, привязать переменную к данным внутри значения, выполнить код на основе привязанных данных. Сначала это может показаться немного сложным, но как только вы привыкнете, то захотите чтобы такая возможность была бы во всех языках. Это неизменно любимый пользователями приём.
+Соединение `match` и перечислений полезно во многих случаях. Вы часто будете видеть подобное сочетание в рукописи на Ржавчине: сделать сопоставление значений перечисления используя `match`, привязать переменную к данным внутри значения, выполнить рукопись на основе привязанных данных. Сначала это может показаться немного сложным, но как только вы привыкнете, то захотите чтобы такая возможность была бы во всех языках. Это неизменно любимый пользователями приём.
 
-### Match объемлет все варианты значения
+### Match охватывает все исходы значения
 
-Есть ещё один аспект `match`, который мы должны обсудить: шаблоны должны покрывать все возможные варианты. Рассмотрим эту версию нашей функции `plus_one`, которая содержит ошибку и не компилируется:
+Есть ещё одна особенность `match`, которую мы должны обсудить: образцы должны покрывать все возможные исходы. Рассмотрим это исполнение нашей функции `plus_one`, которое содержит ошибку и не собирается:
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/src/main.rs:here}}
 ```
 
-Мы не обработали вариант `None`, поэтому этот код вызовет дефект в программе. К счастью, Rust знает и умеет ловить такой случай. Если мы попытаемся скомпилировать такой код, мы получим ошибку компиляции:
+Мы не обработали исход `None`, поэтому эта рукопись вызовет сбой в программе. К счастью, Ржавчина знает и умеет ловить такой случай. Если мы попытаемся собрать такую рукопись, мы получим ошибку сборки:
 
 ```console
 {{#include ../listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt}}
 ```
 
-Rust знает, что мы не описали все возможные случаи, и даже знает, какой именно из шаблонов мы упустили! Сопоставления в Rust являются *исчерпывающими*: мы должны покрыть все возможные варианты, чтобы код был корректным. Особенно в случае `Option`, когда Rust не даёт нам забыть обработать явным образом значение `None`, тем самым он защищает нас от предположения, что у нас есть значение, в то время как у нас может быть и null, что делает невозможным совершить ошибку на миллиард долларов, о которой говорилось ранее.
+Ржавчина знает, что мы не описали все возможные исходы, и даже знает, какой именно из образцов мы упустили! Сопоставления в Ржавчине являются *исчерпывающими*: мы должны покрыть все возможные исходы, чтобы рукопись была правильной. Особенно в случае `Option`, когда Ржавчина не даёт нам забыть обработать явным образом значение `None`, тем самым он защищает нас от предположения, что у нас есть значение, в то время как у нас может быть и пустота, что делает невозможным совершить ошибку на миллиард долларов, о которой говорилось ранее.
 
-### Универсальные шаблоны и заполнитель `_`
+### Гибкие образцы и исполнитель `_`
 
-Используя перечисления, мы также можем выполнять специальные действия для нескольких определённых значений, а для всех остальных значений выполнять одно действие по умолчанию. Представьте, что мы реализуем игру, в которой при выпадении 3 игрок не двигается, а получает новую модную шляпу. Если выпадает 7, игрок теряет шляпу. При всех остальных значениях ваш игрок перемещается на столько-то мест на игровом поле. Вот `match`, реализующий эту логику, в котором результат броска костей жёстко закодирован, а не является случайным значением, а вся остальная логика представлена функциями без тел, поскольку их реализация не входит в рамки данного примера:
+Используя перечисления, мы также можем выполнять особые действия для нескольких определённых значений, а для всех остальных значений выполнять одно действие по умолчанию. Представьте, что мы выполняем игру, в которой при выпадении 3 игрок не двигается, а получает новую шляпу нового образца . Если выпадает 7, игрок теряет шляпу. При всех остальных значениях ваш игрок перемещается на столько-то мест на игровом поле. Вот средство `match`, выполняющее этот ход мыслей, в котором итог броска костей жёстко задан, а не является случайным значением, а вся остальной ход мыслей представлена функциями без тел, поскольку их выполнение не входит в рамки данного примера:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/src/main.rs:here}}
 ```
 
-Для первых двух веток шаблонами являются литеральные значения 3 и 7. Для последней ветки, которая охватывает все остальные возможные значения, шаблоном является переменная, которую мы решили назвать `other`. Код, выполняемый для ветки `other`, использует эту переменную, передавая её в функцию `move_player`.
+Для первых двух веток образцами данных являются записанные значения 3 и 7. Для последней ветки, которая охватывает все остальные возможные значения, образцом является переменная, которую мы решили назвать `other`. Рукопись, выполняемая для ветки `other`, использует эту переменную, передавая её в функцию `move_player`.
 
-Этот код компилируется, даже если мы не перечислили все возможные значения `u8`, потому что последний паттерн будет соответствовать всем значениям, не указанным в конкретном списке. Этот универсальный шаблон удовлетворяет требованию, что соответствие должно быть исчерпывающим. Обратите внимание, что мы должны поместить ветку с универсальным шаблоном последней, потому что шаблоны оцениваются по порядку. Rust предупредит нас, если мы добавим ветки после универсального шаблона, потому что эти последующие ветки никогда не будут выполняться!
+Эта рукопись собирается, даже если мы не перечислили все возможные значения вида данных `u8`, потому что последний образец данных будет соответствовать всем значениям, не указанным в определенном списке. Этот гибкий образец данных удовлетворяет требованию, что соответствие должно быть исчерпывающим. Обратите внимание, что мы должны поместить ветку с гибким образцом последней, потому что образцы оцениваются по порядку. Ржавчина предупредит нас, если мы добавим ветки после гибкого образца, потому что эти последующие ветки никогда не будут выполняться!
 
-В Rust также есть шаблон, который можно использовать, когда мы не хотим использовать значение в универсальном шаблоне: `_`, который является специальным шаблоном, который соответствует любому значению и не привязывается к этому значению. Это говорит Rust, что мы не собираемся использовать это значение, поэтому Rust не будет предупреждать нас о неиспользуемой переменной.
+В Ржавчине также есть образец данных, который можно использовать, когда мы не хотим использовать значение в гибком образце: `_`, который является особым образцом, который соответствует любому значению и не привязывается к этому значению. Это говорит Ржавчине, что мы не собираемся использовать это значение, поэтому Ржавчина не будет предупреждать нас о неиспользуемой переменной.
 
-Давайте изменим правила игры так: если выпадает что-то, кроме 3 или 7, нужно бросить ещё раз. Нам не нужно использовать значение в этом случае, поэтому мы можем изменить наш код, чтобы использовать `_` вместо переменной с именем `other`:
+Давайте изменим правила игры так: если выпадает что-то, кроме 3 или 7, нужно бросить ещё раз. Нам не нужно использовать значение в этом случае, поэтому мы можем изменить нашу рукопись, чтобы использовать `_` вместо переменной с именем `other`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/src/main.rs:here}}
 ```
 
-Этот пример также удовлетворяет требованию исчерпывающей полноты, поскольку мы явно игнорируем все остальные значения в последней ветке; мы ничего не забыли.
+Этот пример также удовлетворяет требованию исчерпывающей полноты, поскольку мы явно пренебрегаем все остальные значения в последней ветке; мы ничего не забыли.
 
-Если мы изменим правила игры ещё раз, чтобы в ваш ход не происходило ничего другого, если вы бросаете не 3 или 7, мы можем выразить это, используя единичное значение (пустой тип кортежа, о котором мы упоминали в разделе ["Кортежи"]) в качестве кода, который идёт вместе с веткой `_`:
+Если мы изменим правила игры ещё раз, чтобы в ваш ход не происходило ничего другого, если вы бросаете не 3 или 7, мы можем выразить это, используя единичное значение (пустой вид данных упорядоченного ряда, о котором мы упоминали в разделе ["Упорядоченные ряды"]) в качестве рукописи, которая идёт вместе с веткой `_`:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/src/main.rs:here}}
 ```
 
-Здесь мы явно говорим Rust, что не собираемся использовать никакое другое значение, которое не соответствует шаблонам в предыдущих ветках, и не хотим запускать никакой код в этом случае.
+Здесь мы явно говорим Ржавчине, что не собираемся использовать никакое другое значение, которое не соответствует образцам в предыдущих ветках, и не хотим запускать никакую рукопись в этом случае.
 
-Подробнее о шаблонах и совпадениях мы поговорим в [Главе 18]. Пока же мы перейдём к синтаксису `if let`, который может быть полезен в ситуациях, когда выражение `match` слишком многословно.
+Подробнее о образцах и совпадениях мы поговорим в [Главе 18]. Пока же мы перейдём к правилам написания `if let`, который может быть полезен в случаях, когда выражение `match` слишком многословно.
 
 
-["Кортежи"]: ch03-02-data-types.html#the-tuple-type
+["Упорядоченные ряды"]: ch03-02-data-types.html#the-tuple-type
 [Главе 18]: ch18-00-patterns.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch06-03-if-let.md b/rustbook-ru/src/ch06-03-if-let.md
index f99d680db..58eaa2860 100644
--- a/rustbook-ru/src/ch06-03-if-let.md
+++ b/rustbook-ru/src/ch06-03-if-let.md
@@ -1,28 +1,28 @@
-## Компактное управление потоком выполнения с `if let`
+## Краткое управление потоком выполнения с `if let`
 
-Синтаксис `if let` позволяет скомбинировать `if` и `let` в менее многословную конструкцию, и затем обработать значения соответствующе только одному шаблону, одновременно игнорируя все остальные. Рассмотрим программу в листинге 6-6, которая обрабатывает сопоставление значения `Option` в переменной `config_max`, но хочет выполнить код только в том случае, если значение является вариантом `Some`.
+Правила написания `if let` позволяют сочетать `if` и `let` в менее многословное устройство, и затем обработать значения соответствующе только одному образцу данных, одновременно пренебрегая все остальные. Рассмотрим программу в приложении 6-6, которая обрабатывает сопоставление значения `Option` в переменной `config_max`, но хочет выполнить рукопись только в том случае, если значение является исходом `Some`.
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs:here}}
 ```
 
-Листинг 6-6. Выражение match, которое выполнит код только при значении равном Some
+Приложение 6-6: Выражение match, которое выполнит рукопись только при значении равном Some
 
-Если значение равно `Some`, мы распечатываем значение в варианте `Some`, привязывая значение к переменной `max` в шаблоне. Мы не хотим ничего делать со значением `None`. Чтобы удовлетворить выражение `match`, мы должны добавить `_ => ()` после обработки первой и единственной ветки, и добавление шаблонного кода раздражает.
+Если значение равно `Some`, мы выводим значение в исходе `Some`, привязывая значение к переменной `max` в образце. Мы не хотим ничего делать со значением `None`. Чтобы удовлетворить выражение `match`, мы должны добавить `_ => ()` после обработки первой и единственной ветки, и добавление образцовой рукописи раздражает.
 
-Вместо этого, мы могли бы написать это более коротким способом, используя `if let`. Следующий код ведёт себя так же, как выражение `match` в листинге 6-6:
+Вместо этого, мы могли бы написать это более коротким способом, используя `if let`. Следующая рукопись ведёт себя так же, как выражение `match` в приложении 6-6:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/src/main.rs:here}}
 ```
 
-Синтаксис `if let` принимает шаблон и выражение, разделённые знаком равенства. Он работает так же, как `match`, когда в него на вход передадут выражение и подходящим шаблоном для этого выражения окажется первая ветка. В данном случае шаблоном является `Some(max)`, где `max` привязывается к значению внутри `Some`. Затем мы можем использовать `max` в теле блока `if let` так же, как мы использовали `max` в соответствующей ветке `match`. Код в блоке `if let` не запускается, если значение не соответствует шаблону.
+Согласно Правил написания `if let` принимает образец данных и выражение, разделённые знаком равенства. Он работает так же, как `match`, когда в него на вход передадут выражение и подходящим образцом для этого выражения окажется первая ветка. В данном случае образцом является `Some(max)`, где `max` привязывается к значению внутри `Some`. Затем мы можем использовать `max` в теле раздела `if let` так же, как мы использовали `max` в соответствующей ветке `match`. Рукопись в разделе `if let` не запускается, если значение не соответствует образцу данных.
 
-Используя `if let` мы меньше печатаем, меньше делаем отступов и меньше получаем шаблонного кода. Тем не менее, мы теряем полную проверку всех вариантов, предоставляемую выражением `match`. Выбор между `match` и `if let` зависит от того, что вы делаете в вашем конкретном случае и является ли получение краткости при потере полноты проверки подходящим компромиссом.
+Используя `if let` мы меньше выводим, меньше делаем отступов и меньше получаем образцовой рукописи. Тем не менее, мы теряем полную проверку всех исходов, предоставляемую выражением `match`. Выбор между `match` и `if let` зависит от того, что вы делаете в вашем определенном случае и является ли получение краткости при потере полноты проверки подходящим решением.
 
-Другими словами, вы можете думать о конструкции `if let` как о синтаксическом сахаре для `match`, который выполнит код если входное значение будет соответствовать единственному шаблону, и проигнорирует все остальные значения.
+Другими словами, вы можете думать о стопке `if let` как о связанном сахаре для `match`, который выполнит рукопись если входное значение будет соответствовать единственному образцу данных, и пренебрегает все остальные значения.
 
-Можно добавлять `else` к `if let`. Блок кода, который находится внутри `else` аналогичен по смыслу блоку кода ветки связанной с шаблоном `_` выражения `match` (которое эквивалентно сборной конструкции `if let` и `else`). Вспомним объявление перечисления `Coin` в листинге 6-4, где вариант `Quarter` также содержит внутри значение штата типа `UsState`. Если бы мы хотели посчитать все монеты не являющиеся четвертями, а для четвертей печатать название штата, то мы могли бы сделать это с помощью выражения `match` таким образом:
+Можно добавлять `else` к `if let`. Раздел рукописи, который находится внутри `else` подобен по смыслу разделу рукописи ветки связанной с образцом `_` выражения `match` (которое равнозначно сборной стопки `if let` и `else`). Вспомним объявление перечисления `Coin` в приложении 6-4, где исход `Quarter` также содержит внутри значение штата вида данных `UsState`. Если бы мы хотели посчитать все монеты не являющиеся четвертями, а для четвертей выводить название штата, то мы могли бы сделать это с помощью выражения `match` таким образом:
 
 ```rust
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/src/main.rs:here}}
@@ -34,12 +34,12 @@
 {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/src/main.rs:here}}
 ```
 
-Если у вас есть ситуация в которой ваша программа имеет логику которая слишком многословна для того чтобы её выражать используя `match`, помните, о том, что также в вашем наборе инструментов Rust есть `if let`.
+Если у вас есть случай в которой ваша программа имеет ход мыслей, который слишком многословен для того чтобы его выражать используя `match`, помните, о том, что также в вашем наборе средств Ржавчине есть `if let`.
 
 ## Итоги
 
-Мы рассмотрели как использовать перечисления для создания пользовательских типов, которые могут быть одним из наборов перечисляемых значений. Мы показали, как тип `Option` из стандартной библиотеки помогает использовать систему типов для предотвращения ошибок. А когда значения перечисления имеют данные внутри них, можно использовать `match` или `if let`, чтобы извлечь и пользоваться значением, в зависимости от того, сколько случаев нужно обработать.
+Мы рассмотрели как использовать перечисления для создания пользовательских видов данных, которые могут быть одним из наборов перечисляемых значений. Мы показали, как вид данных `Option` из встроенной библиотеки помогает использовать систему видов данных для предотвращения ошибок. А когда значения перечисления имеют данные внутри них, можно использовать `match` или `if let`, чтобы извлечь и пользоваться значением, в зависимости от того, сколько случаев нужно обработать.
 
-Теперь ваши программы на Rust могут выражать концепции вашей предметной области, используя структуры и перечисления. Создание и использование пользовательских типов в API обеспечивает типобезопасность: компилятор позаботится о том, чтобы функции получали значения только того типа, который они ожидают.
+Теперь ваши программы на Ржавчине могут выражать подходы вашей предметной области, используя стопки и перечисления. Создание и использование пользовательских видов данных в API обеспечивает безопасность видов данных: сборщик позаботится о том, чтобы функции получали значения только того вида данных, который они ожидают.
 
-Чтобы предоставить вашим пользователям хорошо организованный API, который прост в использовании и предоставляет только то, что нужно вашим пользователям, надо поговорить о модулях в Rust.
+Чтобы предоставить вашим пользователям хорошо согласованный API, который прост в использовании и предоставляет только то, что нужно вашим пользователям, надо поговорить о разделах в Ржавчине.
diff --git a/rustbook-ru/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md b/rustbook-ru/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md
index 55f8a3d3f..037929c0a 100644
--- a/rustbook-ru/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md
+++ b/rustbook-ru/src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md
@@ -1,21 +1,21 @@
-# Управление растущими проектами с помощью пакетов, крейтов и модулей
+# Управление растущими делами с помощью дополнений, ящиков и разделов
 
-По мере роста кодовой базы ваших программ, организация проекта будет иметь большое значение, ведь отслеживание всей программы в голове будет становиться всё более сложным.  Группируя связанные функции и разделяя код по основным функциональностям (фичам, feature), вы делаете более прозрачным понимание о том, где искать код реализующий определённую функцию и где стоит вносить изменения для того чтобы изменить её поведение.
+По мере роста хранилища рукописей ваших программ, создание дела будет иметь большое значение, ведь отслеживание всей программы в голове будет становиться всё более сложным.  Объединяя сопряженные функции и разделяя рукопись по основным возможностям (feature), вы делаете более прозрачным понимание о том, где искать рукопись, выполняющую определённую функцию и где стоит вносить изменения для того чтобы изменить её поведение.
 
-Программы, которые мы писали до сих пор, были в одном файле одного модуля. По мере роста проекта, мы можем организовывать код иначе, разделив его на несколько модулей и несколько файлов. Пакет может содержать несколько бинарных крейтов и опционально один крейт библиотеки. Пакет может включать в себя много бинарных крейтов и опционально один библиотечный крейт. По мере роста пакета вы можете извлекать части программы в отдельные крейты, которые затем станут внешними зависимостями для основного кода нашей программы. Эта глава охватывает все эти техники. В свою очередь для очень крупных проектов, состоящих из набора взаимосвязанных пакетов развивающихся вместе, Cargo предоставляет рабочие пространства, *workspaces*, их мы рассмотрим за пределами данной главы, в разделе ["Рабочие пространства Cargo"] Главы 14.
+Программы, которые мы писали до сих пор, были в одном файле одного раздела. По мере роста дела, мы можем создавать рукопись иначе, разделив её на несколько разделов и несколько файлов. Дополнение может включать в себя много двоичных ящиков и дополнительно один библиотечный ящик. По мере роста дополнения вы можете извлекать части программы в отдельные ящики, которые затем станут внешними дополнениями для основной рукописи нашей программы. Эта глава охватывает все эти способы. В свою очередь для очень крупных дел, состоящих из набора взаимосвязанных дополнений развивающихся вместе, Cargo предоставляет рабочие пространства, *workspaces*, их мы рассмотрим за пределами данной Главы, в разделе ["Рабочие пространства Cargo"] Главы 14.
 
-Мы также обсудим инкапсуляцию деталей, которая позволяет использовать код снова на более высоком уровне: единожды реализовав какую-то операцию, другой код может вызывать этот код через публичный интерфейс, не зная как работает реализация. То, как вы пишете код, определяет какие части общедоступны для использования другим кодом и какие части являются закрытыми деталями реализации для которых вы оставляете право на изменения только за собой. Это ещё один способ ограничить количество деталей, которые вы должны держать в голове.
+Мы также обсудим инкапсуляцию подробностей, которая позволяет использовать рукопись снова на более высоком уровне: единожды выполнив какое-либо действие, другая рукопись может вызывать эту рукопись через открытую внешнюю оболочку, не зная как работает эта рукопись. То, как вы пишете рукопись, определяет какие части общедоступны для использования другой рукописью и какие части являются закрытыми разделами, для которых вы оставляете право на изменения только за собой. Это ещё один способ ограничить количество подробностей, которые вы должны держать в голове.
 
-Связанное понятие - это область видимости: вложенный контекст в котором написан код имеющий набор имён, которые определены «в текущей области видимости». При чтении, письме и компиляции кода, программистам и компиляторам необходимо знать, относится ли конкретное имя в определённом месте к переменной, к функции, к структуре, к перечислению, к модулю, к константе или другому элементу и что означает этот элемент. Можно создавать области видимости и изменять какие имена входят или выходят за их рамки. Нельзя иметь два элемента с тем же именем в одной области; есть доступные инструменты для разрешения конфликтов имён.
+Связанное понятие - это область видимости: вложенная среда в которой написана рукопись, имеющая набор имён, которые определены «в текущей области видимости». При чтении, написании и сборки рукописи, программистам и сборщикам необходимо знать, относится ли определенное имя в определённом месте к переменной, к функции, к стопке, к перечислению, к разделу, к постоянной переменной или другой переменной и что означает эта переменная. Можно создавать области видимости и изменять какие имена входят или выходят за их рамки. Нельзя иметь два имени переменных или способа с тем же именем в одной области; есть доступные средства для разрешения несоответствий имён.
 
-Rust имеет ряд функций, которые позволяют управлять организацией кода, в том числе управлять тем какие детали открыты, какие детали являются частными, какие имена есть в каждой области вашей программы. Эти функции иногда вместе именуемые *модульной системой* включают в себя:
+Ржавчина имеет ряд функций, которые позволяют управлять согласованием рукописи, в том числе управлять тем какие подробности открыты, какие подробности являются частными, какие имена есть в каждой области вашей программы. Эти функции иногда вместе именуемые *состоящими из разделов системой* включают в себя:
 
-- **Пакеты:** Функционал Cargo позволяющий собирать, тестировать и делиться крейтами
-- **Крейты:** Дерево модулей, которое создаёт библиотечный или исполняемый файл
-- **Модули** и **use:** Позволяют вместе контролировать организацию, область видимости и скрытие путей
-- **Пути:** способ именования элемента, такого как структура, функция или модуль
+- **Дополнения:** Возможности Cargo позволяющие собирать, проверять и делиться ящиками
+- **Ящики:** Дерево разделов, которое создаёт библиотечный или исполняемый файл
+- **Разделы** и **use:** Позволяют вместе управлять устройством всего дела, областью видимости и скрытием путей
+- **Пути:** способ именования переменной или способа, таких как стопка, функция или раздел
 
-В этой главе мы рассмотрим все эти функции, обсудим как они взаимодействуют и объясним, как использовать их для управления областью видимости. К концу у вас должно появиться солидное понимание модульной системы и умение работать с областями видимости на уровне профессионала!
+В этой главе мы рассмотрим все эти функции, обсудим как они взаимодействуют и объясним, как использовать их для управления областью видимости. К концу у вас должно появиться целостное понимание разделения рукописи и умение работать с областями видимости на уровне искусника!
 
 
 ["Рабочие пространства Cargo"]: ch14-03-cargo-workspaces.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch07-00-modules.md b/rustbook-ru/src/ch07-00-modules.md
index c12a7cd80..345f51b51 100644
--- a/rustbook-ru/src/ch07-00-modules.md
+++ b/rustbook-ru/src/ch07-00-modules.md
@@ -1,21 +1,13 @@
-# Использование модулей для организации и многократного использования кода
+# Использование разделов для согласования и многократного использования рукописи
 
-Когда вы только начинаете писать программу, ваш код может совершенно свободно
-поместиться в функции `main`. Но по мере создания функциональных возможностей, добавления
-все большего и большего количества функций вам понадобиться организовать код в
-удобные для чтения, группировки структуры. Для этого в Rust есть система модулей.
+Когда вы только начинаете писать программу, ваша рукопись может совершенно свободно поместиться в функции `main`. Но по мере создания полезных возможностей, добавления все большего и большего количества функций вам понадобиться согласовать рукописи в удобные для чтения, объединения стопок. Для этого в Ржавчине есть устройство управления разделами.
 
-Также, как вы используете код программы в функциях, вы можете использовать функции в
-модулях. Модуль представляет собой пространство имён, в которое могут входить
-различные функции и типы. Вы также можете управлять видимостью внутри модуля.
+Также, как вы используете рукопись программы в функциях, вы можете использовать функции в разделах. Раздел представляет собой пространство имён, в которое могут входить различные функции и виды данных. Вы также можете управлять видимостью внутри раздела.
 
-Общее описание возможностей модулей:
+Общее описание возможностей разделов:
 
-* Ключевое слово `mod` объявляет модуль. Код следующий после объявления модуля считается
-включенным в него.
-* По умолчанию, модуль закрыт и чтобы извне был доступ к его элементам это надо указать
-в коде. Для этого используется ключевое слово `pub`.
-* Ключевое слов `use` даёт возможность использовать в тексте программы функционал
-модуля.
+* Ключевое слово `mod` объявляет раздел. Рукопись следующая после объявления раздела считается включенной в него.
+* По умолчанию, раздел закрыто и чтобы извне был доступ к его переменным это надо указать в рукописи. Для этого используется ключевое слово `pub`.
+* Ключевое слов `use` даёт возможность использовать в писании программы возможности раздела.
 
-Мы рассмотрим подробнее все эти возможности в следующих секциях.
+Мы рассмотрим подробнее все эти возможности в следующих главах.
diff --git a/rustbook-ru/src/ch07-01-mod-and-the-filesystem.md b/rustbook-ru/src/ch07-01-mod-and-the-filesystem.md
index a31fe6b51..98151cb30 100644
--- a/rustbook-ru/src/ch07-01-mod-and-the-filesystem.md
+++ b/rustbook-ru/src/ch07-01-mod-and-the-filesystem.md
@@ -1,12 +1,11 @@
 ## `mod` и файловая система
 
-Мы начнём создавать наш пример использования модуля. Создадим проект библиотеки
-кода.
+Мы начнём создавать наш пример использования раздела. Создадим дело библиотеки рукописей.
 
-Создадим основные блоки нашей библиотеки, которая будет предоставлять функциональные
+Создадим основные разделы нашей библиотеки, которая будет предоставлять полезные 
 возможности использования сетевых технологий. Назовём нашу библиотеку `communicator`.
-По умолчанию Cargo создаёт библиотеки кода. Если при создании нового проекта мы
-не установим флаг `--bin`, то будет создана библиотека:
+По умолчанию Cargo создаёт библиотеки рукописей. Если при создании нового дела мы
+не установим клеймо `--bin`, то будет создана библиотека:
 
 ```text
 $ cargo new communicator
@@ -26,21 +25,20 @@ mod tests {
     }
 }
 ```
-Cargo  создаёт пустой тест, чтобы показать как можно тестировать функционал библиотеки.
-Мы изучим использование синтаксических конструкций `#[]` и `mod tests` в последующей
-секции "Использование `super` для доступа к родительскому модулю" этой главы.
+Cargo  создаёт пустую проверку, чтобы показать как можно проверять возможности библиотеки.
+Мы изучим использование связанных стопок `#[]` и `mod tests` в последующих разделах "Использование `super` для доступа к родительскому разделу" этой Главы.
 
-Сейчас же мы не будем использовать данный функционал, поэтому просто удалим этот код.
+Сейчас же мы не будем использовать данные возможности, поэтому просто удалим эту рукопись.
 
-Т.к. у нас нет файла *src/main.rs*, нечего запускать на выполнение с помощью команды
-`cargo run`. В тоже время мы можем воспользоваться командой `cargo build` для компиляции
+Т.к. у нас нет файла *src/main.rs*, нечего запускать на выполнение с помощью приказов
+`cargo run`. В тоже время мы можем воспользоваться приказом `cargo build` для сборки
 нашей библиотеки.
 
-Мы рассмотрим различные опции организации кода нашей библиотеки.
+Мы рассмотрим различные возможности согласования рукописей нашей библиотеки.
 
-### Определение модуля
+### Определение раздела
 
-Первым делом напишем определение модуля `network`, который будет содержать
+Первым делом напишем определение раздела `network`, которое будет содержать
 определение функции `connect`. Определение начинается с ключевого слова `mod`.
 
 
@@ -53,12 +51,12 @@ mod network {
 }
 ```
 
-После определения модуля, внутри фигурных скобок пишем определения функции и
-все что входит в состав модуля. В нашем случае это описание функции.
-Если мы хотим вызывать функцию извне модуля, мы должны явно указать это `network::connect()`.
+После определения раздела, внутри узорчатых скобок пишем определения функции и
+все что входит в состав раздела. В нашем случае это описание функции.
+Если мы хотим вызывать функцию извне раздела, мы должны явно указать это `network::connect()`.
 
-У нас может быть множество описаний модулей в одном файле  *src/lib.rs*.
-К примеру, модуль `client`, может содержать функцию `connect` 7-1:
+У нас может быть множество описаний разделов в одном файле  *src/lib.rs*.
+К примеру, раздел `client`, может содержать функцию `connect` 7-1:
 
 Filename: src/lib.rs
 
@@ -74,18 +72,17 @@ mod client {
 }
 ```
 
-Пример 7-1: Определение модулей `network` и `client`в файле
+Пример 7-1: Определение разделов `network` и `client`в файле
  *src/lib.rs*
 
-Теперь у нас есть описание двух функций, которые могут быть вызваны с помощью
-синтаксических конструкций `network::connect` и `client::connect`.
-У каждой из этих функций могут быть различные функциональные возможности, но у них нет
-между собой никакого конфликта имён.
+Теперь у нас есть описание двух функций, которые могут быть вызваны с помощью связанных стопок `network::connect` и `client::connect`.
+У каждой из этих функций могут быть различные полезные  возможности, но у них нет
+между собой никакого несоответствия имён.
 
 В этом случае, если мы создаём библиотеку, файл *src/lib.rs* хранит точку доступа к
-библиотеке.  Также мы можем создать модуль в файле  *src/main.rs*
-для какой-либо бинарной программы. Очень важная особенностью модулей - они
-могут быть вложенными. Это весьма удобно для логической организации кода.
+библиотеке.  Также мы можем создать раздел в файле  *src/main.rs*
+для какой-либо двоичной программы. Очень важная особенность разделов - они могут быть вложенными. 
+Это весьма удобно для разумного согласования рукописи.
 Пример 7-2:
 
 Filename: src/lib.rs
@@ -102,12 +99,12 @@ mod network {
 }
 ```
 
- Пример 7-2: Перемещение модуля `client` внутрь модуля `network`
+ Пример 7-2: Перемещение раздела `client` внутрь раздела `network`
 
 Теперь у нас есть две разные функции `network::connect` и `network::client::connect`.
 Каждая из которых находится в своём пространстве имён.
 
-Теперь организация нашего кода имеет вот такую структуру:
+Теперь создание нашей рукописи имеет вот такое устройство:
 
 ```text
 communicator
@@ -115,7 +112,7 @@ communicator
  └── client
 ```
 
-Пример вложенных модулей 7-2:
+Пример вложенных разделов 7-2:
 
 ```text
 communicator
@@ -123,12 +120,12 @@ communicator
      └── client
 ```
 
-Логическая организация кода зависит от ваших задач.
+Разумное создание рукописи зависит от ваших задач.
 
-### Размещение модулей по нескольким файлам
+### Размещение разделов по нескольким файлам
 
-Модульная структура похожа на файловую систему. Мы можем использовать модульную
-систему для хранения кода в разных файлах. Рассмотрим пример 7-3:
+Состоящее из разделов устройство похоже на файловую систему. Мы можем использовать состоящую из разделов
+систему для хранения рукописи в разных файлах. Рассмотрим пример 7-3:
 
 Filename: src/lib.rs
 
@@ -149,10 +146,10 @@ mod network {
 }
 ```
 
-Пример 7-3: Модули `client`, `network` и`network::server`,
+Пример 7-3: Разделы `client`, `network` и`network::server`,
 все они находятся в *src/lib.rs*
 
-Архитектура модулей *src/lib.rs*:
+Архитектура разделов *src/lib.rs*:
 
 ```text
 communicator
@@ -161,10 +158,9 @@ communicator
      └── server
 ```
 
-Если модули имеют множество функций и эти функции длинные, было бы удобно разделить
-такой код на несколько файлов.
+Если разделы имеют множество функций и эти функции длинные, было бы удобно разделить такую рукопись на несколько файлов.
 
-Сначала заменим код модуля `client` на декларацию модуля:
+Сначала заменим рукопись раздела `client` на объявление раздела:
 
 Filename: src/lib.rs
 
@@ -182,8 +178,7 @@ mod network {
 }
 ```
 
-Тут мы видим декларацию модуля. Этим мы сообщаем, что в другом месте есть определение
-модуля `client`:
+Тут мы видим объявление раздела. Этим мы сообщаем, что в другом месте есть определение раздела `client`:
 
 ```rust,ignore
 mod client {
@@ -191,7 +186,7 @@ mod client {
 }
 ```
 
-Теперь создадим файл *client.rs* в директории *src*:
+Теперь создадим файл *client.rs* в папки *src*:
 
 Filename: src/client.rs
 
@@ -199,17 +194,16 @@ mod client {
 fn connect() {
 }
 ```
-Обратите внимание, что вам не надо декларировать модуль, т.к. вы уже декларировали
-его в файле *src/lib.rs*. Файл *src/client.rs* содержит компоненты модуля `client`. Если же
-вы и здесь напишите декларацию модуля `mod client`, то это будет значит, что внутри модуля
-`client` есть модуль `client`!
-
-По умолчанию, компилятор сначала исследует содержание файла *src/lib.rs*. Если
-есть необходимость добавить несколько файлов в проект, необходимо сообщить об этом
-в файле *src/lib.rs*. Именно поэтому, модуль `client` надо определить в файле *src/lib.rs*
+Обратите внимание, что вам не надо объявлять раздел, т.к. вы уже объявили
+его в файле *src/lib.rs*. Файл *src/client.rs* содержит составляющие раздела `client`. Если же
+вы и здесь напишите объявление раздела `mod client`, то это будет значит, что внутри раздела `client` есть раздел `client`!
+
+По умолчанию, сборщик сначала исследует содержание файла *src/lib.rs*. Если
+есть необходимость добавить несколько файлов в дело, необходимо сообщить об этом
+в файле *src/lib.rs*. Именно поэтому, раздел `client` надо определить в файле *src/lib.rs*
 и не надо делать этого в файле *src/client.rs*.
 
-Компиляция проекта пройдет успешно:
+Сборка дела пройдет успешно:
 
 ```text
 $ cargo build
@@ -234,10 +228,10 @@ warning: function is never used: `connect`, #[warn(dead_code)] on by default
   |         ^
 ```
 
-Эти сообщения сигнализируют нам, что наши функции нигде не используются. Проигнорируем
-их до секции "Управление доступом с помощью ключевого слова `pub`".
+Эти сообщения сообщают нам, что наши функции нигде не используются. Пренебрегаем
+ими до разделы "Управление доступом с помощью ключевого слова `pub`".
 
-Теперь перенесём модуль `network` в свой файл:
+Теперь перенесём раздел `network` в свой файл:
 
 Filename: src/lib.rs
 
@@ -247,7 +241,7 @@ mod client;
 mod network;
 ```
 
-Далее, создадим файл *src/network.rs* и введём в него следующий код:
+Далее, создадим файл *src/network.rs* и введём в него следующую рукопись:
 
 Filename: src/network.rs
 
@@ -260,12 +254,12 @@ mod server {
     }
 }
 ```
-Обратите внимание, что у нас есть описание модулей в файле, т.к. у нас всё еще есть
-вложенность модулей.
+Обратите внимание, что у нас есть описание разделов в файле, т.к. у нас всё еще есть
+вложенность разделов.
 
-Выполним команды `cargo clean`, а потом `cargo build`. Всё в порядке! Отлично!
-Теперь осталось создать файл только для ещё одного модуля. Для этого создадим
-описание подчиненного модуля в файле *src/network.rs* `mod server;`:
+Выполним приказы `cargo clean`, а потом `cargo build`. Всё в порядке! Отлично!
+Теперь осталось создать файл только для ещё одного раздела. Для этого создадим
+описание подчиненного раздела в файле *src/network.rs* `mod server;`:
 
 Filename: src/network.rs
 
@@ -285,7 +279,7 @@ fn connect() {
 }
 ```
 
-Выполним команды `cargo clean`, а потом `cargo build`. Получим сообщение об ошибке 7-4:
+Выполним приказы `cargo clean`, а потом `cargo build`. Получим сообщение об ошибке 7-4:
 
 ```text
 $ cargo build
@@ -308,33 +302,33 @@ note: ... or maybe `use` the module `server` instead of possibly redeclaring it
   |     ^^^^^^
 ```
 
-Код 7-4: Ошибка при переносе кода вложенного модуля `server`
+Рукопись 7-4: Ошибка при переносе рукописи вложенного раздела `server`
 в файл *src/server.rs*
 
-Компилятор предлагает решение:
+Сборщик предлагает решение:
 
 ```text
 note: maybe move this module `network` to its own directory via
 `network/mod.rs`
 ```
-Вместо того, чтобы создавать файл аналогично предыдущему, сделаем следующее:
+Вместо того, чтобы создавать файл подобно предыдущему, сделаем следующее:
 
-1. Создадим *папку* с именем *network* (это имя нашего родительского модуля).
+1. Создадим *папку* с именем *network* (это имя нашего родительского раздела).
 2. Перенесём файл *src/network.rs* в эту новую папку и переименуем файл в *src/network/mod.rs*.
 3. Далее перенесём файл *src/server.rs* в папку *network*.
 
- Для подчиненных модулей проделаем тоже самое.
+ Для подчиненных разделов проделаем тоже самое.
 
-### Правила модульной файловой системы
+### Правила состоящей из разделов файловой системы
 
 Список правил:
 
-* Если модуль `foo` не имеет подчиненных модулей, вы можете сохранить код модуля в
+* Если раздел `foo` не имеет подчиненных разделов, вы можете сохранить рукопись раздела в
 файл *foo.rs*.
-* Если модуль `foo` имеет подмодуль, вы должны перенести код модуля в файл *foo/mod.rs*
+* Если раздел `foo` имеет подраздел, вы должны перенести рукопись раздела в файл *foo/mod.rs*
 
-Это правило применяется рекурсивно. Если модуль с именем `foo` имеет подмодуль
-`bar` и `bar` не имеет подмодулей, то у вас получится вот такая структура
+Это правило применяется рекурсивно. Если раздел с именем `foo` имеет подраздел
+`bar` и `bar` не имеет подразделов, то у вас получится вот такое устройство
 в папке *src*:
 
 ```text
@@ -343,7 +337,7 @@ note: maybe move this module `network` to its own directory via
 │   └── mod.rs (contains the declarations in `foo`, including `mod bar`)
 ```
 
-Модули должны быть определены в своих файлах используя ключевое слово `mod`.
+Разделы должны быть определены в своих файлах используя ключевое слово `mod`.
 
-Далее, мы поговорим о модификаторе доступа `pub` и устраним сообщения о проблемах
-в коде.
+Далее, мы поговорим о изменителе доступа `pub` и устраним сообщения о неполадках
+в рукописи.
diff --git a/rustbook-ru/src/ch07-01-packages-and-crates.md b/rustbook-ru/src/ch07-01-packages-and-crates.md
index 03a2fc130..5f66399ec 100644
--- a/rustbook-ru/src/ch07-01-packages-and-crates.md
+++ b/rustbook-ru/src/ch07-01-packages-and-crates.md
@@ -1,20 +1,20 @@
-## Пакеты и крейты
+## Дополнения и ящики
 
-Первые части модульной системы, которые мы рассмотрим — это пакеты и крейты.
+Первые части состоящие из разделов системы, которые мы рассмотрим — это дополнения и ящики.
 
-*Крейт* — это наименьший объем кода, который компилятор Rust рассматривает за раз. Даже если вы запустите `rustc` вместо `cargo` и передадите один файл с исходным кодом (как мы уже делали в разделе «Написание и запуск программы на Rust» Главы 1), компилятор считает этот файл крейтом. Крейты могут содержать модули, и модули могут быть определены в других файлах, которые компилируются вместе с крейтом, как мы увидим в следующих разделах.
+*Ящик (Раздел)*  — это наименьший размер рукописи, который сборщик Ржавчины рассматривает за раз. Даже если вы запустите `rustc` вместо `cargo` и передадите один файл с исходной рукописью (как мы уже делали в разделе «Написание и запуск программы на Ржавчине» Главы 1), сборщик считает этот файл ящиком. Ящики могут содержать разделы, и разделы могут быть определены в других файлах, которые собираются вместе с ящиком, как мы увидим в следующих главах.
 
-Крейт может быть одним из двух видов: бинарный крейт или библиотечный крейт. *Бинарные крейты* — это программы, которые вы можете скомпилировать в исполняемые файлы, которые вы можете запускать, например программу командной строки или сервер. У каждого бинарного крейта должна быть функция с именем `main`, которая определяет, что происходит при запуске исполняемого файла. Все крейты, которые мы создали до сих пор, были бинарными крейтами.
+Ящик может быть одним из двух видов данных: двоичный ящик или библиотечный ящик. *Двоичные ящики* — это программы, которые вы можете собрать в исполняемые файлы, которые вы можете запускать, например программу приказной строки или отдельный вычислитель. У каждого двоичного ящика должна быть функция с именем `main`, которая определяет, что происходит при запуске исполняемого файла. Все ящики, которые мы создали до сих пор, были двоичными ящиками.
 
-*Библиотечные крейты* не имеют функции `main` и не компилируются в исполняемый файл. Вместо этого они определяют функциональность, предназначенную для совместного использования другими проектами. Например, крейт `rand`, который мы использовали в [Главе 2] обеспечивает функциональность, которая генерирует случайные числа. В большинстве случаев, когда Rustaceans говорят «крейт», они имеют в виду библиотечный крейт, и они используют «крейт» взаимозаменяемо с общей концепцией программирования «библиотека».
+*Библиотечные ящики* не имеют функции `main` и не собираются в исполняемый файл. Вместо этого они определяют возможность, предназначенную для совместного использования другими делами. Например, ящик `rand`, который мы использовали в [Главе 2] обеспечивает возможность, которая порождает случайные числа. В большинстве случаев, когда Rustaceans говорят «ящик», они имеют в виду библиотечный ящик, и они используют «ящик» взаимозаменяемо с общим подходом программирования «библиотека».
 
-*Корневой модуль крейта* — это исходный файл, из которого компилятор Rust начинает собирать корневой модуль вашего крейта (мы подробно объясним модули в разделе [«Определение модулей для контроля видимости и закрытости»]).
+*Корневой раздел ящика* — это исходный файл, из которого сборщик Ржавчины начинает собирать корневой раздел вашего ящика (мы подробно объясним разделы в главе [«Определение разделов для управления видимости и закрытости»]).
 
-*Пакет* — это набор из одного или нескольких крейтов, предоставляющий набор функциональности. Пакет содержит файл *Cargo.toml*, в котором описывается, как собирать эти крейты. На самом деле Cargo — это пакет, содержащий бинарный крейт для инструмента командной строки, который вы использовали для создания своего кода. Пакет Cargo также содержит библиотечный крейт, от которого зависит бинарный крейт. Другие проекты тоже могут зависеть от библиотечного крейта Cargo, чтобы использовать ту же логику, что и инструмент командной строки Cargo.
+*Дополнение* — это совокупность из одного или нескольких разделов, предоставляющий . Дополнение содержит файл *Cargo.toml*, в котором описывается, как собирать эти ящики. На самом деле Cargo — это дополнение, содержащее двоичный ящик для средства приказной строки, который вы использовали для создания своей рукописи. Дополнение Cargo также содержит библиотечный ящик, от которого зависит двоичный ящик. Другие дела тоже могут зависеть от библиотечного ящика Cargo, чтобы использовать тот же ход мыслей, что и средство приказной строки Cargo.
 
-Пакет может содержать сколько угодно бинарных крейтов, но не более одного библиотечного крейта. Пакет должен содержать хотя бы один крейт, библиотечный или бинарный.
+Дополнение может содержать сколько угодно двоичных ящиков, но не более одного библиотечного ящика. Дополнение должно содержать хотя бы один ящик, библиотечный или двоичный.
 
-Давайте пройдёмся по тому, что происходит, когда мы создаём пакет. Сначала введём команду `cargo new`:
+Давайте пройдёмся по тому, что происходит, когда мы создаём дополнение. Сначала введём приказ `cargo new`:
 
 ```console
 $ cargo new my-project
@@ -26,10 +26,10 @@ $ ls my-project/src
 main.rs
 ```
 
-После того, как мы запустили `cargo new`, мы используем `ls`, чтобы увидеть, что создал Cargo. В каталоге проекта есть файл *Cargo.toml*, дающий нам пакет. Также есть каталог *src*, содержащий *main.rs*. Откройте *Cargo.toml* в текстовом редакторе и обратите внимание, что в нём нет упоминаний о *src/main.rs*. Cargo следует соглашению о том, что *src/main.rs* — это корневой модуль бинарного крейта с тем же именем, что и у пакета. Точно так же Cargo знает, что если каталог пакета содержит *src/lib.rs*, пакет содержит библиотечный крейт с тем же именем, что и пакет, а *src/lib.rs* является корневым модулем этого крейта. Cargo передаёт файлы корневого модуля крейта в `rustc` для сборки библиотечного или бинарного крейта.
+После того, как мы запустили `cargo new`, мы используем `ls`, чтобы увидеть, что создал Cargo. В папке дела есть файл *Cargo.toml*, дающий нам дополнение. Также есть папка *src*, содержащая *main.rs*. Откройте *Cargo.toml* в письменном редакторе и обратите внимание, что в нём нет упоминаний о *src/main.rs*. Cargo следует соглашению о том, что *src/main.rs* — это корневой раздел двоичного ящика с тем же именем, что и у дополнения. Точно так же Cargo знает, что если папка дополнения содержит *src/lib.rs*, дополнение содержит библиотечный ящик с тем же именем, что и дополнение, а *src/lib.rs* является корневым разделом этого ящика. Cargo передаёт файлы корневого раздела ящика в `rustc` для сборки библиотечного или двоичного ящика.
 
-Здесь у нас есть пакет, который содержит только *src/main.rs*, что означает, что он содержит только бинарный крейт с именем `my-project`. Если пакет содержит *src/main.rs* и *src/lib.rs*, он имеет два крейта: бинарный и библиотечный, оба с тем же именем, что и пакет. Пакет может иметь несколько бинарных крейтов, помещая их файлы в каталог *src/bin*: каждый файл будет отдельным бинарным крейтом.
+Здесь у нас есть дополнение, которое содержит только *src/main.rs*, что означает, что оно содержит только двоичный ящик с именем `my-project`. Если дополнение содержит *src/main.rs* и *src/lib.rs*, он имеет два ящика: двоичный и библиотечный, оба с тем же именем, что и дополнение. Дополнение может иметь несколько двоичных ящиков, помещая их файлы в папку *src/bin*: каждый файл будет отдельным двоичным ящиком.
 
 
-[«Определение модулей для контроля видимости и закрытости»]: ch07-02-defining-modules-to-control-scope-and-privacy.html
+[«Определение разделов для управления видимости и закрытости»]: ch07-02-defining-modules-to-control-scope-and-privacy.html
 [Главе 2]: ch02-00-guessing-game-tutorial.html#generating-a-random-number
\ No newline at end of file
diff --git a/rustbook-ru/src/ch07-02-controlling-visibility-with-pub.md b/rustbook-ru/src/ch07-02-controlling-visibility-with-pub.md
index bf3f06756..f3d71baa2 100644
--- a/rustbook-ru/src/ch07-02-controlling-visibility-with-pub.md
+++ b/rustbook-ru/src/ch07-02-controlling-visibility-with-pub.md
@@ -1,7 +1,6 @@
 ## Управление доступом с помощью ключевого слова `pub`
 
-Мы исправили ошибки связанные с распределением кода. Но остались проблемы с использованием
-кода (функции не используются):
+Мы исправили ошибки связанные с распределением рукописи. Но остались сбои с использованием рукописи (функции не используются):
 
 ```text
 warning: function is never used: `connect`, #[warn(dead_code)] on by default
@@ -23,12 +22,11 @@ warning: function is never used: `connect`, #[warn(dead_code)] on by default
   | ^
 ```
 
-Почему имеют место эти ошибки? Библиотеки существуют для того, чтобы ими пользовались
-пользователи. Поэтому важно, чтобы проблемы с доступом к функционалу были решены.
+Почему имеют место эти ошибки? Библиотеки существуют для того, чтобы ими пользовались пользователи. Поэтому важно, чтобы сбои с доступом к возможностям языка были решены.
 
 Для того, чтобы понять почему существуют такие ошибки, и как важно их устранить,
-попробуем воспользоваться функционалом кода извне. Для этого создадим выполняемый
-проект в этой же директории. Создадим файл *src/main.rs*, который содержит:
+попробуем воспользоваться возможностями рукописи извне. Для этого создадим выполняемое
+дело в этой же папке. Создадим файл *src/main.rs*, который содержит:
 
 Filename: src/main.rs
 
@@ -40,22 +38,22 @@ fn main() {
 }
 ```
 
-Мы сейчас использовали команду `extern crate` для того чтобы использовать функционал
+Мы сейчас использовали приказ `extern crate` для того чтобы использовать возможности
 библиотеки `communicator` в нашей новой программе. Cargo использует файл *src/main.rs*,
-как точку доступа для бинарной программы, в то время, как *src/lib.rs* используется
-для библиотеки. Такая организация кода довольно-таки обычна. Большинство кода
-находится в библиотеках, а бинарный файл просто использует эту библиотеку. Результатом
-такой архитектуры является возможность другим программам также использовать функционал
+как точку доступа для двоичной программы, в то время, как *src/lib.rs* используется
+для библиотеки. Такое создание рукописи довольно-таки обычно. Большинство рукописи
+находится в библиотеках, а двоичный файл просто использует эту библиотеку. Итогом
+такой архитектуры является возможность другим программам также использовать возможности
 библиотеки.
 
-Со стороны стороннего кода все что находится в библиотеке имеет пространство имён
-`communicator` (имя библиотеки) верхнего уровня. Всё остальное, это подчиненные модули.
+Со стороны сторонней рукописи все что находится в библиотеке имеет пространство имён
+`communicator` (имя библиотеки) верхнего уровня. Всё остальное, это подчиненные разделы.
 
-Также, обратите внимание, что когда мы используем внешние библиотеки с подмодулями,
-команда `extern crate` начинает искать модули с верхнего уровня.
+Также, обратите внимание, что когда мы используем внешние библиотеки с внутренними вложениями,
+приказ `extern crate` начинает искать разделы с верхнего уровня.
 
-В нашей программе бинарный файл вызывает библиотечную функцию `connect` из
-модуля `client`. Но при компиляции этого кода получим сообщении об ошибке:
+В нашей программе двоичный файл вызывает библиотечную функцию `connect` из
+раздела `client`. Но при сборке этой рукописи получим сообщении об ошибке:
 
 ```text
 error: module `client` is private
@@ -65,21 +63,16 @@ error: module `client` is private
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ```
 
-Это сообщение говорит нам о том, что модуль `client` закрытый.
-Т.к. код в модуле закрытый по умолчанию и не используется внутри библиотеки - на
-это надо обратить внимание, т.к. это явная ошибка в организации кода.
+Это сообщение говорит нам о том, что раздел `client` закрытое.
+Т.к. рукопись в разделе закрытая по умолчанию и не используется внутри библиотеки - на это надо обратить внимание, т.к. это явная ошибка в согласовании рукописи.
 
-После определения функции `client::connect`, как доступной (`pub`), не только сообщение
-об ошибке исчезнет, но и пропадёт сообщение о том, что код не используется.
-Создания доступного кода в Rust даёт возможность его использования вне библиотеки.
-Когда какой-либо кода помечается как `pub`, компилятор больше не сообщает об неиспользованном
-коде, если даже он фактически не используется.
+После определения функции `client::connect`, как доступной (`pub`), не только сообщение об ошибке исчезнет, но и пропадёт сообщение о том, что рукопись не используется.
+Создания доступной рукописи в Ржавчине даёт возможность её использования вне библиотеки.
+Когда какая-либо рукопись помечается как `pub`, сборщик больше не сообщает об неиспользованной рукописи, если даже она в действительности не используется.
 
 ### Сделать функции доступными
 
-Для того, чтобы сделать что-либо доступным извне, необходимо добавить ключевое слово
-`pub` в начало декларирования элемента кода. Для исправления ошибки, мы добавим
-этот спецификатор доступа перед определением имени модуля:
+Для того, чтобы сделать что-либо доступным извне, необходимо добавить ключевое слово `pub` в начало объявления переменной или способа рукописи. Для исправления ошибки, мы добавим этот определитель доступа перед определением имени раздела:
 
 Filename: src/lib.rs
 
@@ -89,7 +82,7 @@ pub mod client;
 mod network;
 ```
 
-Ключевое слово `pub` перед `mod`. Компиляция. Сообщение об ошибке:
+Ключевое слово `pub` перед `mod`. Сборка. Сообщение об ошибке:
 
 ```text
 error: function `connect` is private
@@ -124,9 +117,9 @@ warning: function is never used: `connect`, #[warn(dead_code)] on by default
   | ^
 ```
 
-Код скомпилировался и предостережения о функции `client::connect` уже нет!
+Рукопись собралась и предостережения о функции `client::connect` уже нет!
 
-Вам решать, что делать с неиспользованным кодом, то ли открыть к нему доступ, то ли
+Вам решать, что делать с неиспользованной рукописью, то ли открыть к ней доступ, то ли
 удалить.
 
 В данном случае мы хотим, чтобы эти функции были доступны. Поэтому добавим `pub`
@@ -141,7 +134,7 @@ pub fn connect() {
 mod server;
 ```
 
-Скомпилируем и проанализируем ошибки:
+Соберем и рассмотрим ошибки:
 
 ```text
 warning: function is never used: `connect`, #[warn(dead_code)] on by default
@@ -157,7 +150,7 @@ warning: function is never used: `connect`, #[warn(dead_code)] on by default
   | ^
 ```
 
-Для того, чтобы открытые функции модуля были доступны, сам модуль должен быть доступен:
+Для того, чтобы открытые функции раздела были доступны, само раздел должно быть доступно:
 
 Filename: src/lib.rs
 
@@ -167,7 +160,7 @@ pub mod client;
 pub mod network;
 ```
 
-Новые сообщения компилятора:
+Новые сообщения сборщика:
 
 ```text
 warning: function is never used: `connect`, #[warn(dead_code)] on by default
@@ -182,12 +175,12 @@ warning: function is never used: `connect`, #[warn(dead_code)] on by default
 ### Правила доступа
 
 
-1. Если элемент открытый, он должен быть открытый и все родительские модули тоже.
-2. Если элемент закрытый, он может быть доступен только из родительского модуля и из любых подчиненных модулей.
+1. Если переменная открытая, она должна быть открытый и все родительские разделы тоже.
+2. Если переменная закрытая, она может быть доступна только из родительского раздела и из любых подчиненных разделов.
 
 ### Примеры
 
-Создадим новый проект библиотеки secret 7-5 *src/lib.rs*:
+Создадим новое дело библиотеки secret 7-5 *src/lib.rs*:
 
 Filename: src/lib.rs
 
@@ -212,15 +205,15 @@ fn try_me() {
 }
 ```
 
-Код 7-5: Примеры открытых и закрытый функций с ошибками
+Рукопись 7-5: Примеры открытых и закрытый функций с ошибками
 
-Перед компиляцией кода, попробуйте догадаться, где будет ошибка. Убедитесь в этом
-с помощью компиляции. Исправьте ошибки в коде!
+Перед сборкой рукописи, попробуйте догадаться, где будет ошибка. Убедитесь в этом
+с помощью сборки. Исправьте ошибки в рукописи!
 
 #### Рассмотрим ошибки
 
-Функция `try_me` находится на верхнем уровне модуля нашего проекта. Модуль
-`outermost` закрытый, но к его функциям может быть доступ, т.к. модуль верхнего
+Функция `try_me` находится на верхнем уровне раздела нашего дела. Раздел
+`outermost` закрытое, но к его функциям может быть доступ, т.к. раздел верхнего
 уровня.
 
 Вызов остальных двух функций вызовет ошибку, т.к. не применяются правила видимости.
@@ -228,7 +221,7 @@ fn try_me() {
 
 #### Исправление ошибок
 
-Пожалуйста, попытайтесь поэкспериментировать с доступом к функциям  и посмотрите
+Пожалуйста, попытайтесь по	проводить опыты с доступом к функциям  и посмотрите
 на описания ошибок!
 
 Далее, мы поговорим об использовании ключевого слова `use`.
diff --git a/rustbook-ru/src/ch07-02-defining-modules-to-control-scope-and-privacy.md b/rustbook-ru/src/ch07-02-defining-modules-to-control-scope-and-privacy.md
index 8146d75cd..65758dee4 100644
--- a/rustbook-ru/src/ch07-02-defining-modules-to-control-scope-and-privacy.md
+++ b/rustbook-ru/src/ch07-02-defining-modules-to-control-scope-and-privacy.md
@@ -1,27 +1,27 @@
-## Определение модулей для контроля видимости и закрытости
+## Определение разделов для управления видимости и закрытости
 
-В этом разделе мы поговорим о модулях и других частях системы модулей, а именно: *путях* (paths), которые позволяют именовать элементы; ключевом слове `use`, которое приносит путь в область видимости; ключевом слове `pub`, которое делает элементы общедоступными. Мы также обсудим ключевое слово `as`, внешние пакеты и оператор glob. А пока давайте сосредоточимся на модулях!
+В этой главе мы поговорим о разделах и других частях их устройства, а именно: *путях* (paths), которые позволяют именовать переменные; ключевом слове `use`, которое приносит путь в область видимости; ключевом слове `pub`, которое делает переменные общедоступными. Мы также обсудим ключевое слово `as`, внешние дополнения и приказчик glob. А пока давайте сосредоточимся на разделах!
 
-Во-первых, мы начнём со списка правил, чтобы вам было легче ориентироваться при организации кода в будущем. Затем мы подробно объясним каждое из правил.
+Во-первых, мы начнём со списка правил, чтобы вам было легче понять при согласовании рукописи в будущем. Затем мы подробно объясним каждое из правил.
 
-### Шпаргалка по модулям
+### Шпаргалка по разделам
 
-Здесь мы даём краткий обзор того, как модули, пути, ключевое слово `use` и ключевое слово `pub` работают в компиляторе и как большинство разработчиков организуют свой код. В этой главе мы рассмотрим примеры каждого из этих правил, и это удобный момент чтобы напомнить о том, как работают модули.
+Здесь мы даём краткий обзор того, как разделы, пути, ключевое слово `use` и ключевое слово `pub` работают в сборщике и как большинство разработчиков согласуют свою рукопись. В этой главе мы рассмотрим примеры каждого из этих правил, и это удобное мгновение чтобы напомнить о том, как работают разделы.
 
-- **Начнём с корня крейта**: при компиляции компилятор сначала ищет корневой модуль крейта (обычно это *src/lib.rs* для библиотечного крейта или *src/main.rs* для бинарного крейта) для компиляции кода.
-- **Объявление модулей**: В файле корневого модуля крейта вы можете объявить новые модули; скажем, вы объявляете модуль “garden” с помощью `mod garden;`. Компилятор будет искать код модуля в следующих местах:
-    - в этом же файле, между фигурных скобок, которые заменяют точку с запятой после `mod garden`
+- **Начнём с корня ящика**: при сборке сборщик сначала ищет корневой раздел ящика (обычно это *src/lib.rs* для библиотечного ящика или *src/main.rs* для двоичного ящика) для сборки рукописи.
+- **Объявление разделов**: В файле корневого раздела ящика вы можете объявить новые разделы; скажем, вы объявляете раздел “garden” с помощью `mod garden;`. Сборщик будет искать рукопись раздела в следующих местах:
+    - в этом же файле, между узорчатых скобок, которые заменяют точку с запятой после `mod garden`
     - в файле *src/garden.rs*
     - в файле *src/garden/mod.rs*
-- **Объявление подмодулей**: В любом файле, кроме корневого модуля крейта, вы можете объявить подмодули. К примеру, вы можете объявить  `mod vegetables;` в *src/garden.rs*. Компилятор будет искать код подмодуля в каталоге с именем родительского модуля в следующих местах:
-    - в этом же файле, сразу после `mod vegetables`, между фигурных скобок, которые заменяют точку с запятой
+- **Объявление подразделов**: В любом файле, кроме корневого раздела ящика, вы можете объявить подразделы. К примеру, вы можете объявить  `mod vegetables;` в *src/garden.rs*. Сборщик будет искать рукопись подраздела в папке с именем родительского раздела в следующих местах:
+    - в этом же файле, сразу после `mod vegetables`, между узорчатых скобок, которые заменяют точку с запятой
     - в файле *src/garden/vegetables.rs*
     - в файле *src/garden/vegetables/mod.rs*
-- **Пути к коду в модулях**: После того, как модуль станет частью вашего крейта и если допускают правила приватности, вы можете ссылаться на код в этом модуле из любого места вашего крейта, используя путь к коду. Например, тип `Asparagus`, в подмодуле vegetables модуля garden, будет найден по пути `crate::garden::vegetables::Asparagus`.
-- **Скрытие или общедоступность**: Код в модуле по умолчанию скрыт от родительского модуля. Чтобы сделать модуль общедоступным, объявите его как `pub mod` вместо `mod`. Чтобы сделать элементы общедоступного модуля тоже общедоступными, используйте `pub` перед их объявлением.
-- **Ключевое слово `use`**: Внутри области видимости использование ключевого слова `use` создаёт псевдонимы для элементов, чтобы уменьшить повторение длинных путей. В любой области видимости, в которой может обращаться к `crate::garden::vegetables::Asparagus`, вы можете создать псевдоним `use crate::garden::vegetables::Asparagus;` и после этого вам нужно просто писать `Asparagus`, чтобы использовать этот тип в этой области видимости.
+- **Пути к рукописи в разделах**: После того, как раздел станет частью вашего ящика и если допускают правила закрытости, вы можете ссылаться на рукопись в этом разделе из любого места вашего ящика, используя путь к рукописи. Например, вид данных `Asparagus`, в подразделе vegetables раздела garden, будет найден по пути `crate::garden::vegetables::Asparagus`.
+- **Скрытие или общедоступность**: Рукопись в разделе по умолчанию скрыта от родительского раздела. Чтобы сделать раздел общедоступным, объявите его как `pub mod` вместо `mod`. Чтобы сделать содержимое общедоступного раздела тоже общедоступными, используйте `pub` перед их объявлением.
+- **Ключевое слово `use`**: Внутри области видимости использование ключевого слова `use` создаёт псевдонимы для переменных, чтобы уменьшить повторение длинных путей. В любой области видимости, в которой может обращаться к `crate::garden::vegetables::Asparagus`, вы можете создать псевдоним `use crate::garden::vegetables::Asparagus;` и после этого вам нужно просто писать `Asparagus`, чтобы использовать этот вид данных в этой области видимости.
 
-Мы создали бинарный крейт `backyard`, который иллюстрирует эти правила. Директория крейта, также названная как `backyard`, содержит следующие файлы и директории:
+Мы создали двоичный ящик `backyard`, который отображает эти правила. Содержимое ящика, также названное как `backyard`, содержит следующие файлы и папки:
 
 ```text
 backyard
@@ -34,7 +34,7 @@ backyard
     └── main.rs
 ```
 
-Файл корневого модуля крейта в нашем случае  *src/main.rs*, и его содержимое:
+Файл корневого раздела ящика в нашем случае  *src/main.rs*, и его содержимое:
 
 Файл: src/main.rs
 
@@ -42,7 +42,7 @@ backyard
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/quick-reference-example/src/main.rs}}
 ```
 
-Строка `pub mod garden;` говорит компилятору о подключении кода, найденном в *src/garden.rs*:
+Строка `pub mod garden;` говорит сборщику о подключении  в *src/garden.rs*:
 
 Файл: src/garden.rs
 
@@ -50,23 +50,23 @@ backyard
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/quick-reference-example/src/garden.rs}}
 ```
 
-А здесь `pub mod vegetables;` указывает на подключаемый код в *src/garden/vegetables.rs*. Этот код:
+А здесь `pub mod vegetables;` указывает на подключаемую рукопись в *src/garden/vegetables.rs*. Содержимое данной рукописи:
 
 ```rust,noplayground,ignore
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/quick-reference-example/src/garden/vegetables.rs}}
 ```
 
-Теперь давайте рассмотрим детали этих правил и продемонстрируем их в действии!
+Теперь давайте рассмотрим подробности этих правил и проверим их в действии!
 
-### Группировка связанного кода в модулях
+### Объединение связанной рукописи в разделах
 
-*Модули* позволяют упорядочивать код внутри крейта для удобочитаемости и лёгкого повторного использования. Модули также позволяют нам управлять *приватностью* элементов, поскольку код внутри модуля по умолчанию является закрытым. Частные элементы — это внутренние детали реализации, недоступные для внешнего использования. Мы можем сделать модули и элементы внутри них общедоступными, что позволит внешнему коду использовать их и зависеть от них.
+*Разделы* позволяют упорядочивать рукопись внутри ящика для удобства читаемости и лёгкого повторного использования. Разделы также позволяют нам управлять *закрытостью* переменных, поскольку рукопись внутри раздела по умолчанию является закрытой. Частные переменные — это внутренние подробности выполнения, недоступные для внешнего использования. Мы можем сделать разделы и переменные внутри них общедоступными, что позволит внешней рукописи использовать их и зависеть от них.
 
-В качестве примера, давайте напишем библиотечный крейт предоставляющий функциональность ресторана. Мы определим сигнатуры функций, но оставим их тела пустыми, чтобы сосредоточиться на организации кода, вместо реализации кода для ресторана.
+В качестве примера, давайте напишем библиотечный ящик предоставляющий возможность ресторана. Мы определим ярлыки функций, но оставим их тела пустыми, чтобы сосредоточиться на согласовании рукописи, вместо выполнения рукописи для ресторана.
 
-В ресторанной индустрии некоторые части ресторана называются *фронтом дома*, а другие *задней частью дома*. Фронт дома это там где находятся клиенты; здесь размещаются места клиентов, официанты принимают заказы и оплаты, а бармены делают напитки. Задняя часть дома это где шеф-повара и повара работают на кухне,  работают посудомоечные машины, а менеджеры занимаются административной деятельностью.
+В ресторанной индустрии некоторые части ресторана называются *передом дома*, а другие *задней частью дома*. Перед дома это там где находятся конечные потребители; здесь размещаются места конечных потребителей, официанты принимают заказы и оплаты, а бармены делают напитки. Задняя часть дома это где шеф-повара и повара работают на кухне,  работают посудомоечные машины, а управленцы занимаются управленческой деятельностью.
 
-Чтобы структурировать крейт аналогично тому, как работает настоящий ресторан, можно организовать размещение функций во вложенных модулях. Создадим новую библиотеку (библиотечный крейт) с именем `restaurant` выполнив команду `cargo new restaurant --lib`; затем вставим код из листинга 7-1 в *src/lib.rs* для определения некоторых модулей и сигнатур функций. Это секция фронта дома:
+Чтобы внутренне выстроить ящик подобно тому, как работает настоящий ресторан, можно согласовать размещение функций во вложенных разделах. Создадим новую библиотеку (библиотечный ящик) с именем `restaurant` выполнив приказ `cargo new restaurant --lib`; затем вставим рукопись из приложения 7-1 в *src/lib.rs* для определения некоторых разделов и ярлыков функций. Это раздел переда дома:
 
 Файл: src/lib.rs
 
@@ -74,15 +74,15 @@ backyard
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-01/src/lib.rs}}
 ```
 
-Листинг 7-1: Модуль front_of_house , содержащий другие модули, которые в свою очередь содержат функции
+Приложение 7-1: Раздел front_of_house , содержащий другие разделы, которые в свою очередь содержат функции
 
-Мы определяем модуль, начиная с ключевого слова  `mod`, затем определяем название модуля (в данном случае `front_of_house`) и размещаем фигурные скобки вокруг тела модуля. Внутри модулей, можно иметь другие модули, как в случае с модулями `hosting` и `serving`. Модули также могут содержать определения для других элементов, таких как структуры, перечисления, константы, типажи или — как в листинге 7-1 — функции.
+Мы определяем раздел, начиная с ключевого слова  `mod`, затем определяем название раздела (в данном случае `front_of_house`) и размещаем узорчатые скобки вокруг тела раздела. Внутри разделов, можно иметь другие разделы, как в случае с разделами `hosting` и `serving`. Разделы также могут содержать определения для других переменных, таких как стопки, перечисления, постоянные переменные, сущности или — как в приложении 7-1 — функции.
 
-Используя модули, мы можем сгруппировать связанные определения вместе и сказать почему они являются связанными. Программистам будет легче найти необходимую функциональность в сгруппированном коде, вместо того чтобы искать её в одном общем списке. Программисты, добавляющие новые функции в этот код, будут знать, где разместить код для поддержания порядка в программе.
+Используя разделы, мы можем объединять связанные определения вместе и сказать почему они являются связанными. Программистам будет легче найти необходимую возможность в объединенной рукописи, вместо того чтобы искать её в одном общем списке. Программисты, добавляющие новые функции в эту рукопись, будут знать, где разместить рукопись для поддержания порядка в программе.
 
-Как мы упоминали ранее, файлы *src/main.rs* и *src/lib.rs* называются *корневыми модулями крейта*. Причина такого именования в том, что содержимое любого из этих двух файлов образует модуль с именем `crate` в корне структуры модулей крейта, известной как *дерево модулей*.
+Как мы упоминали ранее, файлы *src/main.rs* и *src/lib.rs* называются *корневыми разделами ящика*. Причина такого именования в том, что содержимое любого из этих двух файлов образует раздел с именем `crate` в корне устройства разделов ящика, известным как *дерево разделов*.
 
-В листинге 7-2 показано дерево модулей для структуры модулей, приведённой в коде листинга 7-1.
+В приложении 7-2 показано дерево разделов для устройства разделов, приведённой в рукописи приложения 7-1.
 
 ```text
 crate
@@ -96,8 +96,8 @@ crate
          └── take_payment
 ```
 
-Листинг 7-2: Древо модулей для программы из Листинга 7-1
+Приложение 7-2: Древо разделов для программы из Приложения 7-1
 
-Это дерево показывает, как некоторые из модулей вкладываются друг в друга; например, `hosting` находится внутри `front_of_house`. Дерево также показывает, что некоторые модули являются  *братьями* (siblings) друг для друга, то есть они определены в одном модуле; `hosting` и `serving` это братья которые определены внутри `front_of_house`. Если модуль A содержится внутри модуля B, мы говорим, что модуль A является *потомком* (child) модуля B, а модуль B является *родителем* (parent) модуля A. Обратите внимание, что родителем всего дерева модулей является неявный модуль с именем `crate`.
+Это дерево показывает, как некоторые из разделов вкладываются друг в друга; например, `hosting` находится внутри `front_of_house`. Дерево также показывает, что некоторые разделы являются  *братьями* (siblings) друг для друга, то есть они определены в одном разделе; `hosting` и `serving` это братья, которые определены внутри `front_of_house`. Если раздел A содержится внутри раздела B, мы говорим, что раздел A является *потомком* (child) раздела B, а раздел B является *родителем* (parent) раздела A. Обратите внимание, что родителем всего дерева разделов является неявный раздел с именем `crate`.
 
-Дерево модулей может напомнить вам дерево каталогов файловой системы на компьютере; это очень удачное сравнение! По аналогии с каталогами в файловой системе, мы используется модули для организации кода. И так же, как нам надо искать файлы в каталогах на компьютере, нам требуется способ поиска нужных модулей.
+Дерево разделов может напомнить вам дерево папок файловой системы на компьютере; это очень удачное сравнение! По подобию с папками в файловой системе, мы используем разделы для согласования рукописи. И так же, как нам надо искать файлы в папках на компьютере, нам требуется способ поиска нужных разделов.
diff --git a/rustbook-ru/src/ch07-03-importing-names-with-use.md b/rustbook-ru/src/ch07-03-importing-names-with-use.md
index 0291f9f80..2e9cbfefb 100644
--- a/rustbook-ru/src/ch07-03-importing-names-with-use.md
+++ b/rustbook-ru/src/ch07-03-importing-names-with-use.md
@@ -1,6 +1,6 @@
-## Импорт имён
+## Вставка имён
 
-Мы изучили, как вызывать функции, определённые в модуле, используя имена модулей, как
+Мы изучили, как вызывать функции, определённые в разделе, используя имена разделов, как
 часть вызова. Пример 7-6:
 
 Filename: src/main.rs
@@ -23,10 +23,9 @@ fn main() {
 
 Пример 7-6: Вызов функции, указав полный к ней путь
 
-Как вы видите, указание полного пути к функции весьма утомительно. Конечно же, в Rust
-имеется функционал упрощающий вызов функций.
+Как вы видите, указание полного пути к функции весьма утомительно. Конечно же, в Ржавчине имеется возможности упрощающий вызов функций.
 
-### Краткий импорт. Использование `use`
+### Краткая вставка. Использование `use`
 
 Использование ключевого слова `use` сокращает указание полного пути к функции, которую
 вы хотите использовать в определённой области видимости. Пример применения `use`:
@@ -51,16 +50,13 @@ fn main() {
 }
 ```
 
-Строка `use a::series::of;` указывает, что в данной области видимости могут использоваться элементы,
-которые находятся в модуле `of`. Их можно вызывать просто указывая префикс имени этого
-модуля `of::`.
+Строка `use a::series::of;` указывает, что в данной области видимости могут использоваться переменные, которые находятся в разделе `of`. Их можно вызывать просто указывая приставка имени этого раздела `of::`.
 
-В область видимости попадают только элементы модуля. Подчиненные модуле не включаются.
+В область видимости попадают только переменные раздела. Подчиненные разделе не включаются.
 Если в этом будет необходимость - надо явным образом это указать.
 Поэтому укажем `of::nested_modules`, вместо `nested_modules`.
 
-Чтобы не указывать имя модуля, можно выполнить статический импорт функции в
-область видимости:
+Чтобы не указывать имя раздела, можно использовать постоянную вставку функции в область видимости:
 
 ```rust
 pub mod a {
@@ -79,11 +75,10 @@ fn main() {
 }
 ```
 
-Такой способ, даёт нам возможность, сокращать список импорта.
+Такой способ, даёт нам возможность, сокращать список подключения.
 
-Очень интересная возможность импорта значений перечислений!
-Т.к. перечисления можно назвать разновидностью пространств имён, то можно указать
-только необходимые элементы перечисления при импорте:
+Очень важная возможность подключения значений перечислений!
+Т.к. перечисления можно назвать разновидностью пространств имён, то можно указать только необходимые переменные перечисления при вставке:
 
 ```rust
 #[derive(Debug)]
@@ -105,12 +100,11 @@ fn main() {
     println!("{:?}", green);
 }
 ```
-Так как мы не включили `TrafficLight` в список импортированных значений перечисления,
-то для его использования нам необходимо указать полный путь до этого элемента.
+Так как мы не включили `TrafficLight` в список вставленных значений перечисления, то для его использования нам необходимо указать полный путь до этой переменной или способа.
 
-### Импорт всех элементов с помощью `*`
+### Вставка всех переменных с помощью `*`
 
-Есть ли возможность импортирования всех элементов выбранного пространства имён?!
+Есть ли возможность подключения всех переменных выбранного пространства имён?!
 Да. Есть. Используйте `*`:
 
 ```rust
@@ -128,11 +122,8 @@ fn main() {
     let green = Green;
 }
 ```
-Символ `*` называют *glob* и его функция - импорт всех элементов, видимых извне
-пространства имён. Обратите также внимание, что наряду с удобствами, существуют
-также недостатки использования полного импорта пространства имён, т.к. это может привести
-к конфликтным или неожиданным ситуациям, когда в разных пространствах имён существуют
-одинаковые (по имени) функции, которые будут импортироваться.
+Знак `*` называют *glob* и его функция - вставка всех переменных, видимых извне пространства имён. Обратите также внимание, что наряду с удобствами, существуют также недостатки использования полного подключения пространства имён, т.к. это может привести
+к конфликтным или неожиданным случайм, когда в разных  пространствах имён существуют одинаковые (по имени) функции, которые будут вставляться.
 Пример:
 
 ```rust
@@ -179,10 +170,10 @@ note: `nested_modules` could also refer to the name imported here
    = note: consider adding an explicit import of `nested_modules` to disambiguate
 ```
 
-### Доступ к функционалу родительского модуля с помощью `super`
+### Доступ к возможности родительского раздела с помощью `super`
 
-Как вы помните, при создании библиотеки, Cargo предлагает использовать модуль `tests`.
-Сейчас разберёмся подробнее. Добавим код теста в исходный код файла *src/lib.rs*:
+Как вы помните, при создании библиотеки, Cargo предлагает использовать раздел `tests`.
+Сейчас разберёмся подробнее. Добавим рукопись проверки в исходную рукопись файла *src/lib.rs*:
 
 Filename: src/lib.rs
 
@@ -199,9 +190,9 @@ mod tests {
 }
 ```
 
-В главе 11  подробно рассказывается о тестировании. Сейчас мы только немного расскажем.
-Обратите внимание на специальную аннотацию и то, что это отдельный модуль в нашем коде.
-Модульная система нашего проекта теперь имеет вид:
+В главе 11  подробно рассказывается о проверке. Сейчас мы только немного расскажем.
+Обратите внимание на особую изложение и то, что это отдельный раздел в нашей рукописи.
+Состоящая из разделов устройство нашего дела теперь имеет вид:
 
 ```text
 communicator
@@ -211,7 +202,7 @@ communicator
  └── tests
 ```
 
-Тесты помогают отлаживать код библиотеки. Напишем наш первый тест. Он будет вызывать
+Проверки помогают отлаживать рукопись библиотеки. Напишем наш первый проверку. Он будет вызывать
 функцию `client::connect`:
 
 Filename: src/lib.rs
@@ -226,7 +217,7 @@ mod tests {
 }
 ```
 
-Выполнение тестов осуществляется командой`cargo test`:
+Выполнение проверок осуществляется приказом`cargo test`:
 
 ```text
 $ cargo test
@@ -238,31 +229,30 @@ error[E0433]: failed to resolve. Use of undeclared type or module `client`
   |         ^^^^^^^^^^^^^^^ Use of undeclared type or module `client`
 ```
 
-Почему-то компиляция прошла неуспешно. Почему же? Нам не надо добавлять префикс
+Почему-то сборка прошла неуспешно. Почему же? Нам не надо добавлять приставка
 библиотеки `communicator::`, т.к. мы находимся внутри неё.
 
-Как же вызвать функцию `client::connect` из модуля `tests`? В модуле `tests` мы
-можем указать что мы хотим начать поиски модулей с корневого модуля:
+Как же вызвать функцию `client::connect` из раздела `tests`? В разделе `tests` мы
+можем указать что мы хотим начать поиски разделов с корневого раздела:
 
 ```rust,ignore
 ::client::connect();
 ```
 
-Или мы можем использовать `super` для того чтобы переместиться по модульной иерархии
-на один уровень выше текущего модуля:
+Или мы можем использовать `super` для того чтобы переместиться по состоящей из разделов упорядочивания
+на один уровень выше текущего раздела:
 
 ```rust,ignore
 super::client::connect();
 ```
 
-Эти две опции выглядят одинаковыми в этом примере. Если находитесь глубоко
-внутри модульной иерархии, то начиная с корневого модуля ваш код будет длинным.
+Эти две возможности выглядят одинаковыми в этом примере. Если находитесь глубоко внутри состоящей из разделов упорядочивания, то начиная с корневого раздела ваша рукопись будет длинной.
 Есть случаи, когда использование `super` более удобно.
 
-Это бывает утомительно печать `super::` в каждом тесте. Есть решение `use`.
-Функциональность `super::` изменяет путь, который вы используете в `use`.
+Это бывает утомительно вывод `super::` в каждой проверке. Есть решение `use`.
+Возможность `super::` изменяет путь, который вы используете в `use`.
 
-Для тех случаев, когда вы пишите тесты к библиотекам, использование `use super::something`,
+Для тех случаев, когда вы пишите проверки к библиотекам, использование `use super::something`,
 наилучшее решение.
 
 Пример:
@@ -281,7 +271,7 @@ mod tests {
 }
 ```
 
-Когда вы теперь выполните команду `cargo test`, вы увидите следующий вывод:
+Когда вы теперь выполните приказ `cargo test`, вы увидите следующий вывод:
 
 ```text
 $ cargo test
@@ -296,8 +286,6 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 ## Итоги
 
-Теперь вы знаете ещё один способ, как можно организовать ваш код. Его можно использовать
-для группировки различных элементов вместе, при рефакторинге большого количества
-кода.
+Теперь вы знаете ещё один способ, как можно согласовать вашу рукопись. Её можно использовать для объединения различных переменных вместе, при переработке большой рукописи.
 
-Далее, мы рассмотрим структуры данных стандартной библиотеки.
+Далее, мы рассмотрим виды данных встроенной библиотеки.
diff --git a/rustbook-ru/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md b/rustbook-ru/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md
index a1de9eb40..67c070b89 100644
--- a/rustbook-ru/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md
+++ b/rustbook-ru/src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md
@@ -1,19 +1,19 @@
-## Пути для ссылки на элемент в дереве модулей
+## Пути для ссылки на переменную в дереве разделов
 
-Чтобы показать Rust, где найти элемент в дереве модулей, мы используем путь так же, как мы используем путь при навигации по файловой системе. Чтобы вызвать функцию, нам нужно знать её путь.
+Чтобы показать Ржавчине, где найти переменную в дереве разделов, мы используем путь так же, как мы используем путь при поиске по файловой системе. Чтобы вызвать функцию, нам нужно знать её путь.
 
 Пути бывают двух видов:
 
-- *абсолютный путь* - это полный путь, начинающийся от корневого модуля крейта; для кода из внешнего крейта абсолютный путь начинается с имени крейта, а для кода из текущего крейта он начинается с литерала `crate`.
-- *относительный путь* начинается с текущего модуля и использует ключевые слова `self`, `super` или идентификатор в текущем модуле.
+- *безусловный путь* - это полный путь, начинающийся от корневого раздела ящика; для рукописи из внешнего ящика безусловный путь начинается с имени ящика, а для рукописи из текущего ящика он начинается с записи `crate`.
+- *относительный путь* начинается с текущего раздела и использует ключевые слова `self`, `super` или определитель в текущем разделе.
 
-Как абсолютные, так и относительные, пути состоят из одного или нескольких идентификаторов, разделённых двойными двоеточиями (`::`).
+Как безусловные, так и относительные, пути состоят из одного или нескольких определителей, разделённых двойными двоеточиями (`::`).
 
-Вернёмся к листингу 7-1, скажем, мы хотим вызвать функцию `add_to_waitlist`. Это то же самое, что спросить: какой путь у функции `add_to_waitlist`? В листинге 7-3 мы немного упростили код листинга 7-1, удалив некоторые модули и функции.
+Вернёмся к приложению 7-1, скажем, мы хотим вызвать функцию `add_to_waitlist`. Это то же самое, что спросить: какой путь у функции `add_to_waitlist`? В приложении 7-3 мы немного упростили рукопись приложения 7-1, удалив некоторые разделы и функции.
 
-Мы покажем два способа вызова функции `add_to_waitlist` из новой функции `eat_at_restaurant`, определённой в корневом модуле крейта. Эти пути правильные, но остаётся ещё одна проблема, которая не позволит этому примеру скомпилироваться как есть. Мы скоро объясним почему.
+Мы покажем два способа вызова функции `add_to_waitlist` из новой функции `eat_at_restaurant`, определённой в корневом разделе ящика. Эти пути правильные, но остаётся ещё одна неполадка, которая не позволит этому примеру собраться как есть. Мы скоро объясним почему.
 
-Функция `eat_at_restaurant` является частью общедоступного API нашего библиотечного крейта, поэтому мы помечаем её ключевым словом `pub`. В разделе "Раскрываем приватные пути с помощью ключевого слова `pub`" мы рассмотрим более подробно `pub`.
+Функция `eat_at_restaurant` является частью общедоступного API нашего библиотечного ящика, поэтому мы помечаем её ключевым словом `pub`. В разделе "Раскрываем закрытые пути с помощью ключевого слова `pub`" мы рассмотрим более подробно `pub`.
 
 Файл: src/lib.rs
 
@@ -21,31 +21,31 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs}}
 ```
 
-Листинг 7-3. Вызов функции add_to_waitlist с использованием абсолютного и относительного пути
+Приложение 7-3: Вызов функции add_to_waitlist с использованием безусловного и относительного пути
 
-При первом вызове функции `add_to_waitlist` из `eat_at_restaurant` мы используем абсолютный путь. Функция `add_to_waitlist` определена в том же крейте, что и `eat_at_restaurant`, и это означает, что мы можем использовать ключевое слово `crate` в начале абсолютного пути. Затем мы добавляем каждый из последующих дочерних модулей, пока не составим путь до `add_to_waitlist`. Вы можете представить себе файловую систему с такой же структурой: мы указываем путь `/front_of_house/hosting/add_to_waitlist` для запуска программы `add_to_waitlist`; использование имени `crate` в качестве корневого модуля крейта аналогично использованию `/` для указания корня файловой системы в вашей оболочке.
+При первом вызове функции `add_to_waitlist` из `eat_at_restaurant` мы используем безусловный путь. Функция `add_to_waitlist` определена в том же ящике, что и `eat_at_restaurant`, и это означает, что мы можем использовать ключевое слово `crate` в начале безусловного пути. Затем мы добавляем каждый из последующих дочерних разделов, пока не составим путь до `add_to_waitlist`. Вы можете представить себе файловую систему с таким же устройством: мы указываем путь `/front_of_house/hosting/add_to_waitlist` для запуска программы `add_to_waitlist`; использование имени `crate` в качестве корневого раздела ящика подобно использованию `/` для указания корня файловой системы в вашей оболочке.
 
-Второй раз, когда мы вызываем `add_to_waitlist` из `eat_at_restaurant`, мы используем относительный путь. Путь начинается с имени модуля `front_of_house`, определённого на том же уровне дерева модулей, что и `eat_at_restaurant`. Для эквивалентной файловой системы использовался бы путь `front_of_house/hosting/add_to_waitlist`. Начало пути с имени модуля означает, что путь является относительным.
+Второй раз, когда мы вызываем `add_to_waitlist` из `eat_at_restaurant`, мы используем относительный путь. Путь начинается с имени раздела `front_of_house`, определённого на том же уровне дерева разделов, что и `eat_at_restaurant`. Для равнозначной файловой системы использовался бы путь `front_of_house/hosting/add_to_waitlist`. Начало пути с имени раздела означает, что путь является относительным.
 
-Выбор, использовать относительный или абсолютный путь, является решением, которое вы примете на основании вашего проекта. Решение должно зависеть от того, с какой вероятностью вы переместите объявление элемента отдельно от или вместе с кодом использующим этот элемент. Например, в случае перемещения модуля `front_of_house` и его функции `eat_at_restaurant` в другой модуль с именем `customer_experience`, будет необходимо обновить абсолютный путь до `add_to_waitlist`, но относительный путь всё равно будет действителен. Однако, если мы переместим отдельно функцию `eat_at_restaurant` в модуль с именем `dining`, то абсолютный путь вызова `add_to_waitlist` останется прежним, а относительный путь нужно будет обновить. Мы предпочитаем указывать абсолютные пути, потому что это позволяет проще перемещать определения кода и вызовы элементов независимо друг от друга.
+Выбор, использовать относительный или безусловный путь, является решением, которое вы примете на основании вашего дела. Решение должно зависеть от того, с какой вероятностью вы переместите объявление переменной или способа отдельно от или вместе с рукописью использующей эту переменную или способ. Например, в случае перемещения раздела `front_of_house` и его функции `eat_at_restaurant` в другой раздел с именем `customer_experience`, будет необходимо обновить безусловный путь до `add_to_waitlist`, но относительный путь всё равно будет действителен. Однако, если мы переместим отдельно функцию `eat_at_restaurant` в раздел с именем `dining`, то безусловный путь вызова `add_to_waitlist` останется прежним, а относительный путь нужно будет обновить. Мы предпочитаем указывать безусловные пути, потому что это позволяет проще перемещать определения рукописи и вызовы переменных независимо друг от друга.
 
-Давайте попробуем скомпилировать код из листинга 7-3 и выяснить, почему он ещё не компилируется. Ошибка, которую мы получаем, показана в листинге 7-4.
+Давайте попробуем собрать рукопись из приложения 7-3 и выяснить, почему она ещё не собирается. Ошибка, которую мы получаем, показана в приложении 7-4.
 
 ```console
 {{#include ../listings/ch07-managing-growing-projects/listing-07-03/output.txt}}
 ```
 
-Листинг 7-4. Ошибки компиляции при сборке кода из листинга 7-3
+Приложение 7-4: Ошибки сборки при сборке рукописи из приложения 7-3
 
-Сообщения об ошибках говорят о том, что модуль `hosting` является приватным. Другими словами, у нас есть правильные пути к модулю `hosting` и функции `add_to_waitlist`, но Rust не позволяет нам использовать их, потому что у него нет доступа к приватным разделам. В Rust все элементы (функции, методы, структуры, перечисления, модули и константы) по умолчанию являются приватными для родительских модулей. Если вы хотите сделать элемент, например функцию или структуру, приватным, вы помещаете его в модуль.
+Сообщения об ошибках говорят о том, что раздел `hosting` является закрытым. Другими словами, у нас указаны правильные пути к разделу `hosting` и функции `add_to_waitlist`, но Ржавчина не позволяет нам использовать их, потому что у него нет доступа к закрытым разделам. В Ржавчине все переменные (функции, способы, стопки, перечисления, разделы и постоянные переменные) по умолчанию являются закрытыми для родительских разделов. Если вы хотите сделать функцию или вид данных, закрытым, вы помещаете их в раздел.
 
-Элементы в родительском модуле не могут использовать приватные элементы внутри дочерних модулей, но элементы в дочерних модулях могут использовать элементы у своих модулях-предках. Это связано с тем, что дочерние модули оборачивают и скрывают детали своей реализации, но дочерние модули могут видеть контекст, в котором они определены. Продолжая нашу метафору, подумайте о правилах приватности как о задней части ресторана: то, что там происходит, скрыто от клиентов ресторана, но офис-менеджеры могут видеть и делать всё в ресторане, которым они управляют.
+Переменные в родительском разделе не могут использовать закрытые переменные внутри дочерних разделов, но переменные в дочерних разделах могут использовать переменные у своих разделов-предков. Это связано с тем, что дочерние разделы оборачивают и скрывают подробности своего выполнения, но дочерние разделы могут видеть среду, в которой они определены. Продолжая наше сравнение, подумайте о правилах закрытости как о задней части ресторана: то, что там происходит, скрыто от конечных потребителей ресторана, но офис-управленцы могут видеть и делать всё в ресторане, которым они управляют.
 
-В Rust решили, что система модулей должна функционировать таким образом, чтобы по умолчанию скрывать детали реализации. Таким образом, вы знаете, какие части внутреннего кода вы можете изменять не нарушая работы внешнего кода. Тем не менее, Rust даёт нам возможность открывать внутренние части кода дочерних модулей для внешних модулей-предков, используя ключевое слово `pub`, чтобы сделать элемент общедоступным.
+В Ржавчине решили, что устройство разделов должно работать таким образом, чтобы по умолчанию скрывать подробности выполнения. Таким образом, вы знаете, какие части внутренней рукописи вы можете изменять не нарушая работы внешней рукописи. Тем не менее, Ржавчина даёт нам возможность открывать внутренние части рукописи дочерних разделов для внешних разделов-предков, используя ключевое слово `pub`, чтобы сделать переменную или способ общедоступным.
 
-### Раскрываем приватные пути с помощью ключевого слова `pub`
+### Раскрываем закрытые пути с помощью ключевого слова `pub`
 
-Давайте вернёмся к ошибке в листинге 7-4, которая говорит, что модуль `hosting` является приватным. Мы хотим, чтобы функция `eat_at_restaurant` из родительского модуля имела доступ к функции `add_to_waitlist` в дочернем модуле, поэтому мы помечаем модуль `hosting` ключевым словом `pub`, как показано в листинге 7-5.
+Давайте вернёмся к ошибке в приложении 7-4, которая говорит, что раздел `hosting` является закрытым. Мы хотим, чтобы функция `eat_at_restaurant` из родительского раздела имела доступ к функции `add_to_waitlist` в дочернем разделе, поэтому мы помечаем раздел `hosting` ключевым словом `pub`, как показано в приложении 7-5.
 
 Файл: src/lib.rs
 
@@ -53,21 +53,21 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs}}
 ```
 
-Листинг 7-5. Объявление модуля hosting как pub для его использования из eat_at_restaurant
+Приложение 7-5: Объявление раздела hosting как pub для его использования из eat_at_restaurant
 
-К сожалению, код в листинге 7-5 всё ещё приводит к ошибке, как показано в листинге 7-6.
+К сожалению, рукопись в приложении 7-5 всё ещё приводит к ошибке, как показано в приложении 7-6.
 
 ```console
 {{#include ../listings/ch07-managing-growing-projects/listing-07-05/output.txt}}
 ```
 
-Листинг 7-6: Ошибки компиляции при сборке кода в листинге 7-5
+Приложение 7-6: Ошибки сборки при сборке рукописи в приложении 7-5
 
-Что произошло? Добавление ключевого слова `pub` перед `mod hosting` сделало модуль общедоступным. После этого изменения, если мы можем получить доступ к модулю `front_of_house`, то мы можем получить доступ к модулю `hosting`. Но *содержимое* модуля `hosting` всё ещё является приватным: превращение модуля в общедоступный модуль не делает его содержимое общедоступным. Ключевое слово `pub` позволяет внешнему коду в модулях-предках обращаться только к модулю, без доступа ко внутреннему коду. Поскольку модули являются контейнерами, мы мало что можем сделать, просто сделав модуль общедоступным; нам нужно пойти дальше и сделать один или несколько элементов в модуле общедоступными.
+Что произошло? Добавление ключевого слова `pub` перед `mod hosting` сделало раздел общедоступным. После этого изменения, если мы можем получить доступ к разделу `front_of_house`, то мы можем получить доступ к разделу `hosting`. Но *содержимое* раздела `hosting` всё ещё является закрытым: превращение раздела в общедоступный раздел не делает его содержимое общедоступным. Ключевое слово `pub` позволяет внешней рукописи в разделах-предках обращаться только к разделу, без доступа ко внутренней рукописи. Поскольку разделы являются дополнениями, мы мало что можем сделать, просто сделав раздел общедоступным; нам нужно пойти дальше и сделать один или несколько переменных в разделе общедоступными.
 
-Ошибки в листинге 7-6 говорят, что функция `add_to_waitlist` является приватной. Правила приватности применяются к структурам, перечислениям, функциям и методам, также как и к модулям.
+Ошибки в приложении 7-6 говорят, что функция `add_to_waitlist` является закрытой. Правила закрытости применяются к стопкам, перечислениям, функциям и способам, также как и к разделам.
 
-Давайте также сделаем функцию `add_to_waitlist` общедоступной, добавив ключевое слово `pub` перед её определением, как показано в листинге 7-7.
+Давайте также сделаем функцию `add_to_waitlist` общедоступной, добавив ключевое слово `pub` перед её определением, как показано в приложении 7-7.
 
 Файл: src/lib.rs
 
@@ -75,29 +75,29 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs}}
 ```
 
-Листинг 7-7. Добавление ключевого слова pub к mod hosting и к fn add_to_waitlist позволяет нам вызывать функцию из eat_at_restaurant
+Приложение 7-7: Добавление ключевого слова pub к mod hosting и к fn add_to_waitlist позволяет нам вызывать функцию из eat_at_restaurant
 
-Теперь код компилируется! Чтобы понять, почему добавление ключевого слова `pub` позволяет нам использовать эти пути для `add_to_waitlist` в соответствии с правилами приватности, давайте рассмотрим абсолютный и относительный пути.
+Теперь рукопись собирается! Чтобы понять, почему добавление ключевого слова `pub` позволяет нам использовать эти пути для `add_to_waitlist` в соответствии с правилами закрытости, давайте рассмотрим безусловный и относительный пути.
 
-В случае абсолютного пути мы начинаем с `crate`, корня дерева модулей нашего крейта. Модуль `front_of_house` определён в корневом модуле крейта. Хотя `front_of_house` не является общедоступным, но поскольку функция `eat_at_restaurant` определена в том же модуле, что и `front_of_house` (то есть, `eat_at_restaurant` и `front_of_house` являются потомками одного родителя), мы можем ссылаться на `front_of_house` из `eat_at_restaurant`. Далее идёт модуль `hosting`, помеченный как `pub`. Мы можем получить доступ к родительскому модулю модуля `hosting`, поэтому мы можем получить доступ и к `hosting`. Наконец, функция `add_to_waitlist` помечена как `pub`, и так как мы можем получить доступ к её родительскому модулю, то вызов этой функции разрешён!
+В случае безусловного пути мы начинаем с `crate`, корня дерева разделов нашего ящика. Раздел `front_of_house` определён в корневом разделе ящика. Хотя `front_of_house` не является общедоступным, но поскольку функция `eat_at_restaurant` определена в том же разделе, что и `front_of_house` (то есть, `eat_at_restaurant` и `front_of_house` являются потомками одного родителя), мы можем ссылаться на `front_of_house` из `eat_at_restaurant`. Далее идёт раздел `hosting`, помеченный как `pub`. Мы можем получить доступ к родительскому разделу раздела `hosting`, поэтому мы можем получить доступ и к `hosting`. Наконец, функция `add_to_waitlist` помечена как `pub`, и так как мы можем получить доступ к её родительскому разделу, то вызов этой функции разрешён!
 
-В случае относительного пути логика такая же как для абсолютного пути, за исключением первого шага: вместо того, чтобы начинать с корневого модуля крейта, путь начинается с `front_of_house`. Модуль `front_of_house` определён в том же модуле, что и `eat_at_restaurant`, поэтому относительный путь, начинающийся с модуля, в котором определена `eat_at_restaurant` тоже работает. Тогда, по причине того, что `hosting` и `add_to_waitlist` помечены как `pub`, остальная часть пути работает и вызов этой функции разрешён!
+В случае относительного пути ход мыслей такой же как для безусловного пути, за исключением первого шага: вместо того, чтобы начинать с корневого раздела ящика, путь начинается с `front_of_house`. Раздел `front_of_house` определён в том же разделе, что и `eat_at_restaurant`, поэтому относительный путь, начинающийся с раздела, в котором определена `eat_at_restaurant` тоже работает. Тогда, по причине того, что `hosting` и `add_to_waitlist` помечены как `pub`, остальная часть пути работает и вызов этой функции разрешён!
 
-Если вы планируете предоставить общий доступ к своему библиотечному крейту, чтобы другие проекты могли использовать ваш код, ваш общедоступный API — это ваш контракт с пользователями вашего крейта, определяющий, как они могут взаимодействовать с вашим кодом. Есть много соображений по поводу управления изменениями в вашем общедоступном API, чтобы сделать необременительным для людей зависимость от вашего крейта. Эти соображения выходят за рамки этой книги; если вам интересна эта тема, см. [The Rust API Guidelines].
+Если вы собираетесь предоставить общий доступ к своему библиотечному ящику, чтобы другие дела могли использовать вашу рукопись, ваш общедоступный API — это ваш договор с пользователями вашего ящика, определяющий, как они могут взаимодействовать с вашей рукописью. Есть много соображений по поводу управления изменениями в вашем общедоступном API, чтобы сделать необременительным для людей дополнение от вашего ящика. Эти соображения выходят за рамки этой книги; если вам важен этот вопрос, см. [The Ржавчина API Guidelines].
 
-> #### Лучшие практики для пакетов с бинарным и библиотечным крейтами
+> #### Лучшие опыты для дополнений с двоичным и библиотечным ящиками
 >
-> Мы упоминали, что пакет может содержать как корневой модуль бинарного крейта *src/main.rs*, так и корневой модуль библиотечного крейта *src/lib.rs*, и оба крейта будут по умолчанию иметь имя пакета. Как правило, пакеты с таким шаблоном, содержащим как библиотечный, так и бинарный крейт, будут иметь достаточно кода в бинарном крейте, чтобы запустить исполняемый файл, который вызывает код из библиотечного крейта. Это позволяет другим проектам извлечь выгоду из большей части функциональности, предоставляемой пакетом, поскольку код библиотечного крейта можно использовать совместно.
+> Мы упоминали, что дополнение может содержать как корневой раздел двоичного ящика *src/main.rs*, так и корневой раздел библиотечного ящика *src/lib.rs*, и оба ящика будут по умолчанию иметь имя дополнения. Как правило, дополнения с таким образцом, содержащим как библиотечный, так и двоичный ящик, будут иметь достаточно рукописи в двоичном ящике, чтобы запустить исполняемый файл, который вызывает рукопись из библиотечного ящика. Это позволяет другим делам извлечь выгоду из большей части возможности, предоставляемой дополнением, поскольку рукопись библиотечного ящика можно использовать совместно.
 >
-> Дерево модулей должно быть определено в *src/lib.rs*. Затем любые общедоступные элементы можно использовать в бинарном крейте, начав пути с имени пакета. Бинарный крейт становится пользователем библиотечного крейта точно так же, как полностью внешний крейт использует библиотечный крейт: он может использовать только общедоступный API. Это поможет вам разработать хороший API; вы не только автор, но и пользователь!
+> Дерево разделов должно быть определено в *src/lib.rs*. Затем любые общедоступные переменные можно использовать в двоичном ящике, начав пути с имени дополнения. Двоичный ящик становится пользователем библиотечного ящика точно так же, как полностью внешний ящик использует библиотечный ящик: он может использовать только общедоступный API. Это поможет вам разработать хороший API; вы не только составитель, но и пользователь!
 >
-> В [Главе 12] мы эту практику организации кода с помощью консольной программы, которая будет содержать как бинарный, так и библиотечный крейты.
+> В [Главе 12] мы использовали данный опыт согласования рукописи с помощью программы с окном вывода, которое будет содержать как двоичный, так и библиотечный ящики.
 
 ### Начинаем относительный путь с помощью `super`
 
-Также можно построить относительные пути, которые начинаются в родительском модуле, используя ключевое слово `super` в начале пути. Это похоже на синтаксис начала пути файловой системы `..`. Использование `super` позволяет нам сослаться на элемент, который, как мы знаем, находится в родительском модуле, что может упростить переупорядочение дерева модулей, чем когда модуль тесно связан с родителем, но родитель может когда-нибудь быть перемещён в другое место в дереве модулей.
+Также можно построить относительные пути, которые начинаются в родительском разделе, используя ключевое слово `super` в начале пути. Это похоже на правила написания начала пути файловой системы `..`. Использование `super` позволяет нам сослаться на переменную, который, как мы знаем, находится в родительском разделе, что может упростить переупорядочение дерева разделов, чем когда раздел тесно связан с родителем, но родитель может когда-нибудь быть перемещён в другое место в дереве разделов.
 
-Рассмотрим код в листинге 7-8, где моделируется ситуация, в которой повар исправляет неправильный заказ и лично приносит его клиенту. Функция `fix_incorrect_order` вызывает функцию `deliver_order`, определённую в родительском модуле, указывая путь к `deliver_order`, начинающийся с `super`:
+Рассмотрим рукопись в приложении 7-8, где рассчитывается случай, в котором повар исправляет неправильный заказ и лично приносит его потребителю. Функция `fix_incorrect_order` вызывает функцию `deliver_order`, определённую в родительском разделе, указывая путь к `deliver_order`, начинающийся с `super`:
 
 Файл: src/lib.rs
 
@@ -105,13 +105,13 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-08/src/lib.rs}}
 ```
 
-Листинг 7-8: Вызов функции с использованием относительного пути, начинающегося с super
+Приложение 7-8: Вызов функции с использованием относительного пути, начинающегося с super
 
-Функция `fix_incorrect_order` находится в модуле `back_of_house`, поэтому мы можем использовать `super` для перехода к родительскому модулю модуля `back_of_house`, который в этом случае является `crate`, корневым модулем. В этом модуле мы ищем `deliver_order` и находим его. Успех! Мы думаем, что модуль `back_of_house` и функция `deliver_order`, скорее всего, останутся в тех же родственных отношениях друг с другом, и должны будут перемещены вместе, если мы решим реорганизовать дерево модулей крейта. Поэтому мы использовали `super`, чтобы в будущем у нас было меньше мест для обновления кода, если этот код будет перемещён в другой модуль.
+Функция `fix_incorrect_order` находится в разделе `back_of_house`, поэтому мы можем использовать `super` для перехода к родительскому разделу раздела `back_of_house`, который в этом случае является `crate`, корневым разделом. В этом разделе мы ищем `deliver_order` и находим его. Успех! Мы думаем, что раздел `back_of_house` и функция `deliver_order`, скорее всего, останутся в тех же родственных отношениях друг с другом, и должны будут перемещены вместе, если мы решим повторно согласовать дерево разделов ящика. Поэтому мы использовали `super`, чтобы в будущем у нас было меньше мест для обновления рукописи, если эта рукопись будет перемещена в другой раздел.
 
-### Делаем общедоступными структуры и перечисления
+### Делаем общедоступными стопки и перечисления
 
-Мы также можем использовать `pub` для обозначения структур и перечислений как общедоступных, но есть несколько дополнительных деталей использования `pub` со структурами и перечислениями. Если мы используем `pub` перед определением структуры, мы делаем структуру общедоступной, но поля структуры по-прежнему остаются приватными. Мы можем сделать каждое поле общедоступным или нет в каждом конкретном случае. В листинге 7-9 мы определили общедоступную структуру `back_of_house::Breakfast` с общедоступным полем `toast` и с приватным полем `seasonal_fruit`. Это моделирует случай в ресторане, когда клиент может выбрать тип хлеба, который подаётся с едой, а шеф-повар решает какие фрукты сопровождают еду, исходя из того, что сезонно и что есть в наличии. Доступные фрукты быстро меняются, поэтому клиенты не могут выбирать фрукты или даже увидеть, какие фрукты они получат.
+Мы также можем использовать `pub` для обозначения стопок и перечислений как общедоступных, но есть несколько дополнительных подробностей использования `pub` со стопками и перечислениями. Если мы используем `pub` перед определением стопки, мы делаем стопку общедоступной, но поля стопки по-прежнему остаются закрытыми. Мы можем сделать каждое поле общедоступным или нет в каждом определенном случае. В приложении 7-9 мы определили общедоступную стопку `back_of_house::Breakfast` с общедоступным полем `toast` и с закрытым полем `seasonal_fruit`. Это рассчитывает случай в ресторане, когда потребитель может выбрать вид хлеба, который подаётся с едой, а шеф-повар решает какие фрукты сопровождают еду, исходя из того, что сезонно и что есть в наличии. Доступные фрукты быстро меняются, поэтому конечные потребители не могут выбирать фрукты или даже увидеть, какие фрукты они получат.
 
 Файл: src/lib.rs
 
@@ -119,13 +119,13 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-09/src/lib.rs}}
 ```
 
-Листинг 7-9: Структура с общедоступными и приватными полями
+Приложение 7-9: Стопки с общедоступными и закрытыми полями
 
-Поскольку поле `toast` в структуре `back_of_house::Breakfast` является открытым, то в функции `eat_at_restaurant` можно писать и читать поле `toast`, используя точечную нотацию. Обратите внимание, что мы не можем использовать поле `seasonal_fruit` в `eat_at_restaurant`, потому что `seasonal_fruit` является приватным. Попробуйте убрать комментирование с последней строки для значения поля `seasonal_fruit`, чтобы увидеть какую ошибку вы получите!
+Поскольку поле `toast` в стопке `back_of_house::Breakfast` является открытым, то в функции `eat_at_restaurant` можно вносить изменения и получать данные из поля `toast`, используя точечное наставление. Обратите внимание, что мы не можем использовать поле `seasonal_fruit` в `eat_at_restaurant`, потому что `seasonal_fruit` является закрытым. Попробуйте убрать примечания с последней строки для значения поля `seasonal_fruit`, чтобы увидеть какую ошибку вы получите!
 
-Также обратите внимание, что поскольку `back_of_house::Breakfast` имеет приватное поле, то структура должна предоставить публичную ассоциированную функцию, которая создаёт экземпляр `Breakfast` (мы назвали её `summer`). Если `Breakfast` не имел бы такой функции, мы бы не могли создать экземпляр `Breakfast` внутри `eat_at_restaurant`, потому что мы не смогли бы установить значение приватного поля `seasonal_fruit` в функции `eat_at_restaurant`.
+Также обратите внимание, что поскольку `back_of_house::Breakfast` имеет закрытое поле, то стопка должна предоставить открытую сопряженную функцию, которая создаёт образец данных `Breakfast` (мы назвали её `summer`). Если `Breakfast` не имел бы такой функции, мы бы не могли создать образец данных `Breakfast` внутри `eat_at_restaurant`, потому что мы не смогли бы установить значение закрытого поля `seasonal_fruit` в функции `eat_at_restaurant`.
 
-В отличии от структуры, если мы сделаем общедоступным перечисление, то все его варианты будут общедоступными. Нужно только указать `pub` перед ключевым словом `enum`, как показано в листинге 7-10.
+В отличии от стопки, если мы сделаем общедоступным перечисление, то все его исходы будут общедоступными. Нужно только указать `pub` перед ключевым словом `enum`, как показано в приложении 7-10.
 
 Файл: src/lib.rs
 
@@ -133,14 +133,14 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-10/src/lib.rs}}
 ```
 
-Листинг 7-10. Определяя перечисление общедоступным мы делаем все его варианты общедоступными
+Приложение 7-10: Определяя перечисление общедоступным, мы делаем все его исходы общедоступными
 
-Поскольку мы сделали общедоступным перечисление `Appetizer`, то можно использовать варианты `Soup` и `Salad` в функции `eat_at_restaurant`.
+Поскольку мы сделали общедоступным перечисление `Appetizer`, то можно использовать исходы `Soup` и `Salad` в функции `eat_at_restaurant`.
 
-Перечисления не очень полезны, если их варианты не являются общедоступными: было бы досадно каждый раз аннотировать все варианты перечисления как `pub`. По этой причине по умолчанию варианты перечислений являются общедоступными. Структуры часто полезны, если их поля не являются общедоступными, поэтому поля структуры следуют общему правилу, согласно которому, всё по умолчанию является приватным, если не указано `pub`.
+Перечисления не очень полезны, если их исходы не являются общедоступными: было бы досадно каждый раз определять все исходы перечисления как `pub`. По этой причине по умолчанию исходы перечислений являются общедоступными. Стопки часто полезны, если их поля не являются общедоступными, поэтому поля стопки следуют общему правилу, согласно которому, всё по умолчанию является закрытым, если не указано `pub`.
 
-Есть ещё одна ситуация с `pub`, которую мы не освещали, и это последняя особенность модульной системы: ключевое слово `use`. Мы сначала опишем `use` само по себе, а затем покажем как сочетать `pub` и `use` вместе.
+Есть ещё один случай с `pub`, который мы не освещали, и это последняя особенность, состоящая из разделов системы: ключевое слово `use`. Мы сначала опишем `use` само по себе, а затем покажем как сочетать `pub` и `use` вместе.
 
 
-[The Rust API Guidelines]: https://rust-lang.github.io/api-guidelines/
+[The Ржавчина API Guidelines]: https://rust-lang.github.io/api-guidelines/
 [Главе 12]: ch12-00-an-io-project.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md b/rustbook-ru/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md
index 58f930bff..97558e6d7 100644
--- a/rustbook-ru/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md
+++ b/rustbook-ru/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md
@@ -1,8 +1,8 @@
 ## Подключение путей в область видимости с помощью ключевого слова `use`
 
-Необходимость записывать пути к функциям вызова может показаться неудобной и повторяющейся. В листинге 7-7 независимо от того, выбирали ли мы абсолютный или относительный путь к функции `add_to_waitlist` , каждый раз, когда мы хотели вызвать `add_to_waitlist` , нам приходилось также указывать `front_of_house` и `hosting` . К счастью, есть способ упростить этот процесс: мы можем один раз создать псевдоним на путь при помощи ключевого слова `use`, а затем использовать более короткое имя везде в области видимости.
+Необходимость записывать пути к функциям вызова может показаться неудобной и повторяющейся. В приложении 7-7 независимо от того, выбирали ли мы безусловный или относительный путь к функции `add_to_waitlist` , каждый раз, когда мы хотели вызвать `add_to_waitlist` , нам приходилось также указывать `front_of_house` и `hosting` . К счастью, есть способ упростить этот этап: мы можем один раз создать псевдоним на путь при помощи ключевого слова `use`, а затем использовать более короткое имя везде в области видимости.
 
-В листинге 7-11 мы подключили модуль `crate::front_of_house::hosting` в область действия функции `eat_at_restaurant`, поэтому нам достаточно только указать `hosting::add_to_waitlist` для вызова функции `add_to_waitlist` внутри `eat_at_restaurant`.
+В приложении 7-11 мы подключили раздел `crate::front_of_house::hosting` в область действия функции `eat_at_restaurant`, поэтому нам достаточно только указать `hosting::add_to_waitlist` для вызова функции `add_to_waitlist` внутри `eat_at_restaurant`.
 
 Файл: src/lib.rs
 
@@ -10,11 +10,11 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-11/src/lib.rs}}
 ```
 
-Листинг 7-11. Добавление модуля в область видимости при помощи use
+Приложение 7-11: Добавление раздела в область видимости при помощи use
 
-Добавление `use` и пути в область видимости аналогично созданию символической ссылки в файловой системе. С добавлением `use crate::front_of_house::hosting` в корневой модуль крейта, `hosting` становится допустимым именем в этой области, как если бы модуль `hosting` был определён в корневом модуле крейта. Пути, подключённые в область видимости с помощью `use`, также проверяются на доступность, как и любые другие пути.
+Добавление `use` и пути в область видимости подобно созданию условной ссылки в файловой системе. С добавлением `use crate::front_of_house::hosting` в корневой раздел ящика, `hosting` становится допустимым именем в этой области, как если бы раздел `hosting` был определён в корневом разделе ящика. Пути, подключённые в область видимости с помощью `use`, также проверяются на доступность, как и любые другие пути.
 
-Обратите внимание, что `use` создаёт псевдоним только для той конкретной области, в которой это объявление `use` и находится. В листинге 7-12 функция `eat_at_restaurant` перемещается в новый дочерний модуль с именем `customer`, область действия которого отличается от области действия инструкции `use`, поэтому тело функции не будет компилироваться:
+Обратите внимание, что `use` создаёт псевдоним только для той именно области, в которой это объявление `use` и находится. В приложении 7-12 функция `eat_at_restaurant` перемещается в новый дочерний раздел с именем `customer`, область действия которого отличается от области действия указания `use`, поэтому тело функции не будет собираться:
 
 Файл: src/lib.rs
 
@@ -22,19 +22,19 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-12/src/lib.rs}}
 ```
 
-Листинг 7-12. Инструкция use применяется только в её собственной области видимости
+Приложение 7-12: Указание use применяется только в её собственной области видимости
 
-Ошибка компилятора показывает, что данный псевдоним не может использоваться в модуле `customer`:
+Ошибка сборщика показывает, что данный псевдоним не может использоваться в разделе `customer`:
 
 ```console
 {{#include ../listings/ch07-managing-growing-projects/listing-07-12/output.txt}}
 ```
 
-Обратите внимание, что есть также предупреждение о том, что `use` не используется в своей области! Чтобы решить эту проблему, можно переместить `use` в модуль `customer`, или же можно сослаться на псевдоним в родительском модуле с помощью `super::hosting` в дочернем модуле `customer`.
+Обратите внимание, что есть также предупреждение о том, что `use` не используется в своей области! Чтобы решить эту неполадку, можно переместить `use` в раздел `customer`, или же можно сослаться на псевдоним в родительском разделе с помощью `super::hosting` в дочернем разделе `customer`.
 
-### Создание идиоматических путей с `use`
+### Создание определенных путей с `use`
 
-В листинге 7-11 вы могли бы задаться вопросом, почему мы указали  `use crate::front_of_house::hosting`, а затем вызвали `hosting::add_to_waitlist` внутри `eat_at_restaurant` вместо указания в  `use` полного пути прямо до функции `add_to_waitlist` для получения того же результата, что в листинге 7-13.
+В приложении 7-11 вы могли бы задаться вопросом, почему мы указали  `use crate::front_of_house::hosting`, а затем вызвали `hosting::add_to_waitlist` внутри `eat_at_restaurant` вместо указания в  `use` полного пути прямо до функции `add_to_waitlist` для получения того же итога, что в приложении 7-13.
 
 Файл: src/lib.rs
 
@@ -42,11 +42,11 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-13/src/lib.rs}}
 ```
 
-Листинг 7-13: Добавление функции add_to_waitlist в область видимости с use неидиоматическим способом
+Приложение 7-13: Добавление функции add_to_waitlist в область видимости с use не обычным способом
 
-Хотя листинги 7-11 и 7-13 выполняют одну и ту же задачу, листинг 7-11 является идиоматическим способом подключения функции в область видимости с помощью `use`. Подключение родительского модуля функции в область видимости при помощи `use` означает, что мы должны указывать родительский модуль при вызове функции. Указание родительского модуля при вызове функции даёт понять, что функция не определена локально, но в то же время сводя к минимуму повторение полного пути. В коде листинга 7-13 не ясно, где именно определена `add_to_waitlist`.
+Хотя приложении 7-11 и 7-13 выполняют одну и ту же задачу, рукопись в приложении 7-11 является принятым способом подключения функции в область видимости с помощью `use`. Подключение родительского раздела функции в область видимости при помощи `use` означает, что мы должны указывать родительский раздел при вызове функции. Указание родительского раздела при вызове функции даёт понять, что функция не определена местно, но в то же время сводя к уменьшению повторение полного пути. В рукописи приложения 7-13 не ясно, где именно определена `add_to_waitlist`.
 
-С другой стороны, при подключении структур, перечислений и других элементов используя `use`, идиоматически правильным будет указывать полный путь. Листинг 7-14 показывает идиоматический способ подключения структуры стандартной библиотеки `HashMap` в область видимости бинарного крейта.
+С другой стороны, при подключении стопок, перечислений и других переменных используя `use`, согласно принятых договоренностей правильным будет указывать полный путь. Приложение 7-14 показывает принятый способ подключения одного из видов данных встроенной библиотеки - `HashMap` в область видимости двоичного ящика.
 
 Файл: src/main.rs
 
@@ -54,11 +54,11 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-14/src/main.rs}}
 ```
 
-Листинг 7-14. Включение HashMap в область видимости идиоматическим способом
+Приложение 7-14: Включение HashMap в область видимости принятым способом
 
-За этой идиомой нет веской причины: это просто соглашение, которое появилось само собой. Люди привыкли читать и писать код на Rust таким образом.
+За этим устойчивым выражением нет веской причины: это просто соглашение, которое появилось само собой. Люди привыкли читать и писать рукопись на Ржавчине таким образом.
 
-Исключением из этой идиомы является случай, когда мы подключаем два элемента с одинаковыми именами в область видимости используя инструкцию `use` — Rust просто не позволяет этого сделать. Листинг 7-15 показывает, как подключить в область действия два типа с одинаковыми именами `Result`, но из разных родительских модулей и как на них ссылаться.
+Исключением из этого устойчивого выражения является случай, когда мы подключаем два имени переменных или способа с одинаковыми именами в область видимости используя указанию `use` — Ржавчина просто не позволяет этого сделать. Приложение 7-15 показывает, как подключить в область действия два способа с одинаковыми именами `Result`, но из разных родительских разделов и как на них ссылаться.
 
 Файл: src/lib.rs
 
@@ -66,13 +66,13 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-15/src/lib.rs:here}}
 ```
 
-Листинг 7-15. Для включения двух типов с одинаковыми именами в одну область видимости необходимо использовать их родительские модули.
+Приложение 7-15: Для включения двух способов с одинаковыми именами в одну область видимости необходимо использовать их родительские разделы.
 
-Как видите, использование имени родительских модулей позволяет различать два типа `Result`. Если бы вместо этого мы указали `use std::fmt::Result` и `use std::io::Result`, мы бы имели два типа `Result` в одной области видимости, и Rust не смог бы понять какой из двух `Result` мы имели в виду, когда нашёл бы их употребление в коде.
+Как видите, использование имени родительских разделов позволяет различать два способа `Result`. Если бы вместо этого мы указали `use std::fmt::Result` и `use std::io::Result`, мы бы имели два способа `Result` в одной области видимости, и Ржавчина не смогла бы понять какой из двух способов `Result` мы имели в виду, когда нашла бы их употребление в рукописи.
 
 ### Предоставление новых имён с помощью ключевого слова `as`
 
-Есть другое решение проблемы добавления двух типов с одинаковыми именами в одну и ту же область видимости используя `use`: после пути можно указать `as` и новое локальное имя (псевдоним) для типа. Листинг 7-16 показывает как по-другому написать код из листинга 7-15, путём переименования одного из двух типов `Result` используя `as`.
+Есть другое решение сбоев добавления двух способов с одинаковыми именами в одну и ту же область видимости используя `use`: после пути можно указать `as` и новое местное имя (псевдоним) для способа. Приложение 7-16 показывает как по-другому написать рукопись из приложения 7-15, путём переименования одного из двух способов `Result` используя `as`.
 
 Файл: src/lib.rs
 
@@ -80,15 +80,15 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-16/src/lib.rs:here}}
 ```
 
-Листинг 7-16: Переименование типа, когда он включён в область видимости с помощью ключевого слова as
+Приложение 7-16: Переименование способа, когда он включён в область видимости с помощью ключевого слова as
 
-Во второй инструкции `use` мы выбрали новое имя `IoResult` для типа `std::io::Result`, которое теперь не будет конфликтовать с типом `Result` из `std::fmt`, который также подключён в область видимости. Листинги 7-15 и 7-16 считаются идиоматичными, поэтому выбор за вами!
+во втором указании `use` мы выбрали новое имя `IoResult` для способа `std::io::Result`, которое теперь не будет враждовать со способом `Result` из `std::fmt`, который также подключён в область видимости. Приложения 7-15 и 7-16 считаются идиоматичными, поэтому выбор за вами!
 
 ### Реэкспорт имён с `pub use`
 
-Когда мы подключаем имя в область видимости, используя ключевое слово `use`, то имя, доступное в новой области видимости, является приватным. Чтобы позволить коду, который вызывает наш код, ссылаться на это имя, как если бы оно было определено в области видимости данного кода, можно объединить `pub` и `use`. Этот метод называется *реэкспортом (re-exporting)*, потому что мы подключаем элемент в область видимости, но также делаем этот элемент доступным для подключения в других областях видимости.
+Когда мы подключаем имя в область видимости, используя ключевое слово `use`, то имя, доступное в новой области видимости, является закрытым. Чтобы позволить рукописи, которая вызывает нашу рукопись, ссылаться на это имя, как если бы оно было определено в области видимости данной рукописи, можно объединить `pub` и `use`. Этот способ называется *реэкспортом (re-exporting)*, потому что мы подключаем переменную или способ в область видимости, но также делаем эту переменную или способ доступным для подключения в других областях видимости.
 
-Листинг 7-17 показывает код из листинга 7-11, где `use` в корневом модуле заменено на `pub use`.
+Приложение 7-17 показывает рукопись из приложения 7-11, где `use` в корневом разделе заменено на `pub use`.
 
 Файл: src/lib.rs
 
@@ -96,15 +96,15 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-17/src/lib.rs}}
 ```
 
-Листинг 7-17. Предоставление имени для использования любым кодом из новой области при помощи pub use
+Приложение 7-17: Предоставление имени для использования любой рукописью из новой области при помощи pub use
 
-До этого изменения внешний код должен был вызывать функцию `add_to_waitlist` , используя путь `restaurant::front_of_house::hosting::add_to_waitlist()` . Теперь, когда это объявление `pub use` повторно экспортировало модуль `hosting` из корневого модуля, внешний код теперь может использовать вместо него путь `restaurant::hosting::add_to_waitlist()` .
+До этого изменения наша внешняя рукопись должна была вызывать функцию `add_to_waitlist` , используя путь `restaurant::front_of_house::hosting::add_to_waitlist()` . Теперь, когда это объявление `pub use` повторно экспортировало раздел `hosting` из корневого раздела, внешняя рукопись теперь может использовать вместо него путь `restaurant::hosting::add_to_waitlist()` .
 
-Реэкспорт полезен, когда внутренняя структура вашего кода отличается от того, как программисты, вызывающие ваш код, думают о предметной области. Например, по аналогии с рестораном люди, управляющие им, думают о «передней части дома» и «задней части дома». Но клиенты, посещающие ресторан, вероятно, не будут думать о частях ресторана в таких терминах. Используя `pub use` , мы можем написать наш код с одной структурой, но сделать общедоступной другую структуру. Благодаря этому наша библиотека хорошо организована для программистов, работающих над библиотекой, и для программистов, вызывающих библиотеку. Мы рассмотрим ещё один пример `pub use` и его влияние на документацию вашего крейта в разделе «Экспорт удобного общедоступного API с `pub use`» Главы 14.
+Реэкспорт полезен, когда внутреннее устройство вашей рукописи отличается от того, как программисты, вызывающие вашу рукопись, думают о предметной области. Например, по подобию с рестораном люди, управляющие им, думают о «передней части дома» и «задней части дома». Но конечные потребители, посещающие ресторан, вероятно, не будут думать о частях ресторана в таких понятиях. Используя `pub use` , мы можем написать нашу рукопись с одним устройством, но сделать общедоступным другое устройство. Благодаря этому наша библиотека хорошо согласована для программистов, работающих над библиотекой, и для программистов, вызывающих библиотеку. Мы рассмотрим ещё один пример `pub use` и его влияние на пособие вашего ящика в разделе «Экспорт удобного общедоступного API с `pub use`» Главы 14.
 
-### Использование внешних пакетов
+### Использование внешних дополнений
 
-В Главе 2 мы запрограммировали игру угадывания числа, где использовался внешний пакет с именем `rand` для генерации случайного числа. Чтобы использовать `rand` в нашем проекте, мы добавили эту строку в *Cargo.toml*:
+В Главе 2 мы запрограммировали игру угадывания числа, где использовался внешнее дополнение с именем `rand` для создания случайного числа. Чтобы использовать `rand` в нашем деле, мы добавили эту строку в *Cargo.toml*:
 
  Главы 2, мы подключили трейт `Rng` в область видимости и вызвали функцию `rand::thread_rng`:
+Затем, чтобы подключить определения `rand` в область видимости нашего дополнения, мы добавили строку `use` начинающуюся с названия дополнения `rand` и списка способов, которые мы хотим подключить в область видимости. Напомним, что в разделе ["Создание случайного числа"] Главы 2, мы подключили сущность `Rng` в область видимости и вызвали функцию `rand::thread_rng`:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs:ch07-04}}
 ```
 
-Члены сообщества Rust сделали много пакетов доступными на ресурсе [crates.io](https://crates.io/), и добавление любого из них в ваш пакет включает в себя одни и те же шаги: добавить внешние пакеты в файл *Cargo.toml* вашего пакета, использовать `use` для подключения элементов внешних пакетов в область видимости.
+Члены сообщества Ржавчина сделали много дополнений доступными на источнике [crates.io](https://crates.io/), и добавление любого из них в ваше дело включает в себя одни и те же шаги: добавить внешние дополнения в файл *Cargo.toml* вашего дела, использовать `use` для подключения содержимого внешних дополнений в область видимости.
 
-Обратите внимание, что стандартная библиотека `std` также является крейтом, внешним по отношению к нашему пакету. Поскольку стандартная библиотека поставляется с языком Rust, нам не нужно изменять *Cargo.toml* для подключения `std`. Но нам нужно ссылаться на неё при помощи `use`, чтобы добавить элементы оттуда в область видимости нашего пакета. Например, с `HashMap` мы использовали бы эту строку:
+Обратите внимание, что обычная библиотека `std` также является ящиком, внешним по отношению к нашему делу. Поскольку обычная библиотека поставляется с языком Ржавчина, нам не нужно изменять *Cargo.toml* для подключения `std`. Но нам нужно ссылаться на неё при помощи `use`, чтобы добавить переменные оттуда в область видимости нашего дела. Например, с `HashMap` мы использовали бы эту строку:
 
 ```rust
 use std::collections::HashMap;
 ```
 
-Это абсолютный путь, начинающийся с `std`, имени крейта стандартной библиотеки.
+Это безусловный путь, начинающийся с `std`, имени ящика встроенной библиотеки.
 
 ### Использование вложенных путей для уменьшения длинных списков `use`
 
-Если мы используем несколько элементов, определённых в одном крейте или в том же модуле, то перечисление каждого элемента в отдельной строке может занимать много вертикального пространства в файле. Например, эти две инструкции `use` используются в программе угадывания числа (листинг 2-4) для подключения элементов из `std` в область видимости:
+Если мы используем несколько способов, определённых в одном ящике или в том же разделе, то перечисление каждой переменной в отдельной строке может занимать много вертикального пространства в файле. Например, эти два указания `use` используются в программе угадывания числа (приложение 2-4) для подключения способов из `std` в область видимости:
 
 Файл: src/main.rs
 
@@ -146,7 +146,7 @@ use std::collections::HashMap;
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/src/main.rs:here}}
 ```
 
-Вместо этого, мы можем использовать вложенные пути, чтобы добавить эти элементы в область видимости одной строкой. Мы делаем это, как показано в листинге 7-18, указывая общую часть пути, за которой следуют два двоеточия, а затем фигурные скобки вокруг списка тех частей продолжения пути, которые отличаются.
+Вместо этого, мы можем использовать вложенные пути, чтобы добавить эти переменные в область видимости одной строкой. Мы делаем это, как показано в приложении 7-18, указывая общую часть пути, за которой следуют два двоеточия, а затем узорчатые скобки вокруг списка тех частей продолжения пути, которые отличаются.
 
 Файл: src/main.rs
 
@@ -154,11 +154,11 @@ use std::collections::HashMap;
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-18/src/main.rs:here}}
 ```
 
-Листинг 7-18. Указание вложенного пути для добавления нескольких элементов с одинаковым префиксом в область видимости
+Приложение 7-18: Указание вложенного пути для добавления нескольких способов с одинаковой приставкой в область видимости
 
-В больших программах, подключение множества элементов из одного пакета или модуля с использованием вложенных путей может значительно сократить количество необходимых отдельных инструкций `use`!
+В больших программах, подключение множества содержимого из одного дополнения или раздела с использованием вложенных путей может значительно сократить количество необходимых отдельных указаний `use`!
 
-Можно использовать вложенный путь на любом уровне, что полезно при объединении двух инструкций `use`, которые имеют общую часть пути. Например, в листинге 7-19 показаны две инструкции `use`: одна подключает `std::io`, а другая подключает `std::io::Write` в область видимости.
+Можно использовать вложенный путь на любом уровне, что полезно при объединении двух указаний `use`, которые имеют общую часть пути. Например, в приложении 7-19 показаны два указания `use`: одна подключает `std::io`, а другая подключает `std::io::Write` в область видимости.
 
 Файл: src/lib.rs
 
@@ -166,9 +166,9 @@ use std::collections::HashMap;
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-19/src/lib.rs}}
 ```
 
-Листинг 7-19: Две инструкции use, в которых один путь является частью другого
+Приложение 7-19: Два указания use, в которых один путь является частью другого
 
-Общей частью этих двух путей является `std::io`, и это полный первый путь. Чтобы объединить эти два пути в одной инструкции `use`, мы можем использовать ключевое слово `self` во вложенном пути, как показано в листинге 7-20.
+Общей частью этих двух путей является `std::io`, и это полный первый путь. Чтобы объединить эти два пути в одном указании `use`, мы можем использовать ключевое слово `self` во вложенном пути, как показано в приложении 7-20.
 
 Файл: src/lib.rs
 
@@ -176,22 +176,22 @@ use std::collections::HashMap;
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-20/src/lib.rs}}
 ```
 
-Листинг 7-20: Объединение путей из Листинга 7-19 в одну инструкцию use
+Приложение 7-20: Объединение путей из Приложения 7-19 в одно указание use
 
 Эта строка подключает `std::io` и `std::io::Write` в область видимости.
 
-### Оператор * (glob)
+### Приказчик * (glob)
 
-Если мы хотим включить в область видимости *все* общедоступные элементы, определённые в пути, мы можем указать этот путь, за которым следует оператор `*`:
+Если мы хотим включить в область видимости *все* общедоступные переменные, определённые в пути, мы можем указать этот путь, за которым следует приказчик `*`:
 
 ```rust
 use std::collections::*;
 ```
 
-Эта инструкция `use` подключает все открытые элементы из модуля `std::collections` в текущую область видимости. Будьте осторожны при использовании оператора `*`! Он может усложнить понимание, какие имена находятся в области видимости и где были определены имена, используемые в вашей программе.
+Это указание `use` подключает все открытые переменные из раздела `std::collections` в текущую область видимости. Будьте осторожны при использовании приказчика `*`! Он может усложнить понимание, какие имена находятся в области видимости и где были определены имена, используемые в вашей программе.
 
-Оператор `*` часто используется при тестировании для подключения всего что есть в модуле `tests`; мы поговорим об этом в разделе ["Как писать тесты"] Главы 11. Оператор `*` также иногда используется как часть шаблона *автоматического импорта (prelude)*: смотрите [документацию по стандартной библиотеке](https://doc.rust-lang.org/std/prelude/index.html#other-preludes) для получения дополнительной информации об этом шаблоне.
+Приказчик `*` часто используется при проверке для подключения всего что есть в разделе `tests`; мы поговорим об этом в разделе ["Как писать проверки"] Главы 11. Приказчик `*` также иногда используется как часть образца *самостоятельного подключения (prelude)*: смотрите [пособие по встроенной библиотеке](https://doc.rust-lang.org/std/prelude/index.html#other-preludes) для получения дополнительных сведений об этом образце.
 
 
-["Генерация случайного числа"]: ch02-00-guessing-game-tutorial.html#generating-a-random-number
-["Как писать тесты"]: ch11-01-writing-tests.html#how-to-write-tests
\ No newline at end of file
+["Создание случайного числа"]: ch02-00-guessing-game-tutorial.html#generating-a-random-number
+["Как писать проверки"]: ch11-01-writing-tests.html#how-to-write-tests
\ No newline at end of file
diff --git a/rustbook-ru/src/ch07-05-separating-modules-into-different-files.md b/rustbook-ru/src/ch07-05-separating-modules-into-different-files.md
index 853f52dd7..4cbbe1e18 100644
--- a/rustbook-ru/src/ch07-05-separating-modules-into-different-files.md
+++ b/rustbook-ru/src/ch07-05-separating-modules-into-different-files.md
@@ -1,10 +1,10 @@
-## Разделение модулей на разные файлы
+## Разделение разделов на разные файлы
 
-До сих пор все примеры в этой главе определяли несколько модулей в одном файле. Когда модули становятся большими, вы можете захотеть переместить их определения в отдельные файлы, чтобы упростить навигацию по коду.
+До сих пор все примеры в этой главе определяли несколько разделов в одном файле. Когда разделы становятся большими, вы можете захотеть переместить их содержимое в отдельные файлы, чтобы упростить поиск по рукописи.
 
-Например, давайте начнём с кода из листинга 7-17, в котором было несколько модулей ресторана. Мы будем извлекать модули в файлы вместо того, чтобы определять все модули в корневом модуле крейта. В нашем случае корневой модуль крейта - *src/lib.rs*, но это разделение также работает и с бинарными крейтами, у которых корневой модуль крейта — *src/main.rs*.
+Например, давайте начнём с рукописи из приложения 7-17, в котором было несколько разделов ресторана. Мы будем извлекать разделы в файлы вместо того, чтобы определять их все в одном корневом разделе ящика. В нашем случае корневой раздел ящика - *src/lib.rs*, но это разделение также работает и с двоичными ящиками, у которых корневой раздел ящика — *src/main.rs*.
 
-Сначала мы извлечём модуль `front_of_house` в свой собственный файл. Удалите код внутри фигурных скобок для модуля `front_of_house`, оставив только объявление `mod front_of_house;`, так что теперь *src/lib.rs* содержит код, показанный в листинге 7-21. Обратите внимание, что этот вариант не скомпилируется, пока мы не создадим файл *src/front_of_house.rs* из листинге 7-22.
+Сначала мы извлечём раздел `front_of_house` в свой собственный файл. Удалите рукопись внутри узорчатых скобок для раздела `front_of_house`, оставив только объявление `mod front_of_house;`, так что теперь *src/lib.rs* содержит рукопись, показанную в приложении 7-21. Обратите внимание, что этот исход не собирается, пока мы не создадим файл *src/front_of_house.rs* из приложения 7-22.
 
 Файл: src/lib.rs
 
@@ -12,9 +12,9 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-21-and-22/src/lib.rs}}
 ```
 
-Листинг 7-21. Объявление модуля front_of_house, чьё содержимое будет в src/front_of_house.rs
+Приложение 7-21: Объявление раздела front_of_house, чьё содержимое будет в src/front_of_house.rs
 
-Затем поместим код, который был в фигурных скобках, в новый файл с именем *src/front_of_house.rs*, как показано в листинге 7-22. Компилятор знает, что нужно искать в этом файле, потому что он наткнулся в корневом модуле крейта на объявление модуля с именем `front_of_house`.
+Затем поместим рукопись, которая была в узорчатых скобках, в новый файл с именем *src/front_of_house.rs*, как показано в приложении 7-22. Сборщик знает, что нужно искать в этом файле, потому что он наткнулся в корневом разделе ящика на объявление раздела с именем `front_of_house`.
 
 Файл: src/front_of_house.rs
 
@@ -22,13 +22,13 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/listing-07-21-and-22/src/front_of_house.rs}}
 ```
 
-Листинг 7-22. Определение содержимого модуля front_of_house в файле src/front_of_house.rs
+Приложение 7-22. Определение содержимого раздела front_of_house в файле src/front_of_house.rs
 
-Обратите внимание, что вам нужно только *один раз* загрузить файл с помощью объявления `mod` в вашем дереве модулей. Как только компилятор узнает, что файл является частью проекта (и узнает, где в дереве модулей находится код из-за того, куда вы поместили инструкцию `mod`), другие файлы в вашем проекте должны ссылаться на код загруженного файла, используя путь к месту, где он был объявлен, как описано в разделе [«Пути для ссылки на элемент в дереве модулей»]. Другими словами, `mod` — это *не* операция «включения», которую вы могли видеть в других языках программирования.
+Обратите внимание, что вам нужно только *один раз* загрузить файл с помощью объявления `mod` в вашем дереве разделов. Как только сборщик узнает, что файл является частью дела (и узнает, где в дереве разделов находится рукопись, поскольку вы поместили указание  `mod`), другие файлы в вашем деле должны ссылаться на рукопись загруженного файла, используя путь к месту, где он был объявлен, как описано в разделе [«Пути для ссылки на переменную в дереве разделов»]. Другими словами, `mod` — это *не* действие «включения», которое вы могли видеть в других языках программирования.
 
-Далее мы извлечём модуль `hosting` в его собственный файл. Процесс немного отличается, потому что `hosting` является дочерним модулем для `front_of_house`, а не корневого модуля. Мы поместим файл для `hosting` в новый каталог, который будет назван по имени его предка в дереве модулей, в данном случае это *src/front_of_house/*.
+Далее мы извлечём раздел `hosting` в его собственный файл. Этап немного отличается, потому что `hosting` является дочерним разделом для `front_of_house`, а не корневого раздела. Мы поместим файл для `hosting` в новую папку, который будет назван по имени его предка в дереве разделов, в данном случае это *src/front_of_house/*.
 
-Чтобы начать перенос `hosting`, мы меняем *src/front_of_house.rs* так, чтобы он содержал только объявление модуля `hosting`:
+Чтобы начать перенос `hosting`, мы меняем *src/front_of_house.rs* так, чтобы он содержал только объявление раздела `hosting`:
 
 Файл: src/front_of_house.rs
 
@@ -36,7 +36,7 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house.rs}}
 ```
 
-Затем мы создаём каталог *src/front_of_house* и файл *hosting.rs*, в котором будут  определения, сделанные в модуле `hosting`:
+Затем мы создаём папку *src/front_of_house* и файл *hosting.rs*, в котором будут  определения, сделанные в разделе `hosting`:
 
 Файл: src/front_of_house/hosting.rs
 
@@ -44,33 +44,33 @@
 {{#rustdoc_include ../listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/src/front_of_house/hosting.rs}}
 ```
 
-Если вместо этого мы поместим *hosting.rs* в каталог *src*, компилятор будет думать, что код в *hosting.rs* это модуль `hosting`, объявленный в корне крейта, а не объявленный как дочерний модуль `front_of_house`. Правила компилятора для проверки какие файлы содержат код каких модулей предполагают, что каталоги и файлы точно соответствуют дереву модулей.
+Если вместо этого мы поместим *hosting.rs* в папку *src*, сборщик будет думать, что рукопись в *hosting.rs* это раздел `hosting`, объявленный в корне ящика, а не объявленный как дочерний раздел `front_of_house`. Правила сборщика для проверки: какие файлы содержат рукопись каких разделов предполагают, что папки и файлы точно соответствуют дереву разделов.
 
-> ### Альтернативные пути к файлам
+> ### Иные пути к файлам
 >
-> До сих пор мы рассматривали наиболее идиоматические пути к файлам, используемые компилятором Rust, но Rust также поддерживает и старый стиль пути к файлу. Для модуля с именем `front_of_house`, объявленного в корневом модуле крейта, компилятор будет искать код модуля в:
+> До сих пор мы рассматривали наиболее привычные пути к файлам, используемые сборщиком Ржавчины, но Ржавчина также поддерживает и старое исполнение пути к файлу. Для раздела с именем `front_of_house`, объявленного в корневом разделе ящика, сборщик будет искать рукопись раздела в:
 >
 > - *src/front_of_house.rs* (что мы рассматривали)
-> - *src/front_of_house/mod.rs* (старый стиль, всё ещё поддерживаемый путь)
+> - *src/front_of_house/mod.rs* (старое исполнение, всё ещё поддерживаемый путь)
 >
-> Для модуля с именем `hosting`, который является подмодулем `front_of_house`, компилятор будет искать код модуля в:
+> Для раздела с именем `hosting`, который является подразделом `front_of_house`, сборщик будет искать рукопись раздела в:
 >
 > - *src/front_of_house/hosting.rs* (что мы рассматривали)
-> - *src/front_of_house/hosting/mod.rs* (старый стиль, всё ещё поддерживаемый путь)
+> - *src/front_of_house/hosting/mod.rs* (старое исполнение, всё ещё поддерживаемый путь)
 >
-> Если вы используете оба стиля для одного и того же модуля, вы получите ошибку компилятора. Использование сочетания обоих стилей для разных модулей в одном проекте разрешено, но это может сбивать с толку людей, перемещающихся по вашему проекту.
+> Если вы используете оба исполнения для одного и того же раздела, вы получите ошибку сборщика. Использование сочетания обоих исполнений для разных разделов в одном деле разрешено, но это может сбивать с толку людей, перемещающихся по вашему делу.
 >
-> Основным недостатком стиля, в котором используются файлы с именами *mod.rs*, является то, что в вашем проекте может оказаться много файлов с именами *mod.rs*, что может привести к путанице, если вы одновременно откроете их в редакторе.
+> Основным недостатком исполнения, в котором используются файлы с именами *mod.rs*, является то, что в вашем деле может оказаться много файлов с именами *mod.rs*, что может привести к путанице, если вы одновременно откроете их в редакторе.
 
-Мы перенесли код каждого модуля в отдельный файл, а дерево модулей осталось прежним. Вызовы функций в `eat_at_restaurant` будут работать без каких-либо изменений, несмотря на то, что определения находятся в разных файлах. Этот метод позволяет перемещать модули в новые файлы по мере увеличения их размеров.
+Мы перенесли рукопись каждого раздела в отдельный файл, а дерево разделов осталось прежним. Вызовы функций в `eat_at_restaurant` будут работать без каких-либо изменений, несмотря на то, что определения находятся в разных файлах. Этот способ позволяет перемещать разделы в новые файлы по мере увеличения их размеров.
 
-Обратите внимание, что инструкция `pub use crate::front_of_house::hosting` в *src/lib.rs* также не изменилась, и `use` не влияет на то, какие файлы компилируются как часть крейта. Ключевое слово `mod` объявляет модули, и Rust ищет в файле с тем же именем, что и у модуля, код, который входит в этот модуль.
+Обратите внимание, что указание `pub use crate::front_of_house::hosting` в *src/lib.rs* также не изменилось, и `use` не влияет на то, какие файлы собираются как часть ящика. Ключевое слово `mod` объявляет разделы, и Ржавчина ищет в файле с тем же именем, что и у раздела, рукопись, которая входит в это раздел.
 
 ## Итог
 
-Rust позволяет разбить пакет на несколько крейтов и крейт - на модули, так что вы можете ссылаться на элементы, определённые в одном модуле, из другого модуля. Это можно делать при помощи указания абсолютных или относительных путей. Эти пути можно добавить в область видимости инструкцией `use`, поэтому вы можете пользоваться более короткими путями для многократного использования элементов в этой области видимости. Код модуля по умолчанию является приватным, но можно сделать определения общедоступными, добавив ключевое слово `pub`.
+Ржавчина позволяет разбить дело на несколько ящиков, а сам ящик - на разделы, так что вы можете ссылаться на переменнуюы, определённые в одном разделе (файле), из другого раздела (файла). Это можно делать при помощи указания безусловных или относительных путей. Эти пути можно добавить в область видимости указанием `use`, поэтому вы можете пользоваться более короткими путями для многократного использования содержимого в этой области видимости. Рукопись раздела по умолчанию является закрытой, но можно сделать его содержимое (функции, определения, виды данных и т.д.) общедоступными, добавив ключевое слово `pub`.
 
-В следующей главе мы рассмотрим некоторые коллекции структур данных из стандартной библиотеки, которые вы можете использовать в своём аккуратно организованном коде.
+В следующей главе мы рассмотрим некоторые виды данных - собрания из встроенной библиотеки, которые вы можете использовать в своей правильно составленной рукописи.
 
 
-[«Пути для ссылки на элемент в дереве модулей»]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
\ No newline at end of file
+[«Пути для ссылки на переменную в дереве разделов»]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
\ No newline at end of file
diff --git a/rustbook-ru/src/ch08-00-common-collections.md b/rustbook-ru/src/ch08-00-common-collections.md
index 08598269f..34dd2ca41 100644
--- a/rustbook-ru/src/ch08-00-common-collections.md
+++ b/rustbook-ru/src/ch08-00-common-collections.md
@@ -1,12 +1,12 @@
-# Общие коллекции
+# Общее: Собрания
 
-Стандартная библиотека содержит несколько полезных структур данных, которые называются *коллекциями*. Большая часть других типов данных представляют собой хранение конкретного значения, но особенностью коллекций является хранение множества однотипных значений. В отличии от массива или кортежа данные коллекций хранятся в куче, а это значит, что размер коллекции может быть неизвестен в момент компиляции программы. Он может изменяться (увеличиваться, уменьшаться) во время работы программы. Каждый вид коллекций имеет свои возможности и отличается по производительности, так что выбор конкретной коллекции зависит от ситуации и является умением разработчика, вырабатываемым со временем. В этой главе будет рассмотрено несколько коллекций:
+Обычная библиотека содержит несколько полезных видов данных, которые называются *собраниями*. Большая часть других видов данных представляют собой хранение одного определенного значения, но особенностью собраний является хранение множества значений. В отличии от массива или упорядоченного ряда, данные собраний хранятся в куче, а это значит, что размер собрания может быть неизвестен во время сборки программы. Он может изменяться (увеличиваться, уменьшаться) во время работы программы. Каждый вид собраний имеет свои возможности и отличается и затратам с точки зрения производительности и памяти, так что выбор какой именно вид собрания стоит использовать - зависит от определенного случая и от опыта самого разработчика, накапливаемым со временем. В этой главе будет рассмотрено несколько видов собраний:
 
-- *Вектор (vector)* - позволяет нам сохранять различное количество последовательно хранящихся значений,
-- *Строка (string)* - это последовательность символов. Мы же упоминали тип `String` ранее, но в данной главе мы поговорим о нем подробнее.
-- *Хеш-таблица (hash map)* - коллекция которая позволяет хранить перечень ассоциаций значения с ключом (перечень пар ключ:значение). Является конкретной реализацией более общей структуры данных называемой *map*.
+- *Вектор (vector)* - позволяет нам сохранять различное количество последовательно хранящихся значений.
+- *Строка (string)* - это набор знаков. Мы же упоминали вид данных `String` ранее, но в данной главе мы поговорим о нем подробнее.
+- *Хеш-таблица (hash map)* - позволяет хранить перечень связанных значения с ключом (перечень пар: ключ-значение). Является разновидностью более общей другого вида данных, называемого *map*.
 
-Для того, чтобы узнать о других видах коллекций предоставляемых стандартной библиотекой смотрите [документацию](https://doc.rust-lang.org/std/collections/index.html).
+Для того, чтобы узнать о других видах собраний, предоставляемых встроенной библиотекой смотрите [пособие](https://doc.rust-lang.org/std/collections/index.html).
 
 Мы обсудим как создавать и обновлять векторы, строки и хеш-таблицы, а также объясним что делает каждую из них особенной.
 
diff --git a/rustbook-ru/src/ch08-01-vectors.md b/rustbook-ru/src/ch08-01-vectors.md
index ed94cdf02..1dd99b9b2 100644
--- a/rustbook-ru/src/ch08-01-vectors.md
+++ b/rustbook-ru/src/ch08-01-vectors.md
@@ -1,139 +1,139 @@
 ## Хранение списков значений в векторах
 
-Первым типом коллекции, который мы разберём, будет `Vec`, также известный как вектор (vector). Векторы позволяют хранить более одного значения в единой структуре данных, хранящей элементы в памяти один за другим. Векторы могут хранить данные только одного типа. Их удобно использовать, когда нужно хранить список элементов, например, список текстовых строк из файла, или список цен товаров в корзине покупок.
+Первым видом собрания, который мы разберём, будет вид данных `Vec`, также известный как вектор (vector). Векторы позволяют хранить более одного значения в единой стопке данных, хранящей значения в памяти одно за другим. Векторы могут хранить данные только одного вида данных. Их удобно использовать, когда нужно хранить список значений, например, список написанных строк из файла, или список цен товаров в корзине покупок.
 
 ### Создание нового вектора
 
-Чтобы создать новый пустой вектор, мы вызываем функцию `Vec::new`, как показано в листинге 8-1.
+Чтобы создать новый пустой вектор, мы вызываем функцию `Vec::new`, как показано в приложении 8-1.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-01/src/main.rs:here}}
 ```
 
-Листинг 8-1: Создание нового пустого вектора для хранения значений типа i32
+Приложение 8-1: Создание нового пустого вектора для хранения значений вида данных i32
 
-Обратите внимание, что здесь мы добавили аннотацию типа. Поскольку мы не вставляем никаких значений в этот вектор, Rust не знает, какие элементы мы собираемся хранить. Это важный момент. Векторы реализованы с использованием обобщённых типов; мы рассмотрим, как использовать обобщённые типы с вашими собственными типами в Главе 10. А пока знайте, что тип `Vec`, предоставляемый стандартной библиотекой, может хранить любой тип. Когда мы создаём новый вектор для хранения конкретного типа, мы можем указать этот тип в угловых скобках. В листинге 8-1 мы сообщили Rust, что `Vec` в `v` будет хранить элементы типа `i32`.
+Обратите внимание, что здесь мы добавили изложение вида данных. Поскольку мы не вставляем никаких значений в этот вектор, Ржавчина не знает, какие значения мы собираемся хранить. Это важная особенность. Векторы выполнены с использованием обобщённых видов данных; мы рассмотрим, как использовать обобщённые виды данных с вашими собственными видами данных в Главе 10. А пока знайте, что вид данных `Vec`, предоставляемый встроенной библиотекой, может хранить любой вид данных. Когда мы создаём новый вектор для хранения определенного вида данных, мы можем указать этот вид данных в угловых скобках. В приложении 8-1 мы сообщили Ржавчине, что вектор `Vec` в переменной `v` будет хранить значения вида данных `i32`.
 
-Чаще всего вы будете создавать `Vec` с начальными значениями и Rust может определить тип сохраняемых вами значений, но иногда вам всё же придётся указывать аннотацию типа. Для удобства Rust предоставляет макрос `vec!`, который создаст новый вектор, содержащий заданные вами значения. В листинге 8-2 создаётся новый `Vec`, который будет хранить значения `1`, `2` и `3`. Числовым типом является `i32`, потому что это тип по умолчанию для целочисленных значений, о чём упоминалось в разделе [“Типы данных”] Главы 3.
+Чаще всего вы будете создавать `Vec` с начальными значениями. Ржавчина может определить вид данных присваиваемых вами значений, но иногда вам всё же придётся указывать изложение вида данных. Для удобства, Ржавчина предоставляет макрос `vec!`, который создаст новый вектор, содержащий заданные вами значения. В приложении 8-2 создаётся новый вектор `Vec`, который будет хранить значения `1`, `2` и `3`. Числовым видом данных является `i32`, потому что это вид данных по установлен умолчанию для целочисленных значений, о чём упоминалось в разделе [“Виды данных”] Главы 3.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-02/src/main.rs:here}}
 ```
 
-Листинг 8-2: Создание нового вектора, содержащего значения
+Приложение 8-2: Создание нового вектора, содержащего значения
 
-Поскольку мы указали начальные значения типа `i32`, Rust может сделать вывод, что тип переменной `v` это `Vec` и аннотация типа здесь не нужна. Далее мы посмотрим как изменять вектор.
+Поскольку мы указали начальные значения вида данных `i32`, Ржавчина может сделать вывод, что вид данных переменной `v` это `Vec` и изложение вида данных здесь не нужно. Далее мы посмотрим как изменять вектор.
 
 ### Изменение вектора
 
-Чтобы создать вектор и затем добавить к нему элементы, можно использовать метод `push` показанный в листинге 8-3.
+Чтобы создать вектор и затем добавить к нему переменные, можно использовать способ `push`, показанный в приложении 8-3.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-03/src/main.rs:here}}
 ```
 
-Листинг 8-3: Использование метода push для добавления значений в вектор
+Приложение 8-3: Использование способа push для добавления значений в вектор
 
-Как и с любой переменной, если мы хотим изменить её значение, нам нужно сделать её изменяемой с помощью ключевого слова `mut`, что обсуждалось в Главе 3. Все числа которые мы помещаем в вектор имеют тип `i32` по этому Rust с лёгкостью выводит тип вектора, по этой причине нам не нужна здесь аннотация типа вектора `Vec`.
+Как и с любой переменной, если мы хотим изменить её значение, нам нужно сделать её изменяемой с помощью ключевого слова `mut`, что обсуждалось в Главе 3. Все числа, которые мы помещаем в вектор имеют вид данных `i32` по умолчанию, поэтому Ржавчина с лёгкостью сама определяет вид данных `вектора`, по этой причине здесь не требуется изложение вида данных вектора как `Vec`.
 
 ### Чтение данных вектора
 
-Есть два способа сослаться на значение, хранящееся в векторе: с помощью индекса или метода `get` . В следующих примерах для большей ясности мы указали типы значений, возвращаемых этими функциями.
+Есть два способа сослаться на значение, хранящееся в векторе: с помощью порядкового указателя или способа `get` . В следующих примерах для большей ясности мы указали виды данных значений, возвращаемых этими функциями.
 
-В листинге 8-4 показаны оба метода доступа к значению в векторе: либо с помощью синтаксиса индексации и с помощью метода `get`.
+В приложении 8-4 показаны оба способа доступа к значению в векторе: с помощью правил порядка и с помощью способа `get`.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-04/src/main.rs:here}}
 ```
 
-Листинг 8-4. Использование синтаксиса индексации и метода get для доступа к элементу в векторе
+Приложение 8-4: Использование правил порядка и способа get, для доступа к переменной ряда в векторе
 
-Обратите внимание здесь на пару деталей. Мы используем значение индекса `2` для получения третьего элемента: векторы индексируются начиная с нуля. Указывая `&` и `[]` мы получаем ссылку на элемент по указанному индексу. Когда мы используем метод `get` содержащего индекс, переданный в качестве аргумента, мы получаем тип `Option<&T>`, который мы можем проверить с помощью `match`.
+Обратите внимание здесь на пару подробностей. Мы используем значение порядкового указателя `2` для получения третьей переменной: векторы упорядочиваются начиная с нуля. Указывая `&` и `[]` мы получаем ссылку на переменную по указанному порядковому указателю. Когда мы используем способ `get`,  содержащего порядковый указатель, переданный в качестве переменной, мы получаем вид данных `Option<&T>`, который мы можем проверить с помощью `match`.
 
-Причина, по которой Rust предоставляет два способа ссылки на элемент, заключается в том, что вы можете выбрать, как программа будет себя вести, когда вы попытаетесь использовать значение индекса за пределами диапазона существующих элементов. В качестве примера давайте посмотрим, что происходит, когда у нас есть вектор из пяти элементов, а затем мы пытаемся получить доступ к элементу с индексом 100 с помощью каждого метода, как показано в листинге 8-5.
+Причина, по которой Ржавчина предоставляет два способа ссылки на переменную, заключается в том, что вы можете выбрать, как программа будет себя вести, когда вы попытаетесь использовать значение порядкового указателя за пределами границ. В качестве примера давайте посмотрим, что происходит, когда у нас есть вектор из пяти переменных, а затем мы пытаемся получить доступ к переменной ряда с порядковым указателем 100 с помощью каждого способа, как показано в приложении 8-5.
 
 ```rust,should_panic,panics
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-05/src/main.rs:here}}
 ```
 
-Листинг 8-5. Попытка доступа к элементу с индексом 100 в векторе, содержащем пять элементов
+Приложение 8-5: Попытка доступа к переменной с порядковым указателем 100 в векторе, содержащем всего пять переменных
 
-Когда мы запускаем этот код, первая строка с `&v[100]` вызовет панику программы, потому что происходит попытка получить ссылку на несуществующий элемент. Такой подход лучше всего использовать, когда вы хотите, чтобы ваша программа аварийно завершила работу при попытке доступа к элементу за пределами вектора.
+Когда мы запускаем эту рукопись, первая строка с `&v[100]` вызовет сбой программы, потому что происходит попытка получить ссылку на несуществующую переменную. Такой подход лучше всего использовать, когда вы хотите, чтобы ваша программа со сбоем завершила работу при попытке доступа к переменной ряда за пределами границ вектора.
 
-Когда методу `get` передаётся индекс, который находится за пределами вектора, он без паники возвращает `None`. Вы могли бы использовать такой подход, если доступ к элементу за пределами диапазона вектора происходит время от времени при нормальных обстоятельствах. Тогда ваш код будет иметь логику для обработки наличия `Some(&element)` или `None`, как обсуждалось в Главе 6. Например, индекс может исходить от человека, вводящего число. Если пользователь случайно введёт слишком большое число, то программа получит значение `None` и у вас будет возможность сообщить пользователю, сколько элементов находится в текущем векторе, и дать ему возможность ввести допустимое значение. Такое поведение было бы более дружелюбным для пользователя, чем внезапный сбой программы из-за опечатки!
+Когда способу `get` передаётся порядковый указатель, который находится за пределами границ вектора, он без сбоя возвращает `None`. Вы могли бы использовать такой подход, если доступ к переменной ряда за пределами границ вектора происходит время от времени при обычных обстоятельствах. Тогда ваша рукопись будет знать что делать для обработки наличия `Some(&element)` или `None`, как обсуждалось в Главе 6. Например, порядковый указатель может исходить от человека, вводящего число. Если пользователь случайно введёт слишком большое число, то программа получит значение `None` и у вас будет возможность сообщить пользователю, сколько переменных находится в текущем векторе, и дать ему возможность ввести допустимое значение. Такое поведение было бы более дружелюбным для пользователя, чем внезапный сбой программы из-за опечатки!
 
-Когда у программы есть действительная ссылка, borrow checker (средство проверки заимствований), обеспечивает соблюдение правил владения и заимствования (описанные в Главе 4), чтобы гарантировать, что эта ссылка и любые другие ссылки на содержимое вектора остаются действительными. Вспомните правило, которое гласит, что у вас не может быть изменяемых и неизменяемых ссылок в одной и той же области. Это правило применяется в листинге 8-6, где мы храним неизменяемую ссылку на первый элемент вектора и затем пытаемся добавить элемент в конец вектора. Данная программа не будет работать, если мы также попробуем сослаться на данный элемент позже в функции:
+Когда у программы есть действительная ссылка, borrow checker (средство проверки заимствований), обеспечивает соблюдение правил владения и заимствования (описанные в Главе 4), чтобы обеспечить, что эта ссылка и любые другие ссылки на содержимое вектора остаются действительными. Вспомните правило, которое гласит, что у вас не может быть изменяемых и неизменяемых ссылок в одной и той же области. Это правило применяется в приложении 8-6, где мы храним неизменяемую ссылку на первую переменную вектора и затем пытаемся добавить переменную в конец вектора. Данная программа не будет работать, если мы также попробуем сослаться на данную переменную позже в функции:
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-06/src/main.rs:here}}
 ```
 
-Листинг 8-6. Попытка добавить некоторый элемент в вектор, в то время когда есть ссылка на элемент вектора
+Приложение 8-6: Попытка добавить некоторую переменную в вектор, в то время когда есть ссылка на переменную вектора
 
-Компиляция этого кода приведёт к ошибке:
+Сборка этой рукописи приведёт к ошибке:
 
 ```console
 {{#include ../listings/ch08-common-collections/listing-08-06/output.txt}}
 ```
 
-Код в листинге 8-6 может выглядеть так, как будто он должен работать. Почему ссылка на первый элемент должна заботиться об изменениях в конце вектора? Эта ошибка возникает из-за особенности того, как работают векторы: поскольку векторы размещают значения в памяти друг за другом, добавление нового элемента в конец вектора может потребовать выделения новой памяти и копирования старых элементов в новое пространство, если нет достаточного места, чтобы разместить все элементы друг за другом там, где в данный момент хранится вектор. В этом случае ссылка на первый элемент будет указывать на освобождённую память. Правила заимствования предотвращают попадание программ в такую ситуацию.
+Рукопись в приложении 8-6 может выглядеть так, как будто она должна работать. Почему ссылка на первую переменную должна заботиться об изменениях в конце вектора? Эта ошибка возникает из-за особенности того, как работают векторы: векторы размещают значения в памяти друг за другом. Добавление новой переменной в конец вектора требует чтобы была свободная память в куче. Если в куче нет достаточного места, чтобы разместить все переменные - требуется выделение новой памяти из ОЗУ и переноса всего текущего содержимого вектора в новое пространство. В этом случае, ссылка на первую переменную будет указывать на освобождённую память. Правила заимствования предотвращают сбои программ в таком случае.
 
-> Примечание: Дополнительные сведения о реализации типа `Vec` смотрите в разделе ["The Rustonomicon"](https://doc.rust-lang.org/nomicon/vec/vec.html).
+> Примечание: Дополнительные сведения о использовании вида данных `Vec` смотрите в разделе ["The Rustonomicon"](https://doc.rust-lang.org/nomicon/vec/vec.html).
 
 ### Перебор значений в векторе
 
-Для доступа к каждому элементу вектора по очереди, мы итерируем все элементы, вместо использования индексов для доступа к одному за раз. В листинге 8-7 показано, как использовать цикл `for` для получения неизменяемых ссылок на каждый элемент в векторе значений типа `i32` и их вывода.
+Для доступа к каждой переменной вектора по очереди, мы перебираем все переменные, а не используем порядковые указатели, для доступа к определенной переменной. В приложении 8-7 показано, как использовать круговорот `for` для получения неизменяемых ссылок на каждую переменную в векторе значений вида данных `i32` и их вывода.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-07/src/main.rs:here}}
 ```
 
-Листинг 8-7. Печать каждого элемента векторе, при помощи итерирования по элементам вектора с помощью цикла for
+Приложение 8-7: Вывод каждой переменной вектора, при помощи повторения по переменным, содержащимся в векторе с помощью круговорота for
 
-Мы также можем итерировать изменяемые ссылки на каждый элемент изменяемого вектора, чтобы вносить изменения во все элементы. Цикл `for` в листинге 8-8 добавит `50` к каждому элементу.
+Мы также можем повторять изменяемые ссылки на каждую переменную изменяемого вектора, чтобы вносить изменения во все переменные. Круговорот `for` в приложении 8-8 добавит `50` к каждой переменной.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-08/src/main.rs:here}}
 ```
 
-Листинг 8-8. Итерирование и изменение элементов вектора по изменяемым ссылкам
+Приложение 8-8: Повторение и изменение переменных вектора по изменяемым ссылкам
 
-Чтобы изменить значение на которое ссылается изменяемая ссылка, мы должны использовать оператор разыменования ссылки `*` для получения значения по ссылке в переменной `i` прежде чем использовать оператор `+=`. Мы поговорим подробнее об операторе разыменования в разделе [“Следование по указателю к значению с помощью оператора разыменования”] Главы 15.
+Чтобы изменить значение на которое ссылается изменяемая ссылка, мы должны использовать приказчик разыменования ссылки `*`. Прежде чем использовать приказчик `+=` с переменной `i`  мы применяем разыменование `*` . Мы поговорим подробнее об приказчике разыменования в разделе [“Следование по указателю к значению с помощью приказчика разыменования”] Главы 15.
 
-Перебор вектора, будь то неизменяемый или изменяемый, безопасен из-за правил проверки заимствования. Если бы мы попытались вставить или удалить элементы в телах цикла `for` в листингах 8-7 и 8-8, мы бы получили ошибку компилятора, подобную той, которую мы получили с кодом в листинге 8-6. Ссылка на вектор, содержащийся в цикле for, предотвращает одновременную модификацию всего вектора.
+Перебор вектора, будь то неизменяемый или изменяемый, безопасен из-за правил проверки заимствования. Если бы мы попытались вставить или удалить переменные в телах круговорота `for` в приложениях 8-7 и 8-8, мы бы получили ошибку сборщика. Ошибка подобна той, которую мы получили с рукописью в приложении 8-6. Ссылка на вектор, содержащийся в круговороте for, предотвращает одновременное изменение всего вектора.
 
-### Использование перечислений для хранения множества разных типов
+### Использование перечислений для хранения множества разных видов
 
-Векторы могут хранить значения только одинакового типа. Это может быть неудобно; определённо могут быть случаи когда надо хранить список элементов разных типов. К счастью, варианты перечисления определены для одного и того же типа перечисления, поэтому, когда нам нужен один тип для представления элементов разных типов, мы можем определить и использовать перечисление!
+Векторы могут хранить значения только одинакового вида данных. Это может быть неудобно; определённо существуют случаи когда надо хранить список переменных разных видов данных. К счастью, исходы перечисления определены в нём самом, поэтому, когда нам нужен один вид данных для представления переменных разных видов данных, мы можем использовать перечисление!
 
-Например, мы хотим получить значения из строки в электронной таблице где некоторые столбцы строки содержат целые числа, некоторые числа с плавающей точкой, а другие - строковые значения. Можно определить перечисление, варианты которого будут содержать разные типы значений и тогда все варианты перечисления будут считаться одним и тем же типом: типом самого перечисления. Затем мы можем создать вектор для хранения этого перечисления и, в конечном счёте, для хранения различных типов. Мы покажем это в листинге 8-9.
+Например, мы хотим получить значения из строки в электронной таблице где некоторые столбцы строки содержат целые числа, некоторые числа с плавающей точкой, а другие - строковые значения. Можно определить перечисление, исходы которого будут содержать разные виды данных значений и тогда все исходы перечисления будут считаться одним и тем же видом: видом самого перечисления. Затем мы можем создать вектор для хранения этого перечисления и, в конечном счёте, для хранения различных видов. Мы покажем это в приложении 8-9.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-09/src/main.rs:here}}
 ```
 
-Листинг 8-9: Определение enum для хранения значений разных типов в одном векторе
+Приложение 8-9: Определение enum для хранения значений разных видов данных в одном векторе
 
-Rust должен знать, какие типы будут в векторе во время компиляции, чтобы точно знать сколько памяти в куче потребуется для хранения каждого элемента. Мы также должны чётко указать, какие типы разрешены в этом векторе. Если бы Rust позволял вектору содержать любой тип, то был бы шанс что один или несколько типов вызовут ошибки при выполнении операций над элементами вектора. Использование перечисления вместе с выражением `match` означает, что во время компиляции Rust  гарантирует, что все возможные случаи будут обработаны, как обсуждалось в главе 6.
+Ржавчина должна знать, какие виды данных будут в векторе во время сборки, чтобы точно знать сколько памяти в куче потребуется для хранения каждой переменной. Мы также должны чётко указать, какие виды данных разрешены в этом векторе. Если бы Ржавчина позволяла вектору содержать любой вид данных, то была бы возможность что один или несколько видов данных вызовут ошибки при выполнении действий над переменными вектора. Использование перечисления вместе с выражением `match` означает, что во время сборки Ржавчина  заверяет, что все возможные исходы будут обработаны, как обсуждалось в главе 6.
 
-Если вы не знаете исчерпывающий набор типов, которые программа получит во время выполнения для хранения в векторе, то техника использования перечисления не сработает. Вместо этого вы можете использовать типаж-объект, который мы рассмотрим в главе 17.
+Если вы не знаете исчерпывающий набор видов данных, которые программа получит во время выполнения для хранения в векторе, то способ использования перечисления не сработает. Вместо этого вы можете использовать сущность-предмет, который мы рассмотрим в главе 17.
 
-Теперь, когда мы обсудили некоторые из наиболее распространённых способов использования векторов, обязательно ознакомьтесь [с документацией по API вектора](https://doc.rust-lang.org/std/vec/struct.Vec.html), чтобы узнать о множестве полезных методов, определённых в `Vec` стандартной библиотеки. Например, в дополнение к методу `push`, существует метод `pop`, который удаляет и возвращает последний элемент.
+Теперь, когда мы обсудили некоторые из наиболее распространённых способов использования векторов, обязательно ознакомьтесь [с пособием по API вектора](https://doc.rust-lang.org/std/vec/struct.Vec.html), чтобы узнать о множестве полезных способов, определённых в `Vec` встроенной библиотеки. Например, в дополнение к способу `push`, существует способ `pop`, который удаляет и возвращает последнюю переменную.
 
-### Удаление элементов из вектора
+### Удаление переменных из вектора
 
-Подобно структурам `struct`, вектор высвобождает свою память когда выходит из области видимости, что показано в листинге 8-10.
+Подобно стопкам`struct`, вектор высвобождает свою память когда выходит из области видимости, что показано в приложении 8-10.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-10/src/main.rs:here}}
 ```
 
-Листинг 8-10. Показано как удаляется вектор и его элементы
+Приложение 8-10: Показано как удаляется вектор и его переменные
 
-Когда вектор удаляется, всё его содержимое также удаляется: удаление вектора означает и удаление значений, которые он содержит. Средство проверки заимствования гарантирует, что любые ссылки на содержимое вектора используются только тогда, когда сам вектор действителен.
+Когда вектор удаляется, всё его содержимое также удаляется: удаление вектора означает и удаление значений, которые он содержит. Средство проверки заимствования заверяет, что любые ссылки на содержимое вектора используются только тогда, когда сам вектор действителен.
 
-Давайте перейдём к следующему типу коллекции: `String`!
+Давайте перейдём к следующему виду собрания: `String`!
 
 
-[“Типы данных”]: ch03-02-data-types.html#data-types
-[“Следование по указателю к значению с помощью оператора разыменования”]: ch15-02-deref.html#following-the-pointer-to-the-value-with-the-dereference-operator
\ No newline at end of file
+[“Виды данных”]: ch03-02-data-types.html#data-types
+[“Следование по указателю к значению с помощью приказчика разыменования”]: ch15-02-deref.html#following-the-pointer-to-the-value-with-the-dereference-operator
\ No newline at end of file
diff --git a/rustbook-ru/src/ch08-02-strings.md b/rustbook-ru/src/ch08-02-strings.md
index 2f6ac9518..0c024fd99 100644
--- a/rustbook-ru/src/ch08-02-strings.md
+++ b/rustbook-ru/src/ch08-02-strings.md
@@ -1,202 +1,202 @@
-## Хранение закодированного текста UTF-8 в строках
+## Хранение закодированного писания UTF-8 в строках
 
-Мы говорили о строках в главе 4, но сейчас мы рассмотрим их более подробно. Новички в Rust обычно застревают на строках из-за  комбинации трёх причин: склонность Rust компилятора к выявлению возможных ошибок, более сложная структура данных чем считают многие программисты и UTF-8. Эти факторы объединяются таким образом, что тема может показаться сложной, если вы пришли из других языков программирования.
+Мы говорили о строках в главе 4, но сейчас мы рассмотрим их более подробно. Новички в Ржавчине обычно застревают на строках из-за  сочетания трёх причин: склонность сборщика Ржавчины  к выявлению возможных ошибок, более сложный вид данных чем считают многие программисты и UTF-8. Эти обстоятельства объединяются таким образом, что освоение может показаться сложным, если вы пришли из других языков программирования.
 
-Полезно обсуждать строки в контексте коллекций, потому что строки реализованы в виде набора байтов, плюс некоторые методы для обеспечения полезной функциональности, когда эти байты интерпретируются как текст. В этом разделе мы поговорим об операциях над `String` таких как создание, обновление и чтение, которые есть у каждого типа коллекций. Мы также обсудим какими особенностями `String` отличается от других коллекций, а именно каким образом индексирование в  `String` осложняется различием между тем как люди и компьютеры интерпретируют данные заключённые в  `String`.
+Рассмотрим строки в среде собраний, потому что строки внутренне представлены в виде набора байтов, дополнительно включены ряд способов для обеспечения действий над строками, которые выполняют действия над при переводе их в писание, понятное человеку. В этом разделе мы поговорим о действиях над видом данных `String`. Создание, чтение, изменение, которые есть у каждого вида собраний. Мы также обсудим какими особенностями вид данных `String` отличается от других собраний, а именно каким образом упорядочивание в виде данных  `String` осложняется различием между тем как люди и компьютеры представляют данные, заключённые в виде `String`.
 
 ### Что же такое строка?
 
-Сначала мы определим, что мы подразумеваем под термином  *строка* (string). В Rust есть только один строковый тип в ядре языка - срез строки `str`, обычно используемый в заимствованном виде как `&str`. В Главе 4 мы говорили о *срезах строк, string slices*, которые являются ссылками на некоторые строковые данные в кодировке UTF-8. Например, строковые литералы хранятся в двоичном файле программы и поэтому являются срезами строк.
+Сначала мы определим, что мы подразумеваем под понятием  `*строка* (string)`. В Ржавчине есть только один строковый вид данных в ядре языка - срез строки `str`, обычно используемый в заимствованном исполнении как вид данных `&str`. В Главе 4 мы говорили о *срезах строк, string slices*, которые являются ссылками на некоторые строковые данные в представлении UTF-8. Например, строковые записи хранятся в двоичном файле программы и поэтому являются срезами строк.
 
-Тип `String` предоставляемый стандартной библиотекой Rust, не встроен в ядро языка и является расширяемым, изменяемым, владеющим, строковым типом в UTF-8 кодировке.  Когда Rustaceans говорят о "строках" то, они обычно имеют в виду типы `String` или строковые срезы `&str`, а не просто один из них. Хотя этот раздел в основном посвящён `String`, оба типа интенсивно используются в стандартной библиотеке Rust, оба, и `String` и строковые срезы, кодируются в UTF-8.
+Вид данных `String` , предоставляемый встроенной библиотекой Ржавчины, не встроен в ядро языка. Поэтому его можно расширять, изменять, изменять владение, он представлен в виле UTF-8.  Когда Rustaceans говорят о "строках" то, они обычно имеют в виду виды данных `String` или строковые срезы `&str`, а не просто один из них. Хотя этот раздел в основном посвящён виду данных `String`, оба вида данных усиленно используются во встроенной библиотеке Ржавчины оба, и сама строка `String` и строковые срезы, кодируются в UTF-8.
 
 ### Создание новых строк
 
-Многие из тех же операций, которые доступны `Vec` , доступны также в `String`, потому что `String` фактически реализован как обёртка вокруг вектора байтов с некоторыми дополнительными гарантиями, ограничениями и возможностями. Примером функции, которая одинаково работает с `Vec` и `String`, является функция  `new`, создающая новый экземпляр типа, и показана в Листинге 8-11.
+Многие из тех же действий, которые доступны  виду данных `Vec` , доступны также в виде данных `String`, потому что `String` в действительности выполнен как обёртка вокруг вектора байтов с некоторыми дополнительными заверениями, ограничениями и возможностями. Примером способа, который одинаково работает с видами данных `Vec` и `String`, является способ  `new`, создающий новый образец вида данных, и показана в Приложении 8-11.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-11/src/main.rs:here}}
 ```
 
-Листинг 8-11. Создание новой пустой String строки
+Приложение 8-11: Создание новой пустой строки вида данных String
 
-Эта строка создаёт новую пустую строковую переменную с именем `s`, в которую мы можем затем загрузить данные. Часто у нас есть некоторые начальные данные, которые мы хотим назначить строке. Для этого мы используем метод `to_string` доступный для любого типа, который реализует типаж `Display`, как у строковых литералов. Листинг 8-12 показывает два примера.
+Эта строка создаёт новую пустую строковую переменную с именем `s`, в которую мы можем затем внести данные. Часто у нас есть некоторые начальные данные, которые мы хотим присвоить строке. Для этого мы используем способ `to_string`, доступный для любого вида данных, который использует сущность `Display`, как у строковых записей. Приложение 8-12 показывает два примера.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-12/src/main.rs:here}}
 ```
 
-Листинг 8-12: Использование метода to_string для создания экземпляра типа String  из строкового литерала
+Приложение 8-12: Использование способа to_string для создания образца вида данных String  из строковой записи
 
-Эти выражения создают строку с  `initial contents`.
+Эти выражения создают строку с содержимым `initial contents`.
 
-Мы также можем использовать функцию `String::from` для создания `String`  из строкового литерала. Код листинга 8-13 является эквивалентным коду из листинга 8-12, который использует функцию `to_string`:
+Мы также можем использовать способ (функцию) `String::from` для создания вида данных `String`  из строковой записи (строкового среза). Рукопись приложения 8-13 является равнозначной рукописи из приложения 8-12, которая использует способ `to_string`:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-13/src/main.rs:here}}
 ```
 
-Листинг 8-13: Использование функции String::from для создания экземпляра типа String из строкового литерала
+Приложение 8-13: Использование способа String::from для создания образца вида данных String из строковой записи
 
-Поскольку строки используются для очень многих вещей, можно использовать множество API для строк, предоставляющих множество возможностей. Некоторые из них могут показаться избыточными, но все они занимаются своим делом!  В данном случае `String::from` и `to_string` делают одно и тоже, поэтому выбор зависит от стиля который вам больше импонирует.
+Поскольку строки используются для очень многих вещей, можно использовать множество API для строк, предоставляющих множество возможностей. Некоторые из них могут показаться избыточными, но все они применимы в том или ином случае!  В данном случае способы `String::from` и `to_string` делают одно и тоже, поэтому выбор зависит от исполнения, которое вас больше всего устраивает.
 
-Запомните, что строки хранятся в кодировке UTF-8, поэтому можно использовать любые правильно кодированные данные в них, как показано в листинге 8-14:
+Запомните, что строки представлены в UTF-8, поэтому можно использовать любые допустимые знаки, которые включены в UTF-8, как показано в приложении 8-14:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-14/src/main.rs:here}}
 ```
 
-Листинг 8-14: Хранение приветствий в строках на разных языках
+Приложение 8-14: Хранение приветствий в `строках` на разных языках
 
-Все это допустимые `String` значения.
+Все это допустимые наборы знаков для вида данных `String`, представленных в UTF-8.
 
-### Обновление строковых данных
+### Изменение строковых данных
 
-Строка `String` может увеличиваться в размере, а её содержимое может меняться, по аналогии как содержимое `Vec` при вставке в него большего количества данных. Кроме того, можно использовать оператор `+` или макрос `format!` для объединения значений `String`.
+Строка `String` может увеличиваться в размере, а её содержимое может меняться, по подобию как содержимое `Vec` при вставке в него большего количества данных. Кроме того, можно использовать приказчик `+` или макрос `format!` для объединения значений `String`.
 
-#### Присоединение к строке с помощью `push_str` и `push`
+#### Присоединение к строке с помощью способов `push_str` и `push`
 
-Мы можем нарастить `String` используя метод `push_str` который добавит в исходное значение новый строковый срез, как показано в листинге 8-15.
+Мы можем расширять вид данных `String` используя способ `push_str`, который добавит в исходную строку новые знаки (строковый срез), как показано в приложении 8-15.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-15/src/main.rs:here}}
 ```
 
-Листинг 8-15. Добавление среза строки к String с помощью метода push_str
+Приложение 8-15. Добавление среза строки к String с помощью способа push_str
 
-После этих двух строк кода `s` будет содержать `foobar`. Метод `push_str` принимает строковый срез, потому что мы не всегда хотим владеть входным параметром. Например, код в листинге 8-16 показывает вариант, когда будет не желательно поведение, при котором мы не сможем использовать `s2` после его добавления к содержимому значения переменной `s1`.
+После выполнения способа `push_str` строка `s` будет содержать значение `foobar`. В ярлыке способа `push_str` принимается переменная - строковый срез, так как нам не обязательно быть владельцем значения. Например, в рукописи в приложении 8-16 показан исход, когда мы не передаем владение строковым срезом `s2` другой строке - `s1` через способ `push_str`. Мы просто добавляем строковый срез `s2` к строке `s1`.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-16/src/main.rs:here}}
 ```
 
-Листинг 8-16: Использование среза строки после добавления её содержимого к другой String
+Приложение 8-16: Использование среза строки после его добавления к содержимому другой String
 
-Если метод `push_str` стал бы владельцем переменной`s2`, мы не смогли бы напечатать его значение в последней строке. Однако этот код работает так, как мы ожидали!
+Если способ `push_str` стал бы владельцем переменной`s2`, мы не смогли бы вывести его значение в последней строке. Однако эта рукопись работает так, как мы ожидали!
 
-Метод `push` принимает один символ в качестве параметра и добавляет его к `String`. В листинге 8-17 показан код, добавляющий букву “l” к `String` используя метод `push`.
+Способ `push` принимает один знак в качестве свойства и добавляет его к `String`. В приложении 8-17 показана рукопись, добавляющая букву “l” к `String`, используя способ `push`.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-17/src/main.rs:here}}
 ```
 
-Листинг 8-17: Добавление одного символа в String значение используя push
+Приложение 8-17: Добавление одного знака к строке s, используя способ push
 
-В результате `s` будет содержать `lol`.
+В итоге `s` будет содержать `lol`.
 
-#### Объединение строк с помощью оператора `+` или макроса `format!`
+#### Объединение строк с помощью приказчика `+` или макроса `format!`
 
-Часто хочется объединять две существующие строки. Один из возможных способов — это использование оператора `+` из листинга 8-18:
+Часто хочется объединять две существующие строки. Один из возможных способов — это использование приказчика `+` из приложения 8-18:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-18/src/main.rs:here}}
 ```
 
-Листинг 8-18: Использование оператора + для объединения двух значений String в новое String значение
+Приложение 8-18: Использование приказчика + для объединения двух значений вида данных String в новую String 
 
-Строка `s3` будет содержать `Hello, world!`. Причина того, что `s1` после добавления больше недействительна и причина, по которой мы использовали ссылку на `s2` имеют отношение к сигнатуре вызываемого метода при использовании оператора `+`. Оператор `+` использует метод `add`, чья сигнатура выглядит примерно так:
+Строка `s3` будет содержать `Hello, world!`. При использовании способа `+` переменная `s1` после действия добавления больше недействительна, при этом обязательно использование ссылки на строку `s2`. Данные обстоятельства указаны в ярлыке вызываемого способа приказчика `+`. Приказчик `+` использует способ `add`, чей ярлык выглядит примерно так:
 
 ```rust,ignore
 fn add(self, s: &str) -> String {
 ```
 
-В стандартной библиотеке вы увидите метод `add` определённым с использованием обобщённых и связанных типов. Здесь мы видим сигнатуру  с конкретными типами, заменяющими обобщённый, что происходит когда вызывается данный метод со значениями `String`. Мы обсудим обобщённые типы в Главе 10. Эта сигнатура даёт нам ключ для понимания особенностей оператора `+`.
+Во встроенной библиотеке вы увидите способ `add`, определённым с использованием обобщённых и связанных видов данных. Здесь мы видим ярлык  с определенными видами данных, заменяющими обобщённый, что происходит когда вызывается данный способ со значениями `String`. Мы обсудим обобщённые виды данных в Главе 10. Этот ярлык даёт нам ключ для понимания особенностей приказчика `+`.
 
-Во-первых, перед `s2` мы видим `&`, что означает что мы складываем *ссылку* на вторую строку с первой строкой. Это происходит из-за  параметра `s` в функции `add`: мы можем добавить только `&str` к `String`; мы не можем сложить два значения `String`. Но подождите — тип `&s2` это `&String`, а не `&str`, как определён второй параметр в `add`. Так почему код в листинге 8-18 компилируется?
+Во-первых, перед переменной `s2` мы видим знак `&`, что означает что мы объединяем *ссылку* на строку `s2` со строкой `s1`. Это происходит из-за  свойства `s` в способе `add`: мы можем добавить только ссылку на срез строки `&str` к виду данных `String`; мы не можем сложить два значения вида данных `String`. Но подождите — ссылка `&s2` это ссылка на строку `&String`, а не на срез строки `&str`, как определено второе свойство в способе `add`. Так почему рукопись в приложении 8-18 собирается?
 
-Причина, по которой мы можем использовать `&s2` в вызове `add` заключается в том, что компилятор может *принудительно привести (coerce)* аргумент типа `&String` к типу `&str`. Когда мы вызываем метод `add` в Rust используется *принудительное приведение* (deref coercion), которое превращает `&s2` в `&s2[..]`. Мы подробно обсудим принудительное приведение в Главе 15. Так как `add` не забирает во владение параметр `s`, `s2` по прежнему будет действительной строкой `String` после применения операции.
+Причина, по которой мы можем использовать неизменяемую ссылку на строку `&s2` в вызове способа `add` заключается в том, что сборщик может *принудительно привести (coerce)* переменную вида данных строка `&String` к виду данных строковый срез `&str`. Когда мы вызываем способ `add`, в Ржавчине используется *принудительное приведение* (deref coercion), которое превращает строку `&s2` в  строковый срез `&s2[..]`. Мы подробно обсудим принудительное приведение в Главе 15. Так как способ `add` не забирает во владение переменную `s2` через свойство, переменная `s2` по прежнему будет действительной строкой `String` после применения действия.
 
-Во-вторых, как можно видеть в сигнатуре, `add` забирает во владение `self`, потому что  `self` *не имеет* `&`. Это означает, что `s1` в листинге 8-18 будет перемещён в вызов `add` и больше не будет действителен после этого вызова. Не смотря на то, что код `let s3 = s1 + &s2;` выглядит как будто он скопирует обе строки и создаёт новую, эта инструкция фактически забирает во владение переменную `s1`, присоединяет к ней копию содержимого `s2`, а затем возвращает владение результатом.  Другими словами, это выглядит как будто код создаёт множество копий, но это не так; данная реализация более эффективна, чем копирование.
+Во-вторых, как можно видеть в ярлыке, способ `add` забирает во владение `self`, потому что  `self` *не имеет* ссылку `&`. Это означает, что переменная `s1` в приложении 8-18 во время вызова способа `add` передана ему во владение и более не будет действительна после вызова способа `add`. Не смотря на то, что рукопись `let s3 = s1 + &s2;` выглядит как будто она лишь объединяет обе строки и создаёт новую, этот способ в действительности забирает во владение переменную `s1`, присоединяет к ней повтор содержимого переменной `s2`, а затем возвращает итог объединения.  Другими словами, это выглядит как будто рукопись создаёт множество повторений переменных, но это не так; Данное выполнение более производительно, чем повторение переменных.
 
-Если нужно объединить несколько строк, поведение оператора `+` становится громоздким:
+Если нужно объединить несколько строк, изложение через приказчик `+` становится громоздким:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/no-listing-01-concat-multiple-strings/src/main.rs:here}}
 ```
 
-Здесь переменная `s` будет содержать `tic-tac-toe`. С множеством символов `+` и `"` становится трудно понять, что происходит. Для более сложного комбинирования строк можно использовать макрос `format!`:
+Здесь переменная `s` будет содержать `tic-tac-toe`. С множеством знаков `+` и `"` становится трудно понять, что происходит. Для более сложного соединения строк можно использовать макрос `format!`:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/no-listing-02-format/src/main.rs:here}}
 ```
 
-Этот код также устанавливает переменную `s` в значение `tic-tac-toe`. Макрос `format!` работает тем же способом что макрос `println!`, но вместо вывода на экран возвращает тип `String` с содержимым. Версия кода с использованием `format!` значительно легче читается, а также код, сгенерированный макросом `format!`, использует ссылки, а значит не забирает во владение ни один из его параметров.
+Эта рукопись также присваивает переменной `s` значение `tic-tac-toe`. Макрос `format!` работает тем же способом, что макрос `println!`, но вместо вывода на экран возвращает вид данных `String` с содержимым. Использование объединения через макрос `format!` значительно легче читается, а также рукопись, созданная макросом `format!`, использует ссылки, а значит не забирает во владение ни одно из её переменных.
 
-### Индексирование в строках
+### Упорядочивание в строках
 
-Доступ к отдельным символам в строке, при помощи ссылки на них по индексу, является допустимой и распространённой операцией во многих других языках программирования. Тем не менее, если вы попытаетесь получить доступ к частям `String`, используя синтаксис индексации в Rust, то вы получите ошибку. Рассмотрим неверный код в листинге 8-19.
+Доступ к отдельным знакам в строке, при помощи ссылки на них по порядковому указателю, является допустимым и распространённым действием во многих других языках программирования. Тем не менее, если вы попытаетесь получить доступ к частям вида данных `String`, используя правила написания упорядочивания в Ржавчине, то вы получите ошибку. Рассмотрим неверную рукопись в приложении 8-19.
 
 ```rust,ignore,does_not_compile
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-19/src/main.rs:here}}
 ```
 
-Листинг 8-19: Попытка использовать синтаксис индекса со строкой
+Приложение 8-19: Попытка использовать получения значения из строки через порядковый указатель
 
-Этот код приведёт к следующей ошибке:
+Эта рукопись приведёт к следующей ошибке:
 
 ```console
 {{#include ../listings/ch08-common-collections/listing-08-19/output.txt}}
 ```
 
-Ошибка и примечание говорит, что в Rust строки не поддерживают индексацию. Но почему так? Чтобы ответить на этот вопрос, нужно обсудить то, как Rust хранит строки в памяти.
+Ошибка и примечание разъясняет, что в Ржавчине строки не поддерживают упорядочивание. Но почему так? Чтобы ответить на этот вопрос, нужно обсудить то, как в Ржавчине представлены строки в памяти.
 
 #### Внутреннее представление
 
-Тип `String` является оболочкой над типом  `Vec`. Давайте посмотрим на несколько закодированных корректным образом в UTF-8 строк из примера листинга 8-14. Начнём с этой:
+Вид данных `String` является оболочкой над видом данных  `Vec`. Давайте посмотрим на несколько закодированных правильным образом в UTF-8 строк из примера приложения 8-14. Начнём с этой:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-14/src/main.rs:spanish}}
 ```
 
-В этом случае `len` будет 4, что означает вектор, хранит строку "Hola" длиной 4 байта. Каждая из этих букв занимает 1 байт при кодировании в UTF-8. Но как насчёт следующей строки? (Обратите внимание, что эта строка начинается с заглавной кириллической "З", а не цифры 3.)
+В этом случае `len` будет 4, что означает вектор, хранит строку "Hola" длиной 4 байта. Каждая из этих букв занимает 1 байт при преобразовании в UTF-8. Но как насчёт следующей строки? (Обратите внимание, что эта строка начинается с заглавной кириллической "З", а не цифры 3.)
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-14/src/main.rs:russian}}
 ```
 
-Отвечая на вопрос, какова длина строки, вы можете ответить 12. Однако ответ Rust - 24, что равно числу байт, необходимых для кодирования «Здравствуйте» в UTF-8, так происходит, потому что каждое скалярное значение Unicode символа в этой строке занимает 2 байта памяти. Следовательно, индекс по байтам строки не всегда бы соответствовал действительному скалярному Unicode значению. Для демонстрации рассмотрим этот недопустимый код Rust:
+Отвечая на вопрос, какова длина строки, вы можете ответить 12. Однако ответ Ржавчины - 24, что равно числу байт, необходимых для преобразования «Здравствуйте» в UTF-8, так происходит, потому что один знак UTF-8 в этой строке занимает 2 байта памяти. Следовательно, порядковый указатель в данном случае не применим. Так как 1 знак в строке в представлении UTF-8 не всегда будет соответствовать 1 байту в памяти. Для отображения рассмотрим эту недопустимую рукопись в Ржавчине:
 
 ```rust,ignore,does_not_compile
 let hello = "Здравствуйте";
 let answer = &hello[0];
 ```
 
-Каким должно быть значение переменной `answer`? Должно ли оно быть значением первой буквы `З`? При кодировке в UTF-8, первый байт значения `З` равен `208`, а второй - `151`, поэтому значение в `answer` на самом деле должно быть `208`, но само по себе `208` не является действительным символом. Возвращение `208`, скорее всего не то, что хотел бы получить пользователь: ведь он ожидает первую букву этой строки; тем не менее, это единственный байт данных, который в Rust доступен по индексу 0. Пользователи обычно не хотят получить значение байта, даже если строка содержит только латинские буквы: если `&"hello"[0] `было бы допустимым кодом, который вернул значение байта, то он вернул бы `104`, а не `h`.
+Каким должно быть значение переменной `answer`? Должно ли оно быть значением первой буквы `З`? При представлении в UTF-8, первый байт значения `З` равен значению `208`, а второй - значению `151`, поэтому содержимое в переменной `answer` на самом деле должно быть значение `208`, но само по себе значение `208` не является действительным знаком в представлении UTF-8. Значение `208`, скорее всего не то, что хотел бы получить пользователь: ведь он ожидает первую букву (знак) этой строки; тем не менее, это единственный байт данных, который в Ржавчине доступен по порядковому указателю 0. Пользователи обычно не хотят получить значение байта, даже если строка содержит только латинские буквы: если `&"hello"[0] `была бы допустимой рукописью, которая вернула значение байта, то она вернула бы значение `104`, а не знак `h`.
 
-Таким образом, чтобы предотвратить возврат непредвиденного значения, вызывающего ошибки которые не могут быть сразу обнаружены, Rust просто не компилирует такой код и предотвращает недопонимание на ранних этапах процесса разработки.
+Таким образом, чтобы предотвратить возврат непредвиденного значения, вызывающего ошибки, которые не могут быть сразу обнаружены, Ржавчина просто не собирает такую рукопись и предотвращает недопонимание на ранних этапах этапа разработки.
 
-#### Байты, скалярные значения и кластеры графем! Боже мой!
+#### Байты, одиночные значения и кластеры графем! Боже мой!
 
-Ещё один момент, касающийся UTF-8, заключается в том, что на самом деле существует три способа рассмотрения строк с точки зрения Rust: как байты, как скалярные значения и как кластеры графем (самая близкая вещь к тому, что мы назвали бы *буквами*).
+Ещё одна особенность, касающаяся UTF-8, заключается в том, что на самом деле существует три способа рассмотрения строк с точки зрения Ржавчины: как байты, как одиночные значения и как кластеры графем (самая близкая вещь к тому, что мы назвали бы *буквами*).
 
-Если посмотреть на слово языка хинди «नमस्ते», написанное в транскрипции Devanagari, то оно хранится как вектор значений `u8` который выглядит следующим образом:
+Если посмотреть на слово языка хинди «नमस्ते», написанное в транскрипции Devanagari, то оно хранится как вектор значений в виде данных `u8`, который выглядит следующим образом:
 
 ```text
 [224, 164, 168, 224, 164, 174, 224, 164, 184, 224, 165, 141, 224, 164, 164,
 224, 165, 135]
 ```
 
-Эти 18 байт являются именно тем, как компьютеры в конечном итоге сохранят в памяти эту строку. Если мы посмотрим на 18 байт как на скалярные Unicode значения, которые являются Rust типом `char`, то байты будут выглядеть так:
+Эти 18 байт являются именно тем, как компьютеры в конечном итоге сохранят в памяти эту строку. Если мы посмотрим на 18 байт как на одиночные UTF-8 значения, которые являются в Ржавчине видом данных `char`, то байты будут выглядеть так:
 
 ```text
 ['न', 'म', 'स', '्', 'त', 'े']
 ```
 
-Здесь есть шесть значений типа `char`, но четвёртый и шестой являются не буквами: они диакритики, специальные обозначения которые не имеют смысла сами по себе. Наконец, если мы посмотрим на байты как на кластеры графем, то получим то, что человек назвал бы словом на хинди состоящем из четырёх букв:
+Здесь есть шесть значений вида данных `char`, но четвёртый и шестой являются не буквами: они диакритики, особые обозначения, которые не имеют смысла сами по себе. Наконец, если мы посмотрим на байты как на кластеры графем, то получим то, что человек назвал бы словом на хинди состоящем из четырёх букв:
 
 ```text
 ["न", "म", "स्", "ते"]
 ```
 
-Rust предоставляет различные способы интерпретации необработанных строковых данных, которые компьютеры хранят так, чтобы каждой программе можно было выбрать необходимую интерпретацию, независимо от того, на каком человеческом языке представлены эти данные.
+Ржавчина предоставляет различные способы преобразования необработанных строковых данных, которые компьютеры хранят так, чтобы каждой программе можно было выбрать необходимое преобразование, независимо от того, на каком человеческом языке представлены эти данные.
 
-Последняя причина, по которой Rust не позволяет нам индексировать `String` для получения символов является то, что программисты ожидают, что операции индексирования всегда имеют постоянное время (O(1)) выполнения. Но невозможно гарантировать такую производительность для `String`, потому что Rust понадобилось бы пройтись по содержимому от начала до индекса, чтобы определить, сколько было действительных символов.
+Последняя причина, по которой Ржавчина не позволяет нам упорядочивать вид данных `String` для получения знаков является то, что программисты ожидают, что действия упорядочивания всегда имеют постоянное время (O(1)) выполнения. Но невозможно обеспечить такую производительность для вида данных `String`, потому что Ржавчине понадобилось бы пройтись по содержимому от начала до заданного порядкового указателя, чтобы определить, сколько строка содержит действительных знаков.
 
 ### Срезы строк
 
-Индексирование строк часто является плохой идеей, потому что не ясно каким должен быть возвращаемый тип такой операции: байтовым значением, символом, кластером графем или срезом строки. Поэтому Rust просит вас быть более конкретным, если действительно требуется использовать индексы для создания срезов строк.
+Упорядочивание строк часто является плохой мыслью, потому что не ясно каким должен быть возвращаемый вид данных такого действия: байтовым значением, знаком, кластером графем или срезом строки. Поэтому Ржавчина просит вас быть более определенным, если действительно требуется использовать порядковые указатели для создания срезов строк.
 
-Вместо индексации с помощью числового индекса `[]`, вы можете использовать оператор диапазона `[]` при создании среза строки в котором содержится указание на то, срез каких байтов надо делать:
+Вместо упорядочивания с помощью числового порядкового указателя `[]`, вы можете использовать приказчик ряда`[]`. При создании среза строки через способ ряда, необходимо указать на то, срез каких байтов надо делать:
 
 ```rust
 let hello = "Здравствуйте";
@@ -204,19 +204,19 @@ let hello = "Здравствуйте";
 let s = &hello[0..4];
 ```
 
-Здесь переменная `s` будет типа `&str` который содержит первые 4 байта строки. Ранее мы упоминали, что каждый из этих символов был по 2 байта, что означает, что `s` будет содержать "Зд".
+Здесь переменная `s` будет вида данных - среза строки `&str`, который содержит первые 4 байта строки. Ранее мы упоминали, что каждый из этих знаков был по 2 байта, что означает, что строка `s` будет содержать "Зд".
 
-Что бы произошло, если бы мы использовали `&hello[0..1]`? Ответ: Rust бы запаниковал во время выполнения точно так же, как если бы обращались к недействительному индексу в векторе:
+Что бы произошло, если бы мы использовали `&hello[0..1]`? Ответ: Ржавчина бы вызвала сбой во время выполнения точно так же, как если бы обращались к недействительному порядковому указателю в векторе:
 
 ```console
 {{#include ../listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt}}
 ```
 
-Вы должны использовать диапазоны для создания срезов строк с осторожностью, потому что это может привести к сбою вашей программы.
+Вы должны использовать ряды для создания срезов строк с осторожностью, потому что это может привести к сбою вашей программы.
 
-### Методы для перебора строк
+### Способы для перебора строк
 
-Лучший способ работать с фрагментами строк — чётко указать, нужны ли вам символы или байты. Для отдельных скалярных значений в Юникоде используйте метод `chars`. Вызов `chars` у "Зд" выделяет и возвращает два значения типа `char`, и вы можете выполнить итерацию по результату для доступа к каждому элементу:
+Лучший способ работать со срезами строк — чётко указать, нужны ли вам знаки или байты. Для отдельных одиночных значений в UTF-8 используйте способ `chars`. Вызов `chars` у "Зд" выделяет и возвращает два значения вида данных `char`, вы можете использовать способ `.chars` для получения каждого знака по отдельности в круговороте `for`:
 
 ```rust
 for c in "Зд".chars() {
@@ -224,14 +224,14 @@ for c in "Зд".chars() {
 }
 ```
 
-Код напечатает следующее:
+Рукопись выведет следующее:
 
 ```text
 З
 д
 ```
 
-Метод `bytes` возвращает каждый байт, который может быть подходящим в другой предметной области:
+Способ `bytes` возвращает каждый байт, который может быть подходящим в другой предметной области:
 
 ```rust
 for b in "Зд".bytes() {
@@ -239,7 +239,7 @@ for b in "Зд".bytes() {
 }
 ```
 
-Этот код выведет четыре байта, составляющих эту строку:
+Эта рукопись выведет четыре байта, составляющих эту строку:
 
 ```text
 208
@@ -248,14 +248,14 @@ for b in "Зд".bytes() {
 180
 ```
 
-Но делая так, обязательно помните, что валидные скалярные Unicode значения могут состоять более чем из одного байта.
+Но делая так, обязательно помните, что один знак UTF-8 может состоять более чем из одного байта памяти.
 
-Извлечение кластеров графем из строк, как в случае с языком хинди, является сложным, поэтому эта функциональность не предусмотрена стандартной библиотекой. На [crates.io](https://crates.io/) есть доступные библиотеки, если Вам нужен данный функционал.
+Извлечение кластеров графем из строк, как в случае с языком хинди, является сложным, поэтому эта возможность не предусмотрена встроенной библиотекой. На [crates.io](https://crates.io/) есть доступные библиотеки, если Вам нужны данные возможности.
 
 ### Строки не так просты
 
-Подводя итог, становится ясно, что строки сложны. Различные языки программирования реализуют различные варианты того, как представить эту сложность для программиста. В Rust решили сделать правильную обработку данных `String` поведением по умолчанию для всех программ Rust, что означает, что программисты должны заранее продумать обработку UTF-8 данных. Этот компромисс раскрывает большую сложность строк, чем в других языках программирования, но это предотвращает от необходимости обрабатывать ошибки, связанные с не-ASCII символами которые могут появиться в ходе разработки позже.
+Подводя итог, становится ясно, что строки сложны. Различные языки программирования предоставляют различные приемы того, как представить решить тот или иной вопрос программисту. В Ржавчине решили принять свод правил обработки  вида данных `String` поведением по умолчанию для всех программ Ржавчины, что означает, что программисты должны заранее продумать обработку данных UTF-8. Это решение раскрывает большую сложность при использовании строк `String` и `str`, чем в других языках программирования, но это предотвращает от необходимости обрабатывать ошибки, связанные с не-ASCII знаками, которые могут появиться в ходе разработки позже.
 
-Хорошая новость состоит в том что стандартная библиотека предлагает множество функциональных возможностей, построенных на основе типов `String` и `&str`, чтобы помочь правильно обрабатывать эти сложные ситуации. Обязательно ознакомьтесь с документацией для полезных методов, таких как `contains` для поиска в строке и `replace` для замены частей строки другой строкой.
+Хорошая новость состоит в том, что обычная библиотека предлагает множество полезных возможностей, построенных на основе видов данных `String` и `&str`, чтобы помочь правильно обрабатывать эти сложные случаи. Обязательно ознакомьтесь с подробным пособием для использования способов, таких как `contains` - для поиска в строке и `replace` - для замены частей строки другой строкой.
 
 Давайте переключимся на что-то немного менее сложное: HashMap!
diff --git a/rustbook-ru/src/ch08-03-hash-maps.md b/rustbook-ru/src/ch08-03-hash-maps.md
index ff4db8a1e..1dc215520 100644
--- a/rustbook-ru/src/ch08-03-hash-maps.md
+++ b/rustbook-ru/src/ch08-03-hash-maps.md
@@ -1,44 +1,44 @@
 ## Хранение ключей со связанными значениями в HashMap
 
-Последняя коллекция, которую мы рассмотрим, будет *hash map* (хеш-карта). Тип `HashMap` хранит ключи типа `K` на значения типа `V`. Данная структура организует и хранит данные с помощью *функции хеширования*. Во множестве языков программирования реализована данная структура, но часто с разными наименованиями: такими как hash, map, object, hash table, dictionary или ассоциативный массив.
+Последний вид собрания, который мы рассмотрим, будет *hash map* (хеш-карта). Вид данных `HashMap` хранит ключи вида данных `K` и значения к ним вида данных `V`. Данный вид собрания согласует и хранит данные с помощью *функции хеширования*. Во множестве языков программирования существуют такие виды данных, но часто с разными названиями: такими как hash, map, object, hash table, dictionary или связанный массив.
 
-Хеш-карты полезны, когда нужно искать данные не используя индекс, как это например делается в векторах, а с помощью ключа, который может быть любого типа. Например, в игре вы можете отслеживать счёт каждой команды в хеш-карте, в которой каждый ключ - это название команды, а значение - счёт команды. Имея имя команды, вы можете получить её счёт из хеш-карты.
+Хеш-карты полезны, когда нужно искать данные не используя порядковый указатель, как это например делается в векторах. Здесь применяется ключ, который может быть любого вида данных. Например, в игре вы можете отслеживать счёт каждого игрока в хеш-карте, в которой каждый `ключ` - это имя игрока, а `значение` - его счёт. Зная имя игрока, вы можете получить его счёт из хеш-карты.
 
-В этом разделе мы рассмотрим базовый API хеш-карт. Остальной набор полезных функций скрывается в объявлении типа `HashMap`. Как и прежде, советуем обратиться к документации по стандартной библиотеке для получения дополнительной информации.
+В этом разделе мы рассмотрим основной API хеш-карт. Остальной набор полезных функций скрывается в объявлении вида данных собрания -  `HashMap`. Как и прежде, советуем обратиться к пособию по встроенной библиотеке для получения дополнительных сведений.
 
 ### Создание новой хеш-карты
 
-Создать пустую хеш-карту можно с помощью `new`, а добавить в неё элементы - с помощью `insert`. В листинге 8-20 мы отслеживаем счёт двух команд, синей *Blue* и жёлтой *Yellow*. Синяя команда набрала 10 очков, а жёлтая команда - 50.
+Создать пустую хеш-карту можно с помощью `new`, а добавить в неё переменные - с помощью `insert`. В приложении 8-20 мы отслеживаем счёт двух игроков, синего *Blue* и жёлтого *Yellow*. Синий игрок набрал 10 очков, а жёлтый игрок - 50.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-20/src/main.rs:here}}
 ```
 
-Листинг 8-20: Создание новой хеш-карты и вставка в неё пары ключей и значений
+Приложение 8-20: Создание новой хеш-карты и вставка в неё пары ключ-значение
 
-Обратите внимание, что нужно сначала указать строку `use std::collections::HashMap;` для её подключения из коллекций стандартной библиотеки. Из трёх коллекций данная является наименее используемой, поэтому она не подключается в область видимости функцией автоматического импорта (prelude). Хеш-карты также имеют меньшую поддержку со стороны стандартной библиотеки; например, нет встроенного макроса для их конструирования.
+Обратите внимание, что нужно сначала указать использование библиотеки `use std::collections::HashMap;` для её подключения из встроенной библиотеки. Из трёх собраний,  данный вид собрания является наименее используемым, поэтому он не подключается в область видимости функцией самостоятельного подключения (prelude). Хеш-карты также имеют меньшую поддержку со стороны встроенной библиотеки; например, нет встроенного макроса для их разработки.
 
-Подобно векторам, хеш-карты хранят свои данные в куче. Здесь тип `HashMap` имеет в качестве типа ключей `String`, а в качестве типа значений тип `i32`. Как и векторы, HashMap однородны: все ключи должны иметь одинаковый тип и все значения должны иметь тоже одинаковый тип.
+Подобно векторам, хеш-карты хранят свои данные в куче. Здесь вид данных `HashMap` имеет в качестве вида ключа значение вида данных строка -  `String`, а в качестве значения - целочисленный вид данных `i32`. Как и векторы, HashMap строго однородны: все ключи должны иметь одинаковый вид данных и все значения должны иметь тоже одинаковый вид данных.
 
 ### Доступ к данным в HashMap
 
-Мы можем получить значение из HashMap по ключу, с помощью метода `get`, как показано в листинге 8-21.
+Мы можем получить значение из HashMap по ключу, с помощью способа `get`, как показано в приложении 8-21.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-21/src/main.rs:here}}
 ```
 
-Листинг 8-21: Доступ к очкам команды "Blue", которые хранятся в хеш-карте
+Приложение 8-21: Доступ к очкам игрока "Blue", которые хранятся в хеш-карте
 
-Здесь `score` будет иметь количество очков, связанное с командой "Blue", результат будет `10`. Метод `get` возвращает `Option<&V>`; если для какого-то ключа нет значения в HashMap, `get` вернёт `None`. Из-за такого подхода программе следует обрабатывать `Option`, вызывая `copied` для получения `Option` вместо `Option<&i32>`, затем `unwrap_or` для установки `score` в ноль, если scores не содержит данных по этому ключу.
+Здесь переменной `score` присваивается количество очков, связанное с игроком "Blue", итог будет значение `10`. Способ `get` возвращает `Option<&V>`; если для какого-то ключа нет значения в HashMap, `get` вернёт `None`. Из-за такого подхода программе следует обрабатывать `Option`, вызывая `copied` для получения `Option` вместо `Option<&i32>`, затем `unwrap_or` для установки `score` в ноль, если scores не содержит данных по этому ключу.
 
-Мы можем перебирать каждую пару ключ/значение в HashMap таким же образом, как мы делали с векторами, используя цикл `for`:
+Мы можем перебирать каждую пару ключ/значение в HashMap таким же образом, как мы делали с векторами, используя круговорот `for`:
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/src/main.rs:here}}
 ```
 
-Этот код будет печатать каждую пару в произвольном порядке:
+Эта рукопись будет выводить каждую пару в произвольном порядке:
 
 ```text
 Yellow: 50
@@ -47,35 +47,35 @@ Blue: 10
 
 ### Хеш-карты и владение
 
-Для типов, которые реализуют типаж `Copy`, например `i32`, значения копируются в HashMap. Для значений со владением, таких как `String`, значения  будут перемещены в хеш-карту и она станет владельцем этих значений, как показано в листинге 8-22.
+Для видов данных, которые используют сущность `Copy`, например `i32`, значения повторяются в HashMap. Для значений с владением, таких как вид данных `String`, значения  будут перемещены в хеш-карту и она станет владельцем этих значений, как показано в приложении 8-22.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-22/src/main.rs:here}}
 ```
 
-Листинг 8-22: Показывает, что ключи и значения находятся во владении HashMap, как только они были вставлены
+Приложение 8-22: Показывает, что ключи и значения находятся во владении HashMap, как только они были вставлены
 
-Мы не можем использовать переменные `field_name` и `field_value` после того, как их значения были перемещены в HashMap вызовом метода `insert`.
+Мы не можем использовать переменные `field_name` и `field_value` после того, как их значения были перемещены в HashMap вызовом способа `insert`.
 
-Если мы вставим в HashMap ссылки на значения, то они не будут перемещены в HashMap. Значения, на которые указывают ссылки, должны быть действительными хотя бы до тех пор, пока хеш-карта действительна. Мы поговорим подробнее об этих вопросах в разделе ["Валидация ссылок при помощи времён жизни"](ch10-03-lifetime-syntax.html#validating-references-with-lifetimes) главы 10.
+Если мы вставим в HashMap ссылки на значения, то они не будут перемещены в HashMap. Значения, на которые указывают ссылки, должны быть действительными хотя бы до тех пор, пока хеш-карта действительна. Мы поговорим подробнее об этих вопросах в разделе ["Проверка действительности ссылок при помощи времён жизни"](ch10-03-lifetime-syntax.html#validating-references-with-lifetimes) Главы 10.
 
 ### Обновление данных в HashMap
 
-Хотя количество ключей и значений может увеличиваться в HashMap, каждый ключ может иметь только одно значение, связанное с ним в один момент времени (обратное утверждение неверно: команды "Blue" и "Yellow" могут хранить в хеш-карте `scores` одинаковое количество очков, например 10).
+Хотя количество ключей и значений может увеличиваться в HashMap, каждый ключ может иметь только одно значение, связанное с ним в одно мгновение времени (обратное утверждение неверно: игроки "Blue" и "Yellow" могут хранить в хеш-карте `scores` одинаковое количество очков, например 10).
 
-Когда вы хотите изменить данные в хеш-карте, необходимо решить, как обрабатывать случай, когда ключ уже имеет назначенное значение. Можно заменить старое значение новым, полностью игнорируя старое. Можно сохранить старое значение и игнорировать новое, или добавлять новое значение, если только ключ *ещё не* имел значения. Или можно было бы объединить старое значение и новое значение. Давайте посмотрим, как сделать каждый из вариантов!
+Когда вы хотите изменить данные в хеш-карте, необходимо решить, как обрабатывать случай, когда ключ уже имеет назначенное значение. Можно заменить старое значение новым, полностью пренебрегая старым. Можно сохранить старое значение и пренебрегать новым, или добавлять новое значение, если только ключ *ещё не* имел значения. Или можно было бы объединить старое значение и новое значение. Давайте посмотрим, как сделать каждый из исходов!
 
 #### Перезапись старых значений
 
-Если мы вставим ключ и значение в HashMap, а затем вставим тот же ключ с новым значением, то старое значение связанное с этим ключом, будет заменено на новое. Даже несмотря на то, что код в листинге 8-23 вызывает `insert` дважды, хеш-карта будет содержать только одну пару ключ/значение, потому что мы вставляем значения для одного и того же ключа - ключа команды "Blue".
+Если мы вставим ключ и значение в HashMap, а затем вставим тот же ключ с новым значением, то старое значение связанное с этим ключом, будет заменено на новое. Даже несмотря на то, что рукопись в приложении 8-23 вызывает `insert` дважды, хеш-карта будет содержать только одну пару ключ/значение, потому что мы вставляем значения для одного и того же ключа - ключа игрока "Blue".
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-23/src/main.rs:here}}
 ```
 
-Листинг 8-23: Замена значения, хранимого в конкретном ключе
+Приложение 8-23: Замена значения, хранимого в определенном ключе
 
-Код напечатает `{"Blue": 25}`. Начальное значение `10` было перезаписано.
+Рукопись выведет `{"Blue": 25}`. Начальное значение `10` было перезаписано.
 
 
 
@@ -83,49 +83,49 @@ Blue: 10
 
 #### Вставка значения только в том случае, когда ключ не имеет значения
 
-Обычно проверяют, существует ли конкретный ключ в хеш-карте со значением, а затем предпринимаются следующие действия: если ключ существует в хеш-карте, существующее значение должно оставаться таким, какое оно есть. Если ключ не существует, то вставляют его и значение для него.
+Обычно проверяют, существует ли определенный ключ в хеш-карте со значением, а затем предпринимаются следующие действия: если ключ существует в хеш-карте, существующее значение должно оставаться таким, какое оно есть. Если ключ не существует, то вставляют его и значение для него.
 
-Хеш-карты имеют для этого специальный API, называемый `entry` , который принимает ключ для проверки в качестве входного параметра. Возвращаемое значение метода `entry` - это перечисление `Entry`, с двумя вариантами: первый представляет значение, которое может существовать, а второй говорит о том, что значение отсутствует. Допустим, мы хотим проверить, имеется ли ключ и связанное с ним значение для команды "Yellow". Если хеш-карта не имеет значения для такого ключа, то мы хотим вставить значение 50. То же самое мы хотим проделать и для команды "Blue". Используем API `entry` в коде листинга 8-24.
+Хеш-карты имеют для этого особый API, называемый `entry` , который принимает ключ для проверки в качестве входного свойства. Возвращаемое значение способа `entry` - это перечисление `Entry`, с двумя исходами: первый представляет значение, которое может существовать, а второй говорит о том, что значение отсутствует. Допустим, мы хотим проверить, имеется ли ключ и связанное с ним значение для игрока "Yellow". Если хеш-карта не имеет значения для такого ключа, то мы хотим вставить значение 50. То же самое мы хотим проделать и для игрока "Blue". Используем API `entry` в рукописи приложения 8-24.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-24/src/main.rs:here}}
 ```
 
-Листинг 8-24: Использование метода entry для вставки значения только в том случае, когда ключ не имеет значения
+Приложение 8-24: Использование способа entry для вставки значения только в том случае, когда ключ не имеет значения. Есть ключ отсутствует - то вставляется пара ключ-значение
 
-Метод `or_insert` определён в `Entry` так, чтобы возвращать изменяемую ссылку на соответствующее значение ключа внутри варианта перечисления `Entry`, когда этот ключ существует, а если его нет, то вставлять параметр в качестве нового значения этого ключа и возвращать изменяемую ссылку на новое значение. Эта техника намного чище, чем самостоятельное написание логики и, кроме того, она более безопасна и согласуется с правилами заимствования.
+Способ `or_insert` определён в `Entry` так, чтобы возвращать изменяемую ссылку на соответствующее значение ключа внутри исхода перечисления `Entry`, когда этот ключ существует, а если его нет, то вставлять свойство в качестве нового значения этого ключа и возвращать изменяемую ссылку на новое значение. Эта техника намного чище, чем самостоятельное написание хода мыслей и, кроме того, она более безопасна и согласуется с правилами заимствования.
 
-При выполнении кода листинга 8-24 будет напечатано `{"Yellow": 50, "Blue": 10}`. Первый вызов `метода entry` вставит ключ для команды "Yellow" со значением 50, потому что для жёлтой команды ещё не имеется значения в HashMap. Второй вызов `entry` не изменит хеш-карту, потому что для ключа команды "Blue" уже имеется значение 10.
+При выполнении рукописи приложения 8-24 будет выведено `{"Yellow": 50, "Blue": 10}`. Первый вызов `способа entry` вставит ключ для игрока "Yellow" со значением 50, потому что для жёлтого игрока ещё не имеется значения в HashMap. Второй вызов `entry` не изменит хеш-карту, потому что для ключа игрока "Blue" уже имеется значение 10.
 
 #### Создание нового значения на основе старого значения
 
-Другим распространённым вариантом использования хеш-карт является поиск значения по ключу, а затем обновление этого значения на основе старого значения. Например, в листинге 8-25 показан код, который подсчитывает, сколько раз определённое слово встречается в некотором тексте. Мы используем HashMap со словами в качестве ключей и увеличиваем соответствующее слову значение, чтобы отслеживать, сколько раз мы встретили это слово. Если мы впервые встретили слово, то сначала вставляем значение 0.
+Другим распространённым исходом использования хеш-карт является поиск значения по ключу, а затем обновление этого значения на основе старого значения. Например, в приложении 8-25 показана рукопись, которая подсчитывает, сколько раз определённое слово встречается в некотором  писании. Мы используем HashMap со словами в качестве ключей и увеличиваем соответствующее слову значение, чтобы отслеживать, сколько раз мы встретили это слово. Если мы впервые встретили слово, то сначала вставляем значение 0.
 
 ```rust
 {{#rustdoc_include ../listings/ch08-common-collections/listing-08-25/src/main.rs:here}}
 ```
 
-Листинг 8-25: Подсчёт количества вхождений слов с использованием хеш-карты, которая хранит слова и счётчики
+Приложение 8-25: Подсчёт количества вхождений слов с использованием хеш-карты, которая хранит слова и счётчики
 
-Этот код напечатает `{"world": 2, "hello": 1, "wonderful": 1}`. Если вы увидите, что пары ключ/значение печатаются в другом порядке, то вспомните, что мы писали в секции ["Доступ к данным в HashMap"], что итерация по хеш-карте происходит в произвольном порядке.
+Эта рукопись выведет `{"world": 2, "hello": 1, "wonderful": 1}`. Если вы увидите, что пары ключ/значение выводятся в другом порядке, то вспомните, что мы писали в разделы ["Доступ к данным в HashMap"], что повторение по хеш-карте происходит в произвольном порядке.
 
-Метод `split_whitespace` возвращает итератор по срезам строки, разделённых пробелам, для строки  `text`. Метод `or_insert` возвращает изменяемую ссылку (`&mut V`) на значение ключа. Мы сохраняем изменяемую ссылку в переменной `count`, для этого, чтобы присвоить переменной значение, необходимо произвести разыменование с помощью звёздочки (*). Изменяемая ссылка удаляется сразу же после выхода из области видимости цикла `for`, поэтому все эти изменения безопасны и согласуются с правилами заимствования.
+Способ `split_whitespace` возвращает повторитель по срезам строки, разделённых пробелам, для строки  `text`. Способ `or_insert` возвращает изменяемую ссылку (`&mut V`) на значение ключа. Мы сохраняем изменяемую ссылку в переменной `count`, для этого, чтобы присвоить переменной значение, необходимо произвести разыменование с помощью звёздочки (*). Изменяемая ссылка удаляется сразу же после выхода из области видимости круговорота `for`, поэтому все эти изменения безопасны и согласуются с правилами заимствования.
 
 ### Функция хеширования
 
-По умолчанию `HashMap` использует функцию хеширования *SipHash*, которая может противостоять атакам класса отказ в обслуживании, Denial of Service (DoS) с использованием хеш-таблиц [siphash](https://en.wikipedia.org/wiki/SipHash). Это не самый быстрый из возможных алгоритмов хеширования, в данном случае производительность идёт на компромисс с обеспечением лучшей безопасности. Если после профилирования вашего кода окажется, что хеш-функция, используемая по умолчанию, очень медленная, вы можете заменить её используя другой hasher. *Hasher* - это тип, реализующий трейт `BuildHasher`. Подробнее о типажах мы поговорим в Главе 10. Вам совсем не обязательно реализовывать свою собственную функцию хеширования; [crates.io](https://crates.io/) имеет достаточное количество библиотек, предоставляющих разные реализации hasher с множеством общих алгоритмов хеширования.
+По умолчанию `HashMap` использует функцию хеширования *SipHash*, которая может противостоять нападениям класса отказ в обслуживании, Denial of Service (DoS) с использованием хеш-таблиц [siphash](https://en.wikipedia.org/wiki/SipHash). Это не самый быстрый из возможных распорядков хеширования, в данном случае производительность идёт на соглашение с обеспечением лучшей безопасности. Если после рассмотрения вашей рукописи окажется, что хеш-функция, используемая по умолчанию, очень медленная, вы можете заменить её используя другой hasher. *Hasher* - это способ, выполняющий сущность `BuildHasher`. Подробнее о особенностях мы поговорим в Главе 10. Вам совсем не обязательно создавать свою собственную функцию хеширования; [crates.io](https://crates.io/) имеет достаточное количество библиотек, предоставляющих разные исполнения hasher с множеством общих распорядков хеширования.
 
 ## Итоги
 
-Векторы, строки и хеш-карты предоставят большое количество функционала для программ, когда необходимо сохранять, получать доступ и модифицировать данные. Теперь вы готовы решить следующие учебные задания:
+Векторы, строки и хеш-карты предоставят большое количество возможностей для программ, когда необходимо сохранять, получать доступ и изменять данные. Теперь вы готовы решить следующие учебные задания:
 
-- Есть список целых чисел. Создайте функцию, используйте вектор и верните из списка: среднее значение; медиану (значение элемента из середины списка после его сортировки); моду списка (mode of list, то значение которое встречается в списке наибольшее количество раз; HashMap будет полезна в данном случае).
-- Преобразуйте строку в кодировку "поросячьей латыни" (Pig Latin). Первая согласная каждого слова перемещается в конец и к ней добавляется окончание "ay", так "first" станет "irst-fay". Слову, начинающемуся на гласную, в конец добавляется "hay" ("apple" становится "apple-hay"). Помните о деталях работы с кодировкой UTF-8!
-- Используя хеш-карту и векторы, создайте текстовый интерфейс позволяющий пользователю добавлять имена сотрудников к названию отдела компании. Например, "Add Sally to Engineering" или "Add Amir to Sales". Затем позвольте пользователю получить список всех людей из отдела или всех людей в компании, отсортированных по отделам в алфавитном порядке.
+- Есть список целых чисел. Создайте функцию, используйте вектор и верните из списка: среднее значение; медиану (значение переменной из середины списка после его упорядочивания); режиму списка (mode of list, то значение которое встречается в списке наибольшее количество раз; HashMap будет полезна в данном случае).
+- Преобразуйте строку в представлении "поросячьей латыни" (Pig Latin). Первая согласная каждого слова перемещается в конец и к ней добавляется окончание "ay", так "first" станет "irst-fay". Слову, начинающемуся на гласную, в конец добавляется "hay" ("apple" становится "apple-hay"). Помните о подробностях работы с представлением UTF-8!
+- Используя хеш-карту и векторы, создайте внешнюю оболочку через рукопись, позволяющую пользователю добавлять имена сотрудников к названию отдела предприятия. Например, "Add Sally to Engineering" или "Add Amir to Sales". Затем позвольте пользователю получить список всех людей из отдела или всех людей в предприятия, упорядоченных по отделам в алфавитном порядке.
 
-Документация API стандартной библиотеки описывает методы у векторов, строк и HashMap. Рекомендуем воспользоваться ей при решении упражнений.
+Пособие API встроенной библиотеки описывает способы у векторов, строк и HashMap. Советуем воспользоваться ей при решении упражнений.
 
-Потихоньку мы переходим к более сложным программам, в которых операции могут потерпеть неудачу. Наступило идеальное время для обсуждения обработки ошибок.
+Потихоньку мы переходим к более сложным программам, в которых действия могут потерпеть неудачу. Наступило наилучшее время для обсуждения обработки ошибок.
 
 
 ["Доступ к данным в HashMap"]: #accessing-values-in-a-hash-map
\ No newline at end of file
diff --git a/rustbook-ru/src/ch09-00-error-handling.md b/rustbook-ru/src/ch09-00-error-handling.md
index 3c695e3c3..89da6112b 100644
--- a/rustbook-ru/src/ch09-00-error-handling.md
+++ b/rustbook-ru/src/ch09-00-error-handling.md
@@ -1,7 +1,7 @@
 # Обработка ошибок
 
-Возникновение ошибок в ходе выполнения программ — это суровая реальность в жизни программного обеспечения, поэтому Rust имеет ряд функций для обработки ситуаций, в которых что-то идёт не так. Во многих случаях Rust требует, чтобы вы признали возможность ошибки и предприняли некоторые действия, прежде чем ваш код будет скомпилирован. Это требование делает вашу программу более надёжной, гарантируя, что вы обнаружите ошибки и обработаете их надлежащим образом, прежде чем развернёте свой код в производственной среде!
+Возникновение ошибок в ходе выполнения программ — это суровая действительность в жизни программного обеспечения, поэтому Ржавчина имеет ряд функций для обработки случаев, в которых что-то идёт не так. Во многих случаях Ржавчина требует, чтобы вы признали возможность ошибки и предприняли некоторые действия, прежде чем ваша рукопись будет собрана. Это требование делает вашу программу более надёжной, обеспечивая, что вы обнаружите ошибки и обработаете их надлежащим образом, прежде чем развернёте свою рукопись в производственной среде!
 
-В Rust ошибки группируются на две основные категории: *исправимые* (recoverable) и *неисправимые* (unrecoverable). В случае исправимой ошибки, такой как *файл не найден*, мы, скорее всего, просто хотим сообщить о проблеме пользователю и повторить операцию. Неисправимые ошибки всегда являются симптомами дефектов в коде, например, попытка доступа к ячейке за пределами границ массива, и поэтому мы хотим немедленно остановить программу.
+В Ржавчине ошибки объединяются на два основные разряды: *исправимые* (recoverable) и *неисправимые* (unrecoverable). В случае исправимой ошибки, такой как *файл не найден*, мы, скорее всего, просто хотим сообщить о неполадке пользователю и повторить действие. Неисправимые ошибки всегда являются симптомами изъянов в рукописи, например, попытка доступа к ячейке за пределами границ массива, и поэтому мы хотим немедленно остановить программу.
 
-Большинство языков не различают эти два вида ошибок и обрабатывают оба вида одинаково, используя такие механизмы, как исключения. В Rust нет исключений. Вместо этого он имеет тип `Result` для обрабатываемых (исправимых) ошибок и макрос `panic!`, который останавливает выполнение, когда программа встречает необрабатываемую (неисправимую) ошибку. Сначала эта глава расскажет про вызов `panic!`, а потом расскажет о возврате значений `Result`. Кроме того, мы рассмотрим, что нужно учитывать при принятии решения о том, следует ли попытаться исправить ошибку или остановить выполнение.
+Большинство языков не различают эти два вида ошибок и обрабатывают оба вида одинаково, используя такие рычаги, как исключения. В Ржавчине нет исключений. Вместо этого он имеет вид данных `Result` для обрабатываемых (исправимых) ошибок и макрос `panic!`, который останавливает выполнение, когда программа встречает необрабатываемую (неисправимую) ошибку. Сначала эта глава расскажет про вызов `panic!`, а потом расскажет о возврате значений `Result`. Кроме того, мы рассмотрим, что нужно учитывать при принятии решения о том, следует ли попытаться исправить ошибку или остановить выполнение.
diff --git a/rustbook-ru/src/ch09-01-unrecoverable-errors-with-panic.md b/rustbook-ru/src/ch09-01-unrecoverable-errors-with-panic.md
index 214006de8..77d797d07 100644
--- a/rustbook-ru/src/ch09-01-unrecoverable-errors-with-panic.md
+++ b/rustbook-ru/src/ch09-01-unrecoverable-errors-with-panic.md
@@ -1,12 +1,12 @@
 ## Неустранимые ошибки с макросом `panic!`
 
-Иногда в коде происходят плохие вещи, и вы ничего не можете с этим поделать. В этих случаях у Rust есть макрос panic! На практике существует два способа вызвать панику: путём выполнения действия, которое вызывает панику в нашем коде (например, обращение к массиву за пределами его размера) или путём явного вызова макроса `panic!`. В обоих случаях мы вызываем панику в нашей программе. По умолчанию паника выводит сообщение об ошибке, раскручивает и очищает стек вызовов, и завершают работу. С помощью переменной окружения вы также можете заставить Rust отображать стек вызовов при возникновении паники, чтобы было легче отследить источник паники.
+Иногда в рукописи происходят плохие вещи, и вы ничего не можете с этим поделать. В этих случаях у Ржавчины есть макрос panic! В действительности существует два способа вызвать сбой: путём выполнения действия, которое вызывает сбой в нашей рукописи (например, обращение к массиву за пределами его размера) или путём явного вызова макроса `panic!`. В обоих случаях мы вызываем сбой в нашей программе. По умолчанию сбой выводит сообщение об ошибке, раскрывает и очищает все содержимое в обойме вызовов действий и способов, после чего завершают работу. С помощью переменного окружения вы также можете заставить Ржавчину отобразить содержимое обоймы вызовов при возникновении сбоя, чтобы было легче отследить источник сбоя.
 
-> ### Раскручивать стек или прерывать выполнение программы в ответ на панику?
+> ### Раскрытие обоймы действий и способов или прервать выполнения программы в ответ на сбой?
 >
-> По умолчанию, когда происходит паника, программа начинает процесс *раскрутки стека*, означающий в Rust проход обратно по стеку вызовов и очистку данных для каждой обнаруженной функции.  Тем не менее, этот обратный проход по стеку и очистка генерируют много работы. Rust как альтернативу предоставляет вам возможность *немедленного прерывания* (aborting), которое завершает работу программы без очистки.
+> По умолчанию, когда происходит сбой, программа начинает этап *раскрытия содержимого обоймы*, означающий в Ржавчине проход обратно по содержимому обоймы вызовов действий и способов, далее очистку данных для каждой обнаруженного действия и способа.  Тем не менее, этот обратный проход по обойме и её очистка порождают много работы. Ржавчина, предоставляет нам иное решение - возможность *немедленного прерывания* (aborting), которое завершает работу программы без очистки.
 >
-> Память, которую использовала программа, должна быть очищена операционной системой. Если в вашем проекте нужно насколько это возможно сделать маленьким исполняемый файл, вы можете переключиться с варианта раскрутки стека на вариант прерывания при панике, добавьте `panic = 'abort'` в раздел [profile] вашего Cargo.toml файла. Например, если вы хотите прервать панику в режиме релиза, добавьте это:
+> Память, которую использовала программа, должна быть очищена операционной системой. Если в вашем деле необходимо чтобы исполняемый файл был наименьшего размера, вы можете выбрать раскрытие обоймы (и очистка памяти) либо прервать выполнение программы при возникновении сбоя. Для того чтобы прервать выполнение программы, добавьте в раздел [profile] вашего Cargo.toml файла строку `panic = 'abort'` . Например, если вы хотите прервать сбой в режиме исполнения, добавьте это:
 >
 > ```toml
 > [profile.release]
@@ -28,13 +28,13 @@
 
 ```
 
-Выполнение макроса `panic!` вызывает сообщение об ошибке, содержащееся в двух последних строках. Первая строка показывает сообщение паники и место в исходном коде, где возникла паника: *src/main.rs:2:5* указывает, что это вторая строка, пятый символ внутри нашего файла *src/main.rs*
+Использование макроса `panic!` вызывает сообщение об ошибке, содержащееся в двух последних строках. Первая строка показывает сообщение сбоя и место в исходной рукописи, где возникла сбой: *src/main.rs:2:5* указывает, что это вторая строка, пятый знак внутри нашего файла *src/main.rs*
 
-В этом случае указанная строка является частью нашего кода, и если мы перейдём к этой строке, мы увидим  вызов макроса `panic!`. В других случаях вызов `panic!` мог бы произойти в стороннем коде, который вызывает наш код, тогда имя файла и номер строки для сообщения об ошибке будет из чужого кода, где макрос `panic!` выполнен, а не из строк нашего кода, которые в конечном итоге привели к выполнению `panic!`. Мы можем использовать обратную трассировку вызовов функций которые вызвали `panic!` чтобы выяснить, какая часть нашего кода вызывает проблему. Мы обсудим обратную трассировку более подробно далее.
+В этом случае указанная строка является частью нашей рукописи, и если мы перейдём к этой строке, мы увидим  вызов макроса `panic!`. В других случаях вызов `panic!` мог бы произойти в сторонней рукописи, которая вызывает нашу рукопись, тогда имя файла и номер строки для сообщения об ошибке будет из чужой рукописи, где макрос `panic!` вызван, а не из строк нашей рукописи, которые в конечном итоге привели к вызову `panic!`. Мы можем использовать обратный отсчёт вызовов функций, которые вызвали `panic!` чтобы выяснить, какая часть нашей рукописи вызывает неполадку. Мы обсудим обратный отсчёт более подробно далее.
 
-### Использование обратной трассировки `panic!`
+### Использование обратного отсчёта `panic!`
 
-Давайте посмотрим на другой пример, где, вызов `panic!` происходит в сторонней библиотеке из-за ошибки в нашем коде (а не как в примере ранее, из-за вызова макроса нашим кодом напрямую). В листинге 9-1 приведён код, который пытается получить доступ по индексу в векторе за пределами допустимого диапазона значений индекса.
+Давайте посмотрим на другой пример, где, вызов `panic!` происходит в сторонней библиотеке из-за ошибки в нашей рукописи (а не как в примере ранее, из-за вызова макроса нашей рукописью напрямую). В приложении 9-1 приведена рукопись, которая пытается получить доступ по порядковому указателю в векторе за пределами допустимых границ внутри вектора.
 
 Файл: src/main.rs
 
@@ -42,19 +42,19 @@
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-01/src/main.rs}}
 ```
 
-Листинг 9-1: Попытка доступа к элементу за пределами вектора, которая вызовет panic!
+Приложение 9-1: Попытка доступа к переменной ряда за пределами границ вектора, которая вызовет panic!
 
-Здесь мы пытаемся получить доступ к 100-му элементу вектора (который находится по индексу 99, потому что индексирование начинается с нуля), но вектор имеет только 3 элемента. В этой ситуации, Rust будет вызывать панику. Использование `[]` должно возвращать элемент, но вы передаёте неверный индекс: не существует элемента, который Rust мог бы вернуть.
+Здесь мы пытаемся получить доступ к 100-й переменной вектора (которая находится по порядковому указателю 99, потому 1-ая переменная имеет `[0]` порядковый указатель ), но вектор имеет только 3 переменных. В этой случае, Ржавчина будет вызывать сбой. Использование `[]` должно возвращать переменную, но вы передаёте неверный порядковый указатель: не существует переменной, которую Ржавчина могла бы вернуть.
 
-В языке C, например, попытка прочесть за пределами конца структуры данных (в нашем случае векторе) приведёт к *неопределённому поведению, undefined behavior, UB*. Вы всё равно получите значение, которое находится в том месте памяти компьютера, которое соответствовало бы этому элементу в векторе, несмотря на то, что память по тому адресу совсем не принадлежит вектору (всё просто: C рассчитал бы место хранения элемента с индексом 99 и считал бы то, что там хранится, упс). Это называется *чтением за пределом буфера, buffer overread,* и может привести к уязвимостям безопасности. Если злоумышленник может манипулировать индексом таким образом, то у него появляется возможность читать данные, которые он не должен иметь возможности читать.
+В языке C, например, попытка прочесть за пределами границ или размера (в нашем случае векторе) приведёт к *неопределённому поведению, undefined behavior, UB*. Вы всё равно получите значение, которое находится в том месте памяти компьютера, которое соответствовало бы этой переменной в векторе, несмотря на то, что память по тому адресу совсем не принадлежит вектору (всё просто: C рассчитал бы место хранения переменной с порядковым указателем 99 и считал бы то, что там хранится, упс). Это называется *чтением за пределом буфера, buffer overread,* и может привести к уязвимостям безопасности. Если злоумышленник может управлять порядковым указателем таким образом, то у него появляется возможность считывать данные, к которым он не должен иметь доступа для чтения.
 
-Чтобы защитить вашу программу от такого рода уязвимостей при попытке прочитать элемент с индексом, которого не существует, Rust остановит выполнение и откажется продолжить работу программы. Давайте попробуем так сделать и посмотрим на поведение Rust:
+Чтобы защитить вашу программу от такого рода уязвимостей при попытке получить доступ к переменной ряда с порядковым указателем, которого не существует, Ржавчина остановит выполнение и откажется продолжить работу программы. Давайте попробуем так сделать и посмотрим на поведение Ржавчины:
 
 ```console
 {{#include ../listings/ch09-error-handling/listing-09-01/output.txt}}
 ```
 
-Следующая строка говорит, что мы можем установить переменную среды `RUST_BACKTRACE`, чтобы получить обратную трассировку того, что именно стало причиной ошибки. Обратная трассировка создаёт список всех функций, которые были вызваны до какой-то определённой точки выполнения программы. Обратная трассировка в Rust работает так же, как и в других языках. По этому предлагаем вам читать данные обратной трассировки как и везде - читать сверху вниз, пока не увидите информацию о файлах написанных вами. Это место, где возникла проблема. Другие строки, которые выше над строками с упоминанием наших файлов, - это код, который вызывается нашим кодом; строки ниже являются кодом, который вызывает наш код. Эти строки могут включать основной код Rust, код стандартной библиотеки или используемые крейты. Давайте попробуем получить обратную трассировку с помощью установки переменной среды RUST_BACKTRACE в любое значение, кроме 0. Листинг 9-2 показывает вывод, подобный тому, что вы увидите.
+Следующая строка говорит, что мы можем установить переменную среды `RUST_BACKTRACE`, чтобы получить обратный отсчёт того, что именно стало причиной ошибки. Обратный отсчёт создаёт список всех функций, которые были вызваны до какой-то определённой точки выполнения программы. Обратный отсчёт в Ржавчине работает так же, как и в других языках. По этому предлагаем вам читать данные обратного отсчёта как и везде - читать сверху вниз, пока не увидите сведения о файлах написанных вами. Это место, где возникла неполадка. Другие строки, которые выше над строками с упоминанием наших файлов, - это рукопись, которая вызывается нашей рукописью; строки ниже являются рукописью, которая вызывает нашу рукопись. Эти строки могут включать основную рукопись Ржавчины, рукопись встроенной библиотеки или используемые ящики. Давайте попробуем получить обратный отсчёт с помощью установки переменной среды RUST_BACKTRACE в любое значение, кроме 0. Приложение 9-2 показывает вывод, подобный тому, что вы увидите.
 
  этой главы. Далее мы рассмотрим, как восстановить выполнение программы после исправляемых ошибок, использующих тип `Result`.
+Мы вернёмся к обсуждению макроса `panic!`, и того когда нам следует и не следует использовать `panic!` для обработки ошибок в разделе "`panic!` или НЕ `panic!`" этой Главы. Далее мы рассмотрим, как восстановить выполнение программы после исправляемых ошибок, использующих вид данных `Result`.
diff --git a/rustbook-ru/src/ch09-02-recoverable-errors-with-result.md b/rustbook-ru/src/ch09-02-recoverable-errors-with-result.md
index 34b6d46b1..4b44988a9 100644
--- a/rustbook-ru/src/ch09-02-recoverable-errors-with-result.md
+++ b/rustbook-ru/src/ch09-02-recoverable-errors-with-result.md
@@ -1,8 +1,8 @@
 ## Исправимые ошибки с `Result`
 
-Многие ошибки являются не настолько критичными, чтобы останавливать выполнение программы. Иногда, когда в функции происходит сбой, необходима просто правильная интерпретация и обработка ошибки. К примеру, при попытке открыть файл может произойти ошибка из-за отсутствия файла. Вы, возможно, захотите исправить ситуацию и создать новый файл вместо остановки программы.
+Многие ошибки являются не настолько существенными, чтобы останавливать выполнение программы. Иногда, когда в функции происходит сбой, необходимо просто правильное преобразование и обработка ошибки. К примеру, при попытке открыть файл может произойти ошибка из-за отсутствия файла. Вы, возможно, захотите исправить ошибку и создать новый файл вместо остановки программы.
 
-Вспомните раздел ["Обработка потенциального сбоя с помощью `Result`"] главы 2: мы использовали там перечисление `Result`, имеющее два варианта, `Ok` и `Err` для обработки сбоев. Само перечисление определено следующим образом:
+Вспомните раздел ["Обработка возможного сбоя с помощью `Result`"][Обработка ошибок] Главы 2: мы использовали там перечисление `Result`, имеющее два исхода. `Ok` и `Err` для обработки сбоев. Само перечисление определено следующим образом:
 
 ```rust
 enum Result {
@@ -11,9 +11,9 @@ enum Result {
 }
 ```
 
-Типы `T` и `E` являются параметрами обобщённого типа: мы обсудим обобщённые типы более подробно в Главе 10. Все что вам нужно знать прямо сейчас - это то, что `T` представляет тип значения, которое будет возвращено в случае успеха внутри варианта `Ok`, а `E` представляет тип ошибки, которая будет возвращена при сбое внутри варианта `Err`. Так как тип `Result` имеет эти обобщённые параметры (generic type parameters), мы можем использовать тип `Result` и функции, которые определены для него, в разных ситуациях, когда тип успешного значение и значения ошибки, которые мы хотим вернуть, отличаются.
+Виды `T` и `E` являются свойствами обобщённого вида данных: мы обсудим обобщённые виды данных более подробно в Главе 10. Все что вам нужно знать прямо сейчас - это то, что `T` представляет вид значения, которое будет возвращено в случае успеха внутри исхода `Ok`, а `E` представляет вид ошибки, которая будет возвращена при сбое внутри исхода `Err`. Так как вид данных `Result` имеет эти обобщённые свойства (generic type parameters), мы можем использовать вид данных `Result` и функции, которые определены для него, в разных случаях, когда вид успешного значение и значения ошибки, которые мы хотим вернуть, отличаются.
 
-Давайте вызовем функцию, которая возвращает значение `Result`, потому что может потерпеть неудачу. В листинге 9-3 мы пытаемся открыть файл.
+Давайте вызовем функцию, которая возвращает значение `Result`, потому что может потерпеть неудачу. В приложении 9-3 мы пытаемся открыть файл.
 
 Файл: src/main.rs
 
@@ -21,13 +21,13 @@ enum Result {
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-03/src/main.rs}}
 ```
 
-Листинг 9-3: Открытие файла
+Приложение 9-3: Открытие файла
 
-`File::open` возвращает значения типа `Result`. Универсальный тип `T` в реализации `File::open` соответствует типу успешно полученного значения, `std::fs::File`, а именно дескриптору файла. Тип `E`, используемый для значения в случае возникновения ошибки, - `std::io::Error`. Такой возвращаемый тип означает, что вызов `File::open` может быть успешным и вернуть дескриптор файла, из которого мы можем читать или в который можем писать. Также вызов функции может завершиться неудачей: например, файл может не существовать, или у нас может не быть разрешения на доступ к файлу. Функция `File::open` должна иметь способ сообщить нам об успехе или неудаче и в то же время дать нам либо дескриптор файла, либо информацию об ошибке. Эту возможность как раз и предоставляет перечисление `Result`.
+`File::open` возвращает значения вида данных `Result`. Гибкий вид данных `T` в выполнении `File::open` соответствует виду успешно полученного значения, `std::fs::File`, а именно указателю файла. Вид данных `E`, используемый для значения в случае возникновения ошибки, - `std::io::Error`. Такой возвращаемый вид данных означает, что вызов `File::open` может быть успешным и вернуть указатель файла, из которого мы можем читать или в который можем вносить данные. Также вызов функции может завершиться неудачей: например, файл может не существовать, или у нас может не быть разрешения на доступ к файлу. Функция `File::open` должна иметь способ сообщить нам об успехе или неудаче и в то же время дать нам либо указатель файла, либо сведения об ошибке. Эту возможность как раз и предоставляет перечисление `Result`.
 
-В случае успеха `File::open` значением переменной `greeting_file_result` будет экземпляр `Ok`, содержащий дескриптор файла. В случае неудачи значение в переменной `greeting_file_result` будет экземпляром `Err`, содержащим дополнительную информацию о том, какая именно ошибка произошла.
+В случае успеха `File::open` значением переменной `greeting_file_result` будет образец данных `Ok`, содержащий указатель файла. В случае неудачи значение в переменной `greeting_file_result` будет образцом `Err`, содержащим дополнительные сведения о том, какая именно ошибка произошла.
 
-Необходимо дописать в код листинга 9-3 выполнение разных действий в зависимости от значения, которое вернёт вызов `File::open`. Листинг 9-4 показывает один из способов обработки `Result` - пользуясь базовым инструментом языка, таким как выражение `match`, рассмотренным в Главе 6.
+Необходимо дописать в рукопись приложения 9-3 выполнение разных действий в зависимости от значения, которое вернёт вызов `File::open`. Приложение 9-4 показывает один из способов обработки `Result` - пользуясь основным средством языка, таким как выражение `match`, рассмотренным в Главе 6.
 
 Файл: src/main.rs
 
@@ -35,13 +35,13 @@ enum Result {
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-04/src/main.rs}}
 ```
 
-Листинг 9-4: Использование выражения match для обработки возвращаемых вариантов типа Result
+Приложение 9-4: Использование выражения match для обработки возвращаемых исходов вида Result
 
-Обратите внимание, что также как перечисление `Option`, перечисление `Result` и его варианты, входят в область видимости благодаря авто-импорту (prelude), поэтому не нужно указывать `Result::` перед использованием вариантов `Ok` и `Err` в ветках выражения `match`.
+Обратите внимание, что также как перечисление `Option`, перечисление `Result` и его исходы, входят в область видимости благодаря само-подключению (prelude), поэтому не нужно указывать `Result::` перед использованием исходов `Ok` и `Err` в ветках выражения `match`.
 
-Если результатом будет `Ok`, этот код вернёт значение `file` из варианта `Ok`, а мы затем присвоим это значение файлового дескриптора переменной `greeting_file`. После `match` мы можем использовать дескриптор файла для чтения или записи.
+Если итогом будет `Ok`, эта рукопись вернёт значение `file` из исхода `Ok`, а мы затем присвоим это значение файлового указателя переменной `greeting_file`. После `match` мы можем использовать указатель файла для чтения или записи.
 
-Другая ветвь `match` обрабатывает случай, где мы получаем значение `Err` после вызова `File::open`. В этом примере мы решили вызвать макрос `panic!`. Если в нашей текущей директории нет файла с именем *hello.txt* и мы выполним этот код, то мы увидим следующее сообщение от макроса `panic!`:
+Другая ветвь `match` обрабатывает случай, где мы получаем значение `Err` после вызова `File::open`. В этом примере мы решили вызвать макрос `panic!`. Если в нашей текущей папки нет файла с именем *hello.txt* и мы выполним эту рукопись, то мы увидим следующее сообщение от макроса `panic!`:
 
 ```console
 {{#include ../listings/ch09-error-handling/listing-09-04/output.txt}}
@@ -51,7 +51,7 @@ enum Result {
 
 ### Обработка различных ошибок с помощью match
 
-Код в листинге 9-4 будет вызывать `panic!` независимо от того, почему вызов `File::open` не удался. Однако мы хотим предпринять различные действия для разных причин сбоя. Если открытие `File::open` не удалось из-за отсутствия файла, мы хотим создать файл и вернуть его дескриптор. Если вызов `File::open` не удался по любой другой причине - например, потому что у нас не было прав на открытие файла, то все равно мы хотим вызвать `panic!` как у нас сделано в листинге 9-4. Для этого мы добавляем выражение внутреннего `match`, показанное в листинге 9-5.
+Рукопись в приложении 9-4 будет вызывать `panic!` независимо от того, почему вызов `File::open` не удался. Однако мы хотим предпринять различные действия для разных причин сбоя. Если открытие `File::open` не удалось из-за отсутствия файла, мы хотим создать файл и вернуть его указатель. Если вызов `File::open` не удался по любой другой причине - например, потому что у нас не было прав на открытие файла, то все равно мы хотим вызвать `panic!` как у нас сделано в приложении 9-4. Для этого мы добавляем выражение внутреннего `match`, показанное в приложении 9-5.
 
 Файл: src/main.rs
 
@@ -62,17 +62,17 @@ tests to fail lol -->
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-05/src/main.rs}}
 ```
 
-Листинг 9-5: Обработка различных ошибок разными способами
+Приложение 9-5: Обработка различных ошибок разными способами
 
-Типом значения возвращаемого функцией `File::open` внутри `Err` варианта является `io::Error`, структура из стандартной библиотеки. Данная структура имеет метод `kind`, который можно вызвать для получения значения `io::ErrorKind`. Перечисление `io::ErrorKind` из стандартной библиотеки имеет варианты, представляющие различные типы ошибок, которые могут появиться при выполнении операций в `io`. Вариант, который мы хотим использовать, это `ErrorKind::NotFound`, который даёт информацию, о том, что файл который мы пытаемся открыть ещё не существует. Итак, во второй строке мы вызываем сопоставление шаблона с переменной `greeting_file_result` и попадаем в ветку с обработкой ошибки, но также у нас есть внутренняя проверка для сопоставления `error.kind()` ошибки.
+Видом значения возвращаемого функцией `File::open` внутри `Err` исхода является `io::Error`, видом данных из встроенной библиотеки. Данный вид данных имеет способ `kind`, который можно вызвать для получения значения `io::ErrorKind`. Перечисление `io::ErrorKind` из встроенной библиотеки имеет исходы, представляющие различные виды ошибок, которые могут появиться при выполнении действий в `io`. Исход, который мы хотим использовать, это `ErrorKind::NotFound`, который предоставляет сведения, о том, что файл, который мы пытаемся открыть, ещё не существует. Итак, во второй строке мы вызываем сопоставление образца данных с переменной `greeting_file_result` и попадаем в ветку с обработкой ошибки, но также у нас есть внутренняя проверка для сопоставления `error.kind()` ошибки.
 
-Условие, которое мы хотим проверить во внутреннем `match`, заключается в том, является ли значение, возвращаемое `error.kind()`, вариантом `NotFound` перечисления `ErrorKind`. Если это так, мы пытаемся создать файл с помощью функции `File::create`. Однако, поскольку вызов `File::create` тоже может завершиться ошибкой, нам нужна обработка ещё одной ошибки, теперь уже во внутреннем выражении `match`. Заметьте: если файл не может быть создан, выводится другое, специализированное сообщение об ошибке. Вторая же ветка внешнего `match` (который обрабатывает вызов `error.kind()`), остаётся той же самой - в итоге программа паникует при любой ошибке, кроме ошибки отсутствия файла.
+Условие, которое мы хотим проверить во внутреннем `match`, заключается в том, является ли значение, возвращаемое `error.kind()`, исходом `NotFound` перечисления `ErrorKind`. Если это так, мы пытаемся создать файл с помощью функции `File::create`. Однако, поскольку вызов `File::create` тоже может завершиться ошибкой, нам нужна обработка ещё одной ошибки, теперь уже во внутреннем выражении `match`. Заметьте: если файл не может быть создан, выводится другое, особое сообщение об ошибке. Вторая же ветка внешнего `match` (который обрабатывает вызов `error.kind()`), остаётся той же самой - в итоге программа вызывает сбой при любой ошибке, кроме ошибки отсутствия файла.
 
-> ### Альтернативы использованию `match` с `Result`
+> ### Иные использованию `match` с `Result`
 >
-> Как много `match`! Выражение `match` является очень полезным, но в то же время довольно примитивным. В главе 13 вы узнаете о замыканиях (closures), которые используются во многих методах типа `Result`. Эти методы помогают быть более лаконичным, чем использование `match` при работе со значениями `Result` в вашем коде.
+> Как много `match`! Выражение `match` является очень полезным, но в то же время довольно простым. В главе 13 вы узнаете о замыканиях (closures), которые используются во многих способах вида данных `Result`. Эти способы помогают быть более кратким, чем использование `match` при работе со значениями `Result` в вашей рукописи.
 >
-> Например, вот другой способ написать ту же логику, что показана в Листинге 9-5, но с использованием замыканий и метода `unwrap_or_else`:
+> Например, вот другой способ написать тот же ход мыслей, что показан в Приложении 9-5, но с использованием замыканий и способа `unwrap_or_else`:
 >
 > 
 >
@@ -93,11 +93,11 @@ tests to fail lol -->
 > }
 > ```
 >
-> Несмотря на то, что данный код имеет такое же поведение как в листинге 9-5, он не содержит ни одного выражения `match` и проще для чтения. Рекомендуем вам вернуться к примеру этого раздела после того как вы прочитаете Главу 13 и изучите метод `unwrap_or_else` по документации стандартной библиотеки. Многие из методов о которых вы узнаете в документации и Главе 13 могут очистить код от больших, вложенных выражений `match` при обработке ошибок.
+> Несмотря на то, что данная рукопись имеет такое же поведение как в приложении 9-5, она не содержит ни одного выражения `match` и проще для чтения. Советуем вам вернуться к примеру этого раздела после того как вы прочитаете Главу 13 и изучите способ `unwrap_or_else` по пособию встроенной библиотеки. Многие из способов, о которых вы узнаете в пособии и Главе 13 могут очистить рукопись от больших, вложенных выражений `match` при обработке ошибок.
 
-### Лаконичные способы обработки ошибок - `unwrap` и `expect`
+### Краткие способы обработки ошибок - `unwrap` и `expect`
 
-Использование `match` работает достаточно хорошо, но может быть довольно многословным и не всегда хорошо передаёт смысл. Тип `Result` имеет множество вспомогательных методов для выполнения различных, более специфических задач. Метод `unwrap` - это метод быстрого доступа к значениям, реализованный так же, как и выражение `match`, которое мы написали в Листинге 9-4. Если значение `Result` является вариантом `Ok`, `unwrap` возвращает значение внутри `Ok`. Если `Result` - вариант `Err`, то `unwrap` вызовет для нас макрос `panic!`. Вот пример `unwrap` в действии:
+Использование средства `match` работает достаточно хорошо, но может быть довольно многословным и не всегда хорошо передаёт смысл. Вид данных `Result` имеет множество вспомогательных способов для выполнения различных, более отличительных задач. Способ `unwrap` - это средство быстрого доступа к значениям, выполненный так же, как и выражение `match`, которое мы написали в Приложении 9-4. Если значение `Result` является исходом `Ok`, `unwrap` возвращает значение внутри `Ok`. Если `Result` - исход `Err`, то `unwrap` вызовет для нас макрос `panic!`. Вот пример `unwrap` в действии:
 
 Файл: src/main.rs
 
@@ -105,7 +105,7 @@ tests to fail lol -->
 {{#rustdoc_include ../listings/ch09-error-handling/no-listing-04-unwrap/src/main.rs}}
 ```
 
-Если мы запустим этот код при отсутствии файла *hello.txt*, то увидим сообщение об ошибке из вызова `panic!` метода `unwrap`:
+Если мы запустим эту рукопись при отсутствии файла *hello.txt*, то увидим сообщение об ошибке из вызова `panic!` способа `unwrap`:
 
 
 {{#include ../listings/ch09-error-handling/listing-09-06/src/main.rs:here}}
 ```
 
-Листинг 9-6: Функция, которая возвращает ошибки в вызывающий код, используя оператор match
+Приложение 9-6: Функция, которая возвращает ошибки в вызывающую рукопись, используя приказчик match
 
-Эта функция может быть написана гораздо более коротким способом, но мы начнём с того, что многое сделаем вручную, чтобы изучить обработку ошибок; а в конце покажем более короткий способ. Давайте сначала рассмотрим тип возвращаемого значения: `Result`. Здесь есть возвращаемое значение функции типа `Result` где шаблонный параметр `T` был заполнен конкретным типом `String` и шаблонный параметр `E` был заполнен конкретным типом `io::Error`.
+Эта функция может быть написана гораздо более коротким способом, но мы начнём с того, что многое сделаем вручную, чтобы изучить обработку ошибок; а в конце покажем более короткий способ. Давайте сначала рассмотрим вид данных возвращаемого значения: `Result`. Здесь есть возвращаемое значение функции вида данных `Result`, где образец свойства `T` был заполнен определенным видом данных `String` и образец свойства `E` был заполнен определенным видом `io::Error`.
 
-Если эта функция выполнится без проблем, то код, вызывающий эту функцию, получит значение `Ok`, содержащее `String` - имя пользователя, которое эта функция прочитала из файла. Если функция столкнётся с какими-либо проблемами, вызывающий код получит значение `Err`, содержащее экземпляр `io::Error`, который включает дополнительную информацию о том, какие проблемы возникли. Мы выбрали `io::Error` в качестве возвращаемого типа этой функции, потому что это тип значения ошибки, возвращаемого из обеих операций, которые мы вызываем в теле этой функции и которые могут завершиться неудачей: функция `File::open` и метод `read_to_string`.
+Если эта функция выполнится без неполадок, то рукопись, вызывающая эту функцию, получит значение `Ok`, содержащее `String` - имя пользователя, которое эта функция прочитала из файла. Если функция столкнётся с какими-либо неполадками, вызывающая рукопись получит значение `Err`, содержащее образец данных `io::Error`, который включает дополнительные сведения о том, какие возникли ошибки. Мы выбрали `io::Error` в качестве возвращаемого вида данных этой функции, потому что это вид значения ошибки, возвращаемого из обоих действий, которые мы вызываем в теле этой функции и которые могут завершиться неудачей: функция `File::open` и способ `read_to_string`.
 
-Тело функции начинается с вызова `File::open`. Затем мы обрабатываем значение `Result` с помощью `match`, аналогично `match` из листинга 9-4. Если `File::open` завершается успешно, то дескриптор файла в переменной образца `file` становится значением в изменяемой переменной `username_file` и функция продолжит свою работу. В случае `Err`, вместо вызова `panic!`, мы используем ключевое слово `return` для досрочного возврата из функции и передаём значение ошибки из `File::open`, которое теперь находится в переменной образца `e`, обратно в вызывающий код как значение ошибки этой функции.
+Тело функции начинается с вызова `File::open`. Затем мы обрабатываем значение `Result` с помощью `match`, подобно `match` из приложения 9-4. Если `File::open` завершается успешно, то указатель файла в переменной образца данных `file` становится значением в изменяемой переменной `username_file` и функция продолжит свою работу. В случае `Err`, вместо вызова `panic!`, мы используем ключевое слово `return` для досрочного возврата из функции и передаём значение ошибки из `File::open`, которое теперь находится в переменной образца данных `e`, обратно в вызывающую рукопись как значение ошибки этой функции.
 
-Таким образом, если у нас есть файловый дескриптор в `username_file`, функция создаёт новую `String` в переменной `username` и вызывает метод `read_to_string` для файлового дескриптора в `username_file`, чтобы прочитать содержимое файла в `username`. Метод `read_to_string` также возвращает `Result`, потому что он может потерпеть неудачу, даже если `File::open` завершился успешно. Поэтому нам нужен ещё один `match` для обработки этого `Result`: если `read_to_string` завершится успешно, то наша функция сработала, и мы возвращаем имя пользователя из файла, которое теперь находится в `username`, обёрнутое в `Ok`. Если `read_to_string` потерпит неудачу, мы возвращаем значение ошибки таким же образом, как мы возвращали значение ошибки в `match`, который обрабатывал возвращаемое значение `File::open`. Однако нам не нужно явно указывать `return`, потому что это последнее выражение в функции.
+Таким образом, если у нас есть файловый указатель в `username_file`, функция создаёт новую `String` в переменной `username` и вызывает способ `read_to_string` для файлового указателя в `username_file`, чтобы прочитать содержимое файла в `username`. Способ `read_to_string` также возвращает `Result`, потому что он может потерпеть неудачу, даже если `File::open` завершился успешно. Поэтому нам нужен ещё один `match` для обработки этого `Result`: если `read_to_string` завершится успешно, то наша функция сработала, и мы возвращаем имя пользователя из файла, которое теперь находится в `username`, обёрнутое в `Ok`. Если `read_to_string` потерпит неудачу, мы возвращаем значение ошибки таким же образом, как мы возвращали значение ошибки в `match`, который обрабатывал возвращаемое значение `File::open`. Однако нам не нужно явно указывать `return`, потому что это последнее выражение в функции.
 
-Затем код, вызывающий этот, будет обрабатывать получение либо значения `Ok`, содержащего имя пользователя, либо значения `Err`, содержащего `io::Error`. Вызывающий код должен решить, что делать с этими значениями. Если вызывающий код получает значение `Err`, он может вызвать `panic!` и завершить работу программы, использовать имя пользователя по умолчанию или найти имя пользователя, например, не в файле. У нас недостаточно информации о том, что на самом деле пытается сделать вызывающий код, поэтому мы распространяем всю информацию об успехах или ошибках вверх, чтобы она могла обрабатываться соответствующим образом.
+Затем рукопись, вызывающая эту, будет обрабатывать полученное значение `Ok`, содержащего имя пользователя, либо значения `Err`, содержащего `io::Error`. Вызывающая рукопись должна решить, что делать с этими значениями. Если вызывающая рукопись получает значение `Err`, она может вызвать `panic!` и завершить работу программы, использовать имя пользователя по умолчанию или найти имя пользователя, например, не в файле. У нас недостаточно сведений о том, что на самом деле пытается сделать вызывающая рукопись, поэтому мы распространяем все сведения об успехах или ошибках вверх, чтобы она могла обрабатываться соответствующим образом.
 
-Эта схема передачи ошибок настолько распространена в Rust, что Rust предоставляет оператор вопросительного знака `?`, чтобы облегчить эту задачу.
+Эта схема передачи ошибок настолько распространена в языке Ржавчина, что язык предоставляет приказчик вопросительного знака `?`, чтобы облегчить эту задачу.
 
-#### Сокращение для проброса ошибок: оператор `?`
+#### Сокращение для проброса ошибок: приказчик `?`
 
-В листинге 9-7 показана реализация `read_username_from_file`, которая имеет ту же функциональность, что и в листинге 9-6, но в этой реализации используется оператор `?`.
+В приложении 9-7 показано использование собственного способа `read_username_from_file`, который имеет ту же возможность, что и в приложении 9-6, но в этои исполнении используется приказчик `?`.
 
 Файл: src/main.rs
 
@@ -187,17 +187,17 @@ don't want to include it for rustdoc testing purposes. -->
 {{#include ../listings/ch09-error-handling/listing-09-07/src/main.rs:here}}
 ```
 
-Листинг 9-7: Функция, возвращающая ошибки в вызывающий код с помощью оператора ?
+Приложение 9-7: Функция, возвращающая ошибки в вызывающую рукопись с помощью приказчика ?
 
-Выражение `?`, расположенное после `Result`, работает почти так же, как и те выражения `match`, которые мы использовали для обработки значений `Result` в листинге 9-6. Если в качестве значения `Result` будет `Ok`, то значение внутри `Ok` будет возвращено из этого выражения, и программа продолжит работу. Если же значение представляет собой `Err`, то `Err` будет возвращено из всей функции, как если бы мы использовали ключевое слово `return`, так что значение ошибки будет передано в вызывающий код.
+Выражение `?`, расположенное после `Result`, работает почти так же, как и те выражения `match`, которые мы использовали для обработки значений `Result` в приложении 9-6. Если в качестве значения `Result` будет `Ok`, то значение внутри `Ok` будет возвращено из этого выражения, и программа продолжит работу. Если же значение представляет собой `Err`, то `Err` будет возвращено из всей функции, как если бы мы использовали ключевое слово `return`, так что значение ошибки будет передано в вызывающую рукопись.
 
-Существует разница между тем, что делает выражение `match` из листинга 9-6 и тем, что делает оператор `?`: значения ошибок, для которых вызван оператор `?`, проходят через функцию `from`, определённую в трейте `From` стандартной библиотеки, которая используется для преобразования значений из одного типа в другой. Когда оператор `?` вызывает функцию `from`, полученный тип ошибки преобразуется в тип ошибки, определённый в возвращаемом типе текущей функции. Это полезно, когда функция возвращает только один тип ошибки, для описания всех возможных вариантов сбоев, даже если её отдельные компоненты могут выходить из строя по разным причинам.
+Существует разница между тем, что делает выражение `match` из приложения 9-6 и тем, что делает приказчик `?`: значения ошибок, для которых вызван приказчик `?`, проходят через функцию `from`, определённую в сущности `From` встроенной библиотеки, которая используется для преобразования значений из одного вида данных в другой. Когда приказчик `?` вызывает функцию `from`, полученный вид ошибки преобразуется в вид ошибки, определённый в возвращаемом виде данных текущей функции. Это полезно, когда функция возвращает только один вид ошибки, для описания всех возможных исходов сбоев, даже если её отдельные составляющие могут выходить из строя по разным причинам.
 
-Например, мы могли бы изменить функцию `read_username_from_file` в листинге 9-7, чтобы возвращать пользовательский тип ошибки с именем `OurError`, который мы определим. Если мы также определим `impl From for OurError` для создания экземпляра `OurError` из `io::Error`, то оператор `?`, вызываемый в теле `read_username_from_file`, вызовет `from` и преобразует типы ошибок без необходимости добавления дополнительного кода в функцию.
+Например, мы могли бы изменить функцию `read_username_from_file` в приложении 9-7, чтобы возвращать пользовательский вид ошибки с именем `OurError`, который мы определим. Если мы также определим `impl From for OurError` для создания образца данных `OurError` из `io::Error`, то приказчик `?`, вызываемый в теле `read_username_from_file`, вызовет `from` и преобразует виды ошибок без необходимости добавления дополнительного рукописи в функцию.
 
-В случае листинга 9-7 оператор `?` в конце вызова `File::open` вернёт значение внутри `Ok` в переменную `username_file`. Если произойдёт ошибка, оператор `?` выполнит ранний возврат значения `Err` вызывающему коду. То же самое относится к оператору `?` в конце вызова `read_to_string`.
+В случае приложения 9-7 приказчик `?` в конце вызова `File::open` вернёт значение внутри `Ok` в переменную `username_file`. Если произойдёт ошибка, приказчик `?` выполнит ранний возврат значения `Err` вызывающей рукописи. То же самое относится к приказчику `?` в конце вызова `read_to_string`.
 
-Оператор `?` позволяет избавиться от большого количества шаблонного кода и упростить реализацию этой функции. Мы могли бы даже ещё больше сократить этот код, если бы использовали цепочку вызовов методов сразу после `?`, как показано в листинге 9-8.
+Приказчик `?` позволяет избавиться от большого количества образцов и упростить выполнение этой функции. Мы могли бы даже ещё больше сократить эту рукопись, если бы использовали цепочку вызовов способов сразу после `?`, как показано в приложении 9-8.
 
 Файл: src/main.rs
 
@@ -209,11 +209,11 @@ don't want to include it for rustdoc testing purposes. -->
 {{#include ../listings/ch09-error-handling/listing-09-08/src/main.rs:here}}
 ```
 
-Листинг 9-8: Цепочка вызовов методов после оператора ?
+Приложение 9-8: Цепочка вызовов способов после приказчика ?
 
-Мы перенесли создание новой `String` в `username` в начало функции; эта часть не изменилась. Вместо создания переменной `username_file` мы соединили вызов `read_to_string` непосредственно с результатом `File::open("hello.txt")?`. У нас по-прежнему есть `?` в конце вызова `read_to_string`, и мы по-прежнему возвращаем значение `Ok`, содержащее `username`, когда и `File::open` и `read_to_string` завершаются успешно, а не возвращают ошибки. Функциональность снова такая же, как в Листинге 9-6 и Листинге 9-7; это просто другой, более эргономичный способ её написания.
+Мы перенесли создание новой `String` в `username` в начало функции; эта часть не изменилась. Вместо создания переменной `username_file` мы соединили вызов `read_to_string` непосредственно с итогом `File::open("hello.txt")?`. У нас по-прежнему есть `?` в конце вызова `read_to_string`, и мы по-прежнему возвращаем значение `Ok`, содержащее `username`, когда и `File::open` и `read_to_string` завершаются успешно, а не возвращают ошибки. Возможность снова такая же, как в Приложении 9-6 и Приложении 9-7; это просто другой, более удобный способ её написания.
 
-Продолжая рассматривать разные способы записи данной функции, листинг 9-9 демонстрирует способ сделать её ещё короче с помощью `fs::read_to_string`.
+Продолжая рассматривать разные способы записи данной функции, приложение 9-9 отображает способ сделать её ещё короче с помощью `fs::read_to_string`.
 
 Файл: src/main.rs
 
@@ -225,15 +225,15 @@ don't want to include it for rustdoc testing purposes. -->
 {{#include ../listings/ch09-error-handling/listing-09-09/src/main.rs:here}}
 ```
 
-Листинг 9-9: Использование fs::read_to_string вместо открытия и последующего чтения файла
+Приложение 9-9: Использование fs::read_to_string вместо открытия и последующего чтения файла
 
-Чтение файла в строку довольно распространённая операция, так что стандартная библиотека предоставляет удобную функцию `fs::read_to_string`, которая открывает файл, создаёт новую `String`, читает содержимое файла, размещает его в `String` и возвращает её. Конечно, использование функции `fs::read_to_string` не даёт возможности объяснить обработку всех ошибок, поэтому мы сначала изучили длинный способ.
+Чтение файла в строку довольно распространённое действие, так что обычная библиотека предоставляет удобную функцию `fs::read_to_string`, которая открывает файл, создаёт новую `String`, считывает содержимое файла, размещает его в `String` и возвращает её. Конечно, использование функции `fs::read_to_string` не даёт возможности объяснить обработку всех ошибок, поэтому мы сначала изучили длинный способ.
 
-#### Где можно использовать оператор `?`
+#### Где можно использовать приказчик `?`
 
-Оператор `?` может использоваться только в функциях, тип возвращаемого значения которых совместим со значением, для которого используется `?`. Это потому, что оператор `?` определён для выполнения раннего возврата значения из функции таким же образом, как и выражение `match`, которое мы определили в листинге 9-6. В листинге 9-6 `match` использовало значение `Result`, а ответвление с ранним возвратом вернуло значение `Err(e)`. Тип возвращаемого значения функции должен быть `Result`, чтобы он был совместим с этим `return`.
+Приказчик `?` может использоваться только в функциях, вид данных возвращаемого значения которых совместимы со значением, для которого используется `?`. Это потому, что приказчик `?` определён для выполнения раннего возврата значения из функции таким же образом, как и выражение `match`, которое мы определили в приложении 9-6. В приложении 9-6 `match` использовало значение `Result`, а ответвление с ранним возвратом вернуло значение `Err(e)`. Вид данных возвращаемого значения функции должен быть `Result`, чтобы он был совместим с этим `return`.
 
-В листинге 9-10 давайте посмотрим на ошибку, которую мы получим, если воспользуемся оператором `?` в функции `main` с типом возвращаемого значения, несовместимым с типом значения, для которого мы используем `?`:
+В приложении 9-10 давайте посмотрим на ошибку, которую мы получим, если воспользуемся приказчиком `?` в функции `main` с видом данных возвращаемого значения, несовместимым с видом данных значения, для которого мы используем `?`:
 
 Файл: src/main.rs
 
@@ -241,50 +241,51 @@ don't want to include it for rustdoc testing purposes. -->
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-10/src/main.rs}}
 ```
 
-Листинг 9-10: Попытка использовать ? в main функции, которая возвращает () , не будет компилироваться
+Приложение 9-10: Попытка использовать ? в main функции, которая возвращает () , не будет собираться
 
-Этот код открывает файл, что может привести к сбою. `?` оператор следует за значением `Result` , возвращаемым `File::open` , но эта `main` функция имеет возвращаемый тип `()` , а не `Result` . Когда мы компилируем этот код, мы получаем следующее сообщение об ошибке:
+Эта рукопись открывает файл, что может привести к сбою. `?` приказчик следует за значением `Result` , возвращаемым `File::open` , но эта `main` функция имеет возвращаемый вид данных `()` , а не `Result` . Когда мы собираем эту рукопись, мы получаем следующее сообщение об ошибке:
 
 ```console
 {{#include ../listings/ch09-error-handling/listing-09-10/output.txt}}
 ```
 
-Эта ошибка указывает на то, что оператор `?` разрешено использовать только в функции, которая возвращает `Result`, `Option` или другой тип, реализующий `FromResidual`.
+Эта ошибка указывает на то, что приказчик `?` разрешено использовать только в функции, которая возвращает `Result`, `Option` или другой вид данных, использующий `FromResidual`.
 
-Для исправления ошибки есть два варианта. Первый - изменить возвращаемый тип вашей функции так, чтобы он был совместим со значением, для которого вы используете оператор `?`, если у вас нет ограничений, препятствующих этому. Другой способ - использовать `match` или один из методов `Result` для обработки `Result` любым подходящим способом.
+Для исправления ошибки есть два исхода. Первый - изменить возвращаемый вид данных вашей функции так, чтобы он был совместим со значением, для которого вы используете приказчик `?`, если у вас нет ограничений, препятствующих этому. Другой способ - использовать `match` или один из способов `Result` для обработки `Result` любым подходящим способом.
 
-В сообщении об ошибке также упоминалось, что `?` можно использовать и со значениями `Option`. Как и при использовании `?` для `Result`, вы можете использовать `?` только для `Option` в функции, которая возвращает `Option`. Поведение оператора `?` при вызове `Option` похоже на его поведение при вызове `Result`: если значение равно `None`, то `None` будет возвращено раньше из функции в этот момент. Если значение `Some`, значение внутри `Some` является результирующим значением выражения, и функция продолжает исполняться. В листинге 9-11 приведён пример функции, которая находит последний символ первой строки заданного текста:
+В сообщении об ошибке также упоминалось, что `?` можно использовать и со значениями `Option`. Как и при использовании `?` для `Result`, вы можете использовать `?` только для `Option` в функции, которая возвращает `Option`. Поведение приказчика `?` при вызове `Option` похоже на его поведение при вызове `Result`: если значение равно `None`, то `None` будет возвращено раньше из функции в это мгновение. Если значение `Some`, значение внутри `Some` является итоговым значением выражения, и функция продолжает исполняться. В приложении 9-11 приведён пример функции, которая находит последний знак первой строки заданного писания:
 
 ```rust
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-11/src/main.rs:here}}
 ```
 
-Листинг 9-11: Использование оператора ? для значения Option<T>
+Приложение 9-11: Использование приказчика ? для значения Option<T>
 
-Эта функция возвращает `Option`, потому что возможно, что там есть символ, но также возможно, что его нет. Этот код принимает аргумент среза `text` строки и вызывает для него метод `lines`, который возвращает итератор для строк в строке. Поскольку эта функция хочет проверить первую строку, она вызывает `next` у итератора, чтобы получить первое значение от итератора. Если `text` является пустой строкой, этот вызов `next` вернёт `None`, и в этом случае мы используем `?` чтобы остановить и вернуть `None` из `last_char_of_first_line`. Если `text` не является пустой строкой, `next` вернёт значение `Some`, содержащее фрагмент строки первой строки в `text`.
+Эта функция возвращает `Option`, потому что возможно, что там есть знак, но также возможно, что его нет. Эта рукопись принимает переменная среза `text` строки и вызывает для него способ `lines`, который возвращает повторитель для строк в строке. Поскольку эта функция хочет проверить первую строку, она вызывает `next` у повторителя, чтобы получить первое значение от повторителя. Если `text` является пустой строкой, этот вызов `next` вернёт `None`, и в этом случае мы используем `?` чтобы остановить и вернуть `None` из `last_char_of_first_line`. Если `text` не является пустой строкой, `next` вернёт значение `Some`, содержащее отрывок строки первой строки в `text`.
 
-Символ `?` извлекает фрагмент строки, и мы можем вызвать `chars` для этого фрагмента строки. чтобы получить итератор символов. Нас интересует последний символ в первой строке, поэтому мы вызываем `last`, чтобы вернуть последний элемент в итераторе. Вернётся `Option`, потому что возможно, что первая строка пустая - например, если `text` начинается с пустой строки, но имеет символы в других строках, как в `"\nhi"`. Однако, если в первой строке есть последний символ, он будет возвращён в варианте `Some`. Оператор `?` в середине даёт нам лаконичный способ выразить эту логику, позволяя реализовать функцию в одной строке. Если бы мы не могли использовать оператор `?` в `Option`, нам пришлось бы реализовать эту логику, используя больше вызовов методов или выражение `match`.
+Знак `?` извлекает отрывок строки, и мы можем вызвать `chars` для этого отрывка строки. чтобы получить повторитель знаков. Нас важно последний знак в первой строке, поэтому мы вызываем `last`, чтобы вернуть последнюю переменную в повторителе. Вернётся `Option`, потому что возможно, что первая строка пустая - например, если `text` начинается с пустой строки, но имеет знаки в других строках, как в `"\nhi"`. Однако, если в первой строке есть последний знак, он будет возвращён в исходе `Some`. Приказчик `?` в середине даёт нам краткий способ выразить этот ход мыслей, позволяя выполнить функцию в одной строке. Если бы мы не могли использовать приказчик `?` в `Option`, нам пришлось бы выполнить этот ход мыслей, используя больше вызовов способов или выражение `match`.
 
-Обратите внимание, что вы можете использовать оператор `?` `Result` в функции, которая возвращает `Result` , и вы можете использовать оператор `?` для `Option` в функции, которая возвращает `Option` , но вы не можете смешивать и сопоставлять. Оператор `?` не будет автоматически преобразовывать `Result` в `Option` или наоборот; в этих случаях вы можете использовать такие методы, как метод `ok` для `Result` или метод `ok_or` для `Option`, чтобы выполнить преобразование явно.
+Обратите внимание, что вы можете использовать приказчик `?` `Result` в функции, которая возвращает `Result` , и вы можете использовать приказчик `?` для `Option` в функции, которая возвращает `Option` , но вы не можете смешивать и сопоставлять. Приказчик `?` не будет самостоятельно преобразовывать `Result` в `Option` или наоборот; в этих случаях вы можете использовать такие способы, как способ `ok` для `Result` или способ `ok_or` для `Option`, чтобы выполнить преобразование явно.
 
-До сих пор все функции `main`, которые мы использовали, возвращали `()`. Функция `main` - особенная, потому что это точка входа и выхода исполняемых программ, и существуют ограничения на тип возвращаемого значения, чтобы программы вели себя так, как ожидается.
+До сих пор все функции `main`, которые мы использовали, возвращали `()`. Функция `main` - особенная, потому что это точка входа и выхода исполняемых программ, и существуют ограничения на вид данных возвращаемого значения, чтобы программы вели себя так, как ожидается.
 
-К счастью, `main` также может возвращать `Result<(), E>` . В листинге 9-12 используется код из листинга 9-10, но мы изменили возвращаемый тип `main` на `Result<(), Box>` и добавили возвращаемое значение `Ok(())` в конец. Теперь этот код будет скомпилирован:
+К счастью, `main` также может возвращать `Result<(), E>` . В приложении 9-12 используется рукопись из приложения 9-10, но мы изменили возвращаемый вид данных `main` на `Result<(), Box>` и добавили возвращаемое значение `Ok(())` в конец. Теперь эта рукопись будет собрана:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch09-error-handling/listing-09-12/src/main.rs}}
 ```
 
-Листинг 9-12: Замена main на return Result<(), E> позволяет использовать оператор ? оператор над значениями Result
+Приложение 9-12: Замена main на return Result<(), E> позволяет использовать приказчик ? приказчик над значениями Result
 
-Тип `Box` является *трейт-объектом*, о котором мы поговорим в разделе ["Использование трейт-объектов, допускающих значения разных типов"] в главе 17. Пока что вы можете считать, что `Box` означает "любой вид ошибки". Использование `?` для значения `Result` в функции `main` с типом ошибки `Box` разрешено, так как позволяет вернуть любое значение `Err` раньше времени. Даже если тело этой функции `main` будет возвращать только ошибки типа `std::io::Error`, указав `Box`, эта сигнатура останется корректной, даже если в тело `main` будет добавлен код, возвращающий другие ошибки.
+Вид данных `Box` является *сущность-предметом*, о котором мы поговорим в разделе ["Использование сущность-предметов, допускающих значения разных видов данных"][Сущность-предмет] в главе 17. Пока что вы можете считать, что `Box` означает "любой вид ошибки". Использование `?` для значения `Result` в функции `main` с видом ошибки `Box` разрешено, так как позволяет вернуть любое значение `Err` раньше времени. Даже если тело этой функции `main` будет возвращать только ошибки вида данных `std::io::Error`, указав `Box`, эта ярлык останется правильным, даже если в тело `main` будет добавлена рукопись, возвращающая другие ошибки.
 
-Когда `main` функция возвращает `Result<(), E>`, исполняемый файл завершится со значением `0`, если `main` вернёт `Ok(())`, и выйдет с ненулевым значением, если `main` вернёт значение `Err`. Исполняемые файлы, написанные на C, при выходе возвращают целые числа: успешно завершённые программы возвращают целое число `0`, а программы с ошибкой возвращают целое число, отличное от `0`. Rust также возвращает целые числа из исполняемых файлов, чтобы быть совместимым с этим соглашением.
+Когда `main` функция возвращает `Result<(), E>`, исполняемый файл завершится со значением `0`, если `main` вернёт `Ok(())`, и выйдет с ненулевым значением, если `main` вернёт значение `Err`. Исполняемые файлы, написанные на C, при выходе возвращают целые числа: успешно завершённые программы возвращают целое число `0`, а программы с ошибкой возвращают целое число, отличное от `0`. Ржавчина также возвращает целые числа из исполняемых файлов, чтобы быть совместимым с этим соглашением.
 
-Функция `main` может возвращать любые типы, реализующие [трейт `std::process::Termination`], в которых имеется функция `report`, возвращающая `ExitCode`. Обратитесь к документации стандартной библиотеки за дополнительной информацией о порядке реализации трейта `Termination` для ваших собственных типов.
+Функция `main` может возвращать любые виды данных, использующие [сущность `std::process::Termination`][Подавление], в которых имеется функция `report`, возвращающая `ExitCode`. Обратитесь к пособию встроенной библиотеки за дополнительными сведениями о порядке использования сущности `Termination` для ваших собственных видов данных.
 
-Теперь, когда мы обсудили детали вызова `panic!` или возврата `Result`, давайте вернёмся к тому, как решить, какой из случаев подходит для какой ситуации.
+Теперь, когда мы обсудили подробности вызова `panic!` или возврата `Result`, давайте вернёмся к тому, как решить, какой из случаев подходит для нашего примера.
 
 
-["Использование трейт-объектов, допускающих значения разных типов"]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
-[трейт `std::process::Termination`]: ../std/process/trait.Termination.html
\ No newline at end of file
+[Сущность-предмет]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types
+[Подавление]: ../std/process/trait.Termination.html
+[Обработка ошибок]: ch02-00-guessing-game-tutorial.html#handling-potential-failure-with-result
\ No newline at end of file
diff --git a/rustbook-ru/src/ch09-03-to-panic-or-not-to-panic.md b/rustbook-ru/src/ch09-03-to-panic-or-not-to-panic.md
index c1cbfe3d3..0403e5888 100644
--- a/rustbook-ru/src/ch09-03-to-panic-or-not-to-panic.md
+++ b/rustbook-ru/src/ch09-03-to-panic-or-not-to-panic.md
@@ -1,58 +1,59 @@
 ## `panic!` или не `panic!`
 
-Итак, как принимается решение о том, когда следует вызывать `panic!`, а когда вернуть `Result`? При панике код не имеет возможности восстановить своё выполнение. Можно было бы вызывать `panic!` для любой ошибочной ситуации, независимо от того, имеется ли способ восстановления или нет, но с другой стороны, вы принимаете решение от имени вызывающего вас кода, что ситуация необратима. Когда вы возвращаете значение `Result`, вы делегируете принятие решения вызывающему коду. Вызывающий код может попытаться выполнить восстановление способом, который подходит в данной ситуации, или же он может решить, что из ошибки в  `Err` нельзя восстановиться и вызовет `panic!`, превратив вашу исправимую ошибку в неисправимую. Поэтому возвращение `Result` является хорошим выбором по умолчанию для функции, которая может дать сбой.
+Итак, как принимается решение о том, когда следует вызывать `panic!`, а когда вернуть `Result`? При сбое рукопись не имеет возможности восстановить своё выполнение. Можно было бы вызывать `panic!` для любого ошибочной случая, независимо от того, имеется ли способ восстановления или нет, но с другой стороны, вы принимаете решение от имени вызывающего вас рукописи, что случай необратима. Когда вы возвращаете значение `Result`, вы делегируете принятие решения вызывающей рукописи. Вызывающая рукопись может попытаться выполнить восстановление способом, который подходит в данной случае, или же он может решить, что из ошибки в  `Err` нельзя восстановиться и вызовет `panic!`, превратив вашу исправимую ошибку в неисправимую. Поэтому возвращение `Result` является хорошим выбором по умолчанию для функции, которая может дать сбой.
 
-В таких ситуация как примеры, прототипы и тесты, более уместно писать код, который паникует вместо возвращения `Result`. Давайте рассмотрим почему, а затем мы обсудим ситуации, в которых компилятор не может доказать, что ошибка невозможна, но вы, как человек, можете это сделать. Глава будет заканчиваться некоторыми общими руководящими принципами о том, как решить, стоит ли паниковать в коде библиотеки.
+В таких случай как примеры, протовиды и проверки, более уместно писать рукопись, которая вызывает сбой вместо возвращения `Result`. Давайте рассмотрим почему, а затем мы обсудим случаи, в которых сборщик не может доказать, что ошибка невозможна, но вы, как человек, можете это сделать. Глава будет заканчиваться некоторыми общими руководящими принципами о том, как решить, стоит ли вызвать сбой в рукописи библиотеки.
 
-### Примеры, прототипирование и тесты
+### Примеры, создание опытного образца и проверки
 
-Когда вы пишете пример, иллюстрирующий некоторую концепцию, наличие хорошего кода обработки ошибок может сделать пример менее понятным. Понятно, что в примерах вызов метода `unwrap`, который может привести к панике, является лишь обозначением способа обработки ошибок в приложении, который может отличаться в зависимости от того, что делает остальная часть кода.
+Когда вы пишете пример, отображающий некоторую подход, наличие хорошего рукописи обработки ошибок может сделать пример менее понятным. Понятно, что в примерах вызов способа `unwrap`, который может привести к сбою, является лишь обозначением способа обработки ошибок в приложении, который может отличаться в зависимости от того, что делает остальная часть рукописи.
 
-Точно так же методы `unwrap` и `expect` являются очень удобными при создании прототипа, прежде чем вы будете готовы решить, как обрабатывать ошибки. Они оставляют чёткие маркеры в коде до момента, когда вы будете готовы сделать программу более надёжной.
+Точно так же способы `unwrap` и `expect` являются очень удобными при создании протовида, прежде чем вы будете готовы решить, как обрабатывать ошибки. Они оставляют чёткие отступы в рукописи до того времени, когда вы будете готовы сделать программу более надёжной.
 
-Если в тесте происходит сбой при вызове метода, то вы бы хотели, чтобы весь тест не прошёл, даже если этот метод не является тестируемой функциональностью. Поскольку вызов `panic!` это способ, которым тест помечается как провалившийся, использование `unwrap` или `expect` - именно то, что нужно.
+Если в проверке происходит сбой при вызове способа, то вы бы хотели, чтобы весь проверка не прошёл, даже если этот способ не является проверяемой возможностью. Поскольку вызов `panic!` это способ, которым проверка помечается как провалившийся, использование `unwrap` или `expect` - именно то, что нужно.
 
-### Случаи, в которых у вас больше информации, чем у компилятора
+### Случаи, в которых у вас больше сведений, чем у сборщика
 
-Также было бы целесообразно вызывать `unwrap` или `expect` когда у вас есть какая-то другая логика, которая гарантирует, что `Result` будет иметь значение `Ok`, но вашу логику не понимает компилятор. У вас по-прежнему будет значение `Result` которое нужно обработать: любая операция, которую вы вызываете, все ещё имеет возможность неудачи в целом, хотя это логически невозможно в вашей конкретной ситуации. Если, проверяя код вручную, вы можете убедиться, что никогда не будет вариант с `Err`, то вполне допустимо вызывать `unwrap`, а ещё лучше задокументировать причину, по которой, по вашему мнению, у вас никогда не будет варианта `Err` в тексте `expect`. Вот пример:
+Также было бы целесообразно вызывать `unwrap` или `expect` когда у вас есть какая-то другая ход мыслей, который заверяет, что `Result` будет иметь значение `Ok`, но вашу ход мыслей не понимает сборщик. У вас по-прежнему будет значение `Result` которое нужно обработать: любое действие, которое вы вызываете, все ещё имеет возможность неудачи в целом, хотя это разумно невозможно в вашем именно случае. Если, проверяя рукопись вручную, вы можете убедиться, что никогда не будет исход с `Err`, то вполне допустимо вызывать `unwrap`, а ещё лучше задокументировать причину, по которой, по вашему мнению, у вас никогда не будет исхода `Err` в писании `expect`. Вот пример:
 
 ```rust
 {{#rustdoc_include ../listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/src/main.rs:here}}
 ```
 
-Мы создаём экземпляр `IpAddr`, анализируя жёстко закодированную строку. Можно увидеть, что `127.0.0.1` является действительным IP-адресом, поэтому здесь допустимо использование `expect`. Однако наличие жёстко закодированной допустимой строки не меняет тип возвращаемого значения метода `parse`: мы все ещё получаем значение `Result` и компилятор все также заставляет нас обращаться с `Result`так, будто возможен вариант `Err`, потому что компилятор недостаточно умён, чтобы увидеть, что эта строка всегда действительный IP-адрес. Если строка IP-адреса пришла от пользователя, то она не является жёстко запрограммированной в программе и, следовательно, *может* привести к ошибке, мы определённо хотели бы обработать `Result` более надёжным способом. Упоминание предположения о том, что этот IP-адрес жёстко закодирован, побудит нас изменить `expect` для лучшей обработки ошибок, если в будущем нам потребуется вместо этого получить IP-адрес из какого-либо другого источника.
+Мы создаём образец данных `IpAddr`, рассмотривая жёстко заданную строку. Можно увидеть, что `127.0.0.1` является действительным IP-адресом, поэтому здесь допустимо использование `expect`. Однако наличие жёстко задан
+ной допустимой строки не меняет вид данных возвращаемого значения способа `parse`: мы все ещё получаем значение `Result` и сборщик все также заставляет нас обращаться с `Result`так, будто возможен исход `Err`, потому что сборщик недостаточно умён, чтобы увидеть, что эта строка всегда действительный IP-адрес. Если строка IP-адреса пришла от пользователя, то она не является жёстко запрограммированной в программе и, следовательно, *может* привести к ошибке, мы определённо хотели бы обработать `Result` более надёжным способом. Упоминание предположения о том, что этот IP-адрес жёстко задан, побудит нас изменить `expect` для лучшей обработки ошибок, если в будущем нам потребуется вместо этого получить IP-адрес из какого-либо другого источника.
 
 ### Руководство по обработке ошибок
 
-Желательно, чтобы код паниковал, если он может оказаться в некорректном состоянии. В этом контексте *некорректное состояние* это когда некоторое допущение, гарантия, контракт или инвариант были нарушены. Например, когда недопустимые, противоречивые или пропущенные значения передаются в ваш код - плюс один или несколько пунктов из следующего перечисленного в списке:
+Желательно, чтобы рукопись вызвал сбой, если он может оказаться в неправильном состоянии. В этой среде *неправильное состояние* это когда некоторое допущение, заверение, договор или неизменная величина были нарушены. Например, когда недопустимые, противоречивые или пропущенные значения передаются в вашу рукопись - дополнительно один или несколько пунктов из следующего перечисленного в списке:
 
-- Некорректное состояние — это что-то неожиданное, отличается от того, что может происходить время от времени, например, когда пользователь вводит данные в неправильном формате.
-- Ваш код после этой точки должен полагаться на то, что он не находится в некорректном состоянии, вместо проверок наличия проблемы на каждом этапе.
-- Нет хорошего способа закодировать данную информацию в типах, которые вы используете. Мы рассмотрим пример того, что мы имеем в виду в разделе [“Кодирование состояний и поведения на основе типов”] главы 17.
+- Неправильное состояние — это что-то неожиданное, отличается от того, что может происходить время от времени, например, когда пользователь вводит данные в неправильном виде данных.
+- Ваша рукопись после этой точки должна полагаться на то, что она не находится в неправильном состоянии, вместо проверок наличия сбоев на каждом этапе.
+- Нет хорошего способа закодировать данную сведения в видах данных, которые вы используете. Мы рассмотрим пример того, что мы имеем в виду в разделе [“Кодирование состояний и поведения на основе видов данных”] Главы 17.
 
-Если кто-то вызывает ваш код и передаёт значения, которые не имеют смысла, лучше всего вернуть ошибку, если вы это можете, чтобы пользователь библиотеки мог решить, что он хочет делать в этом случае. Однако в тех случаях, когда продолжение выполнения программы может быть небезопасным или вредным, лучшим выбором будет вызов `panic!` и оповещение пользователя, использующего вашу библиотеку, об ошибке в его коде, чтобы он мог исправить её во время разработки. Аналогично `panic!` подходит, если вы вызываете внешний, неподконтрольный вам код, и он возвращает недопустимое состояние, которое вы не можете исправить.
+Если кто-то вызывает вашу рукопись и передаёт значения, которые не имеют смысла, лучше всего вернуть ошибку, если вы это можете, чтобы пользователь библиотеки мог решить, что он хочет делать в этом случае. Однако в тех случаях, когда продолжение выполнения программы может быть небезопасным или вредным, лучшим выбором будет вызов `panic!` и оповещение пользователя, использующего вашу библиотеку, об ошибке в его рукописи, чтобы он мог исправить её во время разработки. Подобно `panic!` подходит, если вы вызываете внешний, неподвластную вам рукопись, и она возвращает недопустимое состояние, которое вы не можете исправить.
 
-Однако, когда ожидается сбой, лучше вернуть `Result`, чем выполнить вызов `panic!`.  В качестве примера можно привести синтаксический анализатор, которому передали неправильно сформированные данные, или HTTP-запрос, возвращающий статус указывающий на то, что вы достигли ограничения на частоту запросов. В этих случаях возврат `Result` означает, что ошибка является ожидаемой и вызывающий код должен решить, как её обрабатывать.
+Однако, когда ожидается сбой, лучше вернуть `Result`, чем использовать вызов `panic!`.  В качестве примера можно привести связанный оценщик, которому передали неправильно созданные данные, или HTTP-запрос, возвращающий значение указывающий на то, что вы достигли ограничения на частоту запросов. В этих случаях возврат `Result` означает, что ошибка является ожидаемой и вызывающая рукопись должна решить, как её обрабатывать.
 
-Когда ваш код выполняет операцию, которая может подвергнуть пользователя риску, если она вызывается с использованием недопустимых значений, ваш код должен сначала проверить допустимость значений и паниковать, если значения недопустимы. Так рекомендуется делать в основном из соображений безопасности: попытка оперировать некорректными данными может привести к уязвимостям. Это основная причина, по которой стандартная библиотека будет вызывать `panic!`, если попытаться получить доступ к памяти вне границ массива: доступ к памяти, не относящейся к текущей структуре данных, является известной проблемой безопасности. Функции часто имеют контракты: их поведение гарантируется, только если входные данные отвечают определённым требованиям. Паника при нарушении контракта имеет смысл, потому что это всегда указывает на дефект со стороны вызывающего кода, и это не ошибка, которую вы хотели бы, чтобы вызывающий код явно обрабатывал. На самом деле, нет разумного способа для восстановления вызывающего кода; программисты, вызывающие ваш код, должны исправить свой. Контракты для функции, особенно когда нарушение вызывает панику, следует описать в документации по API функции.
+Когда ваша рукопись выполняет действие, которое может подвергнуть пользователя риску, если она вызывается с использованием недопустимых значений, ваша рукопись должна сначала проверить допустимость значений и вызвать сбой, если значения недопустимы. Так советуется делать в основном из соображений безопасности: попытка оперировать неправильными данными может привести к уязвимостям. Это основная причина, по которой обычная библиотека будет вызывать `panic!`, если попытаться получить доступ к памяти вне границ массива: доступ к памяти, не относящейся к текущему виду данных, является известной неполадкой безопасности. Функции часто имеют договоры: их поведение обеспечивается, только если входные данные отвечают определённым требованиям. Сбой при нарушении договора имеет смысл, потому что это всегда указывает на изъян со стороны вызывающей рукописи, и это не ошибка, которую вы хотели бы, чтобы вызывающая рукопись явно обрабатывала. На самом деле, нет разумного способа для восстановления вызывающего рукопись; программисты, вызывающие вашу рукопись, должны исправить свою рукопись. Договоры для функции, особенно когда нарушение вызывает сбой, следует описать в пособии по API функции.
 
-Тем не менее, наличие множества проверок ошибок во всех ваших функциях было бы многословным и раздражительным. К счастью, можно использовать систему типов Rust (следовательно и проверку типов компилятором), чтобы она сделала множество проверок вместо вас. Если ваша функция имеет определённый тип в качестве параметра, вы можете продолжить работу с логикой кода зная, что компилятор уже обеспечил правильное значение. Например, если используется обычный тип, а не тип `Option`, то ваша программа ожидает наличие *чего-то* вместо *ничего*. Ваш код не должен будет обрабатывать оба варианта `Some` и `None`: он будет иметь только один вариант для определённого значения. Код, пытающийся ничего не передавать в функцию, не будет даже компилироваться, поэтому ваша функция не должна проверять такой случай во время выполнения. Другой пример - это использование целого типа без знака, такого как `u32`, который гарантирует, что параметр никогда не будет отрицательным.
+Тем не менее, наличие множества проверок ошибок во всех ваших функциях было бы многословным и раздражительным. К счастью, можно использовать систему видов данных Ржавчине (следовательно и проверку видов данных сборщиком), чтобы она сделала множество проверок вместо вас. Если ваша функция имеет определённый вид данных в качестве свойства, вы можете продолжить работу с ходом мыслей рукописи зная, что сборщик уже обеспечил правильное значение. Например, если используется обычный вид данных, а не вид данных `Option`, то ваша программа ожидает наличие *чего-то* вместо *ничего*. Ваша рукопись не должна будет обрабатывать оба исхода `Some` и `None`: она будет иметь только один исход для определённого значения. Рукопись, пытающиаяся ничего не передавать в функцию, не будет даже собираться, поэтому ваша функция не должна проверять такой случай во время выполнения. Другой пример - это использование целого вида данных без знака, такого как вид `u32`, который заверяет, что свойство никогда не будет отрицательным.
 
-### Создание пользовательских типов для проверки
+### Создание пользовательских видов данных для проверки
 
-Давайте разовьём идею использования системы типов Rust чтобы убедиться, что у нас есть корректное значение, и рассмотрим создание пользовательского типа для валидации. Вспомним игру угадывания числа из Главы 2, в которой наш код просил пользователя угадать число между 1 и 100. Мы никогда не проверяли, что предположение пользователя лежит между этими числами, перед сравнением предположения с загаданным нами числом; мы только проверяли, что оно положительно. В этом случае последствия были не очень страшными: наши сообщения «Слишком много» или «Слишком мало», выводимые в консоль, все равно были правильными. Но было бы лучше подталкивать пользователя к правильным догадкам и иметь различное поведение для случаев, когда пользователь предлагает число за пределами диапазона, и когда пользователь вводит, например, буквы вместо цифр.
+Давайте разовьём мысль использования системы видов данных Ржавчине чтобы убедиться, что у нас есть правильное значение, и рассмотрим создание пользовательского вида данных для проверки. Вспомним игру угадывания числа из Главы 2, в которой особую рукопись просила пользователя угадать число между 1 и 100. Мы никогда не проверяли, что предположение пользователя лежит между этими числами, перед сравнением предположения с загаданным нами числом; мы только проверяли, что оно положительно. В этом случае последствия были не очень страшными: наши сообщения «Слишком много» или «Слишком мало», выводимые в окно вывода, все равно были правильными. Но было бы лучше подталкивать пользователя к правильным догадкам и иметь различное поведение для случаев, когда пользователь предлагает число за пределами ряда, и когда пользователь вводит, например, буквы вместо цифр.
 
-Один из способов добиться этого - пытаться разобрать введённое значение как `i32`, а не как `u32`, чтобы разрешить потенциально отрицательные числа, а затем добавить проверку для нахождение числа в диапазоне, например, так:
+Один из способов добиться этого - пытаться разобрать введённое значение как вид данных `i32`, а не как вид `u32`, чтобы разрешить возможно отрицательные числа, а затем добавить проверку для нахождение числа в ряде, например, так:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch09-error-handling/no-listing-09-guess-out-of-range/src/main.rs:here}}
 ```
 
-Выражение `if` проверяет, находится ли наше значение вне диапазона, сообщает пользователю о проблеме и вызывает `continue`, чтобы начать следующую итерацию цикла и попросить ввести другое число. После выражения `if` мы можем продолжить сравнение значения `guess` с загаданным числом, зная, что `guess` лежит в диапазоне от 1 до 100.
+Условное выражение `if` проверяет, находится ли наше значение вне ряда, сообщает пользователю о неполадке и вызывает `continue`, чтобы начать следующую повторение круговорота и попросить ввести другое число. После выражения `if` мы можем продолжить сравнение значения `guess` с загаданным числом, зная, что `guess` лежит в ряде от 1 до 100.
 
-Однако это не идеальное решение: если бы было чрезвычайно важно, чтобы программа работала только со значениями от 1 до 100, существовало бы много функций, требующих этого, то такая проверка в каждой функции была бы утомительной (и могла бы отрицательно повлиять на производительность).
+Однако это не наилучшее решение: если бы было чрезвычайно важно, чтобы программа работала только со значениями от 1 до 100, существовало бы много функций, требующих этого, то такая проверка в каждой функции была бы утомительной (и могла бы отрицательно повлиять на производительность).
 
-Вместо этого можно создать новый тип и поместить проверки в функцию создания экземпляра этого типа, не повторяя их везде. Таким образом, функции могут использовать новый тип в своих сигнатурах и быть уверены в значениях, которые им передают. Листинг 9-13 показывает один из способов, как определить тип `Guess`, чтобы экземпляр `Guess` создавался только при условии, что функция `new` получает значение от 1 до 100.
+Вместо этого можно создать новый вид данных и поместить проверки в функцию создания образца этого вида данных, не повторяя их везде. Таким образом, функции могут использовать новый вид данных в своих ярлыках и быть уверены в значениях, которые им передают. Приложение 9-13 показывает один из способов, как определить вид данных `Guess`, чтобы образец данных `Guess` создавался только при условии, что функция `new` получает значение от 1 до 100.
 
 
 {{#include ../listings/ch09-error-handling/listing-09-13/src/main.rs:here}}
 ```
 
-Листинг 9-13. Тип Guess, который будет создавать экземпляры только для значений от 1 до 100
+Приложение 9-13: Вид данных Guess, который будет создавать образцы только для значений от 1 до 100
 
-Сначала мы определяем структуру с именем `Guess`, которая имеет поле с именем `value` типа `i32`, в котором будет храниться число.
+Сначала мы определяем вид данных с именем `Guess`, которая имеет поле с именем `value` вида данных `i32`, в котором будет храниться число.
 
-Затем мы реализуем ассоциированную функцию `new`, создающую экземпляры значений типа `Guess`. Функция `new`  имеет один параметр `value` типа `i32`, и возвращает `Guess`. Код в теле функции `new` проверяет, что значение `value` находится между 1 и 100. Если `value` не проходит эту проверку, мы вызываем `panic!`, которая оповестит программиста, написавшего вызывающий код, что в его коде есть ошибка, которую необходимо исправить, поскольку попытка создания `Guess` со значением `value` вне заданного диапазона нарушает контракт, на который полагается `Guess::new`. Условия, в которых `Guess::new` паникует, должны быть описаны в документации к API; мы рассмотрим соглашения о документации, указывающие на возможность появления `panic!` в документации API, которую вы создадите в Главе 14. Если `value` проходит проверку, мы создаём новый экземпляр `Guess`, у которого значение поля  `value` равно значению параметра `value`, и возвращаем `Guess`.
+Затем мы выполняем сопряженную функцию `new`, создающую образцы значений вида данных `Guess`. Функция `new`  имеет одно свойство `value` вида данных `i32`, и возвращает `Guess`. Рукопись в теле функции `new` проверяет, что значение `value` находится между 1 и 100. Если `value` не проходит эту проверку, мы вызываем `panic!`, которая оповестит программиста, написавшего вызывающую рукопись, что в его рукописи есть ошибка, которую необходимо исправить, поскольку попытка создания `Guess` со значением `value` вне заданного ряда нарушает договор, на который полагается `Guess::new`. Условия, в которых `Guess::new` вызывает сбой, должны быть описаны в пособии к API; мы рассмотрим соглашения о пособия, указывающие на возможность появления `panic!` в пособии API, которую вы создадите в Главе 14. Если `value` проходит проверку, мы создаём новый образец данных `Guess`, у которого значение поля  `value` равно значению свойства `value`, и возвращаем `Guess`.
 
-Затем мы реализуем метод с названием `value`, который заимствует `self`, не имеет других параметров, и возвращает значение типа `i32`. Этот метод иногда называют *извлекатель* (getter), потому что его цель состоит в том, чтобы извлечь данные из полей структуры и вернуть их. Этот публичный метод является необходимым, поскольку поле `value` структуры `Guess`  является приватным. Важно, чтобы поле `value` было приватным, чтобы код, использующий структуру `Guess`, не мог устанавливать `value` напрямую: код снаружи модуля *должен* использовать функцию `Guess::new` для создания экземпляра `Guess`, таким образом гарантируя, что у `Guess` нет возможности получить `value`, не проверенное условиями в функции `Guess::new`.
+Затем мы выполняем способ с названием `value`, который заимствует `self`, не имеет других свойств, и возвращает значение вида данных `i32`. Этот способ иногда называют *извлекатель* (getter), потому что его цель состоит в том, чтобы извлечь данные из полей стопки и вернуть их. Этот открытый способ является необходимым, поскольку поле `value` стопки `Guess`  является закрытым. Важно, чтобы поле `value` было закрытым, чтобы рукопись, использующая вид данных `Guess`, не могла устанавливать `value` напрямую: рукопись снаружи раздела *должна* использовать функцию `Guess::new` для создания образца данных `Guess`, таким образом обеспечивая, что у `Guess` нет возможности получить `value`, не проверенное условиями в функции `Guess::new`.
 
-Функция, которая принимает или возвращает только числа от 1 до 100, может объявить в своей сигнатуре, что она принимает или возвращает `Guess`, вместо `i32`, таким образом не будет необходимости делать дополнительные проверки в теле такой функции.
+Функция, которая принимает или возвращает только числа от 1 до 100, может объявить в своей ярлыке, что она принимает или возвращает вид данных `Guess`, вместо `i32`, таким образом не будет необходимости делать дополнительные проверки в теле такой функции.
 
 ## Итоги
 
-Функции обработки ошибок в Rust призваны помочь написанию более надёжного кода. Макрос `panic!` сигнализирует, что ваша программа находится в состоянии, которое она не может обработать, и позволяет сказать процессу чтобы он прекратил своё выполнение, вместо попытки продолжить выполнение с некорректными или неверными значениями. Перечисление `Result` использует систему типов Rust, чтобы сообщить, что операции могут завершиться неудачей, и ваш код мог восстановиться. Можно использовать `Result`, чтобы сообщить вызывающему коду, что он должен обрабатывать потенциальный успех или потенциальную неудачу. Использование `panic!` и `Result` правильным образом сделает ваш код более надёжным перед лицом неизбежных проблем.
+Функции обработки ошибок в Ржавчине призваны помочь написанию более надёжного рукописи. Макрос `panic!` указывает , что ваша программа находится в состоянии, которое она не может обработать, и позволяет сказать этапу чтобы он прекратил своё выполнение, вместо попытки продолжить выполнение с неправильными или неверными значениями. Перечисление `Result` использует систему видов Ржавчине, чтобы сообщить, что действия могут завершиться неудачей, и Ваша рукопись могла восстановиться. Можно использовать способ `Result`, чтобы сообщить вызывающей рукописи, что она должна обрабатывать вероятный успех или вероятную неудачу. Использование `panic!` и `Result` правильным образом сделает вашу рукопись более надёжной перед лицом неизбежных неполадок.
 
-Теперь, когда вы увидели полезные способы использования  обобщённых типов `Option` и `Result` в стандартной библиотеке, мы поговорим о том, как работают обобщённые типы и как вы можете использовать их в своём коде.
+Теперь, когда вы увидели полезные способы использования  обобщённых видов данных `Option` и `Result` во встроенной библиотеке, мы поговорим о том, как работают обобщённые виды и как вы можете использовать их в своей рукописи.
 
 
-[“Кодирование состояний и поведения на основе типов”]: ch17-03-oo-design-patterns.html#encoding-states-and-behavior-as-types
\ No newline at end of file
+[“Кодирование состояний и поведения на основе видов”]: ch17-03-oo-design-patterns.html#encoding-states-and-behavior-as-types
\ No newline at end of file
diff --git a/rustbook-ru/src/ch10-00-generics.md b/rustbook-ru/src/ch10-00-generics.md
index 35e5660a6..f889bae80 100644
--- a/rustbook-ru/src/ch10-00-generics.md
+++ b/rustbook-ru/src/ch10-00-generics.md
@@ -1,20 +1,20 @@
-# Обобщённые типы, типажи и время жизни
+# Обобщённые виды данных, сущности и время жизни
 
-Каждый язык программирования имеет в своём арсенале эффективные средства борьбы с дублированием кода. В Rust одним из таких инструментов являются обобщённые типы данных - *generics*. Это абстрактные подставные типы на место которых возможно поставить какой-либо конкретный тип или другое свойство. Когда мы пишем код, мы можем выразить поведение обобщённых типов или их связь с другими обобщёнными типами, не зная какой тип будет использован на их месте при компиляции и запуске кода.
+Каждый язык программирования имеет в своём запасе производительные средства борьбы с повторением рукописи. В Ржавчине одним из таких средств являются обобщённые виды данных - *generics*. Это абстрактные подставные виды данных на место которых возможно поставить какой-либо определенный вид данных или другое свойство. Когда мы пишем рукопись, мы можем выразить поведение обобщённых видов данных или их связь с другими обобщёнными видами данных, не зная какой вид данных будет использован на их месте при сборке и запуске рукописи.
 
-Функции могут принимать параметры некоторого "обобщённого" типа вместо привычных "конкретных" типов, вроде `i32` или `String`. Аналогично, функция принимает параметры с неизвестными заранее значениями, чтобы выполнять одинаковые действия над несколькими конкретными значениями. На самом деле мы уже использовали обобщённые типы данных в Главе 6 (`Option`), в Главе 8 (`Vec` и `HashMap`) и в Главе 9 (`Result`). В этой главе вы узнаете, как определить собственные типы данных, функции и методы, используя возможности обобщённых типов.
+Функции могут принимать свойства некоторого "обобщённого" вида данных вместо привычных "определенных" видов данных, вроде `i32` или `String`. Подобно, функция принимает свойства с неизвестными заранее значениями, чтобы выполнять одинаковые действия над несколькими определенными значениями. На самом деле мы уже использовали обобщённые виды данных в Главе 6 (`Option`), в Главе 8 (`Vec` и `HashMap`) и в Главе 9 (`Result`). В этой главе вы узнаете, как определить собственные виды данных, функции и способы, используя возможности обобщённых видов данных.
 
-Прежде всего, мы рассмотрим как для уменьшения дублирования извлечь из кода некоторую общую функциональность. Далее, мы будем использовать тот же механизм для создания обобщённой функции из двух функций, которые отличаются только типом их параметров. Мы также объясним, как использовать обобщённые типы данных при определении структур и перечислений.
+Прежде всего, мы рассмотрим как для уменьшения повторения извлечь из рукописи некоторую общую возможность. Далее, мы будем использовать тот же рычаг для создания обобщённой функции из двух функций, которые отличаются только видом данных их свойств. Мы также объясним, как использовать обобщённые виды данных при определении стопок и перечислений.
 
-После этого мы изучим как использовать типажи (traits) для определения поведения в обобщённом виде. Можно комбинировать типажи с обобщёнными типами, чтобы обобщённый тип мог принимать только такие типы, которые имеют определённое поведение, а не все подряд.
+После этого мы изучим как использовать сущности (traits) для определения поведения в обобщённом виде данных. Можно соединить сущности с обобщёнными видами данных, чтобы обобщённый вид данных мог принимать только такие виды данных, которые имеют определённое поведение, а не все подряд.
 
-В конце мы обсудим *времена жизни (lifetimes)*, вариации обобщённых типов, которые дают компилятору информацию о том, как сроки жизни ссылок относятся друг к другу. Времена жизни позволяют нам указать дополнительную информацию об "одолженных" (borrowed) значениях, которая позволит компилятору удостовериться в корректности используемых ссылок в тех ситуациях, когда компилятор не может сделать это автоматически.
+В конце мы обсудим *времена жизни (lifetimes)*, вариации обобщённых видов данных, которые дают сборщику сведения о том, как сроки жизни ссылок относятся друг к другу. Времена жизни позволяют нам указать дополнительные сведения об "одолженных" (borrowed) значениях, которая позволит сборщику удостовериться в соблюдения правил используемых ссылок в тех случаях, когда сборщик не может сделать это самостоятельно .
 
-## Удаление дублирования кода с помощью выделения общей функциональности
+## Удаление повторения рукописи с помощью выделения общей возможности
 
-В обобщениях мы можем заменить конкретный тип на "заполнитель" (placeholder), обозначающую несколько типов, что позволяет удалить дублирующийся код. Прежде чем углубляться в синтаксис обобщённых типов, давайте сначала посмотрим, как удалить дублирование, не задействуя универсальные типы, путём извлечения функции, которая заменяет определённые значения заполнителем, представляющим несколько значений. Затем мы применим ту же технику для извлечения универсальной функции! Изучив, как распознать дублированный код, который можно извлечь в функцию, вы начнёте распознавать дублированный код, который может использовать обобщённые типы.
+В обобщениях мы можем заменить определенный вид данных на "исполнитель" (placeholder), обозначающую несколько видов данных, что позволяет удалить повторяющуюся рукопись. Прежде чем углубляться в правила написания обобщённых видов, давайте сначала посмотрим, как удалить повторение, не задействуя гибкие виды данных, путём извлечения функции, которая заменяет определённые значения исполнителем, представляющим несколько значений. Затем мы применим ту же технику для извлечения гибкой функции! Изучив, как распознать повторяющуюся рукопись, которую можно извлечь в функцию, вы начнёте распознавать повторяющуюся рукопись, которая может использовать обобщённые виды данных.
 
-Начнём с короткой программы в листинге 10-1, которая находит наибольшее число в списке.
+Начнём с короткой программы в приложении 10-1, которая находит наибольшее число в списке.
 
 Файл: src/main.rs
 
@@ -22,11 +22,11 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/src/main.rs:here}}
 ```
 
-Листинг 10-1: Поиск наибольшего числа в списке чисел
+Приложение 10-1: Поиск наибольшего числа в списке чисел
 
-Сохраним список целых чисел в переменной `number_list` и поместим первое значение из списка в переменную `largest`. Далее, переберём все элементы списка, и, если текущий элемент больше числа сохранённого в переменной `largest`, заменим значение в этой переменной. Если текущий элемент меньше или равен "наибольшему", найденному ранее, значение переменной оставим прежним и перейдём к следующему элементу списка. После перебора всех элементов списка переменная `largest` должна содержать наибольшее значение, которое в нашем случае будет равно 100.
+Сохраним список целых чисел в переменной `number_list` и поместим первое значение из списка в переменную `largest`. Далее, переберём все переменные списка, и, если текущая переменная больше числа сохранённого в переменной `largest`, заменим значение в этой переменной. Если текущая переменная меньше или равна "наибольшему", найденному ранее, значение переменной оставим прежним и перейдём к следующей переменной списка. После перебора всех переменных списка переменная `largest` должна содержать наибольшее значение, которое в нашем случае будет равно 100.
 
-Теперь перед нами стоит задача найти наибольшее число в двух разных списках. Для этого мы можем дублировать код из листинга 10-1 и использовать ту же логику в двух разных местах программы, как показано в листинге 10-2.
+Теперь перед нами стоит задача найти наибольшее число в двух разных списках. Для этого мы можем повторять рукопись из приложения 10-1 и использовать тот же ход мыслей в двух разных местах программы, как показано в приложении 10-2.
 
 Файл: src/main.rs
 
@@ -34,13 +34,13 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/src/main.rs}}
 ```
 
-Листинг 10-2: Код для поиска наибольшего числа в двух списках чисел
+Приложение 10-2: Рукопись для поиска наибольшего числа в двух списках чисел
 
-Несмотря на то, что код программы работает, дублирование кода утомительно и подвержено ошибкам. При внесении изменений мы должны не забыть обновить каждое место, где код дублируется.
+Несмотря на то, что рукопись программы работает, повторение рукописи утомительно и подвержено ошибкам. При внесении изменений мы должны не забыть обновить каждое место, где рукопись повторяется.
 
-Для устранения дублирования мы можем создать дополнительную абстракцию с помощью функции которая сможет работать с любым списком целых чисел переданным ей в качестве входного параметра и находить для этого списка наибольшее число. Данное решение делает код более ясным и позволяет абстрактным образом реализовать алгоритм поиска наибольшего числа в списке.
+Для устранения повторения мы можем создать дополнительную абстракцию с помощью функции которая сможет работать с любым списком целых чисел переданным ей в качестве входного свойства и находить для этого списка наибольшее число. Данное решение делает рукопись более ясным и позволяет абстрактным образом выполнить распорядок поиска наибольшего числа в списке.
 
-В листинге 10-3 мы извлекаем код, который находит наибольшее число, в функцию с именем  `largest`. Затем мы вызываем функцию, чтобы найти наибольшее число в двух списках из листинга 10-2. Мы также можем использовать эту функцию для любого другого списка значений `i32` , который может встретиться позже.
+В приложении 10-3 мы извлекаем рукопись, которая находит наибольшее число, в функцию с именем  `largest`. Затем мы вызываем функцию, чтобы найти наибольшее число в двух списках из приложения 10-2. Мы также можем использовать эту функцию для любого другого списка значений `i32` , который может встретиться позже.
 
 Файл: src/main.rs
 
@@ -48,18 +48,18 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/src/main.rs:here}}
 ```
 
-Листинг 10-3: Абстрактный код для поиска наибольшего числа в двух списках
+Приложение 10-3: Абстрактный рукопись для поиска наибольшего числа в двух списках
 
-Функция `largest` имеет параметр с именем `list`, который представляет любой срез значений типа `i32`, которые мы можем передать в неё. В результате вызова функции, код выполнится с конкретными, переданными в неё значениями.
+Функция `largest` имеет свойство с именем `list`, который представляет любой срез значений вида данных `i32`, которые мы можем передать в неё. В итоге вызова функции, рукопись выполнится с определенными, переданными в неё значениями.
 
-Итак, вот шаги выполненные для изменения кода из листинга 10-2 в листинг 10-3:
+Итак, вот шаги выполненные для изменения рукописи из приложения 10-2 в приложение 10-3:
 
-1. Определить дублирующийся код.
-2. Извлечь дублирующийся код и поместить его в тело функции, определив входные и выходные значения этого кода в сигнатуре функции.
-3. Обновить и заменить два участка дублирующегося кода вызовом одной функции.
+1. Определить повторяющуюся рукопись.
+2. Извлечь повторяющуюся рукопись и поместить ее в тело функции, определив входные и выходные значения этой рукописи в ярлыке функции.
+3. Обновить и заменить два участка повторяющегося рукописи вызовом одной функции.
 
-Далее, чтобы уменьшить дублирование кода, мы воспользуемся теми же шагами для обобщённых типов. Обобщённые типы позволяют работать над абстрактными типами таким же образом, как тело функции может работать над абстрактным списком `list` вместо конкретных значений.
+Далее, чтобы уменьшить повторение рукописи, мы воспользуемся теми же шагами для обобщённых видов данных. Обобщённые виды данных позволяют работать над абстрактными видами данных таким же образом, как тело функции может работать над абстрактным списком `list` вместо определенных значений.
 
-Например, у нас есть две функции: одна ищет наибольший элемент внутри среза значений типа `i32`, а другая внутри среза значений типа `char`. Как уменьшить такое дублирование? Давайте выяснять!
+Например, у нас есть две функции: одна ищет наибольшее значение внутри среза значений вида данных `i32`, а другая внутри среза значений вида данных `char`. Как уменьшить такое повторение? Давайте выяснять!
 
 
diff --git a/rustbook-ru/src/ch10-01-syntax.md b/rustbook-ru/src/ch10-01-syntax.md
index 400e9bc83..7ebf5d01f 100644
--- a/rustbook-ru/src/ch10-01-syntax.md
+++ b/rustbook-ru/src/ch10-01-syntax.md
@@ -1,12 +1,12 @@
-## Обобщённые типы данных
+## Обобщённые виды данных
 
-Мы используем обобщённые типы данных для объявления функций или структур, которые затем можно использовать с различными конкретными типами данных. Давайте сначала посмотрим, как объявлять функции, структуры, перечисления и методы, используя обобщённые типы данных. Затем мы обсудим, как обобщённые типы данных влияют на производительность кода.
+Мы используем обобщённые виды данных для объявления функций или стопок, которые затем можно использовать с различными определенными видами данных. Давайте сначала посмотрим, как объявлять функции, стопки, перечисления и способы, используя обобщённые виды данных. Затем мы обсудим, как обобщённые виды данных влияют на производительность рукописи.
 
 ### В объявлении функций
 
-Когда мы объявляем функцию с обобщёнными типами, мы размещаем обобщённые типы в сигнатуре функции, где мы обычно указываем типы данных аргументов и возвращаемого значения. Используя обобщённые типы, мы делаем код более гибким и предоставляем большую функциональность при вызове нашей функции, предотвращая дублирование кода.
+Когда мы объявляем функцию с обобщёнными видами данных, мы размещаем обобщённые виды данных в ярлыке функции, где мы обычно указываем виды данных переменных и возвращаемого значения. Используя обобщённые виды данных, мы делаем рукопись более гибким и предоставляем большую возможность при вызове нашей функции, предотвращая повторение рукописи.
 
-Рассмотрим пример с функцией `largest`. Листинг 10-4 показывает две функции, каждая из которых находит самое большое значение в срезе своего типа. Позже мы объединим их в одну функцию, использующую обобщённые типы данных.
+Рассмотрим пример с функцией `largest`. Приложение 10-4 показывает две функции, каждая из которых находит самое большое значение в срезе своего вида данных. Позже мы объединим их в одну функцию, использующую обобщённые виды данных.
 
 Файл: src/main.rs
 
@@ -14,21 +14,21 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/src/main.rs:here}}
 ```
 
-Листинг 10-4: две функции, отличающиеся только именем и типом обрабатываемых данных
+Приложение 10-4: Две функции, отличающиеся только именем и видом обрабатываемых данных
 
-Функция `largest_i32` уже встречалась нам: мы извлекли её в листинге 10-3, когда боролись с дублированием кода — она находит наибольшее значение типа `i32` в срезе. Функция `largest_char` находит самое большое значение типа `char` в срезе. Тело у этих функций одинаковое, поэтому давайте избавимся от дублируемого кода, используя параметр обобщённого типа в одной функции.
+Функция `largest_i32` уже встречалась нам: мы извлекли её в приложении 10-3, когда боролись с повторением рукописи — она находит наибольшее значение вида данных `i32` в срезе. Функция `largest_char` находит самое большое значение вида данных `char` в срезе. Тело у этих функций одинаковое, поэтому давайте избавимся от повторной рукописи, используя свойство обобщённого вида данных в одной функции.
 
-Для параметризации типов данных в новой объявляемой функции нам нужно дать имя обобщённому типу — так же, как мы это делаем для аргументов функций. Можно использовать любой идентификатор для имени параметра типа, но мы будем использовать `T`, потому что по соглашению имена параметров в Rust должны быть короткими (обычно длиной в один символ), а именование типов в Rust делается в нотации UpperCamelCase. Сокращение слова «type» до одной буквы `T` является стандартным выбором большинства программистов, использующих язык Rust.
+Для изменения свойств видов данных, в новой объявляемой функции нам нужно дать имя обобщённому виду данных — так же, как мы это делаем для переменных функций. Можно использовать любой определитель для имени свойства вида данных, но мы будем использовать `T`, потому что по соглашению имена свойств в Ржавчине должны быть короткими (обычно длиной в один знак), а именование видов данных в Ржавчине делается в наставлении UpperCamelCase. Сокращение слова «type» до одной буквы `T` является обычным выбором большинства программистов, использующих язык Ржавчина.
 
-Когда мы используем параметр в теле функции, мы должны объявить имя параметра в сигнатуре, чтобы компилятор знал, что означает это имя. Аналогично когда мы используем имя типа параметра в сигнатуре функции, мы должны объявить это имя раньше, чем мы его используем. Чтобы определить обобщённую функцию `largest`, поместим объявление имён параметров в треугольные скобки `<>` между именем функции и списком параметров, как здесь:
+Когда мы используем свойство в теле функции, мы должны объявить имя свойства в ярлыке, чтобы сборщик знал, что означает это имя. Подобно когда мы используем имя вида данных свойства в ярлыке функции, мы должны объявить это имя раньше, чем мы его используем. Чтобы определить обобщённую функцию `largest`, поместим объявление имён свойств в треугольные скобки `<>` между именем функции и списком свойств, как здесь:
 
 ```rust,ignore
 fn largest(list: &[T]) -> &T {
 ```
 
-Объявление читается так: функция `largest` является обобщённой по типу `T`. Эта функция имеет один параметр с именем `list`, который является срезом значений с типом данных `T`. Функция `largest` возвращает значение этого же типа `T`.
+Объявление читается так: функция `largest` является обобщённой по виду данных `T`. Эта функция имеет одно свойство с именем `list`, который является срезом значений с видом данных `T`. Функция `largest` возвращает значение этого же вида данных `T`.
 
-Листинг 10-5 показывает определение функции `largest` с использованием обобщённых типов данных в её сигнатуре. Листинг также показывает, как мы можем вызвать функцию со срезом данных типа `i32` или `char`. Данный код пока не будет компилироваться, но мы исправим это к концу раздела.
+Приложение 10-5 показывает определение функции `largest` с использованием обобщённых видов данных в её ярлыке. Приложение также показывает, как мы можем вызвать функцию со срезом данных вида данных `i32` или `char`. Данная рукопись пока не будет собираться, но мы исправим это к концу раздела.
 
 Файл: src/main.rs
 
@@ -36,19 +36,19 @@ fn largest(list: &[T]) -> &T {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/src/main.rs}}
 ```
 
-Листинг 10-5: функция largest, использующая параметры обобщённого типа; пока ещё не компилируется
+Приложение 10-5: Функция largest, использующая свойства обобщённого вида данных; пока ещё не собирается
 
-Если мы скомпилируем программу сейчас, мы получим следующую ошибку:
+Если мы соберем программу сейчас, мы получим следующую ошибку:
 
 ```console
 {{#include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt}}
 ```
 
-В подсказке упоминается `std::cmp::PartialOrd`, который является *типажом*. Мы поговорим про типажи в следующем разделе. Сейчас ошибка в функции `largest` указывает, что функция не будет работать для всех возможных типов `T`. Так как мы хотим сравнивать значения типа `T` в теле функции, мы можем использовать только те типы, данные которых можно упорядочить: можем упорядочить — значит, можем и сравнить. Чтобы можно было задействовать сравнения, стандартная библиотека имеет типаж `std::cmp::PartialOrd`, который вы можете реализовать для типов (смотрите дополнение С для большей информации про данный типаж). Следуя совету в сообщении компилятора, ограничим тип `T` теми вариантами, которые поддерживают типаж `PartialOrd`, и тогда пример успешно  скомпилируется, так как стандартная библиотека реализует `PartialOrd` как для типа `i32`, так и для типа `char`.
+В подсказке упоминается `std::cmp::PartialOrd`, который является *сущностью*. Мы поговорим про сущности в следующем разделе. Сейчас ошибка в функции `largest` указывает, что функция не будет работать для всех возможных видов данных `T`. Так как мы хотим сравнивать значения вида данных `T` в теле функции, мы можем использовать только те виды данных, данные которых можно упорядочить: можем упорядочить — значит, можем и сравнить. Чтобы можно было задействовать сравнения, обычная библиотека имеет сущность `std::cmp::PartialOrd`, который вы можете использовать для видов данных (смотрите дополнение С для больших сведений про данную сущность). Следуя совету в сообщении сборщика, ограничим вид данных `T` теми исходами, которые поддерживают сущность `PartialOrd`, и тогда пример успешно  собирается, так как обычная библиотека использует `PartialOrd` как для вида данных `i32`, так и для вида данных `char`.
 
-### В определении структур
+### Определение видов данных
 
-Мы также можем определить структуры, использующие обобщённые типы в одном или нескольких своих полях, с помощью синтаксиса `<>`. Листинг 10-6 показывает, как определить структуру `Point`, чтобы хранить поля координат `x` и `y` любого типа данных.
+Мы также можем определить вид данных, использующие обобщённые виды в одном или нескольких своих полях, с помощью правил написания `<>`. Приложение 10-6 показывает, как определить вид данных `Point`, чтобы хранить поля координат `x` и `y` любого вида данных.
 
 Файл: src/main.rs
 
@@ -56,11 +56,11 @@ fn largest(list: &[T]) -> &T {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/src/main.rs}}
 ```
 
-Листинг 10-6: структура Point, содержащая поля x и y типа T
+Приложение 10-6: Стопки Point, содержащая поля x и y вида данных T
 
-Синтаксис использования обобщённых типов в определении структуры очень похож на синтаксис в определении функции. Сначала мы объявляем имена типов параметров внутри треугольных скобок сразу после названия структуры. Затем мы можем использовать обобщённые типы в определении структуры в тех местах, где ранее мы указывали бы конкретные типы.
+Правила написания использования обобщённых видов данных в определении стопки очень похож на правила написания в определении функции. Сначала мы объявляем имена видов данных свойств внутри треугольных скобок сразу после названия стопки. Затем мы можем использовать обобщённые виды данных в определении стопки в тех местах, где ранее мы указывали бы определенные виды данных.
 
-Так как мы используем только один обобщённый тип данных для определения структуры `Point`, это определение означает, что структура `Point` является обобщённой с типом `T`, и оба поля `x` и y имеют одинаковый тип, каким бы он не являлся. Если мы создадим экземпляр структуры `Point` со значениями разных типов, как показано в листинге 10-7, наш код не скомпилируется.
+Так как мы используем только один обобщённый вид данных для определения стопки `Point`, это определение означает, что стопка `Point` является обобщённой с видом данных `T`, и оба поля `x` и y имеют одинаковый вид данных, каким бы он не являлся. Если мы создадим образец данных стопки `Point` со значениями разных видов данных, как показано в приложении 10-7, наша рукопись не соберется.
 
 Файл: src/main.rs
 
@@ -68,15 +68,15 @@ fn largest(list: &[T]) -> &T {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/src/main.rs}}
 ```
 
-Листинг 10-7: поля x и y должны быть одного типа, так как они имеют один и тот же обобщённый тип T
+Приложение 10-7: Поля x и y должны быть одного вида данных, так как они имеют один и тот же обобщённый вид данных T
 
-В этом примере, когда мы присваиваем целочисленное значение 5 переменной `x` , мы сообщаем компилятору, что обобщённый тип `T` будет целым числом для этого экземпляра `Point`. Затем, когда мы указываем значение 4.0 (имеющее тип, отличный от целого числа) для `y`, который по нашему определению должен иметь тот же тип, что и `x`, мы получим ошибку несоответствия типов:
+В этом примере, когда мы присваиваем целочисленное значение 5 переменной `x` , мы сообщаем сборщику, что обобщённый вид данных `T` будет целым числом для этого образца данных `Point`. Затем, когда мы указываем значение 4.0 (имеющее вид данных, отличный от целого числа) для `y`, который по нашему определению должен иметь тот же вид данных, что и `x`, мы получим ошибку несоответствия видов данных:
 
 ```console
 {{#include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt}}
 ```
 
-Чтобы определить структуру `Point`, где оба значения `x` и `y` являются обобщёнными, но различными типами, можно использовать несколько параметров обобщённого типа. Например, в листинге 10-8 мы изменим определение `Point` таким образом, чтобы оно использовало обобщённые типы `T` и `U`, где `x` имеет тип `T` а `y` имеет тип `U`.
+Чтобы определить вид данных `Point`, где оба значения `x` и `y` являются обобщёнными, но различными видами данных, можно использовать несколько свойств обобщённого вида данных. Например, в приложении 10-8 мы изменим определение `Point` таким образом, чтобы оно использовало обобщённые виды данных `T` и `U`, где `x` имеет вид данных `T` а `y` имеет вид данных `U`.
 
 Файл: src/main.rs
 
@@ -84,13 +84,13 @@ fn largest(list: &[T]) -> &T {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/src/main.rs}}
 ```
 
-Листинг 10-8: структура Point<T, U> обобщена для двух типов, так что x и y могут быть значениями разных типов
+Приложение 10-8: Стопки Point<T, U> обобщена для двух видов данных, так что x и y могут быть значениями разных видов данных
 
-Теперь разрешены все показанные экземпляры типа `Point`! В объявлении можно использовать сколь угодно много параметров обобщённого типа, но если делать это в большом количестве, код будет тяжело читать. Если в вашем коде требуется много обобщённых типов, возможно, стоит разбить его на более мелкие части.
+Теперь разрешены все показанные образцы вида данных `Point`! В объявлении можно использовать сколь угодно много свойств обобщённого вида данных, но если делать это в большом количестве, рукопись будет тяжело читать. Если в вашей рукописи требуется много обобщённых видов данных, возможно, стоит разбить её на более мелкие части.
 
 ### В определениях перечислений
 
-Как и структуры, перечисления также могут хранить обобщённые типы в своих вариантах. Давайте ещё раз посмотрим на перечисление `Option`, предоставленное стандартной библиотекой, которое мы использовали в главе 6:
+Как и стопки, перечисления также могут хранить обобщённые виды данных в своих исходах. Давайте ещё раз посмотрим на перечисление `Option`, предоставленное встроенной библиотекой, которое мы использовали в главе 6:
 
 ```rust
 enum Option {
@@ -99,9 +99,9 @@ enum Option {
 }
 ```
 
-Это определение теперь должно быть вам более понятно. Как видите,  перечисление `Option` является обобщённым по типу `T` и имеет два варианта: вариант `Some`, который содержит одно значение типа `T`, и вариант `None`, который не содержит никакого значения. Используя перечисление `Option`, можно выразить абстрактную концепцию необязательного значения — и так как `Option` является обобщённым, можно использовать эту абстракцию независимо от того, каким будет тип необязательного значения.
+Это определение теперь должно быть вам более понятно. Как видите,  перечисление `Option` является обобщённым по виду данных `T` и имеет два исхода: исход `Some`, который содержит одно значение вида данных `T`, и исход `None`, который не содержит никакого значения. Используя перечисление `Option`, можно выразить абстрактную подход необязательного значения — и так как `Option` является обобщённым, можно использовать эту абстракцию независимо от того, каким будет вид данных необязательного значения.
 
-Перечисления также могут использовать несколько обобщённых типов. Определение перечисления `Result`, которое мы упоминали в главе 9, является примером такого использования:
+Перечисления также могут использовать несколько обобщённых видов данных. Определение перечисления `Result`, которое мы упоминали в главе 9, является примером такого использования:
 
 ```rust
 enum Result {
@@ -110,13 +110,13 @@ enum Result {
 }
 ```
 
-Перечисление `Result` имеет два обобщённых типа: `T` и `E` — и два варианта:  `Ok`, который содержит тип `T`, и `Err`, содержащий тип `E`. С таким определением удобно использовать перечисление `Result` везде, где операции могут быть выполнены успешно (возвращая значение типа `T`) или неуспешно (возвращая ошибку типа `E`). Это то, что мы делали при открытии файла в листинге 9-3, где `T` заполнялось типом `std::fs::File`, если файл был открыт успешно, либо `E` заполнялось типом  `std::io::Error`, если при открытии файла возникали какие-либо проблемы.
+Перечисление `Result` имеет два обобщённых вида данных: `T` и `E` — и два исхода:  `Ok`, который содержит вид данных `T`, и `Err`, содержащий вид данных `E`. С таким определением удобно использовать перечисление `Result` везде, где действия могут быть выполнены успешно (возвращая значение вида данных `T`) или неуспешно (возвращая ошибку вида данных `E`). Это то, что мы делали при открытии файла в приложении 9-3, где `T` заполнялось видом `std::fs::File`, если файл был открыт успешно, либо `E` заполнялось видом  `std::io::Error`, если при открытии файла возникали какие-либо сбои.
 
-Если вы встречаете в коде ситуации, когда несколько определений структур или перечислений отличаются только типами содержащихся в них значений, вы можете устранить дублирование, используя обобщённые типы.
+Если вы встречаете в рукописи случаи, когда несколько определений стопок или перечислений отличаются только видами данных , содержащихся в них значений, вы можете устранить повторение, используя обобщённые виды данных.
 
-### В определении методов
+### В определении стопок
 
-Мы можем реализовать методы для структур и перечислений (как мы делали в главе 5) и в определениях этих методов также использовать обобщённые типы. В листинге 10-9 показана структура `Point`, которую мы определили в листинге 10-6, с добавленным для неё методом `x`.
+Мы можем использовать способы для стопок и перечислений (как мы делали в главе 5) и в определениях этих способов также использовать обобщённые виды данных. В приложении 10-9 показана стопки `Point`, которую мы определили в приложении 10-6, с добавленным для неё способом `x`.
 
 Файл: src/main.rs
 
@@ -124,13 +124,13 @@ enum Result {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/src/main.rs}}
 ```
 
-Листинг 10-9: Реализация метода с именем x у структуры Point<T>, которая будет возвращать ссылку на поле x типа T
+Приложение 10-9: Использование способа с именем x у стопки Point<T>, которая будет возвращать ссылку на поле x вида данных T
 
-Здесь мы определили метод с именем `x` у структуры `Point`, который возвращает ссылку на данные в поле `x`.
+Здесь мы определили способ с именем `x` у стопки `Point`, который возвращает ссылку на данные в поле `x`.
 
-Обратите внимание, что мы должны объявить `T` сразу после `impl` .  В этом случае мы можем использовать `T` для указания на то, что реализуем метод для типа `Point`. Объявив `T` универсальным типом сразу после `impl` , Rust может определить, что тип в угловых скобках в `Point` является универсальным, а не конкретным типом. Мы могли бы выбрать другое имя для этого обобщённого параметра, отличное от имени, использованного в определении структуры, но обычно используют одно и то же имя. Методы, написанные внутри раздела `impl` , который использует обобщённый тип, будут определены для любого экземпляра типа, независимо от того, какой конкретный тип в конечном итоге будет подставлен вместо этого обобщённого.
+Обратите внимание, что мы должны объявить `T` сразу после `impl` .  В этом случае мы можем использовать `T` для указания на то, что выполняем способ для вида данных `Point`. Объявив `T` гибким видом данных сразу после `impl` , Ржавчина может определить, что вид данных в угловых скобках в `Point` является гибким, а не определенным видом данных. Мы могли бы выбрать другое имя для этого обобщённого свойства, отличное от имени, использованного в определении стопки, но обычно используют одно и то же имя. Способы, написанные внутри раздела `impl` , который использует обобщённый вид данных, будут определены для любого образца вида данных, независимо от того, какой определенный вид данных в конечном итоге будет подставлен вместо этого обобщённого.
 
-Мы можем также указать ограничения, какие обобщённые типы разрешено использовать при определении методов. Например, мы могли бы реализовать методы только для экземпляров типа `Point`, а не для экземпляров `Point`, в которых используется произвольный обобщённый тип. В листинге 10-10 мы используем конкретный тип `f32`, что означает, что мы не определяем никакие типы после `impl`.
+Мы можем также указать ограничения, какие обобщённые виды данных разрешено использовать при определении способов. Например, мы могли бы использовать способы только для образцов вида данных `Point`, а не для образцов `Point`, в которых используется произвольный обобщённый вид данных. В приложении 10-10 мы используем определенный вид данных `f32`, что означает, что мы не определяем никакие виды данных после `impl`.
 
 Файл: src/main.rs
 
@@ -138,11 +138,11 @@ enum Result {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/src/main.rs:here}}
 ```
 
-Листинг 10-10: блок impl, который применяется только к структуре, имеющей конкретный тип для параметра обобщённого типа T
+Приложение 10-10: Разделimpl, который применяется только к стопке, имеющей определенный вид данных для свойства обобщённого вида данных T
 
-Этот код означает, что тип `Point` будет иметь метод с именем `distance_from_origin`, а другие экземпляры `Point`, где `T` имеет тип, отличный от `f32`, не будут иметь этого метода. Метод вычисляет, насколько далеко наша точка находится от точки с координатами (0.0, 0.0), и использует математические операции, доступные только для типов с плавающей точкой.
+Эта рукопись означает, что вид данных `Point` будет иметь способ с именем `distance_from_origin`, а другие образцы `Point`, где `T` имеет вид данных, отличный от `f32`, не будут иметь этого способа. Способ вычисляет, насколько далеко наша точка находится от точки с координатами (0.0, 0.0), и использует математические действия, доступные только для видов данных с плавающей точкой.
 
-Параметры обобщённого типа, которые мы используем в определении структуры, не всегда совпадают с аналогами, использующимися в сигнатурах методов этой структуры. Чтобы пример был более очевидным, в листинге 10-11 используются обобщённые типы `X1` и `Y1` для определения структуры `Point` и типы `X2` `Y2` для сигнатуры метода `mixup`. Метод создаёт новый экземпляр структуры `Point`, где значение `x` берётся из `self` `Point` (имеющей тип `X1`), а значение `y` - из переданной структуры `Point` (где эта переменная имеет тип `Y2`).
+Свойства обобщённого вида данных, которые мы используем в определении стопки, не всегда совпадают с подобиями, использующимися в ярлыках способов этой стопки. Чтобы пример был более очевидным, в приложении 10-11 используются обобщённые виды `X1` и `Y1` для определения стопки `Point` и виды `X2` `Y2` для ярлыки способа `mixup`. Способ создаёт новый образец данных стопки `Point`, где значение `x` берётся из `self` `Point` (имеющей вид данных `X1`), а значение `y` - из переданного стопки `Point` (где эта переменная имеет вид данных `Y2`).
 
 Файл: src/main.rs
 
@@ -150,28 +150,28 @@ enum Result {
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/src/main.rs}}
 ```
 
-Листинг 10-11: метод, использующий обобщённые типы, отличающиеся от типов, используемых в определении структуры
+Приложение 10-11: Способ, использующий обобщённые виды данных, отличающиеся от видов, используемых в определении стопки
 
-В функции `main` мы определили тип `Point`, который имеет тип `i32` для `x` (со значением `5` ) и тип `f64` для `y` (со значением `10.4`). Переменная `p2` является структурой `Point`, которая имеет строковый срез для `x` (со значением `«Hello»`) и `char` для `y` (со значением `c`). Вызов `mixup` на `p1` с аргументом `p2` создаст для нас экземпляр структуры `p3`, который будет иметь тип `i32` для `x` (потому что `x` взят из `p1`). Переменная `p3` будет иметь тип `char`  для  `y` (потому что `y` взят из `p2`). Вызов макроса `println! ` выведет `p3.x = 5, p3.y = c`.
+В функции `main` мы определили вид данных `Point`, который имеет вид данных `i32` для `x` (со значением `5` ) и вид данных `f64` для `y` (со значением `10.4`). Переменная `p2` является видом данных `Point`, которая имеет строковый срез для `x` (со значением `«Hello»`) и `char` для `y` (со значением `c`). Вызов `mixup` на `p1` с переменной `p2` создаст для нас образец данных стопки `p3`, который будет иметь вид данных `i32` для `x` (потому что `x` взят из `p1`). Переменная `p3` будет иметь вид данных `char`  для  `y` (потому что `y` взят из `p2`). Вызов макроса `println! ` выведет `p3.x = 5, p3.y = c`.
 
-Цель этого примера — продемонстрировать ситуацию, в которой некоторые обобщённые параметры объявлены с помощью `impl`, а некоторые объявлены в определении метода. Здесь обобщённые параметры `X1` и `Y1` объявляются после `impl`, потому что они относятся к определению структуры. Обобщённые параметры `X2` и `Y2` объявляются после `fn mixup`, так как они относятся только к методу.
+Цель этого примера — отобразить случай, в котором некоторые обобщённые свойства объявлены с помощью `impl`, а некоторые объявлены в определении способа. Здесь обобщённые свойства `X1` и `Y1` объявляются после `impl`, потому что они относятся к определению стопки. Обобщённые свойства `X2` и `Y2` объявляются после `fn mixup`, так как они относятся только к способу.
 
-### Производительность кода, использующего обобщённые типы
+### Производительность рукописи, использующего обобщённые виды данных
 
-Вы могли бы задаться вопросом, возникают ли какие-нибудь дополнительные издержки при использовании параметров обобщённого типа. Хорошая новость в том, что при использовании обобщённых типов ваша программа работает ничуть ни медленнее, чем если бы она работала с использованием конкретных типов.
+Вы могли бы задаться вопросом, возникают ли какие-нибудь дополнительные издержки при использовании свойств обобщённого вида данных. Хорошая новость в том, что при использовании обобщённых видов данных ваша программа работает ничуть ни медленнее, чем если бы она работала с использованием определенных видов данных.
 
-В Rust это достигается во время компиляции при помощи мономорфизации кода, использующего обобщённые типы. *Мономорфизация* — это процесс превращения обобщённого кода в конкретный код путём подстановки конкретных типов, использующихся при компиляции. В этом процессе компилятор выполняет шаги, противоположные тем, которые мы использовали для создания обобщённой функции в листинге 10-5: он просматривает все места, где вызывается обобщённый код, и генерирует код для конкретных типов, использовавшихся для вызова в обобщённом.
+В Ржавчине это достигается во время сборки при помощи мономорфизации рукописи, использующего обобщённые виды данных. *Мономорфизация* — это этап превращения обобщённого рукописи в определенный рукопись путём подстановки определенных видов данных, использующихся при сборке. В этом этапе сборщик выполняет шаги, противоположные тем, которые мы использовали для создания обобщённой функции в приложении 10-5: он просматривает все места, где вызывается обобщённый рукопись, и порождает рукопись для определенных видов, использовавшихся для вызова в обобщённом.
 
-Давайте посмотрим, как это работает при использовании перечисления `Option` из стандартной библиотеки:
+Давайте посмотрим, как это работает при использовании перечисления `Option` из встроенной библиотеки:
 
 ```rust
 let integer = Some(5);
 let float = Some(5.0);
 ```
 
-Когда Rust компилирует этот код, он выполняет мономорфизацию. Во время этого процесса компилятор считывает значения, которые были использованы в экземплярах `Option`, и определяет два вида `Option`: один для типа `i32`, а другой — для `f64`. Таким образом, он разворачивает обобщённое определение `Option` в два определения, специализированные для `i32` и `f64`, тем самым заменяя обобщённое определение конкретными.
+Когда Ржавчина собирает эту рукопись, она использует мономорфизацию. Во время этого этапа сборщик считывает значения, которые были использованы в образцах `Option`, и определяет два вида данных `Option`: один для вида данных `i32`, а другой — для `f64`. Таким образом, он разворачивает обобщённое определение `Option` в два определения, именно для `i32` и `f64`, тем самым заменяя обобщённое определение определенными.
 
-Мономорфизированная версия кода выглядит примерно так (компилятор использует имена, отличные от тех, которые мы используем здесь для иллюстрации):
+Мономорфизированная исполнение рукописи выглядит примерно так (сборщик использует имена, отличные от тех, которые мы используем здесь для отображения):
 
 Файл: src/main.rs
 
@@ -192,6 +192,6 @@ fn main() {
 }
 ```
 
-Обобщённое `Option` заменяется конкретными определениями, созданными компилятором. Поскольку Rust компилирует обобщённый код в код, определяющий тип в каждом экземпляре, мы не платим за использование обобщённых типов во время выполнения. Когда код запускается, он работает точно так же, как если бы мы продублировали каждое определение вручную. Процесс мономорфизации делает обобщённые типы Rust чрезвычайно эффективными во время выполнения.
+Обобщённое `Option` заменяется определенными определениями, созданными сборщиком. Поскольку Ржавчина собирает обобщённый рукопись в рукопись, определяющий вид данных в каждом образце, мы не платим за использование обобщённых видов данных во время выполнения. Когда рукопись запускается, она работает точно так же, как если бы мы сделали повторение каждого определения вручную. Этап мономорфизации делает обобщённые виды данных Ржавчины чрезвычайно производительными во время выполнения.
 
 
diff --git a/rustbook-ru/src/ch10-02-traits.md b/rustbook-ru/src/ch10-02-traits.md
index c597add1c..7b3633cbf 100644
--- a/rustbook-ru/src/ch10-02-traits.md
+++ b/rustbook-ru/src/ch10-02-traits.md
@@ -1,16 +1,16 @@
-## Типажи: определение общего поведения
+## Сущности: определение общего поведения
 
-*Типаж* сообщает компилятору Rust о функциональности, которой обладает определённый тип и которой он может поделиться с другими типами. Можно использовать типажи, чтобы определять общее поведение абстрактным способом. Мы можем использовать *ограничение типажа* (trait bounds) чтобы указать, что общим типом может быть любой тип, который имеет определённое поведение.
+*Сущность* сообщает сборщику Ржавчина о возможности, которой обладает определённый  данных и которой он может поделиться с другими видами данных. Можно использовать сущности, чтобы определять общее поведение абстрактным способом. Мы можем использовать *ограничение сущности* (trait bounds) чтобы указать, что общим видом данных может быть любой вид, который имеет определённое поведение.
 
-> Примечание: Типажи похожи на функциональность часто называемую *интерфейсами* в других языках программирования, хотя и с некоторыми отличиями.
+> Примечание: Сущности похожи на возможность часто называемую *внешней оболочкими* в других языках программирования, хотя и с некоторыми отличиями.
 
-### Определение типажа
+### Определение сущности
 
-Поведение типа определяется теми методами, которые мы можем вызвать у данного типа. Различные типы разделяют одинаковое поведение, если мы можем вызвать одни и те же методы у этих типов. Определение типажей - это способ сгруппировать сигнатуры методов вместе для того, чтобы описать общее поведение, необходимое для достижения определённой цели.
+Поведение вида данных определяется теми способами, которые мы можем вызвать у данного вида данных. Различные виды данных разделяют одинаковое поведение, если мы можем вызвать одни и те же способы у этих видов данных. Определение сущностей - это способ объединять ярлыки способов вместе для того, чтобы описать общее поведение, необходимое для достижения определённой цели.
 
-Например, пусть есть несколько структур, которые имеют различный тип и различный размер текста: структура `NewsArticle`, которая содержит новость, напечатанную в каком-то месте мира; структура `Tweet`, которая содержит 280 символьную строку твита и мета-данные, обозначающие является ли твит новым или ответом на другой твит.
+Например, пусть есть несколько стопок, которые имеют различный вид данных и различный размер писания: стопки `NewsArticle`, которая содержит новость, выведенную в каком-то месте мира; стопки `Tweet`, которая содержит 280 знаковую строку твита и мета-данные, обозначающие является ли твит новым или ответом на другой твит.
 
-Мы хотим создать крейт библиотеки медиа-агрегатора `aggregator`, которая может отображать сводку данных сохранённых в экземплярах структур `NewsArticle` или `Tweet`. Чтобы этого достичь, нам необходимо иметь возможность для каждой структуры получить короткую сводку на основе имеющихся данных, и для этого мы запросим сводку вызвав метод `summarize`. Листинг 10-12 показывает определение типажа `Summary`, который выражает это поведение.
+Мы хотим создать ящик библиотеки медиа-агрегатора `aggregator`, которая может отображать сводку данных сохранённых в образцах стопок `NewsArticle` или `Tweet`. Чтобы этого достичь, нам необходимо иметь возможность для каждой стопки получить короткую сводку на основе имеющихся данных, и для этого мы запросим сводку вызвав способ `summarize`. Приложение 10-12 показывает определение сущности `Summary`, который выражает это поведение.
 
 Файл: src/lib.rs
 
@@ -18,17 +18,17 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/src/lib.rs}}
 ```
 
-Листинг 10-12: Определение типажа Summary, который содержит поведение предоставленное методом summarize
+Приложение 10-12: Определение сущности Summary, который содержит поведение предоставленное способом summarize
 
-Здесь мы объявляем типаж с использованием ключевого слова `trait`, а затем его название, которым в нашем случае является `Summary`. Также мы объявляем крейт как `pub` что позволяет крейтам, зависящим от нашего крейта, тоже использовать наш крейт, что мы увидим в последующих примерах. Внутри фигурных скобок объявляются сигнатуры методов, которые описывают поведения типов, реализующих данный типаж, в данном случае поведение определяется только одной сигнатурой метода `fn summarize(&self) -> String`.
+Здесь мы объявляем сущность с использованием ключевого слова `trait`, а затем его название, которым в нашем случае является `Summary`. Также мы объявляем ящик как `pub` что позволяет ящикам, зависящим от нашего ящика, тоже использовать наш ящик, что мы увидим в последующих примерах. Внутри узорчатых скобок объявляются ярлыки способов, которые описывают поведения видов данных, выполняющих данную сущность, в данном случае поведение определяется только одной ярлыком способа `fn summarize(&self) -> String`.
 
-После сигнатуры метода, вместо предоставления реализации в фигурных в скобках, мы используем точку с запятой. Каждый тип, реализующий данный типаж, должен предоставить своё собственное поведение для данного метода. Компилятор обеспечит, что любой тип содержащий типаж `Summary`, будет также иметь и метод `summarize` объявленный с точно такой же сигнатурой.
+После ярлыков способа, вместо предоставления выполнения в узорчатых в скобках, мы используем точку с запятой. Каждый вид, выполняющий данную сущность, должен предоставить своё собственное поведение для данного способа. Сборщик обеспечит, что любой вид данных содержащий сущность `Summary`, будет также иметь и способ `summarize` объявленный с точно такой же ярлыком.
 
-Типаж может иметь несколько методов в описании его тела: сигнатуры методов перечисляются по одной на каждой строке и должны закачиваться символом ;.
+Сущность может иметь несколько способов в описании его тела: ярлыки способов перечисляются по одной на каждой строке и должны закачиваться знаком ;.
 
-### Реализация типажа у типа
+### Использование сущности у вида
 
-Теперь, после того как мы определили желаемое поведение используя типаж `Summary`, можно реализовать его у типов в нашем медиа-агрегаторе. Листинг 10-13 показывает реализацию типажа `Summary` у структуры `NewsArticle`, которая использует для создания сводки в методе `summarize` заголовок, автора и место публикации статьи. Для структуры `Tweet` мы определяем реализацию `summarize` используя имя пользователя и следующий за ним полный текст твита, полагая что содержание твита уже ограничено 280 символами.
+Теперь, после того как мы определили желаемое поведение используя сущность `Summary`, можно использовать его у видов данных в нашем медиа-агрегаторе. Приложение 10-13 показывает использование сущности `Summary` у стопки `NewsArticle`, которая использует для создания сводки в способе `summarize` заголовок, составителя и место обнародования статьи. Для стопки `Tweet` мы определяем использование `summarize` используя имя пользователя и следующий за ним полный писание твита, полагая что содержание твита уже ограничено 280 знаками.
 
 Файл: src/lib.rs
 
@@ -36,27 +36,27 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs:here}}
 ```
 
-Листинг 10-13: Реализация типажа Summary для структур NewsArticle и Tweet
+Приложение 10-13: Использование сущности Summary для стопок NewsArticle и Tweet
 
-Реализация типажа у типа аналогична реализации обычных методов. Разница в том что после `impl` мы ставим имя типажа, который мы хотим реализовать, затем используем ключевое слово `for`, а затем указываем имя типа, для которого мы хотим сделать реализацию типажа. Внутри блока `impl` мы помещаем сигнатуру метода объявленную в типаже. Вместо добавления точки с запятой в конце, после каждой сигнатуры используются фигурные скобки и тело метода заполняется конкретным поведением, которое мы хотим получить у методов типажа для конкретного типа.
+Использование сущности у вида данных подобно выполнению обычных способов. Разница в том что после `impl` мы ставим имя сущности, который мы хотим использовать, затем используем ключевое слово `for`, а затем указываем имя вида данных, для которого мы хотим сделать использование сущности. Внутри раздела `impl` мы помещаем ярлык способа объявленную в сущности. Вместо добавления точки с запятой в конце, после каждой ярлыки используются узорчатые скобки и тело способа заполняется определенным поведением, которое мы хотим получить у способов сущности для определенного вида данных.
 
-Теперь когда библиотека реализовала типаж `Summary` для `NewsArticle` и `Tweet`, программисты использующие крейт могут вызывать методы типажа у экземпляров типов `NewsArticle` и `Tweet` точно так же как если бы это были обычные методы. Единственное отличие состоит в том, что программист должен ввести типаж в область видимости точно так же как и типы. Здесь пример того как бинарный крейт может использовать наш `aggregator`:
+Теперь когда библиотека выполнила сущность `Summary` для `NewsArticle` и `Tweet`, программисты использующие ящик могут вызывать способы сущности у образцов видов данных `NewsArticle` и `Tweet` точно так же как если бы это были обычные способы. Единственное отличие состоит в том, что программист должен ввести сущность в область видимости точно так же как и виды данных. Здесь пример того как двоичный ящик может использовать наш `aggregator`:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs}}
 ```
 
-Данный код напечатает: `1 new tweet: horse_ebooks: of course, as you probably already know, people`.
+Данная рукопись выведет: `1 new tweet: horse_ebooks: of course, as you probably already know, people`.
 
-Другие крейты, которые зависят от `aggregator`, тоже могу включить типаж `Summary` в область видимости для реализации `Summary` в их собственных типах. Одно ограничение, на которое следует обратить внимание, заключается в том, что мы можем реализовать типаж для типа только в том случае, если хотя бы один из типажей типа является локальным для нашего крейта. Например, мы можем реализовать стандартный библиотечный типаж `Display` на собственном типе `Tweet` как часть функциональности нашего крейта `aggregator` потому что тип `Tweet` является локальным для крейта `aggregator`. Также мы можем реализовать `Summary` для `Vec` в нашем крейте `aggregator`, потому что типаж `Summary` является локальным для нашего крейта `aggregator`.
+Другие ящики, которые зависят от `aggregator`, тоже могу включить сущность `Summary` в область видимости для использования `Summary` в их собственных видах данных. Одно ограничение, на которое следует обратить внимание, заключается в том, что мы можем использовать сущность для вида данных только в том случае, если хотя бы один из сущностей вида данных является местным для нашего ящика. Например, мы можем использовать обычную библиотечную сущность `Display` на собственном виде данных `Tweet` как часть возможности нашего ящика `aggregator` потому что вид данных `Tweet` является местным для ящика `aggregator`. Также мы можем использовать `Summary` для `Vec` в нашем ящике `aggregator`, потому что сущность `Summary` является местным для нашего ящика `aggregator`.
 
-Но мы не можем реализовать внешние типажи для внешних типов. Например, мы не можем реализовать типаж `Display` для `Vec` внутри нашего крейта `aggregator`, потому что `Display` и `Vec` оба определены в стандартной библиотеке а не локально в нашем крейте `aggregator`. Это ограничение является частью свойства называемого *согласованность* (coherence), а ещё точнее *сиротское правило* (orphan rule), которое называется так потому что не представлен родительский тип. Это правило гарантирует, что код других людей не может сломать ваш код и наоборот. Без этого правила два крейта могли бы реализовать один типаж для одинакового типа и Rust не сможет понять, какой реализацией нужно пользоваться.
+Но мы не можем использовать внешние сущности для внешних видов данных. Например, мы не можем использовать сущность `Display` для `Vec` внутри нашего ящика `aggregator`, потому что `Display` и `Vec` оба определены во встроенной библиотеке а не местно в нашем ящике `aggregator`. Это ограничение является частью свойства называемого *согласованность* (coherence), а ещё точнее *сиротское правило* (orphan rule), которое называется так потому что не представлен родительский вид данных. Это правило заверяет, что рукопись других людей не может сломать вашу рукопись и наоборот. Без этого правила два ящика могли бы использовать одну сущность для одинакового вида данных и Ржавчина не сможет понять, каким исполнением нужно пользоваться.
 
-### Реализация поведения по умолчанию
+### Выполнение поведения по умолчанию
 
-Иногда полезно иметь поведение по умолчанию для некоторых или всех методов в типаже вместо того, чтобы требовать реализации всех методов в каждом типе, реализующим данный типаж. Затем, когда мы реализуем типаж для определённого типа, можно сохранить или переопределить поведение каждого метода по умолчанию уже внутри типов.
+Иногда полезно иметь поведение по умолчанию для некоторых или всех способов в сущности вместо того, чтобы требовать выполнения всех способов в каждом виде данных, выполняющим данную сущность. Затем, когда мы выполняем сущность для определённого вида данных, можно сохранить или переопределить поведение каждого способа по умолчанию уже внутри видов данных.
 
-В примере 10-14 показано, как указать строку по умолчанию для метода `summarize` из типажа `Summary` вместо определения только сигнатуры метода, как мы сделали в примере 10-12.
+В примере 10-14 показано, как указать строку по умолчанию для способа `summarize` из сущности `Summary` вместо определения только ярлыки способа, как мы сделали в примере 10-12.
 
 Файл: src/lib.rs
 
@@ -64,59 +64,59 @@
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs:here}}
 ```
 
-Листинг 10-14: Определение типажа Summary с реализацией метода summarize по умолчанию
+Приложение 10-14: Определение сущности Summary с использованием способа summarize по умолчанию
 
-Для использования реализации по умолчанию при создании сводки у экземпляров `NewsArticle` вместо определения пользовательской реализации, мы указываем пустой блок `impl` с `impl Summary for NewsArticle {}`.
+Для использования выполнения по умолчанию при создании сводки у образцов `NewsArticle` вместо определения пользовательского выполнения, мы указываем пустой раздел`impl` с `impl Summary for NewsArticle {}`.
 
-Хотя мы больше не определяем метод `summarize` непосредственно в `NewsArticle`, мы предоставили реализацию по умолчанию и указали, что `NewsArticle` реализует типаж `Summary`. В результате мы всё ещё можем вызвать метод `summarize` у экземпляра `NewsArticle`, например так:
+Хотя мы больше не определяем способ `summarize` непосредственно в `NewsArticle`, мы предоставили выполнение по умолчанию и указали, что `NewsArticle` использует сущность `Summary`. В итоге мы всё ещё можем вызвать способ `summarize` у образца данных `NewsArticle`, например так:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/main.rs:here}}
 ```
 
-Этот код печатает `New article available! (Read more...)` .
+Эта рукопись выводит `New article available! (Read more...)` .
 
-Создание реализации по умолчанию не требует от нас изменений чего-либо в реализации `Summary` для `Tweet` в листинге 10-13. Причина заключается в том, что синтаксис для переопределения реализации по умолчанию является таким же, как синтаксис для реализации метода типажа, который не имеет реализации по умолчанию.
+Создание выполнения по умолчанию не требует от нас изменений чего-либо в выполнении `Summary` для `Tweet` в приложении 10-13. Причина заключается в том, что правила написания для переопределения выполнения по умолчанию является таким же, как правила написания для выполнения способа сущности, который не имеет выполнения по умолчанию.
 
-Реализации по умолчанию могут вызывать другие методы в том же типаже, даже если эти другие методы не имеют реализации по умолчанию. Таким образом, типаж может предоставить много полезной функциональности и только требует от разработчиков  указывать небольшую его часть. Например, мы могли бы определить типаж `Summary` имеющий метод `summarize_author`, реализация которого требуется, а затем определить метод `summarize` который имеет реализацию по умолчанию, которая внутри вызывает метод `summarize_author`:
+Выполнения по умолчанию могут вызывать другие способы в том же сущности, даже если эти другие способы не имеют выполнения по умолчанию. Таким образом, сущность может предоставить много полезной возможности и только требует от разработчиков  указывать небольшую его часть. Например, мы могли бы определить сущность `Summary` имеющий способ `summarize_author`, выполнение которого требуется, а затем определить способ `summarize` который имеет выполнение по умолчанию, которая внутри вызывает способ `summarize_author`:
 
 ```rust,noplayground
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs:here}}
 ```
 
-Чтобы использовать такую версию типажа `Summary`, нужно только определить метод `summarize_author`, при реализации типажа для типа:
+Чтобы использовать такую исполнение сущности `Summary`, нужно только определить способ `summarize_author`, при выполнения сущности для вида данных:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs:impl}}
 ```
 
-После того, как мы определим `summarize_author`, можно вызвать `summarize` для экземпляров структуры `Tweet` и реализация по умолчанию метода `summarize` будет вызывать определение `summarize_author` которое мы уже предоставили. Так как мы реализовали метод `summarize_author` типажа `Summary`, то типаж даёт нам поведение метода `summarize` без необходимости писать код.
+После того, как мы определим `summarize_author`, можно вызвать `summarize` для образцов стопки `Tweet` и выполнение по умолчанию способа `summarize` будет вызывать определение `summarize_author` которое мы уже предоставили. Так как мы выполнили способ `summarize_author` сущности `Summary`, то сущность даёт нам поведение способа `summarize` без необходимости писать рукопись.
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs:here}}
 ```
 
-Этот код печатает `1 new tweet: (Read more from @horse_ebooks...)` .
+Эта рукопись выводит `1 new tweet: (Read more from @horse_ebooks...)` .
 
-Обратите внимание, что невозможно вызвать реализацию по умолчанию из переопределённой реализации того же метода.
+Обратите внимание, что невозможно вызвать выполнение по умолчанию из переопределённой выполнения того же способа.
 
-### Типажи как параметры
+### Сущности как свойства
 
-Теперь, когда вы знаете, как определять и реализовывать типажи, можно изучить, как использовать типажи, чтобы определить функции, которые принимают много различных типов. Мы будем использовать типаж `Summary`,  реализованный для типов `NewsArticle` и `Tweet` в листинге 10-13, чтобы определить функцию `notify`, которая вызывает метод `summarize` для его параметра `item`, который имеет некоторый тип, реализующий типаж `Summary`. Для этого мы используем синтаксис `impl Trait` примерно так:
+Теперь, когда вы знаете, как определять и использовать сущности, можно изучить, как использовать сущности, чтобы определить функции, которые принимают много различных видов данных. Мы будем использовать сущность `Summary`,  выполненный для видов данных `NewsArticle` и `Tweet` в приложении 10-13, чтобы определить функцию `notify`, которая вызывает способ `summarize` для его свойства `item`, который имеет некоторый вид данных, выполняющий сущность `Summary`. Для этого мы используем правила написания `impl Trait` примерно так:
 
 ```rust,ignore
 {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs:here}}
 ```
 
-Вместо конкретного типа у параметра `item` указывается ключевое слово `impl` и имя типажа. Этот параметр принимает любой тип, который реализует указанный типаж. В теле `notify` мы можем вызывать любые методы у экземпляра `item` , которые приходят с типажом `Summary`, такие как метод `summarize`. Мы можем вызвать `notify` и передать в него любой экземпляр `NewsArticle` или `Tweet`. Код, который вызывает данную функцию с любым другим типом, таким как `String` или `i32`, не будет компилироваться, потому что эти типы не реализуют типаж `Summary`.
+Вместо определенного вида данных у свойства `item` указывается ключевое слово `impl` и имя сущности. Это свойство принимает любой вид данных, который использует указанную сущность. В теле `notify` мы можем вызывать любые способы у образца данных `item` , которые приходят с сущностью `Summary`, такие как способ `summarize`. Мы можем вызвать `notify` и передать в него любой образец данных `NewsArticle` или `Tweet`. Рукопись, которая вызывает данную функцию с любым другим видом данных, таким как `String` или `i32`, не будет собираться, потому что эти виды данных не используют сущность `Summary`.
 
 
 
 
 
-#### Синтаксис ограничения типажа
+#### Правила написания ограничения сущности
 
-Синтаксис `impl Trait` работает для простых случаев, но на самом деле является синтаксическим сахаром для более длинной формы, которая называется *ограничением типажа* (trait bound); это выглядит так:
+Соглано правил написания `impl Trait` работает для простых случаев, но на самом деле является связанным сахаром для более длинной вида данных, которая называется *ограничением сущности* (trait bound); это выглядит так:
 
 ```rust,ignore
 pub fn notify(item: &T) {
@@ -124,41 +124,41 @@ pub fn notify(item: &T) {
 }
 ```
 
-Эта более длинная форма эквивалентна примеру в предыдущем разделе, но она более многословна. Мы помещаем объявление параметра обобщённого типа с ограничением типажа после двоеточия внутри угловых скобок.
+Эта более длинная разновидность равнозначна примеру в предыдущем разделе, но она более многословна. Мы помещаем объявление свойства обобщённого вида данных с ограничением сущности после двоеточия внутри угловых скобок.
 
-Синтаксис `impl Trait` удобен и делает код более сжатым в простых случаях, в то время как более полный синтаксис с ограничением типажа в других случаях может выразить большую сложность. Например, у нас может быть два параметра, которые реализуют типаж  `Summary`. Использование синтаксиса  `impl Trait` выглядит так:
+Соглано правил написания `impl Trait` удобен и делает рукопись более сжатым в простых случаях, в то время как более полные правила написания с ограничением сущности в других случаях может выразить большую сложность. Например, у нас может быть два свойства, которые используют сущность  `Summary`. Использование правил написания  `impl Trait` выглядит так:
 
 ```rust,ignore
 pub fn notify(item1: &impl Summary, item2: &impl Summary) {
 ```
 
-Использовать `impl Trait` удобнее если мы хотим разрешить функции иметь разные типы для `item1` и `item2` (но оба типа должны реализовывать `Summary`). Если же мы хотим заставить оба параметра иметь один и тот же тип, то мы должны использовать ограничение типажа так:
+Использовать `impl Trait` удобнее если мы хотим разрешить функции иметь разные виды данных для `item1` и `item2` (но оба вида данных должны использовать `Summary`). Если же мы хотим заставить оба свойства иметь один и тот же вид данных, то мы должны использовать ограничение сущности так:
 
 ```rust,ignore
 pub fn notify(item1: &T, item2: &T) {
 ```
 
-Обобщённый тип `T` указан для типов параметров `item1` и `item2` и ограничивает функцию так, что конкретные значения типов переданные аргументами для `item1` и `item2` должны быть одинаковыми.
+Обобщённый вид данных `T` указан для видов свойств `item1` и `item2` и ограничивает функцию так, что определенные значения видов данных переданные переменными для `item1` и `item2` должны быть одинаковыми.
 
-#### Задание нескольких границ типажей с помощью синтаксиса `+`
+#### Задание нескольких границ сущностей с помощью правил написания `+`
 
-Также можно указать более одного ограничения типажа. Допустим, мы хотели бы чтобы `notify` использовал как форматирование вывода так и  `summarize` для параметра `item`: 
тогда мы указываем что в `notify` параметр `item` должен реализовывать оба типажа `Display` и `Summary`. Мы можем сделать это используя синтаксис `+`: +Также можно указать более одного ограничения сущности. Допустим, мы хотели бы чтобы `notify` использовал как разметку вывода так и `summarize` для свойства `item`:
тогда мы указываем что в `notify` свойство `item` должно использовать обе сущности `Display` и `Summary`. Мы можем сделать это используя правила написания `+`: ```rust,ignore pub fn notify(item: &(impl Summary + Display)) { ``` -Синтаксис `+` также допустим с ограничениями типажа для обобщённых типов: +Соглано правил написания `+` также допустим с ограничениями сущности для обобщённых видов данных: ```rust,ignore pub fn notify(item: &T) { ``` -При наличии двух ограничений типажа, тело метода `notify` может вызывать `summarize` и использовать `{}` для форматирования `item` при его печати. +При наличии двух ограничений сущности, тело способа `notify` может вызывать `summarize` и использовать `{}` для разметки `item` при его выводе. -#### Более ясные границы типажа с помощью `where` +#### Более ясные границы сущности с помощью `where` -Использование слишком большого количества ограничений типажа имеет свои недостатки. Каждый обобщённый тип имеет свои границы типажа, поэтому функции с несколькими параметрами обобщённого типа могут содержать много информации об ограничениях между названием функции и списком её параметров затрудняющих чтение сигнатуры. По этой причине в Rust есть альтернативный синтаксис для определения ограничений типажа внутри предложения `where` после сигнатуры функции. Поэтому вместо того, чтобы писать так: +Использование слишком большого количества ограничений сущности имеет свои недостатки. Каждый обобщённый вид данных имеет свои границы сущности, поэтому функции с несколькими свойствами обобщённого вида данных могут содержать много сведений об ограничениях между названием функции и списком её свойств затрудняющих чтение ярлыки. По этой причине в Ржавчине есть иной правила написания для определения ограничений сущности внутри предложения `where` после ярлыков функции. Поэтому вместо того, чтобы писать так: ```rust,ignore fn some_function(t: &T, u: &U) -> i32 { @@ -170,31 +170,31 @@ fn some_function(t: &T, u: &U) -> i32 { {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/src/lib.rs:here}} ``` -Сигнатура этой функции менее загромождена: название функции, список параметров, и возвращаемый тип находятся рядом, а сигнатура не содержит в себе множество ограничений типажа. +Ярлык этой функции менее загромождена: название функции, список свойств, и возвращаемый вид данных находятся рядом, а ярлык не содержит в себе множество ограничений сущности. -### Возврат значений типа реализующего определённый типаж +### Возврат значений вида данных выполняющего определённый сущность -Также можно использовать синтаксис `impl Trait` в возвращаемой позиции, чтобы вернуть значение некоторого типа реализующего типаж, как показано здесь: +Также можно использовать правила написания `impl Trait` в возвращаемое положение, чтобы вернуть значение некоторого вида данных выполняющего сущность, как показано здесь: ```rust,ignore {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs:here}} ``` -Используя `impl Summary` для возвращаемого типа, мы указываем, что функция `returns_summarizable` возвращает некоторый тип, который реализует типаж `Summary` без обозначения конкретного типа. В этом случае `returns_summarizable` возвращает `Tweet`, но код, вызывающий эту функцию, этого не знает. +Используя `impl Summary` для возвращаемого вида данных, мы указываем, что функция `returns_summarizable` возвращает некоторый вид данных, который использует сущность `Summary` без обозначения определенного вида данных. В этом случае `returns_summarizable` возвращает `Tweet`, но рукопись, вызывающая эту функцию, этого не знает. -Возможность возвращать тип, который определяется только реализуемым им признаком, особенно полезна в контексте замыканий и итераторов, которые мы рассмотрим в Главе 13. Замыкания и итераторы создают типы, которые знает только компилятор или типы, которые очень долго указывать. Синтаксис `impl Trait` позволяет кратко указать, что функция возвращает некоторый тип, который реализует типаж `Iterator` без необходимости писать очень длинный тип. +Возможность возвращать вид данных, который определяется только выполняемым им признаком, особенно полезна в среде замыканий и повторителей, которые мы рассмотрим в Главе 13. Замыкания и повторители создают виды данных, которые знает только сборщик или виды данных, которые очень долго указывать. Правила написания `impl Trait` позволяют кратко указать, что функция возвращает некоторый вид данных, который использует сущность `Iterator` без необходимости писать очень длинный вид данных. -Однако, `impl Trait` возможно использовать, если возвращаете только один тип. Например, данный код, который возвращает значения или типа `NewsArticle` или типа `Tweet`, но в качестве возвращаемого типа объявляет `impl Summary` , не будет работать: +Однако, `impl Trait` возможно использовать, если возвращаете только один вид данных. Например, данная рукопись, которая возвращает значения или вида данных `NewsArticle` или вида данных `Tweet`, но в качестве возвращаемого вида данных объявляет `impl Summary` , не будет работать: ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs:here}} ``` -Возврат либо `NewsArticle` либо `Tweet` не допускается из-за ограничений того, как реализован синтаксис `impl Trait` в компиляторе. Мы рассмотрим, как написать функцию с таким поведением в разделе ["Использование объектов типажей, которые разрешены для значений или разных типов"] Главы 17. +Возврат либо `NewsArticle` либо `Tweet` не допускается из-за ограничений того, как выполнен `impl Trait` согласно правил написания в сборщике. Мы рассмотрим, как написать функцию с таким поведением в разделе ["Использование предметов сущностей, которые разрешены для значений или разных видов данных"] Главы 17. -### Использование ограничений типажа для условной реализации методов +### Использование ограничений сущности для условного выполнения способов -Используя ограничение типажа с блоком `impl`, который использует параметры обобщённого типа, можно реализовать методы условно, для тех типов, которые реализуют указанный типаж. Например, тип `Pair` в листинге 10-15 всегда реализует функцию `new` для возврата нового экземпляра `Pair` (вспомните раздел [“Определение методов”] Главы 5 где `Self` является псевдонимом типа для типа блока `impl`, который в данном случае является `Pair`). Но в следующем блоке `impl` тип `Pair` реализует метод `cmp_display` только если его внутренний тип `T` реализует типаж `PartialOrd` (позволяющий сравнивать) *и* типаж `Display` (позволяющий выводить на печать). +Используя ограничение сущности с разделом `impl`, который использует свойства обобщённого вида данных, можно использовать способы условно, для тех видов данных, которые используют указанную сущность. Например, вид данных `Pair` в приложении 10-15 всегда использует функцию `new` для возврата нового образца данных `Pair` (вспомните раздел [“Определение способов”] Главы 5 где `Self` является псевдонимом вида данных для вида раздела `impl`, который в данном случае является `Pair`). Но в следующем разделе `impl` вид данных `Pair` использует способ `cmp_display` только если его внутренний вид данных `T` использует сущность `PartialOrd` (позволяющий сравнивать) *и* сущность `Display` (позволяющий выводить на вывод). Файл: src/lib.rs @@ -202,9 +202,9 @@ fn some_function(t: &T, u: &U) -> i32 { {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/src/lib.rs}} ``` -Листинг 10-15: Условная реализация методов у обобщённых типов в зависимости от ограничений типажа +Приложение 10-15: Условная использование способов у обобщённых видов данных в зависимости от ограничений сущности -Мы также можем условно реализовать типаж для любого типа, который реализует другой типаж. Реализации типажа для любого типа, который удовлетворяет ограничениям типажа, называются *общими реализациями* и широко используются в стандартной библиотеке Rust. Например, стандартная библиотека реализует типаж `ToString` для любого типа, который реализует типаж `Display`. Блок `impl` в стандартной библиотеке выглядит примерно так: +Мы также можем условно использовать сущность для любого вида данных, который использует другой сущность. Выполнения сущности для любого вида данных, который удовлетворяет ограничениям сущности, называются *общими исполнениями* и широко используются во встроенной библиотеке Ржавчины. Например, обычная библиотека использует сущность `ToString` для любого вида данных, который использует сущность `Display`. Раздел`impl` во встроенной библиотеке выглядит примерно так: ```rust,ignore impl ToString for T { @@ -212,16 +212,16 @@ impl ToString for T { } ``` -Поскольку стандартная библиотека имеет эту общую реализацию, то можно вызвать метод `to_string` определённый типажом `ToString` для любого типа, который реализует типаж `Display`. Например, мы можем превратить целые числа в их соответствующие `String` значения, потому что целые числа реализуют типаж `Display`: +Поскольку обычная библиотека имеет эту общую выполнение, то можно вызвать способ `to_string` определённый сущностью `ToString` для любого вида данных, который использует сущность `Display`. Например, мы можем превратить целые числа в их соответствующие `String` значения, потому что целые числа используют сущность `Display`: ```rust let s = 3.to_string(); ``` -Общие реализации приведены в документации к типажу в разделе "Implementors". +Общие выполнения приведены в пособии к сущности в разделе "Implementors". -Типажи и ограничения типажей позволяют писать код, который использует параметры обобщённого типа для уменьшения дублирования кода, а также указывая компилятору, что мы хотим обобщённый тип, чтобы иметь определённое поведение. Затем компилятор может использовать информацию про ограничения типажа, чтобы проверить, что все конкретные типы, используемые с нашим кодом, обеспечивают правильное поведение. В динамически типизированных языках мы получили бы ошибку во время выполнения, если бы вызвали метод для типа, который не реализует тип определяемый методом. Но Rust перемещает эти ошибки на время компиляции, поэтому мы вынуждены исправить проблемы, прежде чем наш код начнёт работать. Кроме того, мы не должны писать код, который проверяет своё поведение во время выполнения, потому что это уже проверено во время компиляции. Это повышает производительность без необходимости отказываться от гибкости обобщённых типов. +Сущности и ограничения сущностей позволяют писать рукопись, которая использует свойства обобщённого вида данных для уменьшения повторения рукописи, а также указывая сборщику, что мы хотим обобщённый вид данных, чтобы иметь определённое поведение. Затем сборщик может использовать сведения про ограничения сущности, чтобы проверить, что все определенные виды данных, используемые с нашей рукописью, обеспечивают правильное поведение. В изменяемых строго определенных языках мы получили бы ошибку во время выполнения, если бы вызвали способ для вида данных, который не использует вид данных определяемый способом. Но Ржавчина перемещает эти ошибки на время сборки, поэтому мы вынуждены исправить сбои, прежде чем наша рукопись начнёт работать. Кроме того, мы не должны писать рукопись, которая проверяет своё поведение во время выполнения, потому что это уже проверено во время сборки. Это повышает производительность без необходимости отказываться от гибкости обобщённых видов данных. -["Использование объектов типажей, которые разрешены для значений или разных типов"]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types -[“Определение методов”]: ch05-03-method-syntax.html#defining-methods \ No newline at end of file +["Использование предметов сущностей, которые разрешены для значений или разных видов данных"]: ch17-02-trait-objects.html#using-trait-objects-that-allow-for-values-of-different-types +[“Определение способов”]: ch05-03-method-syntax.html#defining-methods \ No newline at end of file diff --git a/rustbook-ru/src/ch10-03-lifetime-syntax.md b/rustbook-ru/src/ch10-03-lifetime-syntax.md index fe5483307..b8649ead4 100644 --- a/rustbook-ru/src/ch10-03-lifetime-syntax.md +++ b/rustbook-ru/src/ch10-03-lifetime-syntax.md @@ -1,58 +1,58 @@ -## Валидация ссылок при помощи времён жизни +## Проверка действительности ссылок при помощи времён жизни -Сроки (времена) жизни - ещё один вид обобщений, с которыми мы уже встречались. Если раньше мы использовали обобщения, чтобы убедиться, что тип обладает нужным нам поведением, теперь мы будем использовать сроки жизни для того, чтобы быть уверенными, что ссылки действительны как минимум столько времени в процессе исполнения программы, сколько нам требуется. +Сроки (времена) жизни - ещё один вид обобщений, с которыми мы уже встречались. Если раньше мы использовали обобщения, чтобы убедиться, что вид данных обладает нужным нам поведением, теперь мы будем использовать сроки жизни для того, чтобы быть уверенными, что ссылки действительны как самое меньшее столько времени в этапе исполнения программы, сколько нам требуется. -В разделе ["Ссылки и заимствование"](ch04-02-references-and-borrowing.html#references-and-borrowing) главы 4, мы кое о чём умолчали: у каждой ссылки в Rust есть своё время жизни — область кода, на протяжении которого данная ссылка действительна (valid). В большинстве случаев сроки жизни выводятся неявно — так же, как у типов (нам требуется явно объявлять типы лишь в тех случаях, когда при автоматическом выведении типа возможны варианты). Точно так же мы должны явно объявлять сроки жизни тех ссылок, для которых времена жизни могут быть определены компилятором по-разному. Rust требует от нас объявлять взаимосвязи посредством обобщённых параметров сроков жизни, чтобы убедиться в том, что во время исполнения все действующие ссылки будут корректными. +В разделе ["Ссылки и заимствование"](ch04-02-references-and-borrowing.html#references-and-borrowing) Главы 4, мы кое о чём умолчали: у каждой ссылки в Ржавчине есть своё время жизни — область рукописи, на протяжении которого данная ссылка действительна (valid). В большинстве случаев сроки жизни выводятся неявно — так же, как у видов данных (нам требуется явно объявлять виды данных лишь в тех случаях, когда при самостоятельном выведении вида данных возможны исходы). Точно так же мы должны явно объявлять сроки жизни тех ссылок, для которых времена жизни могут быть определены сборщиком по-разному. Ржавчина требует от нас объявлять взаимосвязи посредством обобщённых свойств сроков жизни, чтобы убедиться в том, что во время исполнения все действующие ссылки будут правильными. -Аннотирование времени жизни — это концепция, отсутствующая в большинстве других языков программирования, так что она может показаться незнакомой. Хотя в этой главе мы не будем рассматривать времена жизни во всех деталях, тем не менее, мы обсудим основные ситуации, в которых вы можете столкнуться с синтаксисом времени жизни, что позволит вам получше ознакомиться с этой концепцией. +Определение времени жизни — это подход, отсутствующая в большинстве других языков программирования, так что она может показаться незнакомой. Хотя в этой главе мы не будем рассматривать времена жизни во всех подробностях, тем не менее, мы обсудим основные случаи, в которых вы можете столкнуться с правилами написания времени жизни, что позволит вам получше ознакомиться с этой подходом. ### Времена жизни предотвращают появление "повисших" ссылок -Основное предназначение сроков жизни — предотвращать появление так называемых *"повисших ссылок"* (dangling references), из-за которых программа обращается не к тем данным, к которым она собиралась обратиться. Рассмотрим программу из листинга 10-16, имеющую внешнюю и внутреннюю области видимости. +Основное предназначение сроков жизни — предотвращать появление так называемых *"повисших ссылок"* (dangling references), из-за которых программа обращается не к тем данным, к которым она собиралась обратиться. Рассмотрим программу из приложения 10-16, имеющую внешнюю и внутреннюю области видимости. ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/src/main.rs}} ``` -Листинг 10-16: Попытка использования ссылки, значение которой вышло из области видимости +Приложение 10-16: Попытка использования ссылки, значение которой вышло из области видимости -> Примечание: примеры в листингах 10-16, 10-17 и 10-23 объявляют переменные без указания их начального значения, поэтому имя переменной существует во внешней области видимости. На первый взгляд может показаться, что это противоречит отсутствию в Rust нулевых (null) значений. Однако, если мы попытаемся использовать переменную, прежде чем присвоить ей значение, мы получим ошибку компиляции, которая показывает, что Rust действительно не разрешает нулевые (null) значения. +> Примечание: примеры в приложениях 10-16, 10-17 и 10-23 объявляют переменные без указания их начального значения, поэтому имя переменной существует во внешней области видимости. На первый взгляд может показаться, что это противоречит отсутствию в Ржавчине пустых (null) значений. Однако, если мы попытаемся использовать переменную, прежде чем присвоить ей значение, мы получим ошибку сборки, которая показывает, что Ржавчина действительно не разрешает пустые (null) значения. -Внешняя область видимости объявляет переменную с именем `r` без начального значения, а внутренняя область объявляет переменную с именем `x` с начальным значением `5`. Во внутренней области мы пытаемся установить значение `r` как ссылку на `x`. Затем внутренняя область видимости заканчивается и мы пытаемся напечатать значение из `r`. Этот код не будет скомпилирован, потому что значение на которое ссылается r исчезает из области видимости, прежде чем мы попробуем использовать его. Вот сообщение об ошибке: +Внешняя область видимости объявляет переменную с именем `r` без начального значения, а внутренняя область объявляет переменную с именем `x` с начальным значением `5`. Во внутренней области мы пытаемся установить значение `r` как ссылку на `x`. Затем внутренняя область видимости заканчивается и мы пытаемся вывести значение из `r`. Эта рукопись не будет собрана, потому что значение на которое ссылается r исчезает из области видимости, прежде чем мы попробуем использовать его. Вот сообщение об ошибке: ```console {{#include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/output.txt}} ``` -Переменная `x` «не живёт достаточно долго». Причина в том, что `x` выйдет из области видимости, когда эта внутренняя область закончится в строке 7. Но `r` все ещё является действительной во внешней области видимости; поскольку её охват больше, мы говорим, что она «живёт дольше». Если бы Rust позволил такому коду работать, то переменная `r` смогла бы ссылаться на память, которая уже была освобождена (в тот момент, когда `x` вышла из внутренней области видимости), и всё что мы попытались бы сделать с `r` работало бы неправильно. Как же Rust определяет, что этот код некорректен? Он использует для этого анализатор заимствований (borrow checker). +Переменная `x` «не живёт достаточно долго». Причина в том, что `x` выйдет из области видимости, когда эта внутренняя область закончится в строке 7. Но `r` все ещё является действительной во внешней области видимости; поскольку её охват больше, мы говорим, что она «живёт дольше». Если бы Ржавчина позволил такому рукописи работать, то переменная `r` смогла бы ссылаться на память, которая уже была освобождена (в тот мгновение, когда `x` вышла из внутренней области видимости), и всё что мы попытались бы сделать с `r` работало бы неправильно. Как же Ржавчина определяет, что эта рукопись неправильно? Он использует для этого оценщик заимствований (borrow checker). -### Анализатор заимствований +### Оценщик заимствований -Компилятор Rust имеет в своём составе *анализатор заимствований*, который сравнивает области видимости для определения, являются ли все заимствования действительными. В листинге 10-17 показан тот же код, что и в листинге 10-16, но с аннотациями, показывающими времена жизни переменных. +Сборщик Ржавчины имеет в своём составе *оценщик заимствований*, который сравнивает области видимости для определения, являются ли все заимствования действительными. В приложении 10-17 показан тот же рукопись, что и в приложении 10-16, но с изложениями, показывающими времена жизни переменных. ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/src/main.rs}} ``` -Пример 10-17: Аннотация времён жизни переменных r и x, с помощью идентификаторов времени жизни 'a и 'b, соответственно +Пример 10-17: Изложение времён жизни переменных r и x, с помощью определителей времени жизни 'a и 'b, соответственно -Здесь мы описали время жизни для `r` с помощью `'a` и время жизни `x` с помощью `'b` . Как видите, время жизни `'b` внутреннего блока гораздо меньше, чем время жизни `'a` внешнего блока. Во время компиляции Rust сравнивает продолжительность двух времён жизни и видит, что `r` имеет время жизни `'a`, но ссылается на память со временем жизни `'b`. Программа отклоняется, потому что `'b` короче, чем `'a`: объект ссылки не живёт так же долго, как сама ссылка. +Здесь мы описали время жизни для `r` с помощью `'a` и время жизни `x` с помощью `'b` . Как видите, время жизни `'b` внутреннего раздела гораздо меньше, чем время жизни `'a` внешнего раздела. Во время сборки Ржавчина сравнивает продолжительность двух времён жизни и видит, что `r` имеет время жизни `'a`, но ссылается на память со временем жизни `'b`. Программа отклоняется, потому что `'b` короче, чем `'a`: предмет ссылки не живёт так же долго, как сама ссылка. -Листинг 10-18 исправляет код, чтобы в нём не было повисшей ссылки, и компилируется без ошибок. +Приложение 10-18 исправляет рукопись, чтобы в ней не было повисшей ссылки, и собирается без ошибок. ```rust {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/src/main.rs}} ``` -Листинг 10-18: Ссылка корректна, так как данные имеют более продолжительное время жизни, чем ссылка на эти данные +Приложение 10-18: Ссылка правильна, так как данные имеют более продолжительное время жизни, чем ссылка на эти данные -Здесь переменная `x` имеет время жизни `'b`, которое больше, чем время жизни `'a`. Это означает, что переменная `r` может ссылаться на переменную `x` потому что Rust знает, что ссылка в переменной `r` будет всегда действительной до тех пор, пока переменная `x` является валидной. +Здесь переменная `x` имеет время жизни `'b`, которое больше, чем время жизни `'a`. Это означает, что переменная `r` может ссылаться на переменную `x` потому что Ржавчина знает, что ссылка в переменной `r` будет всегда действительной до тех пор, пока переменная `x` является существующей. -После того, как мы на примерах рассмотрели времена жизни ссылок и обсудили как Rust их анализирует, давайте поговорим об обобщённых временах жизни входных параметров и возвращаемых значений функций. +После того, как мы на примерах рассмотрели времена жизни ссылок и обсудили как Ржавчина их рассматривает, давайте поговорим об обобщённых временах жизни входных свойств и возвращаемых значений функций. ### Обобщённые времена жизни в функциях -Напишем функцию, которая возвращает более длинный из двух срезов строки. Эта функция принимает два среза строки и возвращает один срез строки. После того как мы реализовали функцию `longest`, код в листинге 10-19 должен вывести `The longest string is abcd`. +Напишем функцию, которая возвращает более длинный из двух срезов строки. Эта функция принимает два среза строки и возвращает один срез строки. После того как мы выполнили функцию `longest`, рукопись в приложении 10-19 должен вывести `The longest string is abcd`. Файл: src/main.rs @@ -60,11 +60,11 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/src/main.rs}} ``` -Листинг 10-19: Функция main вызывает функцию longest для поиска наибольшего из двух срезов строки +Приложение 10-19: Функция main вызывает функцию longest для поиска наибольшего из двух срезов строки -Обратите внимание, что мы хотим чтобы функция принимала строковые срезы, которые являются ссылками, а не строки, потому что мы не хотим, чтобы функция `longest` забирала во владение свои параметры. Обратитесь к разделу ["Строковые срезы как параметры"](ch04-03-slices.html#string-slices-as-parameters) Главы 4 для более подробного обсуждения того, почему параметры используемые в листинге 10-19 выбраны именно таким образом. +Обратите внимание, что мы хотим чтобы функция принимала строковые срезы, которые являются ссылками, а не строки, потому что мы не хотим, чтобы функция `longest` забирала во владение свои свойства. Обратитесь к разделу ["Строковые срезы как свойства"](ch04-03-slices.html#string-slices-as-parameters) Главы 4 для более подробного обсуждения того, почему свойства используемые в приложении 10-19 выбраны именно таким образом. -Если мы попробуем реализовать функцию `longest` так, как это показано в листинге 10-20, программа не скомпилируется: +Если мы попробуем использовать функцию `longest` так, как это показано в приложении 10-20, программа не собирается: Файл: src/main.rs @@ -72,7 +72,7 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs:here}} ``` -Листинг 10-20: Реализация функции longest, которая возвращает наибольший срез строки, но пока не компилируется +Приложение 10-20: Выполнение функции longest, которая возвращает наибольший срез строки, но пока не собирается Вместо этого мы получим следующую ошибку, говорящую о временах жизни: @@ -80,15 +80,15 @@ {{#include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt}} ``` -Текст ошибки показывает, что возвращаемому типу нужен обобщённый параметр времени жизни, потому что Rust не может определить, относится ли возвращаемая ссылка к `x` или к `y`. На самом деле, мы тоже не знаем, потому что блок `if` в теле функции возвращает ссылку на `x`, а блок `else` возвращает ссылку на `y`! +Текст ошибки показывает, что возвращаемому виду нужно Обобщённое свойство времени жизни, потому что Ржавчина не может определить, относится ли возвращаемая ссылка к `x` или к `y`. На самом деле, мы тоже не знаем, потому что раздел`if` в теле функции возвращает ссылку на `x`, а раздел`else` возвращает ссылку на `y`! -Когда мы определяем эту функцию, мы не знаем конкретных значений, которые будут в неё передаваться. Поэтому мы не знаем какая из ветвей оператора `if` или `else` будет выполнена. Мы также не знаем конкретных времён жизни ссылок, которые будут переданы в функцию, поэтому мы не можем посмотреть на их области видимости, как мы делали в примерах 10-17 и 10-18, чтобы определить, будет ли возвращаемая нами ссылка корректной во всех случаях. Анализатор заимствований также не может этого определить, потому что он не знает как времена жизни переменных `x` и `y` соотносятся с временем жизни возвращаемого значения. Чтобы исправить эту ошибку, мы добавим обобщённый параметр времени жизни, который определит отношения между ссылками таким образом, чтобы анализатор заимствований мог провести свой анализ. +Когда мы определяем эту функцию, мы не знаем определенных значений, которые будут в неё передаваться. Поэтому мы не знаем какая из ветвей приказчика `if` или `else` будет выполнена. Мы также не знаем определенных времён жизни ссылок, которые будут переданы в функцию, поэтому мы не можем посмотреть на их области видимости, как мы делали в примерах 10-17 и 10-18, чтобы определить, будет ли возвращаемая нами ссылка правильной во всех случаях. Оценщик заимствований также не может этого определить, потому что он не знает как времена жизни переменных `x` и `y` соотносятся с временем жизни возвращаемого значения. Чтобы исправить эту ошибку, мы добавим Обобщённое свойство времени жизни, который определит отношения между ссылками таким образом, чтобы оценщик заимствований мог провести свой оценку. -### Синтаксис аннотации времени жизни +### Правила написания изложении времени жизни -Аннотации времени жизни не меняют срок, как долго живёт та или иная ссылка. Они скорее описывают, как соотносятся между собой времена жизни нескольких ссылок, не влияя на само время жизни. Точно так же, как функции могут принимать любой тип, когда в сигнатуре указан параметр обобщённого типа, функции могут принимать ссылки с любым временем жизни, указанным с помощью параметра обобщённого времени жизни. +Изложения времени жизни не меняют срок, как долго живёт та или иная ссылка. Они скорее описывают, как соотносятся между собой времена жизни нескольких ссылок, не влияя на само время жизни. Точно так же, как функции могут принимать любой вид данных, когда в ярлыке указан свойство обобщённого вида данных, функции могут принимать ссылки с любым временем жизни, указанным с помощью свойства обобщённого времени жизни. -Аннотации времени жизни имеют немного необычный синтаксис: имена параметров времени жизни должны начинаться с апострофа (`'`), пишутся маленькими буквами, и обычно очень короткие, как и имена обобщённых типов. Большинство людей использует имя `'a` в качестве первой аннотации времени жизни. Аннотации параметров времени жизни следуют после символа `&` и отделяются пробелом от названия ссылочного типа. +Изложения времени жизни имеют немного необычный правила написания: имена свойств времени жизни должны начинаться с апострофа (`'`), пишутся маленькими буквами, и обычно очень короткие, как и имена обобщённых видов данных. Большинство людей использует имя `'a` в качестве первой изложении времени жизни. Изложения свойств времени жизни следуют после знака `&` и отделяются пробелом от названия ссылочного вида данных. Приведём несколько примеров: у нас есть ссылка на `i32` без указания времени жизни, ссылка на `i32`, с временем жизни имеющим имя `'a` и изменяемая ссылка на `i32`, которая также имеет время жизни `'a`. @@ -98,13 +98,13 @@ &'a mut i32 // a mutable reference with an explicit lifetime ``` -Одна аннотация времени жизни сама по себе не имеет большого значения, поскольку аннотации предназначены для того, чтобы проинформировать Rust о том, как времена жизни нескольких ссылок соотносятся между собой. Давайте рассмотрим, как аннотации времени жизни связаны друг с другом в контексте функции `longest`. +Одна изложение времени жизни сама по себе не имеет большого значения, поскольку изложении предназначены для того, чтобы уведомить Ржавчина о том, как времена жизни нескольких ссылок соотносятся между собой. Давайте рассмотрим, как изложении времени жизни связаны друг с другом в среде функции `longest`. -### Аннотации времени жизни в сигнатурах функций +### Изложения времени жизни в описании самих функций -Чтобы использовать аннотации времени жизни в сигнатурах функций, нам нужно объявить параметры обобщённого *времени жизни* внутри угловых скобок между именем функции и списком параметров, как мы это делали с параметрами обобщённого *типа* . +Чтобы использовать изложении времени жизни в описании самих функций, нам нужно объявить свойства обобщённого *времени жизни* внутри угловых скобок между именем функции и списком свойств, как мы это делали с свойствами обобщённого *вида данных* . -Мы хотим, чтобы сигнатура отражала следующее ограничение: возвращаемая ссылка будет действительна до тех пор, пока валидны оба параметра. Это связь между временами жизни параметров и возвращаемого значения. Мы назовём это время жизни `'a`, а затем добавим его к каждой ссылке, как показано в листинге 10-21. +Мы хотим, чтобы ярлык отражала следующее ограничение: возвращаемая ссылка будет действительна до тех пор, пока действительны оба свойства. Это связь между временами жизни свойств и возвращаемого значения. Мы назовём это время жизни `'a`, а затем добавим его к каждой ссылке, как показано в приложении 10-21. Файл: src/main.rs @@ -112,19 +112,19 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs:here}} ``` -Листинг 10-21: В определении функции longest указано, что все ссылки должны иметь одинаковое время жизни, обозначенное как 'a +Приложение 10-21: В определении функции longest указано, что все ссылки должны иметь одинаковое время жизни, обозначенное как 'a -Этот код должен компилироваться и давать желаемый результат, когда мы вызовем его в функции `main` листинга 10-19. +Эта рукопись должна собираться и давать желаемый итог, когда мы вызовем ее в функции `main` приложения 10-19. -Сигнатура функции теперь сообщает Rust, что для некоторого времени жизни `'a` функция принимает два параметра, оба из которых являются срезами строк, которые живут не меньше, чем время жизни `'a`. Сигнатура функции также сообщает Rust, что срез строки, возвращаемый функцией, будет жить как минимум столько, сколько длится время жизни `'a`. На практике это означает, что время жизни ссылки, возвращаемой функцией `longest`, равно меньшему времени жизни передаваемых в неё ссылок. Мы хотим, чтобы Rust использовал именно такие отношения при анализе этого кода. +Ярлык функции теперь сообщает Ржавчина, что для некоторого времени жизни `'a` функция принимает два свойства, оба из которых являются срезами строк, которые живут не меньше, чем время жизни `'a`. Ярлык функции также сообщает Ржавчина что срез строки, возвращаемый функцией, будет жить как самое меньшее столько, сколько длится время жизни `'a`. В действительности это означает, что время жизни ссылки, возвращаемой функцией `longest`, равно меньшему времени жизни передаваемых в неё ссылок. Мы хотим, чтобы Ржавчина использовал именно такие отношения при оценке этой рукописи. -Помните, когда мы указываем параметры времени жизни в этой сигнатуре функции, мы не меняем время жизни каких-либо переданных или возвращённых значений. Скорее, мы указываем, что анализатор заимствований должен отклонять любые значения, которые не соответствуют этим ограничениям. Обратите внимание, что самой функции `longest` не нужно точно знать, как долго будут жить `x` и `y`, достаточно того, что некоторая область может быть заменена на `'a`, которая будет удовлетворять этой сигнатуре. +Помните, когда мы указываем свойства времени жизни в этой ярлыке функции, мы не меняем время жизни каких-либо переданных или возвращённых значений. Скорее, мы указываем, что оценщик заимствований должен отклонять любые значения, которые не соответствуют этим ограничениям. Обратите внимание, что самой функции `longest` не нужно точно знать, как долго будут жить `x` и `y`, достаточно того, что некоторая область может быть заменена на `'a`, которая будет удовлетворять этой ярлыке. -При аннотировании времён жизни функций, аннотации помещаются в сигнатуру функции, а не в тело функции. Аннотации времени жизни становятся частью контракта функции, как и типы в сигнатуре. Наличие сигнатур функций, содержащих контракт времени жизни, означает, что анализ который выполняет компилятор Rust, может быть проще. Если есть проблема с тем, как функция аннотируется или как она вызывается, ошибки компилятора могут указать на часть нашего кода и ограничения более точно. Если бы вместо этого компилятор Rust сделал больше предположений о том, какие отношения времён жизни мы хотели получить, компилятор смог бы указать только на использование нашего кода за много шагов от источника проблемы. +При определении времён жизни функций, изложении помещаются в ярлык функции, а не в тело функции. Изложения времени жизни становятся частью договора функции, как и виды данных в ярлыке. Наличие ярлыков функций, содержащих договор времени жизни, означает, что оценка которую использует сборщик Ржавчины, может быть проще. Если есть неполадка с тем, как функция определяется или как она вызывается, ошибки сборщика могут указать на часть нашей рукописи и ограничения более точно. Если бы вместо этого сборщик Ржавчины сделал больше предположений о том, какие отношения времён жизни мы хотели получить, сборщик смог бы указать только на использование нашей рукописи за много шагов от источника сбоев. -Когда мы передаём конкретные ссылки в функцию `longest`, конкретным временем жизни, которое будет заменено на `'a`, является часть области видимости `x`, которая пересекается с областью видимости `y`. Другими словами, обобщённое время жизни `'a` получит конкретное время жизни, равное меньшему из времён жизни `x` и `y`. Так как мы аннотировали возвращаемую ссылку тем же параметром времени жизни `'a`, то возвращённая ссылка также будет действительна на протяжении меньшего из времён жизни `x` и `y`. +Когда мы передаём определенные ссылки в функцию `longest`, определенным временем жизни, которое будет заменено на `'a`, является часть области видимости `x`, которая пересекается с областью видимости `y`. Другими словами, обобщённое время жизни `'a` получит определенное время жизни, равное меньшему из времён жизни `x` и `y`. Так как мы определяли возвращаемую ссылку тем же свойством времени жизни `'a`, то возвращённая ссылка также будет действительна на протяжении меньшего из времён жизни `x` и `y`. -Давайте посмотрим, как аннотации времени жизни ограничивают функцию `longest` путём передачи в неё ссылок, которые имеют разные конкретные времена жизни. Листинг 10-22 является очевидным примером. +Давайте посмотрим, как изложении времени жизни ограничивают функцию `longest` путём передачи в неё ссылок, которые имеют разные определенные времена жизни. Приложение 10-22 является очевидным примером. Файл: src/main.rs @@ -132,11 +132,11 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs:here}} ``` -Листинг 10-22: Использование функции longest со ссылками на значения типа String, имеющими разное время жизни +Приложение 10-22: Использование функции longest со ссылками на значения вида данных String, имеющими разное время жизни -В этом примере переменная `string1` действительна до конца внешней области, `string2` действует до конца внутренней области видимости и `result` ссылается на что-то, что является действительным до конца внутренней области видимости. Запустите этот код, и вы увидите что анализатор заимствований разрешает такой код; он скомпилирует и напечатает `The longest string is long string is long`. +В этом примере переменная `string1` действительна до конца внешней области, `string2` действует до конца внутренней области видимости и `result` ссылается на что-то, что является действительным до конца внутренней области видимости. Запустите эту рукопись, и вы увидите что оценщик заимствований разрешает такую рукопись; он собирает и выведет `The longest string is long string is long`. -Теперь, давайте попробуем пример, который показывает, что время жизни ссылки `result` должно быть меньшим временем жизни одного из двух аргументов. Мы переместим объявление переменной `result` за пределы внутренней области видимости, но оставим присвоение значения переменной `result` в области видимости `string2`. Затем мы переместим `println!`, который использует `result` за пределы внутренней области видимости, после того как внутренняя область видимости закончилась. Код в листинге 10-23 не скомпилируется. +Теперь, давайте попробуем пример, который показывает, что время жизни ссылки `result` должно быть меньшим временем жизни одного из двух переменных. Мы переместим объявление переменной `result` за пределы внутренней области видимости, но оставим присвоение значения переменной `result` в области видимости `string2`. Затем мы переместим `println!`, который использует `result` за пределы внутренней области видимости, после того как внутренняя область видимости закончилась. Рукопись в приложении 10-23 не собирается. Файл: src/main.rs @@ -144,23 +144,23 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs:here}} ``` -Листинг 10-23: Попытка использования result, после того как string2 вышла из области видимости +Приложение 10-23: Попытка использования result, после того как string2 вышла из области видимости -При попытке скомпилировать этот код, мы получим такую ошибку: +При попытке собрать эту рукопись, мы получим такую ошибку: ```console {{#include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/output.txt}} ``` -Эта ошибка говорит о том, что если мы хотим использовать `result` в инструкции `println!`, переменная `string2` должна бы быть действительной до конца внешней области видимости. Rust знает об этом, потому что мы аннотировали параметры функции и её возвращаемое значение одинаковым временем жизни `'a`. +Эта ошибка говорит о том, что если мы хотим использовать `result` в указании `println!`, переменная `string2` должна бы быть действительной до конца внешней области видимости. Ржавчина знает об этом, потому что мы определяли свойства функции и её возвращаемое значение одинаковым временем жизни `'a`. -Будучи людьми, мы можем посмотреть на этот код и увидеть, что `string1` длиннее, чем `string2` и, следовательно, `result` будет содержать ссылку на `string1`. Поскольку `string1` ещё не вышла из области видимости, ссылка на `string1` будет все ещё действительной в инструкции `println!`. Однако компилятор не видит, что ссылка в этом случае валидна. Мы сказали Rust, что время жизни ссылки, возвращаемой из функции `longest`, равняется меньшему из времён жизни переданных в неё ссылок. Таким образом, анализатор заимствований запрещает код в листинге 10-23, как возможно имеющий недействительную ссылку. +Будучи людьми, мы можем посмотреть на эту рукопись и увидеть, что `string1` длиннее, чем `string2` и, следовательно, `result` будет содержать ссылку на `string1`. Поскольку `string1` ещё не вышла из области видимости, ссылка на `string1` будет все ещё действительной в указании `println!`. Однако сборщик не видит, что ссылка в этом случае действительна. Мы сказали Ржавчина, что время жизни ссылки, возвращаемой из функции `longest`, равняется меньшему из времён жизни переданных в неё ссылок. Таким образом, оценщик заимствований запрещает рукопись в приложении 10-23, как возможно имеющую недействительную ссылку. -Попробуйте провести больше экспериментов с различными значениями и временами жизни ссылок, передаваемых в функцию `longest`, а также с тем, как используется возвращаемое значение Перед компиляцией делайте предположения о том, пройдёт ли ваш код анализ заимствований, а затем проверяйте, насколько вы были правы. +Попробуйте провести больше опытов с различными значениями и временами жизни ссылок, передаваемых в функцию `longest`, а также с тем, как используется возвращаемое значение Перед сборкой делайте предположения о том, пройдёт ли Ваша рукопись оценку заимствований, а затем проверяйте, насколько вы были правы. -### Мышление в терминах времён жизни +### Мышление в понятиях времён жизни -В зависимости от того, что делает ваша функция, следует использовать разные способы указания параметров времени жизни. Например, если мы изменим реализацию функции `longest` таким образом, чтобы она всегда возвращала свой первый аргумент вместо самого длинного среза строки, то время жизни для параметра `y` можно совсем не указывать. Этот код скомпилируется: +В зависимости от того, что делает ваша функция, следует использовать разные способы указания свойств времени жизни. Например, если мы изменим выполнение функции `longest` таким образом, чтобы она всегда возвращала свою первую переменная вместо самого длинного среза строки, то время жизни для свойства `y` можно совсем не указывать. Эта рукопись собирается: Файл: src/main.rs @@ -168,9 +168,9 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/src/main.rs:here}} ``` -Мы указали параметр времени жизни `'a` для параметра `x` и возвращаемого значения, но не для параметра `y`, поскольку время жизни параметра `y` никак не соотносится с временем жизни параметра `x` или возвращаемого значения. +Мы указали свойство времени жизни `'a` для свойства `x` и возвращаемого значения, но не для свойства `y`, поскольку время жизни свойства `y` никак не соотносится с временем жизни свойства `x` или возвращаемого значения. -При возврате ссылки из функции, параметр времени жизни для возвращаемого типа должен соответствовать параметру времени жизни одного из аргументов. Если возвращаемая ссылка *не* ссылается на один из параметров, она должна ссылаться на значение, созданное внутри функции. Однако, это приведёт к недействительной ссылке, поскольку значение, на которое она ссылается, выйдет из области видимости в конце функции. Посмотрите на попытку реализации функции `longest`, которая не скомпилируется: +При возврате ссылки из функции, свойство времени жизни для возвращаемого вида данных должен соответствовать свойству времени жизни одного из переменных. Если возвращаемая ссылка *не* ссылается на одно из свойств, она должна ссылаться на значение, созданное внутри функции. Однако, это приведёт к недействительной ссылке, поскольку значение, на которое она ссылается, выйдет из области видимости в конце функции. Посмотрите на попытку выполнения функции `longest`, которая не собирается: Файл: src/main.rs @@ -178,19 +178,19 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/src/main.rs:here}} ``` -Здесь, несмотря на то, что мы указали параметр времени жизни `'a` для возвращаемого типа, реализация не будет скомпилирована, потому что время жизни возвращаемого значения никак не связано с временем жизни параметров. Получаем сообщение об ошибке: +Здесь, несмотря на то, что мы указали свойство времени жизни `'a` для возвращаемого вида данных, выполнение не будет собрана, потому что время жизни возвращаемого значения никак не связано с временем жизни свойств. Получаем сообщение об ошибке: ```console {{#include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt}} ``` -Проблема заключается в том, что `result` выходит за область видимости и очищается в конце функции `longest`. Мы также пытаемся вернуть ссылку на `result` из функции. Мы не можем указать параметры времени жизни, которые могли бы изменить недействительную ссылку, а Rust не позволит нам создать недействительную ссылку. В этом случае лучшим решением будет вернуть владеющий тип данных, а не ссылку: в этом случае вызывающая функция будет нести ответственность за очистку полученного ею значения. +Неполадка заключается в том, что `result` выходит за область видимости и очищается в конце функции `longest`. Мы также пытаемся вернуть ссылку на `result` из функции. Мы не можем указать свойства времени жизни, которые могли бы изменить недействительную ссылку, а Ржавчина не позволит нам создать недействительную ссылку. В этом случае лучшим решением будет вернуть владеющий вид данных, а не ссылку: в этом случае вызывающая функция будет нести ответственность за очистку полученного ею значения. -В конечном итоге, синтаксис времён жизни реализует связывание времён жизни различных аргументов и возвращаемых значений функций. Описывая времена жизни, мы даём Rust достаточно информации, чтобы разрешить безопасные операции с памятью и запретить операции, которые могли бы создать недействительные ссылки или иным способом нарушить безопасность памяти. +В конечном итоге, правила написания времён жизни выполняют связывание времён жизни различных переменных и возвращаемых значений функций. Описывая времена жизни, мы даём Ржавчина достаточно сведений, чтобы разрешить безопасные действия с памятью и запретить действия, которые могли бы создать недействительные ссылки или иным способом нарушить безопасное управлению памятью. -### Определение времён жизни при объявлении структур +### Определение времён жизни при объявлении видов данных -До сих пор мы объявляли структуры, которые всегда содержали владеющие типы данных. Структуры могут содержать и ссылки, но при этом необходимо добавить аннотацию времени жизни для каждой ссылки в определении структуры. Листинг 10-24 описывает структуру `ImportantExcerpt`, содержащую срез строки: +До сих пор мы объявляли стопки, которые всегда содержали владеющие виды данных. Стопки могут содержать и ссылки, но при этом необходимо добавить изложение времени жизни для каждой ссылки в определении стопки. Приложение 10-24 описывает вид данных `ImportantExcerpt`, содержащее срез строки: Файл: src/main.rs @@ -198,15 +198,15 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/src/main.rs}} ``` -Листинг 10-25. Структура, содержащая ссылку, требует аннотации времени жизни +Приложение 10-25. Стопки, содержащая ссылку, требует изложении времени жизни -У структуры имеется одно поле `part`, хранящее срез строки, который сам по себе является ссылкой. Как и в случае с обобщёнными типами данных, мы объявляем имя обобщённого параметра времени жизни внутри угловых скобок после имени структуры, чтобы иметь возможность использовать его внутри определения структуры. Данная аннотация означает, что экземпляр `ImportantExcerpt` не может пережить ссылку, которую он содержит в своём поле `part`. +У стопки имеется одно поле `part`, хранящее срез строки, который сам по себе является ссылкой. Как и в случае с обобщёнными видами данных, мы объявляем имя обобщённого свойства времени жизни внутри угловых скобок после имени стопки, чтобы иметь возможность использовать его внутри определения стопки. Данное изложение означает, что образец данных `ImportantExcerpt` не может пережить ссылку, которую он содержит в своём поле `part`. -Функция `main` здесь создаёт экземпляр структуры `ImportantExcerpt`, который содержит ссылку на первое предложение типа `String` принадлежащее переменной `novel`. Данные в `novel` существуют до создания экземпляра `ImportantExcerpt`. Кроме того, `novel` не выходит из области видимости до тех пор, пока `ImportantExcerpt` не выйдет за область видимости, поэтому ссылка в внутри экземпляра `ImportantExcerpt` является действительной. +Функция `main` здесь создаёт образец данных стопки `ImportantExcerpt`, который содержит ссылку на первое предложение вида данных `String` принадлежащее переменной `novel`. Данные в `novel` существуют до создания образца данных `ImportantExcerpt`. Кроме того, `novel` не выходит из области видимости до тех пор, пока `ImportantExcerpt` не выйдет за область видимости, поэтому ссылка в внутри образца данных `ImportantExcerpt` является действительной. ### Правила неявного выведения времени жизни -Вы изучили, что у каждой ссылки есть время жизни и что нужно указывать параметры времени жизни для функций или структур, которые используют ссылки. Однако в Главе 4 у нас была функция в листинге 4-9, которая затем снова показана в листинге 10-25, в которой код скомпилировался без аннотаций времени жизни. +Вы изучили, что у каждой ссылки есть время жизни и что нужно указывать свойства времени жизни для функций или стопок, которые используют ссылки. Однако в Главе 4 у нас была функция в приложении 4-9, которая затем снова показана в приложении 10-25, в которой рукопись собралась без наставлений времени жизни. Файл: src/lib.rs @@ -214,83 +214,83 @@ {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/src/main.rs:here}} ``` -Листинг 10-25: Функция, которую мы определили в листинге 4-9 компилируется без аннотаций времени жизни, несмотря на то, что входной и возвращаемый тип параметров являются ссылками +Приложение 10-25: Функция, которую мы определили в приложении 4-9 собирается без наставлений времени жизни, несмотря на то, что входной и возвращаемый вид данных свойств являются ссылками -Причина, по которой этот код компилируется — историческая. В ранних (до-1.0) версиях Rust этот код не скомпилировался бы, поскольку каждой ссылке нужно было явно назначать время жизни. В те времена, сигнатура функции была бы написана примерно так: +Причина, по которой эта рукопись собирается — летописная. В ранних (до-1.0) исполнениях Ржавчины эта рукопись не собралась бы, поскольку каждой ссылке нужно было явно указывать время жизни. В те времена, ярлык функции был бы написан примерно так: ```rust,ignore fn first_word<'a>(s: &'a str) -> &'a str { ``` -После написания большого количества кода на Rust разработчики языка обнаружили, что в определённых ситуациях программисты описывают одни и те же аннотации времён жизни снова и снова. Эти ситуации были предсказуемы и следовали нескольким детерминированным шаблонным моделям. Команда Rust решила запрограммировать эти шаблоны в код компилятора Rust, чтобы анализатор заимствований мог вывести времена жизни в таких ситуациях без необходимости явного указания аннотаций программистами. +После написания большого количества рукописей на Ржавчине разработчики языка обнаружили, что в определённых случаях программисты описывают одни и те же изложении времён жизни снова и снова. Эти случаи были предсказуемы и следовали нескольким определенным образцовым моделям. Объединение Ржавчины решило запрограммировать эти образцы в рукопись сборщика Ржавчины чтобы оценщик заимствований мог вывести времена жизни в таких случаях без необходимости явного указания наставлений программистами. -Мы упоминаем этот фрагмент истории Rust, потому что возможно, что в будущем появится больше шаблонов для автоматического выведения времён жизни, которые будут добавлены в компилятор. Таким образом, в будущем может понадобится ещё меньшее количество аннотаций. +Мы упоминаем этот отрывок истории Ржавчина, потому что возможно, что в будущем появится больше образцов для самостоятельного выведения времён жизни, которые будут добавлены в сборщик. Таким образом, в будущем может понадобится ещё меньшее количество наставлений. -Шаблоны, запрограммированные в анализаторе ссылок языка Rust, называются *правилами неявного выведения времени жизни*. Это не правила, которым должны следовать программисты; а набор частных случаев, которые рассмотрит компилятор, и, если ваш код попадает в эти случаи, вам не нужно будет указывать время жизни явно. +Образцы, запрограммированные в оценщике ссылок языка Ржавчина называются *правилами неявного выведения времени жизни*. Это не правила, которым должны следовать программисты; а набор частных случаев, которые рассмотрит сборщик, и, если Ваша рукопись попадает в эти случаи, вам не нужно будет указывать время жизни явно. -Правила выведения не предоставляют полного заключения. Если Rust детерминировано применяет правила, но некоторая неясность относительно времён жизни ссылок все ещё остаётся, компилятор не будет догадываться, какими должны быть времена жизни оставшихся ссылок. В этом случае, вместо угадывания компилятор выдаст ошибку, которую вы можете устранить, добавив аннотации времени жизни. +Правила выведения не предоставляют полного заключения. Если Ржавчина определенно применяет правила, но некоторая неясность относительно времён жизни ссылок все ещё остаётся, сборщик не будет догадываться, какими должны быть времена жизни оставшихся ссылок. В этом случае, вместо угадывания сборщик выдаст ошибку, которую вы можете устранить, добавив изложении времени жизни. -Времена жизни параметров функции или метода называются *временем жизни ввода*, а времена жизни возвращаемых значений называются *временем жизни вывода*. +Времена жизни свойств функции или способа называются *временем жизни ввода*, а времена жизни возвращаемых значений называются *временем жизни вывода*. -Компилятор использует три правила, чтобы выяснить времена жизни ссылок при отсутствии явных аннотаций. Первое правило относится ко времени жизни ввода, второе и третье правила применяются ко временам жизни вывода. Если компилятор доходит до конца проверки трёх правил и всё ещё есть ссылки, для которых он не может выяснить время жизни, компилятор остановится с ошибкой. Эти правила применяются к объявлениям `fn`, а также к блокам `impl`. +Сборщик использует три правила, чтобы выяснить времена жизни ссылок при отсутствии явных наставлений. Первое правило относится ко времени жизни ввода, второе и третье правила применяются ко временам жизни вывода. Если сборщик доходит до конца проверки трёх правил и всё ещё есть ссылки, для которых он не может выяснить время жизни, сборщик остановится с ошибкой. Эти правила применяются к объявлениям `fn`, а также к разделам `impl`. -Первое правило заключается в том, что каждый параметр являющийся ссылкой, получает свой собственный параметр времени жизни. Другими словами, функция с одним параметром получит один параметр времени жизни: `fn foo<'a>(x: &'a i32)`; функция с двумя аргументами получит два отдельных параметра времени жизни: `fn foo<'a, 'b>(x: &'a i32, y: &'b i32)`, и так далее. +Первое правило заключается в том, что каждый свойство являющийся ссылкой, получает свой собственный свойство времени жизни. Другими словами, функция с одним свойством получит одно свойство времени жизни: `fn foo<'a>(x: &'a i32)`; функция с двумя переменными получит два отдельных свойства времени жизни: `fn foo<'a, 'b>(x: &'a i32, y: &'b i32)`, и так далее. -Второе правило говорит, что если есть ровно один входной параметр времени жизни, то его время жизни назначается всем выходным параметрам: `fn foo<'a>(x: &'a i32) -> &'a i32`. +Второе правило говорит, что если есть ровно одно входное свойство время жизни, то его время жизни назначается всем выходным свойствам: `fn foo<'a>(x: &'a i32) -> &'a i32`. -Третье правило о том, что если есть множество входных параметров времени жизни, но один из них является ссылкой `&self` или `&mut self`, так как эта функция является методом, то время жизни `self` назначается временем жизни всем выходным параметрам. Это третье правило делает методы намного приятнее для чтения и записи, потому что требуется меньше символов. +Третье правило о том, что если есть множество входных свойств времени жизни, но один из них является ссылкой `&self` или `&mut self`, так как эта функция является способом, то время жизни `self` назначается временем жизни всем выходным свойствам. Это третье правило делает способы намного приятнее для чтения и записи, потому что требуется меньше знаков. -Представим, что мы компилятор и применим эти правила, чтобы вывести времена жизни ссылок в сигнатуре функции `first_word` листинга 10-25. Сигнатура этой функции начинается без объявления времён жизни ссылок: +Представим, что мы сборщик и применим эти правила, чтобы вывести времена жизни ссылок в ярлыке функции `first_word` приложения 10-25. Ярлык этой функции начинается без объявления времён жизни ссылок: ```rust,ignore fn first_word(s: &str) -> &str { ``` -Теперь мы (в качестве компилятора) применим первое правило, утверждающее, что каждый параметр функции получает своё собственное время жизни. Как обычно, назовём его `'a` и теперь сигнатура выглядит так: +Теперь мы (в качестве сборщика) применим первое правило, утверждающее, что каждый свойство функции получает своё собственное время жизни. Как обычно, назовём его `'a` и теперь ярлык выглядит так: ```rust,ignore fn first_word<'a>(s: &'a str) -> &str { ``` -Далее применяем второе правило, поскольку в функции указан только один входной параметр времени жизни. Второе правило гласит, что время жизни единственного входного параметра назначается выходным параметрам, поэтому сигнатура теперь преобразуется таким образом: +Далее применяем второе правило, поскольку в функции указан только один входное свойство времени жизни. Второе правило гласит, что время жизни единственного входного свойства назначается выходным свойствам, поэтому ярлык теперь преобразуется таким образом: ```rust,ignore fn first_word<'a>(s: &'a str) -> &'a str { ``` -Теперь все ссылки в этой функции имеют параметры времени жизни и компилятор может продолжить свой анализ без необходимости просить у программиста указать аннотации времён жизни в сигнатуре этой функции. +Теперь все ссылки в этой функции имеют свойства времени жизни и сборщик может продолжить свой оценка без необходимости просить у программиста указать изложении времён жизни в ярлыке этой функции. -Давайте рассмотрим ещё один пример: на этот раз функцию `longest`, в которой не было параметров времени жизни, когда мы начали с ней работать в листинге 10-20: +Давайте рассмотрим ещё один пример: на этот раз функцию `longest`, в которой не было свойств времени жизни, когда мы начали с ней работать в приложении 10-20: ```rust,ignore fn longest(x: &str, y: &str) -> &str { ``` -Применим первое правило: каждому параметру назначается собственное время жизни. На этот раз у функции есть два параметра, поэтому есть два времени жизни: +Применим первое правило: каждому свойству назначается собственное время жизни. На этот раз у функции есть два свойства, поэтому есть два времени жизни: ```rust,ignore fn longest<'a, 'b>(x: &'a str, y: &'b str) -> &str { ``` -Можно заметить, что второе правило здесь не применимо, так как в сигнатуре указано больше одного входного параметра времени жизни. Третье правило также не применимо, так как `longest` — функция, а не метод, следовательно, в ней нет параметра `self`. Итак, мы прошли все три правила, но так и не смогли вычислить время жизни выходного параметра. Поэтому мы и получили ошибку при попытке скомпилировать код листинга 10-20: компилятор работал по правилам неявного выведения времён жизни, но не мог выяснить все времена жизни ссылок в сигнатуре. +Можно заметить, что второе правило здесь не применимо, так как в ярлыке указано больше одного входного свойства времени жизни. Третье правило также не применимо, так как `longest` — функция, а не способ, следовательно, в ней нет свойства `self`. Итак, мы прошли все три правила, но так и не смогли вычислить время жизни выходного свойства. Поэтому мы и получили ошибку при попытке собрать рукопись приложения 10-20: сборщик работал по правилам неявного выведения времён жизни, но не мог выяснить все времена жизни ссылок в ярлыке. -Так как третье правило применяется только к методам, далее мы рассмотрим времена жизни в этом контексте, чтобы понять, почему нам часто не требуется аннотировать времена жизни в сигнатурах методов. +Так как третье правило применяется только к способам, далее мы рассмотрим времена жизни в этой среде, чтобы понять, почему нам часто не требуется определять времена жизни в ярлыках способов. -### Аннотация времён жизни в определении методов +### Изложение времён жизни в определении способов -Когда мы реализуем методы для структур с временами жизни, мы используем тот же синтаксис, который применялся для аннотаций обобщённых типов данных на листинге 10-11. Место, где мы объявляем и используем времена жизни, зависит от того, с чем они связаны — с полями структуры, либо с аргументами методов и возвращаемыми значениями. +Когда мы выполняем способы для стопок с временами жизни, мы используем тот же правила написания, который применялся для наставлений обобщённых видов данных на приложении 10-11. Место, где мы объявляем и используем времена жизни, зависит от того, с чем они связаны — с полями стопки, либо с переменными способов и возвращаемыми значениями. -Имена параметров времени жизни для полей структур всегда описываются после ключевого слова `impl` и затем используются после имени структуры, поскольку эти времена жизни являются частью типа структуры. +Имена свойств времени жизни для полей стопок всегда описываются после ключевого слова `impl` и затем используются после имени стопки, поскольку эти времена жизни являются частью вида данных стопки. -В сигнатурах методов внутри блока `impl` ссылки могут быть привязаны ко времени жизни ссылок в полях структуры, либо могут быть независимыми. Вдобавок, правила неявного выведения времён жизни часто делают так, что аннотации переменных времён жизни являются необязательными в сигнатурах методов. Рассмотрим несколько примеров, использующих структуру с названием `ImportantExcerpt`, которую мы определили в листинге 10-24. +В ярлыках способов внутри раздела `impl` ссылки могут быть привязаны ко времени жизни ссылок в полях стопки, либо могут быть независимыми. Вдобавок, правила неявного выведения времён жизни часто делают так, что изложении переменных времён жизни являются необязательными в ярлыках способов. Рассмотрим несколько примеров, использующих устройство с названием `ImportantExcerpt`, которую мы определили в приложении 10-24. -Сначала, воспользуемся методом `level`, чей единственный параметр является ссылкой на `self`, а возвращаемое значение `i32`, не является ссылкой ни на что: +Сначала, воспользуемся способом `level`, чьё единственное свойство является ссылкой на `self`, а возвращаемое значение `i32`, не является ссылкой ни на что: ```rust {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/src/main.rs:1st}} ``` -Объявление параметра времени жизни после `impl` и его использование после имени типа является обязательным, но нам не нужно аннотировать время жизни ссылки на `self`, благодаря первому правилу неявного выведения времён жизни. +Объявление свойства времени жизни после `impl` и его использование после имени вида данных является обязательным, но нам не нужно определять время жизни ссылки на `self`, благодаря первому правилу неявного выведения времён жизни. Вот пример, где применяется третье правило неявного выведения времён жизни: @@ -298,35 +298,35 @@ fn longest<'a, 'b>(x: &'a str, y: &'b str) -> &str { {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/src/main.rs:3rd}} ``` -В этом методе имеется два входных параметра, поэтому Rust применит первое правило и назначит обоим параметрам `&self` и `announcement` собственные времена жизни. Далее, поскольку один из параметров является `&self`, то возвращаемое значение получает время жизни переменой `&self` и все времена жизни теперь выведены. +В этом способе имеется два входных свойства, поэтому Ржавчина применит первое правило и назначит обоим свойствам `&self` и `announcement` собственные времена жизни. Далее, поскольку одно из свойств является `&self`, то возвращаемое значение получает время жизни переменой `&self` и все времена жизни теперь выведены. -### Статическое время жизни +### Постоянное время жизни -Одно особенное время жизни, которое мы должны обсудить, называется `'static`. Оно означает, что данная ссылка *может* жить всю продолжительность работы программы. Все строковые литералы по умолчанию имеют время жизни `'static`, но мы можем указать его явным образом: +Одно особенное время жизни, которое мы должны обсудить, называется `'static`. Оно означает, что данная ссылка *может* жить всю продолжительность работы программы. Все строковые записи по умолчанию имеют время жизни `'static`, но мы можем указать его явным образом: ```rust let s: &'static str = "I have a static lifetime."; ``` -Содержание этой строки сохраняется внутри бинарного файл программы и всегда доступно для использования. Следовательно, время жизни всех строковых литералов равно `'static`. +Содержание этой строки сохраняется внутри двоичного файл программы и всегда доступно для использования. Следовательно, время жизни всех строковых записей равно `'static`. -Сообщения компилятора об ошибках в качестве решения проблемы могут предлагать вам использовать время жизни `'static`. Но прежде чем указывать `'static` как время жизни для ссылки, подумайте, на самом ли деле данная ссылка будет доступна во всё время работы программы. В большинстве случаев, сообщения об ошибках, предлагающие использовать время жизни `'static` появляются при попытках создания недействительных ссылок или несовпадения имеющихся времён жизни. В таких случаях, решение заключается в исправлении таких проблем, а не в указании статического времени жизни `'static`. +Сообщения сборщика об ошибках в качестве решения сбоев могут предлагать вам использовать время жизни `'static`. Но прежде чем указывать `'static` как время жизни для ссылки, подумайте, на самом ли деле данная ссылка будет доступна во всё время работы программы. В большинстве случаев, сообщения об ошибках, предлагающие использовать время жизни `'static` появляются при попытках создания недействительных ссылок или несовпадения имеющихся времён жизни. В таких случаях, решение заключается в исправлении таких неполадок. а не в указании постоянного времени жизни `'static`. -## Обобщённые типы параметров, ограничения типажей и времена жизни вместе +## Обобщённые виды свойств, ограничения сущностей и времена жизни вместе -Давайте кратко рассмотрим синтаксис задания параметров обобщённых типов, ограничений типажа и времён жизни совместно в одной функции: +Давайте кратко рассмотрим правила написания задания свойств обобщённых видов данных, ограничений сущности и времён жизни совместно в одной функции: ```rust {{#rustdoc_include ../listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs:here}} ``` -Это функция `longest` из листинга 10-21, которая возвращает наибольший из двух срезов строки. Но теперь у неё есть дополнительный параметр с именем `ann` обобщённого типа `T`, который может быть представлен любым типом, реализующим типаж `Display`, как указано в предложении `where`. Этот дополнительный параметр будет напечатан с использованием `{}` , поэтому ограничение типажа `Display` необходимо. Поскольку время жизни является обобщённым типом, то объявления параметра времени жизни `'a` и параметра обобщённого типа `T` помещаются в один список внутри угловых скобок после имени функции. +Это функция `longest` из приложения 10-21, которая возвращает наибольший из двух срезов строки. Но теперь у неё есть дополнительное свойство с именем `ann` обобщённого вида данных `T`, которое может быть представлено любым видом данных, выполняющим сущность `Display`, как указано в предложении `where`. Это дополнительное свойство будет выведено с использованием `{}` , поэтому ограничение сущности `Display` необходимо. Поскольку время жизни является обобщённым видом данных, то объявления свойства времени жизни `'a` и свойства обобщённого вида данных `T` помещаются в один список внутри угловых скобок после имени функции. ## Итоги -В этой главе мы рассмотрели много всего! Теперь вы знакомы с параметрами обобщённого типа, типажами и ограничениями типажа, обобщёнными параметрами времени жизни, вы готовы писать код без повторений, который будет работать во множестве различных ситуаций. Параметры обобщённого типа позволяют использовать код для различных типов данных. Типажи и ограничения типажа помогают убедиться, что, хотя типы и обобщённые, они будут вести себя, как этого требует ваш код. Вы изучили, как использовать аннотации времени жизни чтобы убедиться, что этот универсальный код не будет генерировать никаких повисших ссылок. И весь этот анализ происходит в момент компиляции и не влияет на производительность программы во время работы! +В этой главе мы рассмотрели много всего! Теперь вы знакомы с свойствами обобщённого вида данных, сущностями и ограничениями сущности, обобщёнными свойствами времени жизни, вы готовы писать рукопись без повторений, которая будет работать во множестве различных случаев. Свойства обобщённого вида данных позволяют использовать рукопись для различных видов данных. Сущности и ограничения сущности помогают убедиться, что, хотя виды данных и обобщённые, они будут вести себя, как этого требует Ваша рукопись. Вы изучили, как использовать изложении времени жизни чтобы убедиться, что эта гибкая рукопись не будет порождать никаких повисших ссылок. И вся эта оценкапроисходит во время сборки и не влияет на производительность программы во время работы! -Верите или нет, но в рамках этой темы всё есть ещё чему поучиться: в Главе 17 обсуждаются типажи-объекты, которые являются ещё одним способом использования типажей. Существуют также более сложные сценарии с аннотациями времени жизни, которые вам понадобятся только в очень сложных случаях; для этого вам следует прочитать [Rust Reference]. Далее вы узнаете, как писать тесты на Rust, чтобы убедиться, что ваш код работает так, как задумано. +Верите или нет, но в рамках этой сути всё есть ещё чему поучиться: в Главе 17 обсуждаются сущности-предметы, которые являются ещё одним способом использования сущностей. Существуют также более сложные задумки с изложениями времени жизни, которые вам понадобятся только в очень сложных случаях; для этого вам следует прочитать [Ржавчина Reference]. Далее вы узнаете, как писать проверки на Ржавчине чтобы убедиться, что Ваша рукопись работает так, как задумано. -[Rust Reference]: ../reference/index.html \ No newline at end of file +[Ржавчина Reference]: ../reference/index.html \ No newline at end of file diff --git a/rustbook-ru/src/ch11-00-testing.md b/rustbook-ru/src/ch11-00-testing.md index 250f0d309..5627b72ec 100644 --- a/rustbook-ru/src/ch11-00-testing.md +++ b/rustbook-ru/src/ch11-00-testing.md @@ -1,11 +1,11 @@ -# Написание автоматизированных тестов +# Написание самоматизированных проверок -В своём эссе 1972 года “The Humble Programmer,” Edsger W. Dijkstra сказал, что «Тестирование программы может быть очень эффективным способом показать наличие ошибок, но это безнадёжно неадекватно для показа их отсутствия». Это не значит, что мы не должны пытаться тестировать столько, сколько мы можем! +В своём эссе 1972 года “The Humble Programmer,” Edsger W. Dijkstra сказал, что «Проверка программы может быть очень производительным способом показать наличие ошибок, но это безнадёжно неадекватно для показа их отсутствия». Это не значит, что мы не должны пытаться проверять столько, сколько мы можем! -Корректностью программы считается то, в какой степени наш код выполняет именно то, что мы задумывали. Rust разработан с учётом большой озабоченности корректностью программ, но корректность сложна и нелегко доказуема. Система типизации Rust берет на себя огромную часть этого бремени, но она не может уловить абсолютно все проблемы. Поэтому в Rust предусмотрена возможность написания автотестов. +Соблюдение правил программы считается то, в какой степени наша рукопись выполняет именно то, что мы задумывали. Ржавчина разработана с учётом большой озабоченности соблюдением правил программ, но соблюдение правил сложна и нелегко доказуема. Система определения Ржавчины берёт на себя огромную часть этого бремени, но она не может уловить безусловно все сбои. Поэтому в Ржавчине предусмотрена возможность написания самопроверок. -Допустим, мы пишем функцию `add_two`, которая прибавляет 2 к любому переданному ей числу. Сигнатура этой функции принимает целое число в качестве параметра и возвращает целое число в качестве результата. Когда мы реализуем и компилируем эту функцию, Rust выполняет всю проверку типов и проверку заимствований, которую вы уже изучили, чтобы убедиться, что, например, мы не передаём значение `String` или недопустимую ссылку в эту функцию. Но Rust *не способен* проверить, что эта функция сделает именно то, что мы задумали, то есть вернёт параметр плюс 2, а не, скажем, параметр плюс 10 или параметр минус 50! Вот тут-то и приходят на помощь тесты. +Допустим, мы пишем функцию `add_two`, которая прибавляет 2 к любому переданному ей числу. Ярлык этой функции принимает целое число в качестве свойства и возвращает целое число в качестве итога. Когда мы выполняем и собираем эту функцию, Ржавчина выполняет всю проверку видов данных и проверку заимствований, которую вы уже изучили, чтобы убедиться, что, например, мы не передаём значение `String` или недопустимую ссылку в эту функцию. Но Ржавчина *не способен* проверить, что эта функция сделает именно то, что мы задумали, то есть вернёт свойство + 2, а не, скажем, свойство + 10 или свойство - 50! Вот тут-то и приходят на помощь проверки. -Мы можем написать тесты, которые утверждают, например, что когда мы передаём `3` в функцию `add_two`, возвращаемое значение будет `5`. Мы можем запускать эти тесты всякий раз, когда мы вносим изменения в наш код, чтобы убедиться, что любое существующее правильное поведение не изменилось. +Мы можем написать проверки, которые утверждают, например, что когда мы передаём `3` в функцию `add_two`, возвращаемое значение будет `5`. Мы можем запускать эти проверки всякий раз, когда мы вносим изменения в нашу рукопись, чтобы убедиться, что любое существующее правильное поведение не изменилось. -Тестирование - сложный навык: мы не сможем охватить все детали написания хороших тестов в одной главе, но мы обсудим основные подходы к тестированию в Rust. Мы поговорим об аннотациях и макросах, доступных вам для написания тестов, о поведении по умолчанию и параметрах, предусмотренных для запуска тестов, а также о том, как организовать тесты в модульные тесты и интеграционные тесты. +Проверка - сложный навык: мы не сможем охватить все подробности написания хороших проверок в одной главе, но мы обсудим основные подходы к проверке в Ржавчине. Мы поговорим об изложениех и макросах, доступных вам для написания проверок, о поведении по умолчанию и свойствах, предусмотренных для запуска проверок, а также о том, как согласовать проверки в состоящие из разделов проверки и встроенные проверки. diff --git a/rustbook-ru/src/ch11-01-writing-tests.md b/rustbook-ru/src/ch11-01-writing-tests.md index ddff091eb..a81905926 100644 --- a/rustbook-ru/src/ch11-01-writing-tests.md +++ b/rustbook-ru/src/ch11-01-writing-tests.md @@ -1,22 +1,22 @@ -## Как писать тесты +## Как писать проверки -Тесты - это функции Rust, которые проверяют, что не тестовый код работает ожидаемым образом. Содержимое тестовых функций обычно выполняет следующие три действия: +Проверки - это функции Ржавчина, которые проверяют, что не проверочная рукопись работает ожидаемым образом. Содержимое проверочных функций обычно выполняет три следующих действия: 1. Установка любых необходимых данных или состояния. -2. Запуск кода, который вы хотите проверить. -3. Утверждение, что результаты являются теми, которые вы ожидаете. +2. Запуск рукописи, которую вы хотите проверить. +3. Утверждение, что итоги являются теми, которые вы ожидаете. -Давайте рассмотрим функции предоставляемые в Rust специально для написания тестов, которые выполнят все эти действия, включая атрибут `test`, несколько макросов и атрибут `should_panic`. +Давайте рассмотрим функции предоставляемые в Ржавчине целенаправленно для написания проверок, которые выполнят все эти действия, включая свойство `test`, несколько макросов и свойство `should_panic`. -### Структура тестирующей функции +### Устройство проверяющей функции -В простейшем случае в Rust тест - это функция, аннотированная атрибутом `test`. Атрибуты представляют собой метаданные о фрагментах кода Rust; один из примеров атрибут `derive`, который мы использовали со структурами в главе 5. Чтобы превратить функцию в тестирующую функцию добавьте `#[test]` в строку перед `fn`. Когда вы запускаете тесты командой `cargo test`, Rust создаёт бинарный модуль выполняющий функции аннотированные атрибутом test и сообщающий о том, успешно или нет прошла каждая тестирующая функция. +В простейшем случае в Ржавчине проверка - это функция, определенная свойством `test`. Свойства представляют собой метаданные о отрывках рукописи Ржавчины; один из примеров средство `derive`, который мы использовали со стопками в главе 5. Чтобы превратить функцию в проверяющую функцию добавьте `#[test]` в строку перед `fn`. Когда вы запускаете проверки приказом `cargo test`, Ржавчина создаёт двоичное раздел выполняющее функции определенные свойством test и сообщающий о том, успешно или нет прошла каждая проверяющая функция. -Когда мы создаём новый проект библиотеки с помощью Cargo, то в нём автоматически генерируется тестовый модуль с тест-функцией для нас. Этот модуль даст вам шаблон для написания ваших тестов, так что вам не нужно искать точную структуру и синтаксис тестовых функций каждый раз, когда вы начинаете новый проект. Вы можете добавить столько дополнительных тестовых функций и столько тестовых модулей, сколько захотите! +Когда мы создаём новое дело библиотеки с помощью Cargo, то в нём самостоятельно порождается проверочный раздел с проверку-функцией для нас. Это раздел даст вам образец данных для написания ваших проверок, так что вам не нужно искать точный вид данных и правила написания проверочных функций каждый раз, когда вы начинаете новое дело. Вы можете добавить столько дополнительных проверочных функций и столько проверочных разделов, сколько захотите! -Мы исследуем некоторые аспекты работы тестов, экспериментируя с шаблонным тестом сгенерированным для нас, без реального тестирования любого кода. Затем мы напишем некоторые реальные тесты, которые вызывают некоторый написанный код и убедимся в его правильном поведении. Мы рассмотрим некоторые аспекты работы тестов, поэкспериментируем с шаблонным тестом, прежде чем приступать к фактическому тестированию любого кода. Затем мы напишем несколько реальных тестов, которые вызывают некоторый написанный нами код и проверяют, что его поведение правильное. +Мы исследуем некоторые особенности работы проверок, проводя опыты с образцовой проверкой созданным для нас, без существующего проверки любой рукописи. Затем мы напишем некоторые существующие проверки, которые вызывают некоторую написанную рукопись и убедимся в ее правильном поведении. Мы рассмотрим некоторые особенности работы проверок, проведем опыты с образцовой проверкой, прежде чем приступать к действительной проверке любой рукописи. Затем мы напишем несколько существующих проверок, которые вызывают некоторую написанную нами рукопись и проверяют, что ее поведение правильное. -Давайте создадим новый библиотечный проект под названием `adder`, который складывает два числа: +Давайте создадим новый библиотечный дело под названием `adder`, который складывает два числа: ```console $ cargo new adder --lib @@ -24,7 +24,7 @@ $ cargo new adder --lib $ cd adder ``` -Содержимое файла *src/lib.rs* вашей библиотеки `adder` должно выглядеть как в листинге 11-1. +Содержимое файла *src/lib.rs* вашей библиотеки `adder` должно выглядеть как в приложении 11-1. Файл: src/lib.rs @@ -42,29 +42,29 @@ cd ../../.. {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs}} ``` -Листинг 11-1: Тестовый модуль и функция, сгенерированные автоматически с помощью cargo new +Приложение 11-1: Проверочный раздел и функция, созданные самостоятельно с помощью cargo new -Сейчас давайте проигнорируем первые две строчки кода и сосредоточимся на функции. Обратите внимание на синтаксис аннотации `#[test]`: этот атрибут указывает, что это тестовая функция, поэтому запускающий тестирование знает, что эту функцию следует рассматривать как тестовую. У нас также могут быть не тестируемые функции в модуле `tests`, которые помогут настроить общие сценарии или выполнить общие операции, поэтому нам всегда нужно указывать, какие функции являются тестами. +Сейчас давайте пренебрегаем первые две строчки рукописи и сосредоточимся на функции. Обратите внимание на правила написания изложении `#[test]`: это свойство указывает, что это проверочная функция, поэтому запускающая проверка знает, что эту функцию следует рассматривать как проверочную. У нас также могут быть не проверяемые функции в разделе `tests`, которые помогут настроить общие задумки или выполнить общие действия, поэтому нам всегда нужно указывать, какие функции являются проверками. -В теле функции теста используется макрос `assert_eq!`, чтобы утверждать, что `result`, который содержит результат сложения 2 и 2, равен 4. Это утверждение служит примером формата для типичного теста. Давайте запустим его, чтобы убедиться, что этот тест пройден. +В теле функции проверки используется макрос `assert_eq!`, чтобы утверждать, что `result`, который содержит итог сложения 2 и 2, равен 4. Это утверждение служит примером вида для обычной проверки. Давайте запустим его, чтобы убедиться, что эта проверка пройдена. -Команда `cargo test` выполнит все тесты в выбранном проекте и сообщит о результатах как в листинге 11-2: +Приказ `cargo test` выполнит все проверки в выбранном деле и сообщит о итогах как в приложении 11-2: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-01/output.txt}} ``` -Листинг 11-2: Вывод информации о работе автоматически сгенерированных тестов +Приложение 11-2: Вывод сведений о работе самостоятельно созданных проверок -Cargo скомпилировал и выполнил тест. Мы видим строку `running 1 test`. Следующая строка показывает имя сгенерированной тестовой функции, называемой `it_works`, и результат запуска этого теста равный `ok`. Текст `test result: ok.` означает, что все тесты пройдены успешно и часть вывода `1 passed; 0 failed` сообщает общее количество тестов, которые прошли или были ошибочными. +Cargo собрал и выполнил проверку. Мы видим строку `running 1 test`. Следующая строка показывает имя созданной проверочной функции, называемой `it_works`, и итог запуска этого проверки равный `ok`. писание `test result: ok.` означает, что все проверки пройдены успешно и часть вывода `1 passed; 0 failed` сообщает общее количество проверок, которые прошли или были ошибочными. -Можно пометить тест как игнорируемый, чтобы он не выполнялся в конкретном случае; мы рассмотрим это в разделе [“Игнорирование некоторых тестов, если их специально не запрашивать”] позже в этой главе. Поскольку в данный момент мы этого не сделали, в сводке показано, что `0 ignored`. Мы также можем передать аргумент команде `cargo test` для запуска только тех тестов, имя которых соответствует строке; это называется *фильтрацией*, и мы рассмотрим это в разделе [“Запуск подмножества тестов по имени”]. Мы также не фильтровали выполняемые тесты, поэтому в конце сводки показано, что `0 filtered out`. +Можно пометить проверка как пренебрегаемый, чтобы он не выполнялся в определенном случае; мы рассмотрим это в разделе [“Пренебрежение некоторых проверок, если их целенаправленно не запрашивать”] позже в этой главе. Поскольку в данный мгновение мы этого не сделали, в сводке показано, что `0 ignored`. Мы также можем передать переменная приказу `cargo test` для запуска только тех проверок, имя которых соответствует строке; это называется *выборкой*, и мы рассмотрим это в разделе [“Запуск подмножества проверок по имени”]. Мы также не фильтровали выполняемые проверки, поэтому в конце сводки показано, что `0 filtered out`. -Статистика `0 measured` предназначена для тестов производительности. На момент написания этой статьи такие тесты доступны только в ночной сборке Rust. Посмотрите [документацию о тестах производительности](https://doc.rust-lang.org/unstable-book/library-features/test.html), чтобы узнать больше. +Исчисление `0 measured` предназначена для проверок производительности. На мгновение написания этой статьи такие проверки доступны только в ночной сборке Ржавчина. Посмотрите [пособие о проверках производительности](https://doc.rust-lang.org/unstable-book/library-features/test.html), чтобы узнать больше. -Следующая часть вывода тестов начинается с `Doc-tests adder` - это информация о тестах в документации. У нас пока нет тестов документации, но Rust может компилировать любые примеры кода, которые находятся в API документации. Такая возможность помогает поддерживать документацию и код в синхронизированном состоянии. Мы поговорим о написании тестов документации в секции ["Комментарии документации как тесты"] Главы 14. Пока просто проигнорируем часть `Doc-tests` вывода. +Следующая часть вывода проверок начинается с `Doc-tests adder` - это сведения о проверках в пособии. У нас пока нет проверок пособия, но Ржавчина может собирать любые примеры рукописи, которые находятся в API пособия. Такая возможность помогает поддерживать пособие и рукопись в согласованном состоянии. Мы поговорим о написании проверок пособия в разделах ["Примечания пособия как проверки"] Главы 14. Пока просто пренебрегаем частью `Doc-tests` вывода. -Давайте начнём настраивать тест в соответствии с нашими собственными потребностями. Сначала поменяем название нашего теста `it_works` на `exploration`, вот так: +Давайте начнём настраивать проверка в соответствии с нашими собственными потребностями. Сначала поменяем название нашего проверки `it_works` на `exploration`, вот так: Файл: src/lib.rs @@ -72,13 +72,13 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs}} ``` -Снова выполним команду `cargo test`. Вывод показывает наименование нашей тест-функции - `exploration` вместо `it_works`: +Снова выполним приказ `cargo test`. Вывод показывает наименование нашей проверку-функции - `exploration` вместо `it_works`: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/output.txt}} ``` -Добавим ещё один тест, но в этот раз специально сделаем так, чтобы этот новый тест не отработал! Тест терпит неудачу, когда что-то паникует в тестируемой функции. Каждый тест запускается в новом потоке и когда главный поток видит, что тестовый поток упал, то помечает тест как завершившийся аварийно. Мы говорили о простейшем способе вызвать панику в главе 9, используя для этого известный макрос `panic!`. Введём код тест-функции `another`, как в файле *src/lib.rs* из листинга 11-3. +Добавим ещё один проверка, но в этот раз целенаправленно сделаем так, чтобы эта новая проверка не отработала! Проверка терпит неудачу, когда что-то вызывает сбой в проверяемой функции. Каждая проверка запускается в новом потоке и когда главный поток видит, что проверочный поток упал, то помечает проверка как завершившийся со сбоем. Мы говорили о простейшем способе вызвать сбой в главе 9, используя для этого известный макрос `panic!`. Введём рукопись проверку-функции `another`, как в файле *src/lib.rs* из приложения 11-3. Файл: src/lib.rs @@ -86,27 +86,27 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs:here}} ``` -Листинг 11-3: Добавление второго теста, который завершится ошибкой, потому что мы вызываем panic! макрос +Приложение 11-3: Добавление второго проверки, который завершится ошибкой, потому что мы вызываем panic! макрос -Запустим команду `cargo test`. Вывод результатов показан в листинге 11-4, который сообщает, что тест `exploration` пройден, а `another` нет: +Запустим приказ `cargo test`. Вывод итогов показан в приложении 11-4, который сообщает, что проверка `exploration` пройден, а `another` нет: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-03/output.txt}} ``` -Листинг 11-4. Результаты теста, когда один тест пройден, а другой нет +Приложение 11-4. Итоги проверки, когда один проверка пройдена, а другой нет -Вместо `ok`, строка `test tests::another` сообщает `FAILED`. Две новые секции появились между отдельными результатами и сводкой: в первом отображается подробная причина каждого сбоя теста. В данном случае тест `another` не сработал, потому что `panicked at 'Make this test fail'`, произошло в строке 10 файла *src/lib.rs*. В следующем разделе перечисляют имена всех не пройденных тестов, что удобно, когда есть много тестов и много подробных результатов неудачных тестов. Мы можем использовать имя не пройденного теста для его дальнейшей отладки; мы больше поговорим о способах запуска тестов в разделе ["Контролирование хода выполнения тестов"](ch11-02-running-tests.html#controlling-how-tests-are-run). +Вместо `ok`, строка `test tests::another` сообщает `FAILED`. Два новых раздела появились между отдельными итогами и сводкой: в первом отображается подробная причина каждого сбоя проверки. В данном случае проверка `another` не сработала, потому что `panicked at 'Make this test fail'`, произошло в строке 10 файла *src/lib.rs*. В следующем разделе перечисляют имена всех не пройденных проверок, что удобно, когда есть много проверок и много подробных итогов неудачных проверок. Мы можем использовать имя не пройденной проверки для его дальнейшей отладки; мы больше поговорим о способах запуска проверок в разделе ["Управление хода выполнения проверок"](ch11-02-running-tests.html#controlling-how-tests-are-run). -Итоговая строка отображается в конце: общий результат нашего тестирования `FAILED`. У нас один тест пройден и один тест завершён аварийно. +Итоговая строка отображается в конце: общий итог нашего проверки `FAILED`. У нас один проверка пройдена и один проверка завершена со сбоем. -Теперь, когда вы увидели, как выглядят результаты теста при разных сценариях, давайте рассмотрим другие макросы полезные в тестах, кроме `panic!`. +Теперь, когда вы увидели, как выглядят итоги проверки при разных задумках, давайте рассмотрим другие макросы полезные в проверках, кроме `panic!`. -### Проверка результатов с помощью макроса `assert!` +### Проверка итогов с помощью макроса `assert!` -Макрос `assert!` доступен из стандартной библиотеки и является удобным, когда вы хотите проверить что некоторое условие в тесте вычисляется в значение `true`. Мы передаём в макрос `assert!` аргумент, который вычисляется в логическое значение. Если оно `true`, то ничего не происходит и тест считается пройденным. Если же значение вычисляется в `false`, то макрос `assert!` вызывает макрос `panic!`, чтобы вызвать сбой теста. Использование макроса `assert!` помогает проверить, что код функционирует как ожидалось. +Макрос `assert!` доступен из встроенной библиотеки и является удобным, когда вы хотите проверить что некоторое условие в проверке вычисляется в значение `true`. Мы передаём в макрос `assert!` переменная, который вычисляется в разумное значение. Если оно `true`, то ничего не происходит и проверка считается пройденным. Если же значение вычисляется в `false`, то макрос `assert!` вызывает макрос `panic!`, чтобы вызвать сбой проверки. Использование макроса `assert!` помогает проверить, что рукопись исполняется как ожидалось. -В главе 5, листинге 5-15, мы использовали структуру `Rectangle` и метод `can_hold`, который повторён в листинге 11-5. Давайте поместим этот код в файл *src/lib.rs* и напишем несколько тестов для него используя макрос `assert!`. +В главе 5, приложении 5-15, мы использовали вид данных стопка `Rectangle`(прямоугольник) и способ `can_hold`, который повторён в приложении 11-5. Давайте поместим эту рукопись в файл *src/lib.rs* и напишем несколько проверок для него используя макрос `assert!`. Файл: src/lib.rs @@ -114,9 +114,9 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-05/src/lib.rs:here}} ``` -Листинг 11-5: Использование структуры Rectangle и её метода can_hold из главы 5 +Приложение 11-5: Использование стопки Rectangle и её способа can_hold из Главы 5 -Метод `can_hold` возвращает логическое значение, что означает, что он является идеальным вариантом использования в макросе `assert!`. В листинге 11-6 мы пишем тест, который выполняет метод `can_hold` путём создания экземпляра `Rectangle` шириной 8 и высотой 7 и убеждаемся, что он может содержать другой экземпляр `Rectangle` имеющий ширину 5 и высоту 1. +Способ `can_hold` возвращает разумное значение, что означает, что он является наилучшим исходом использования в макросе `assert!`. В приложении 11-6 мы пишем проверка, которая использует способ `can_hold` путём создания образца данных `Rectangle` шириной 8 и высотой 7 и убеждаемся, что он может содержать другой образец данных `Rectangle` имеющий ширину 5 и высоту 1. Файл: src/lib.rs @@ -124,17 +124,17 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-06/src/lib.rs:here}} ``` -Листинг 11-6: Тест для метода can_hold, который проверяет что больший прямоугольник действительно может содержать меньший +Приложение 11-6: Проверка для способа can_hold, который проверяет что больший прямоугольник действительно может содержать меньший -Также, в модуле `tests` обратите внимание на новую добавленную строку `use super::*;`. Модуль `tests` является обычным и подчиняется тем же правилам видимости, которые мы обсуждали в главе 7 ["Пути для ссылки на элементы внутри дерева модуля"]. Так как этот модуль `tests` является внутренним, нужно подключить тестируемый код из внешнего модуля в область видимости внутреннего модуля с тестами. Для этого используется глобальное подключение, так что все что определено во внешнем модуле становится доступным внутри `tests` модуля. +Также, в разделе `tests` обратите внимание на новую добавленную строку `use super::*;`. Раздел `tests` является обычным и подчиняется тем же правилам видимости, которые мы обсуждали в главе 7 ["Пути для ссылки на переменнуюы внутри дерева раздела"]. Так как это раздел `tests` является внутренним, нужно подключить проверяемый рукопись из внешнего раздела в область видимости внутреннего раздела с проверками. Для этого используется вездесущеее подключение, так что все что определено во внешнем разделе становится доступным внутри `tests` раздела. -Мы назвали наш тест `larger_can_hold_smaller` и создали два нужных экземпляра `Rectangle`. Затем вызвали макрос `assert!` и передали результат вызова `larger.can_hold(&smaller)` в него. Это выражение должно возвращать `true`, поэтому наш тест должен пройти. Давайте выясним! +Мы назвали нашу проверку `larger_can_hold_smaller` и создали два нужных образца данных `Rectangle`. Затем вызвали макрос `assert!` и передали итог вызова `larger.can_hold(&smaller)` в него. Это выражение должно возвращать `true`, поэтому наша проверка должна пройти. Давайте выясним! ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-06/output.txt}} ``` -Тест проходит. Теперь добавим другой тест, в этот раз мы попытаемся убедиться, что меньший прямоугольник не может содержать больший прямоугольник: +Проверка проходит. Теперь добавим другой проверка, в этот раз мы попытаемся убедиться, что меньший прямоугольник не может содержать больший прямоугольник: Файл: src/lib.rs @@ -142,31 +142,31 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/src/lib.rs:here}} ``` -Поскольку правильный результат функции `can_hold` в этом случае `false`, то мы должны инвертировать этот результат, прежде чем передадим его в `assert!` макро. Как результат, наш тест пройдёт, если `can_hold` вернёт `false`: +Поскольку правильный итог функции `can_hold` в этом случае `false`, то мы должны инвертировать этот итог, прежде чем передадим его в `assert!` макро. Как итог, наша проверка пройдёт, если `can_hold` вернёт `false`: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/output.txt}} ``` -Два теста работают. Теперь проверим, как отреагируют тесты, если мы добавим ошибку в код. Давайте изменим реализацию метода `can_hold` заменив одно из логических выражений знак сравнения с "больше чем" на противоположный "меньше чем" при сравнении ширины: +Два проверки работают. Теперь проверим, как отреагируют проверки, если мы добавим ошибку в рукопись. Давайте изменим использование способа `can_hold` заменив одно из разумных выражений знак сравнения с "больше чем" на противоположный "меньше чем" при сравнении ширины: ```rust,not_desired_behavior,noplayground {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/src/lib.rs:here}} ``` -Запуск тестов теперь производит следующее: +Запуск проверок теперь производит следующее: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt}} ``` -Наши тесты нашли ошибку! Так как в тесте `larger.width` равно 8 и `smaller.width` равно 5 сравнение ширины в методе `can_hold` возвращает результат `false`, поскольку число 8 не меньше чем 5. +Наши проверки нашли ошибку! Так как в проверке `larger.width` равно 8 и `smaller.width` равно 5 сравнение ширины в способе `can_hold` возвращает итог `false`, поскольку число 8 не меньше чем 5. ### Проверка на равенство с помощью макросов `assert_eq!` и `assert_ne!` -Общим способом проверки функциональности является использование сравнения результата тестируемого кода и ожидаемого значения, чтобы убедиться в их равенстве. Для этого можно использовать макрос `assert!`, передавая ему выражение с использованием оператора `==`. Важно также знать, что кроме этого стандартная библиотека предлагает пару макросов `assert_eq!` и `assert_ne!`, чтобы сделать тестирование более удобным. Эти макросы сравнивают два аргумента на равенство или неравенство соответственно. Макросы также печатают два значения входных параметров, если тест завершился ошибкой, что позволяет легче увидеть *почему* тест ошибочен. Противоположно этому, макрос `assert!` может только отобразить, что он вычислил значение `false` для выражения `==`, но не значения, которые привели к результату `false`. +Общим способом проверки возможности является использование сравнения итога проверяемого рукописью и ожидаемого значения, чтобы убедиться в их равенстве. Для этого можно использовать макрос `assert!`, передавая ему выражение с использованием приказчика `==`. Важно также знать, что кроме этого обычная библиотека предлагает пару макросов `assert_eq!` и `assert_ne!`, чтобы сделать проверка более удобной. Эти макросы сравнивают две переменной на равенство или неравенство соответственно. Макросы также выводят два значения входных свойств, если проверка завершилась ошибкой, что позволяет легче увидеть *почему* проверка ошибочна. Противоположно этому, макрос `assert!` может только отобразить, что он вычислил значение `false` для выражения `==`, но не значения, которые привели к итогу `false`. -В листинге 11-7, мы напишем функцию `add_two`, которая прибавляет к входному параметру `2` и возвращает значение. Затем, протестируем эту функцию с помощью макроса `assert_eq!`: +В приложении 11-7, мы напишем функцию `add_two`, которая прибавляет к входному свойству `2` и возвращает значение. Затем, проверим эту функцию с помощью макроса `assert_eq!`: Файл: src/lib.rs @@ -174,41 +174,41 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-07/src/lib.rs}} ``` -Листинг 11-7: Тестирование функции add_two с помощью макроса assert_eq! +Приложение 11-7: Проверка функции add_two с помощью макроса assert_eq! -Проверим, что тесты проходят! +Проверим, что проверки проходят! ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-07/output.txt}} ``` -Первый аргумент, который мы передаём в макрос `assert_eq!` число `4` чей результат вызова равен `add_two(2)` . Строка для этого теста - `test tests::it_adds_two ... ok` , а текст `ok` означает, что наш тест пройден! +Первая переменная, которую мы передаём в макрос `assert_eq!` число `4` чей итог вызова равен `add_two(2)` . Строка для этой проверки - `test tests::it_adds_two ... ok` , а писание `ok` означает, что наша проверка пройдена! -Давайте введём ошибку в код, чтобы увидеть, как она выглядит, когда тест, который использует `assert_eq!` завершается ошибкой. Измените реализацию функции `add_two`, чтобы добавлять `3`: +Давайте введём ошибку в рукопись, чтобы увидеть, как она выглядит, когда проверка, которая использует `assert_eq!` завершается ошибкой. Измените выполнение функции `add_two`, чтобы добавлять `3`: ```rust,not_desired_behavior,noplayground {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs:here}} ``` -Попробуем выполнить данный тест ещё раз: +Попробуем выполнить данную проверка ещё раз: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt}} ``` -Наш тест нашёл ошибку! Тест `it_adds_two` не выполнился, отображается сообщение `assertion failed: `(left == right)`` и показывает, что `left` было `4`, а `right` было `5`. Это сообщение полезно и помогает начать отладку: это означает `left` аргумент `assert_eq!` имел значение `4`, но right аргумент для вызова add_two(2) был со значением 5. +Наша проверка нашла ошибку! Проверка `it_adds_two` не выполнился, отображается сообщение `assertion failed: `(left == right)`` и показывает, что `left` было `4`, а `right` было `5`. Это сообщение полезно и помогает начать отладку: это означает `left` переменная `assert_eq!` имел значение `4`, но right переменная для вызова add_two(2) был со значением 5. -Обратите внимание, что в некоторых языках (таких как Java) в библиотеках кода для тестирования принято именовать входные параметры проверочных функций как "ожидаемое" (`expected`) и "фактическое" (`actual`). В Rust приняты следующие обозначения `left` и `right` соответственно, а порядок в котором определяются ожидаемое значение и производимое тестируемым кодом значение не имеют значения. Мы могли бы написать выражение в тесте как `assert_eq!(add_two(2), 4)`, что приведёт к отображаемому сообщению об ошибке `assertion failed: `(left == right)``, слева `left` было бы 5, а справа right было бы 4. +Обратите внимание, что в некоторых языках (таких как Java) в библиотеках рукописи для проверки принято именовать входные свойства проверочных функций как "ожидаемое" (`expected`) и "действительное" (`actual`). В Ржавчине приняты следующие обозначения `left` и `right` соответственно, а порядок в котором определяются ожидаемое значение и производимое проверяемым рукописью значение не имеют значения. Мы могли бы написать выражение в проверке как `assert_eq!(add_two(2), 4)`, что приведёт к отображаемому сообщению об ошибке `assertion failed: `(left == right)``, слева `left` было бы 5, а справа right было бы 4. -Макрос `assert_ne!` сработает успешно, если входные параметры не равны друг другу и завершится с ошибкой, если значения равны. Этот макрос наиболее полезен в тех случаях, когда мы не знаем заранее, каким значение *будет*, но знаем точно, каким оно *не может* быть. К примеру, если тестируется функция, которая гарантировано изменяет входные данные определённым образом, но способ изменения входного параметра зависит от дня недели, в который запускаются тесты, что лучший способ проверить правильность работы такой функции - это сравнить и убедиться, что выходное значение функции не должно быть равным входному значению. +Макрос `assert_ne!` сработает успешно, если входные свойства не равны друг другу и завершится с ошибкой, если значения равны. Этот макрос наиболее полезен в тех случаях, когда мы не знаем заранее, каким значение *будет*, но знаем точно, каким оно *не может* быть. К примеру, если проверяется функция, которая обязательно изменяет входные данные определённым образом, но способ изменения входного свойства зависит от дня недели, в котором запускаются проверки, что лучший способ проверить правильность работы такой функции - это сравнить и убедиться, что выходное значение функции не должно быть равным входному значению. -В своей работе макросы `assert_eq!` и `assert_ne!` неявным образом используют операторы `==` и `!=` соответственно. Когда проверка не срабатывает, макросы печатают значения аргументов с помощью отладочного форматирования и это означает, что значения сравниваемых аргументов должны реализовать типажи `PartialEq` и `Debug`. Все примитивные и большая часть типов стандартной библиотеки Rust реализуют эти типажи. Для структур и перечислений, которые вы реализуете сами будет необходимо реализовать типаж `PartialEq` для сравнения значений на равенство или неравенство. Для печати отладочной информации в виде сообщений в строку вывода консоли необходимо реализовать типаж `Debug`. Так как оба типажа являются выводимыми типажами, как упоминалось в листинге 5-12 главы 5, то эти типажи можно реализовать добавив аннотацию `#[derive(PartialEq, Debug)]` к определению структуры или перечисления. Смотрите больше деталей в Appendix C ["Выводимые типажи"] про эти и другие выводимые типажи. +В своей работе макросы `assert_eq!` и `assert_ne!` неявным образом используют приказчики `==` и `!=` соответственно. Когда проверка не срабатывает, макросы выводят значения переменных с помощью отладочной разметки и это означает, что значения сравниваемых переменных должны использовать сущности `PartialEq` и `Debug`. Все простые и большая часть видов данных встроенной библиотеки Ржавчина используют эти сущности. Для стопок и перечислений, которые вы используете сами будет необходимо использовать сущность `PartialEq` для сравнения значений на равенство или неравенство. Для вывода отладочных сведений в виде сообщений в строку вывода окне вывода необходимо использовать сущность `Debug`. Так как обе сущности являются выводимыми сущностями, как упоминалось в приложении 5-12 Главы 5, то эти сущности можно использовать добавив изложение `#[derive(PartialEq, Debug)]` к определению стопки или перечисления. Смотрите больше подробностей в Appendix C ["Выводимые сущности"] про эти и другие выводимые сущности. ### Создание сообщений об ошибках -Также можно добавить пользовательское сообщение как дополнительный аргумент макросов для печати в сообщении об ошибке теста `assert!`, `assert_eq!`, и `assert_ne!`. Любые аргументы, указанные после обязательных аргументов, далее передаются в макрос `format!` (он обсуждается в разделе ["Конкатенация с помощью оператора `+` или макроса format!"](ch08-02-strings.html#concatenation-with-the--operator-or-the-format-macro)), так что вы можете передать форматированную строку, которая содержит `{}` для заполнителей и значения, заменяющие эти заполнители. Пользовательские сообщения полезны для пояснения того, что означает утверждение (assertion); когда тест завершается неудачей, у вас будет лучшее представление о том, в чем проблема с кодом. +Также можно добавить пользовательское сообщение как дополнительный переменная макросов для выводе в сообщении об ошибке проверки `assert!`, `assert_eq!`, и `assert_ne!`. Любые переменные, указанные после обязательных переменных, далее передаются в макрос `format!` (он обсуждается в разделе ["Сцепление с помощью приказчика `+` или макроса format!"](ch08-02-strings.html#concatenation-with-the--operator-or-the-format-macro)), так что вы можете передать размеченную строку, которая содержит `{}` для исполнителей и значения, заменяющие эти исполнители. Пользовательские сообщения полезны для пояснения того, что означает утверждение (assertion); когда проверка завершается неудачей, у вас будет лучшее представление о том, в чем неполадка с рукописью. -Например, есть функция, которая приветствует человека по имени и мы хотим протестировать эту функцию. Мы хотим чтобы передаваемое ей имя выводилось в консоль: +Например, есть функция, которая приветствует человека по имени и мы хотим проверять эту функцию. Мы хотим чтобы передаваемое ей имя выводилось в окно вывода: Файл: src/lib.rs @@ -216,41 +216,41 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-05-greeter/src/lib.rs}} ``` -Требования к этой программе ещё не были согласованы и мы вполне уверены, что текст `Hello` в начале приветствия ещё изменится. Мы решили, что не хотим обновлять тест при изменении требований, поэтому вместо проверки на точное равенство со значением возвращённым из `greeting`, мы просто будем проверять, что вывод содержит текст из входного параметра. +Требования к этой программе ещё не были согласованы и мы вполне уверены, что писание `Hello` в начале приветствия ещё изменится. Мы решили, что не хотим обновлять проверка при изменении требований, поэтому вместо проверки на точное равенство со значением возвращённым из `greeting`, мы просто будем проверять, что вывод содержит писание из входного свойства. -Давайте внесём ошибку в этот код, изменив `greeting` так, чтобы оно не включало `name` и увидим, как выглядит сбой этого теста: +Давайте внесём ошибку в эту рукопись, изменив `greeting` так, чтобы оно не включало `name` и увидим, как выглядит сбой этого проверки: ```rust,not_desired_behavior,noplayground {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/src/lib.rs:here}} ``` -Запуск этого теста выводит следующее: +Запуск этого проверки выводит следующее: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt}} ``` -Сообщение содержит лишь информацию о том что сравнение не было успешным и в какой строке это произошло. В данном случае, более полезный текст сообщения был бы, если бы также выводилось значение из функции `greeting`. Изменим тестирующую функцию так, чтобы выводились пользовательское сообщение форматированное строкой с заменителем и фактическими данными из кода `greeting`: +Сообщение содержит лишь сведения о том что сравнение не было успешным и в какой строке это произошло. В данном случае, более полезный писание сообщения был бы, если бы также выводилось значение из функции `greeting`. Изменим проверяющую функцию так, чтобы выводились пользовательское сообщение, размеченной строкой с заменителем и действительными данными из рукописи `greeting`: ```rust,ignore {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/src/lib.rs:here}} ``` -После того, как выполним тест ещё раз мы получим подробное сообщение об ошибке: +После того, как выполним проверка ещё раз мы получим подробное сообщение об ошибке: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt}} ``` -Мы можем увидеть значение, которое мы на самом деле получили в тестовом выводе, что поможет нам отлаживать произошедшее, а не то, что мы ожидали. +Мы можем увидеть значение, которое мы на самом деле получили в проверочном выводе, что поможет нам отлаживать произошедшее, а не то, что мы ожидали. ### Проверка с помощью макроса `should_panic` -В дополнение к проверке того, что наш код возвращает правильные, ожидаемые значения, важным также является проверить, что наш код обрабатывает ошибки, которые мы ожидаем. Например, рассмотрим тип `Guess` который мы создали в главе 9, листинга 9-10. Другой код, который использует `Guess` зависит от гарантии того, что `Guess` экземпляры будут содержать значения только от 1 до 100. Мы можем написать тест, который гарантирует, что попытка создать экземпляр `Guess` со значением вне этого диапазона вызывает панику. +В дополнение к проверке того, что наша рукопись возвращает правильные, ожидаемые значения, важным также является проверить, что наша рукопись обрабатывает ошибки, которые мы ожидаем. Например, рассмотрим вид данных `Guess` который мы создали в главе 9, приложения 9-10. Другая рукопись, которая использует `Guess` зависит от заверения того, что `Guess` образцы будут содержать значения только от 1 до 100. Мы можем написать проверку, которая заверяет, что попытка создать образец данных `Guess` со значением вне этого ряда вызывает сбой. -Реализуем это с помощью другого атрибута тест-функции `#[should_panic]`. Этот атрибут сообщает системе тестирования, что тест проходит, когда метод генерирует ошибку. Если ошибка не генерируется - тест считается не пройденным. +Выполняем это с помощью другого свойства проверку-функции `#[should_panic]`. Это свойство сообщает устройству проверки, что проверка проходит, когда способ порождает ошибку. Если ошибка не порождается - проверка считается не пройденным. -Листинг 11-8 показывает тест, который проверяет, что условия ошибки `Guess::new` произойдут, когда мы их ожидаем их. +Приложение 11-8 показывает проверка, которая проверяет, что условия ошибки `Guess::new` произойдут, когда мы их ожидаем их. Файл: src/lib.rs @@ -258,29 +258,30 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-08/src/lib.rs}} ``` -Листинг 11-8: Проверка того, что условие вызовет макрос panic! +Приложение 11-8: Проверка того, что условие вызовет макрос panic! -Атрибут `#[should_panic]` следует после `#[test]` и до объявления тестовой функции. Посмотрим на вывод результата, когда тест проходит: +Свойство `#[should_panic]` следует после `#[test]` и до объявления проверочной функции. Посмотрим на вывод итога, когда проверка проходит: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-08/output.txt}} ``` -Выглядит хорошо! Теперь давайте внесём ошибку в наш код, убрав условие о том, что функция `new` будет паниковать если значение больше 100: +Выглядит хорошо! Теперь давайте внесём ошибку в нашу рукопись, убрав условие о том, что функция `new` будет вызвать сбой если значение больше 100: ```rust,not_desired_behavior,noplayground {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/src/lib.rs:here}} ``` -Когда мы запустим тест в листинге 11-8, он потерпит неудачу: +Когда мы запустим проверка в приложении 11-8, он потерпит неудачу: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt}} ``` -Мы получаем не очень полезное сообщение в этом случае, но когда мы смотрим на тестирующую функцию, мы видим, что она `#[should_panic]`. Аварийное выполнение, которое мы получили означает, что код в тестирующей функции не вызвал паники. +Мы получаем мало полезных сведений в этом случае, но когда мы смотрим на проверяющую функцию, мы видим, что она обозначена +как `#[should_panic]`. Ошибка, которую мы получили во время выполнения означает, что рукопись в проверяющей функции не вызвала сбоя и завершения программы. -Тесты, которые используют `should_panic` могут быть неточными, потому что они только указывают, что код вызвал панику. Тест с атрибутом `should_panic` пройдёт, даже если тест паникует по причине, отличной от той, которую мы ожидали. Чтобы сделать тесты с `should_panic` более точными, мы можем добавить необязательный параметр `expected` для атрибута `should_panic`. Такая детализация теста позволит удостовериться, что сообщение об ошибке содержит предоставленный текст. Например, рассмотрим модифицированный код для `Guess` в листинге 11-9, где `new` функция паникует с различными сообщениями в зависимости от того, является ли значение слишком маленьким или слишком большим. +Проверки, которые используют `should_panic` могут быть неточными, потому что они только указывают, что рукопись вызвал сбой. Проверка со свойством `should_panic` пройдёт, даже если проверка вызывает сбой по причине, отличной от той, которую мы ожидали. Чтобы сделать проверки с `should_panic` более точными, мы можем добавить необязательный свойство `expected` для свойства `should_panic`. Такое подробное проведение проверки позволит удостовериться, что сообщение об ошибке содержит предоставленный писание. Например, рассмотрим измененный рукопись для `Guess` в приложении 11-9, где `new` функция вызывает сбой с различными сообщениями в зависимости от того, является ли значение слишком маленьким или слишком большим. Файл: src/lib.rs @@ -288,43 +289,43 @@ Cargo скомпилировал и выполнил тест. Мы видим {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-09/src/lib.rs:here}} ``` -Листинг 11-9: Проверка panic! на наличие в его сообщении указанной подстроки +Приложение 11-9: Проверка panic! на наличие в его сообщении указанной подстроки -Этот тест пройдёт, потому что значение, которое мы поместили для `should_panic` в параметр атрибута `expected` является подстрокой сообщения, с которым функция `Guess::new` вызывает панику. Мы могли бы указать полное, ожидаемое сообщение для паники, в этом случае это будет `Guess value must be less than or equal to 100, got 200`. То что вы выберите для указания как ожидаемого параметра у `should_panic` зависит от того, какая часть сообщения о панике уникальна или динамична, насколько вы хотите, чтобы ваш тест был точным. В этом случае достаточно подстроки из сообщения паники, чтобы гарантировать выполнение кода в тестовой функции `else if value > 100` . +Эта проверка пройдёт, потому что значение, которое мы поместили для `should_panic` в свойство свойства `expected` является подстрокой сообщения, с которым функция `Guess::new` вызывает сбой. Мы могли бы указать полное, ожидаемое сообщение для сбоя, в этом случае это будет `Guess value must be less than or equal to 100, got 200`. То что вы выберите для указания как ожидаемого свойства у `should_panic` зависит от того, какая часть сообщения о сбое неповторима или динамична, насколько вы хотите, чтобы ваш проверка был точным. В этом случае достаточно подстроки из сообщения сбоя, чтобы обеспечить выполнение рукописи в проверочной функции `else if value > 100` . -Чтобы увидеть, что происходит, когда тест `should_panic` неуспешно завершается с сообщением `expected`, давайте снова внесём ошибку в наш код, поменяв местами `if value < 1` и `else if value > 100` блоки: +Чтобы увидеть, что происходит, когда проверка `should_panic` неуспешно завершается с сообщением `expected`, давайте снова внесём ошибку в нашу рукопись, поменяв местами `if value < 1` и `else if value > 100` разделы: ```rust,ignore,not_desired_behavior {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/src/lib.rs:here}} ``` -На этот раз, когда мы выполним `should_panic` тест, он потерпит неудачу: +На этот раз, когда мы выполним `should_panic` проверка, он потерпит неудачу: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt}} ``` -Сообщение об ошибке указывает, что этот тест действительно вызвал панику, как мы и ожидали, но сообщение о панике не включено ожидаемую строку `'Guess value must be less than or equal to 100'`. Сообщение о панике, которое мы получили в этом случае, было `Guess value must be greater than or equal to 1, got 200.` Теперь мы можем начать выяснение, где ошибка! +Сообщение об ошибке указывает, что эта проверка действительно вызвала сбой, как мы и ожидали, но сообщение о сбое не включено ожидаемую строку `'Guess value must be less than or equal to 100'`. Сообщение о сбое, которое мы получили в этом случае, было `Guess value must be greater than or equal to 1, got 200.` Теперь мы можем начать выяснение, где ошибка! -### Использование `Result` в тестах +### Использование `Result` в проверках -Пока что мы написали тесты, которые паникуют, когда терпят неудачу. Мы также можем написать тесты которые используют `Result`! Вот тест из листинга 11-1, переписанный с использованием `Result` и возвращающий `Err` вместо паники: +Пока что мы написали проверки, которые вызывают сбой, когда терпят неудачу. Мы также можем написать проверки которые используют `Result`! Вот проверка из приложения 11-1, переписанный с использованием `Result` и возвращающий `Err` вместо сбоя: ```rust,noplayground {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs}} ``` -Функция `it_works` теперь имеет возвращаемый тип `Result<(), String>`. В теле функции, вместо вызова макроса `assert_eq!`, мы возвращаем `Ok(())` когда тест успешно выполнен и `Err` со `String` внутри, когда тест не проходит. +Функция `it_works` теперь имеет возвращаемый вид данных `Result<(), String>`. В теле функции, вместо вызова макроса `assert_eq!`, мы возвращаем `Ok(())` когда проверка успешно выполнен и `Err` со `String` внутри, когда проверка не проходит. -Написание тестов так, чтобы они возвращали `Result` позволяет использовать оператор "вопросительный знак" в теле тестов, который может быть удобным способом писать тесты, которые должны выполниться не успешно, если какая-либо операция внутри них возвращает вариант ошибки `Err`. +Написание проверок так, чтобы они возвращали `Result` позволяет использовать приказчик "вопросительный знак" в теле проверок, который может быть удобным способом писать проверки, которые должны выполниться не успешно, если какая-либо действие внутри них возвращает исход ошибки `Err`. -Вы не можете использовать аннотацию `#[should_panic]` в тестах, использующих `Result`. Чтобы утверждать, что операция возвращает вариант `Err`, *не* используйте оператор вопросительного знака для значения `Result`. Вместо этого используйте `assert!(value.is_err())`. +Вы не можете использовать изложение `#[should_panic]` в проверках, использующих `Result`. Чтобы утверждать, что действие возвращает исход `Err`, *не* используйте приказчик вопросительного знака для значения `Result`. Вместо этого используйте `assert!(value.is_err())`. -Теперь, когда вы знаете несколько способов написания тестов, давайте взглянем на то, что происходит при запуске тестов и исследуем разные опции используемые с командой `cargo test`. +Теперь, когда вы знаете несколько способов написания проверок, давайте взглянем на то, что происходит при запуске проверок и исследуем разные возможности используемые с приказом `cargo test`. -[“Игнорирование некоторых тестов, если их специально не запрашивать”]: ch11-02-running-tests.html#ignoring-some-tests-unless-specifically-requested -[“Запуск подмножества тестов по имени”]: ch11-02-running-tests.html#running-a-subset-of-tests-by-name -["Выводимые типажи"]: appendix-03-derivable-traits.html -["Комментарии документации как тесты"]: ch14-02-publishing-to-crates-io.html#documentation-comments-as-tests -["Пути для ссылки на элементы внутри дерева модуля"]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html \ No newline at end of file +[“Пренебрежение некоторых проверок, если их целенаправленно не запрашивать”]: ch11-02-running-tests.html#ignoring-some-tests-unless-specifically-requested +[“Запуск подмножества проверок по имени”]: ch11-02-running-tests.html#running-a-subset-of-tests-by-name +["Выводимые сущности"]: appendix-03-derivable-traits.html +["Примечания пособия как проверки"]: ch14-02-publishing-to-crates-io.html#documentation-comments-as-tests +["Пути для ссылки на переменнуюы внутри дерева раздела"]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html \ No newline at end of file diff --git a/rustbook-ru/src/ch11-02-running-tests.md b/rustbook-ru/src/ch11-02-running-tests.md index 3dc8f7762..03ec8f6a1 100644 --- a/rustbook-ru/src/ch11-02-running-tests.md +++ b/rustbook-ru/src/ch11-02-running-tests.md @@ -1,28 +1,28 @@ -## Контролирование хода выполнения тестов +## Управление хода выполнения проверок -Подобно тому, как `cargo run` выполняет компиляцию вашего кода, а затем запускает полученный двоичный файл, `cargo test` компилирует ваш код в режиме тестирования и запускает полученный бинарник с тестами. Двоичный файл, создаваемый `cargo test`, по умолчанию запускает все тесты параллельно и перехватывает вывод, генерируемый во время выполнения тестов, предотвращая их вывод на экран для облегчения чтения вывода, относящегося к результатам тестирования. Однако вы можете указать параметры командной строки, чтобы изменить это поведение по умолчанию. +Подобно тому, как `cargo run` выполняет сборку вашей рукописи, а затем запускает полученный двоичный файл, `cargo test` собирает вашу рукопись в режиме проверки и запускает полученный двоичный файл с проверками. Двоичный файл, создаваемый `cargo test`, по умолчанию запускает все проверки одновременно и перехватывает вывод, порождаемый во время выполнения проверок, предотвращая их вывод на экран для облегчения чтения вывода, относящегося к итогам проверки. Однако вы можете указать свойства приказной строки, чтобы изменить это поведение по умолчанию. -Часть параметров командной строки передаётся в `cargo test`, а часть - в итоговый двоичный файл с тестами. Чтобы разделить эти два типа аргументов, нужно сначала указать аргументы, которые идут в `cargo test`, затем использовать разделитель `--`, а потом те, которые попадут в двоичный файл теста. Выполнение `cargo test --help` выводит опции, которые вы можете использовать с `cargo test`, а выполнение `cargo test -- --help` выводит опции, которые вы можете использовать за разделителем. +Часть свойств приказной строки передаётся в `cargo test`, а часть - в итоговый двоичный файл с проверками. Чтобы разделить эти два вида данных переменных, нужно сначала указать переменные, которые идут в `cargo test`, затем использовать разделитель `--`, а потом те, которые попадут в двоичный файл проверки. Использование `cargo test --help` выводит возможности, которые вы можете использовать с `cargo test`, а использование `cargo test -- --help` выводит возможности, которые вы можете использовать за разделителем. -### Выполнение тестов параллельно или последовательно +### Выполнение проверок одновременно или последовательно -Когда вы запускаете несколько тестов, по умолчанию они выполняются параллельно с использованием потоков, что означает, что они завершатся быстрее, и вы быстрее получите результаты. Поскольку тесты выполняются параллельно, вы должны убедиться, что ваши тесты не зависят друг от друга или от какого-либо общего состояния, включая общее окружение, например, текущий рабочий каталог или переменные окружения. +Когда вы запускаете несколько проверок, по умолчанию они выполняются одновременно с использованием потоков, что означает, что они завершатся быстрее, и вы быстрее получите итоги. Поскольку проверки выполняются одновременно, вы должны убедиться, что ваши проверки не зависят друг от друга или от какого-либо общего состояния, включая общее окружение, например, текущая рабочая папка или переменные окружения. -Например, допустим, каждый из ваших тестов запускает код, который создаёт файл на диске с именем *test-output.txt* и записывает некоторые данные в этот файл. Затем каждый тест считывает данные из этого файла и утверждает, что файл содержит определённое значение, которое в каждом тесте разное. Поскольку все тесты выполняются одновременно, один из тестов может перезаписать файл в промежутке между записью и чтением файла другим тестом. Тогда второй тест потерпит неудачу, но не потому, что код неверен, а потому, что эти тесты мешали друг другу при параллельном выполнении. Одно из решений - убедиться, что каждый тест пишет в свой отдельный файл; другое решение - запускать тесты по одному. +Например, допустим, каждая из ваших проверок запускает рукопись, которая создаёт файл на диске с именем *test-output.txt* и записывает некоторые данные в этот файл. Затем каждая проверка считывает данные из этого файла и утверждает, что файл содержит определённое значение, которое в каждой проверке разное. Поскольку все проверки выполняются одновременно, одна из проверок может перезаписать файл в промежутке между записью и чтением файла другой проверкой. Тогда вторая проверка потерпит неудачу, но не потому, что рукопись неверна, а потому, что эти проверки мешали друг другу при одновременном выполнении. Одно из решений - убедиться, что каждая проверка пишет в свой отдельный файл; другое решение - запускать проверки по одной. -Если вы не хотите запускать тесты параллельно или хотите более детальный контроль над количеством используемых потоков, можно установить флаг `--test-threads` и то количество потоков, которое вы хотите использовать для теста. Взгляните на следующий пример: +Если вы не хотите запускать проверки одновременно или хотите более подробный управление над количеством используемых потоков, можно установить клеймо `--test-threads` и то количество потоков, которое вы хотите использовать для проверки. Взгляните на следующий пример: ```console $ cargo test -- --test-threads=1 ``` -Мы устанавливаем количество тестовых потоков равным `1` , указывая программе не использовать параллелизм. Выполнение тестов с использованием одного потока займёт больше времени, чем их параллельное выполнение, но тесты не будут мешать друг другу, если они совместно используют состояние. +Мы устанавливаем количество проверочных потоков равным `1` , указывая программе не использовать одновременность. Выполнение проверок с использованием одного потока займёт больше времени, чем их одновременное выполнение, но проверки не будут мешать друг другу, если они совместно используют состояние. -### Демонстрация результатов работы функции +### Отображение итогов работы функции -По умолчанию, если тест пройден, система управления запуска тестов блокирует вывод на печать, т.е. если вы вызовете макрос `println!` внутри кода теста и тест будет пройден, вы не увидите вывода на консоль результатов вызова `println!`. Если же тест не был пройден, все информационные сообщения, а также описание ошибки будут выведены на консоль. +По умолчанию, если проверка пройдена, система управления запуска проверок запрещает вывод на вывод, т.е. если вы вызовете макрос `println!` внутри рукописи проверки и проверка будет пройден, вы не увидите вывода на окно вывода итогов вызова `println!`. Если же проверка не был пройден, все несущие сведения сообщения, а также описание ошибки будут выведены на окно вывода. -Например, в коде (11-10) функция выводит значение параметра с поясняющим текстовым сообщением, а также возвращает целочисленное константное значение 10. Далее следует тест, который имеет правильный входной параметр и тест, который имеет ошибочный входной параметр: +Например, в рукописи (11-10) функция выводит значение свойства с поясняющим выводом сообщения, а также возвращает целочисленное значение в виде постоянной переменной 10. Далее следует проверка, которая имеет правильное входное свойство и проверка, которая имеет ошибочное входное свойство: Файл: src/lib.rs @@ -30,33 +30,33 @@ $ cargo test -- --test-threads=1 {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-10/src/lib.rs}} ``` -Листинг 11-10: Тест функции, которая использует макрос println! +Приложение 11-10: Проверка функции, которая использует макрос println! -Результат вывода на консоль команды `cargo test`: +Итог вывода на окно вывода приказы `cargo test`: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-10/output.txt}} ``` -Обратите внимание, что нигде в этом выводе мы не видим сообщения `I got the value 4` , которое печатается при выполнении пройденного теста. Этот вывод был записан. Результат неудачного теста, `I got the value 8` , появляется в разделе итоговых результатов теста, который также показывает причину неудачного теста. +Обратите внимание, что нигде в этом выводе мы не видим сообщения `I got the value 4` , которое выводится при выполнении пройденной проверки. Этот вывод был записан. Итог неудачного проверки, `I got the value 8` , появляется в разделе итоговых итогов проверки, который также показывает причину неудачного проверки. -Если мы хотим видеть напечатанные результаты прохождения тестов, мы можем сказать Rust, чтобы он также показывал результаты успешных тестов с помощью `--show-output`. +Если мы хотим видеть выведенные итоги прохождения проверок, мы можем сказать Ржавчина, чтобы она также показывала итоги успешных проверок с помощью `--show-output`. ```console $ cargo test -- --show-output ``` -Когда мы снова запускаем тесты из Листинга 11-10 с флагом `--show-output` , мы видим следующий результат: +Когда мы снова запускаем проверки из Приложения 11-10 с клеймом `--show-output` , мы видим следующий итог: ```console {{#include ../listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt}} ``` -### Запуск подмножества тестов по имени +### Запуск подмножества проверок по имени -Бывают случаи, когда в запуске всех тестов нет необходимости и нужно запустить только несколько тестов. Если вы работаете над функцией и хотите запустить тесты, которые исследуют её работу - это было бы удобно. Вы можете это сделать, используя команду `cargo test`, передав в качестве аргумента имена тестов. +Бывают случаи, когда в запуске всех проверок нет необходимости и нужно запустить только несколько проверок. Если вы работаете над функцией и хотите запустить проверки, которые исследуют её работу - это было бы удобно. Вы можете это сделать, используя приказ `cargo test`, передав в качестве переменной имена проверок. -Для демонстрации, как запустить группу тестов, мы создадим группу тестов для функции `add_two` function, как показано в Листинге 11-11, и постараемся выбрать какие из них запускать. +Для отображения, как запустить объединение проверок, мы создадим объединение проверок для функции `add_two` function, как показано в Приложении 11-11, и постараемся выбрать какие из них запускать. Файл: src/lib.rs @@ -64,39 +64,39 @@ $ cargo test -- --show-output {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-11/src/lib.rs}} ``` -Листинг 11-11: Три теста с различными именами +Приложение 11-11: Три проверки с различными именами -Если вы выполните команду `cargo test` без уточняющих аргументов, все тесты выполнятся параллельно: +Если вы выполните приказ `cargo test` без уточняющих переменных, все проверки выполнятся одновременно: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-11/output.txt}} ``` -#### Запуск одного теста +#### Запуск одного проверки -Мы можем запустить один тест с помощью указания его имени в команде `cargo test`: +Мы можем запустить один проверка с помощью указания его имени в приказу `cargo test`: ```console {{#include ../listings/ch11-writing-automated-tests/output-only-02-single-test/output.txt}} ``` -Был запущен только тест с названием `one_hundred`; два других теста не соответствовали этому названию. Результаты теста с помощью вывода `2 filtered out` дают нам понять, что у нас было больше тестов, но они не были запущены. +Был запущен только проверка с названием `one_hundred`; два других проверки не соответствовали этому названию. Итоги проверки с помощью вывода `2 filtered out` дают нам понять, что у нас было больше проверок, но они не были запущены. -Таким образом мы не можем указать имена нескольких тестов; будет использоваться только первое значение, указанное для `cargo test` . Но есть способ запустить несколько тестов. +Таким образом мы не можем указать имена нескольких проверок; будет использоваться только первое значение, указанное для `cargo test` . Но есть способ запустить несколько проверок. -#### Использование фильтров для запуска нескольких тестов +#### Использование фильтров для запуска нескольких проверок -Мы можем указать часть имени теста, и будет запущен любой тест, имя которого соответствует этому значению. Например, поскольку имена двух наших тестов содержат `add`, мы можем запустить эти два, запустив `cargo test add`: +Мы можем указать часть имени проверки, и будет запущен любой проверка, имя которого соответствует этому значению. Например, поскольку имена двух наших проверок содержат `add`, мы можем запустить эти два, запустив `cargo test add`: ```console {{#include ../listings/ch11-writing-automated-tests/output-only-03-multiple-tests/output.txt}} ``` -Эта команда запускала все тесты с `add` в имени и отфильтровывала тест с именем `one_hundred` . Также обратите внимание, что модуль, в котором появляется тест, становится частью имени теста, поэтому мы можем запускать все тесты в модуле, фильтруя имя модуля. +Этот приказ запускала все проверки с `add` в имени и отфильтровывала проверка с именем `one_hundred` . Также обратите внимание, что раздел, в котором появляется проверка, становится частью имени проверки, поэтому мы можем запускать все проверки в разделе, фильтруя имя раздела. -### Игнорирование тестов +### Пренебрежение проверок -Бывает, что некоторые тесты требуют продолжительного времени для своего исполнения, и вы хотите исключить их из исполнения при запуске `cargo test`. Вместо перечисления в командной строке всех тестов, которые вы хотите запускать, вы можете аннотировать тесты, требующие много времени для прогона, атрибутом `ignore`, чтобы исключить их, как показано здесь: +Бывает, что некоторые проверки требуют продолжительного времени для своего исполнения, и вы хотите исключить их из исполнения при запуске `cargo test`. Вместо перечисления в приказной строке всех проверок, которые вы хотите запускать, вы можете определять проверки, требующие много времени для прогона, свойством `ignore`, чтобы исключить их, как показано здесь: Файл: src/lib.rs @@ -104,16 +104,16 @@ $ cargo test -- --show-output {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs}} ``` -После `#[test]` мы добавляем строку `#[ignore]` в тест, который хотим исключить. Теперь, когда мы запускаем наши тесты, `it_works` запускается, а `expensive_test` игнорируется: +После `#[test]` мы добавляем строку `#[ignore]` в проверка, которую хотим исключить. Теперь, когда мы запускаем наши проверки, `it_works` запускается, а `expensive_test` пренебрегается: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/output.txt}} ``` -Функция `expensive_test` помечена как `ignored`. Если вы хотите выполнить только проигнорированные тесты, вы можете воспользоваться командой `cargo test -- --ignored`: +Функция `expensive_test` помечена как `ignored`. Если вы хотите выполнить только проверки, которые были отклонены, вы можете воспользоваться приказом `cargo test -- --ignored`: ```console {{#include ../listings/ch11-writing-automated-tests/output-only-04-running-ignored/output.txt}} ``` -Управляя тем, какие тесты запускать, вы можете быть уверены, что результаты вашего `cargo test` будут быстрыми. Когда вы дойдёте до момента, где имеет смысл проверить результаты тестов `ignored`, и у вас есть время дождаться их результатов, вы можете запустить их с помощью `cargo test -- --ignored`. Если вы хотите запустить все тесты независимо от того, игнорируются они или нет, выполните `cargo test -- --include-ignored`. +Управляя тем, какие проверки запускать, вы можете быть уверены, что итоги вашего `cargo test` будут быстрыми. Когда вы дойдёте до этапа, где имеет смысл проверить итоги проверок `ignored`, и у вас есть время дождаться их итогов, вы можете запустить их с помощью `cargo test -- --ignored`. Если вы хотите запустить все проверки независимо от того, пренебрегаются они или нет, выполните `cargo test -- --include-ignored`. diff --git a/rustbook-ru/src/ch11-03-test-organization.md b/rustbook-ru/src/ch11-03-test-organization.md index 2f7ecaac6..b6365b6e6 100644 --- a/rustbook-ru/src/ch11-03-test-organization.md +++ b/rustbook-ru/src/ch11-03-test-organization.md @@ -1,18 +1,18 @@ -## Организация тестов +## Создание проверок -Как упоминалось в начале главы, тестирование является сложной дисциплиной и разные люди используют разную терминологию и организацию. Сообщество Rust думает о тестах с точки зрения двух основных категорий: *модульные тесты* и *интеграционные тесты*. Модульные тесты это небольшие и более сфокусированные на тестировании одного модуля в отдельности или могут тестироваться приватные интерфейсы. Интеграционные тесты являются полностью внешними по отношению к вашей библиотеке и используют код библиотеки так же, как любой другой внешний код, используя только общедоступные интерфейсы и потенциально выполняя тестирование нескольких модулей в одном тесте. +Как упоминалось в начале Главы, проверка является сложным пунктом и разные люди используют разную совокупность понятий и устройств. Сообщество Ржавчина думает о проверках с точки зрения двух основных разрядов: *состоящие из разделов проверки* и *встроенные проверки*. Состоящие из разделов проверки это небольшие и более сосредоточенные на проверке одного раздела в отдельности или могут проверяться закрытые внешние оболочки. Встраиваемые проверки являются полностью внешними по отношению к вашей библиотеке и используют рукопись библиотеки так же, как любой другой внешней рукописи, используя только общедоступные внешние оболочки и возможно выполняя проверку сразу нескольких разделов в одной проверке. -Написание обоих видов тестов важно для обеспечения того, чтобы кусочки вашей библиотеки по отдельности и вместе делали то, что вы ожидаете. +Написание обоих видов проверок важно для обеспечения того, чтобы кусочки вашей библиотеки по отдельности и вместе делали то, что вы ожидаете. -### Модульные тесты +### Состоящие из разделов проверки -Целью модульных тестов является тестирование каждого блока кода, изолированное от остального функционала, чтобы можно было быстро понять, что работает некорректно или не так как ожидается. Мы разместим модульные тесты в папке *src*, в каждый тестируемый файл. Но в Rust принято создавать тестирующий модуль `tests` и код теста сохранять в файлы с таким же именем, как компоненты которые предстоит тестировать. Также необходимо добавить аннотацию `cfg(test)` к этому модулю. +Целью состоящих из разделов проверок является проверка каждого раздела рукописи, изолированное от остального возможностей, чтобы можно было быстро понять, что работает неправильно или не так как ожидается. Мы разместим состоящие из разделов проверки в папке *src*, в каждый проверяемый файл. Но в Ржавчине принято создавать проверяемый раздел `tests` и рукопись проверки сохранять в файлы с таким же именем, как составляющие, которые предстоит проверять. Также необходимо добавить изложение `cfg(test)` к этому разделу. -#### Модуль тестов и аннотация `#[cfg(test)]` +#### Раздел проверок и изложение `#[cfg(test)]` -Аннотация `#[cfg(test)]` у модуля с тестами указывает Rust компилировать и запускать только код тестов, когда выполняется команда `cargo test`, а не когда запускается `cargo build`. Это экономит время компиляции, если вы только хотите собрать библиотеку и сэкономить место для результирующих скомпилированных артефактов, потому что тесты не будут включены. Вы увидите что, по причине того, что интеграционные тесты помещаются в другой каталог им не нужна аннотация `#[cfg(test)]`. Тем не менее, так как модульные тесты идут в тех же файлах что и основной код, вы будете использовать `#[cfg(test)]` чтобы указать, что они не должны быть включены в скомпилированный результат. +Изложение `#[cfg(test)]` у раздела с проверками указывает Ржавчине собирать и запускать только рукопись проверок, когда выполняется приказ `cargo test`, а не когда запускается `cargo build`. Это уменьшает время сборки, если вы только хотите собрать библиотеку и уменьшить место для итоговых собранных артефактов, потому что проверки не будут включены. Вы увидите что, по причине того, что встроенные проверки помещаются в другую папку им не нужно изложение `#[cfg(test)]`. Тем не менее, так как состоящие из разделов проверки идут в тех же файлах что и основная рукопись, вы будете использовать `#[cfg(test)]` чтобы указать, что они не должны быть включены в собранный итог. -Напомним, что когда мы генерировали новый проект `adder` в первом разделе этой главы, то Cargo сгенерировал для нас код ниже: +Напомним, что когда мы порождали новое дело `adder` в первом разделе этой Главы, то Cargo создал для нас рукопись ниже: Файл: src/lib.rs @@ -20,11 +20,11 @@ {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs}} ``` -Этот код является автоматически сгенерированным тестовым модулем. Атрибут `cfg` предназначен для *конфигурации* и говорит Rust, что следующий элемент должен быть включён только учитывая определённую опцию конфигурации. В этом случае опцией конфигурации является `test`, который предоставлен в Rust для компиляции и запуска текущих тестов. Используя атрибут `cfg`, Cargo компилирует только тестовый код при активном запуске тестов командой `cargo test`. Это включает в себя любые вспомогательные функции, которые могут быть в этом модуле в дополнение к функциям помеченным `#[test]`. +Эта рукопись является самостоятельно созданным проверочным разделом. Свойство `cfg` предназначен для *настройки* и говорит Ржавчине, что следующий элемент должен быть включён только учитывая определённую возможность настройки. В этом случае возможностью настройки является `test`, который предоставлен в Ржавчине для сборки и запуска текущих проверок. Используя свойство `cfg`, Cargo собирает только проверочную рукопись при постоянном запуске проверок приказом `cargo test`. Это включает в себя любые вспомогательные функции, которые могут быть в этом разделе в дополнение к функциям помеченным `#[test]`. -#### Тестирование приватных функций (private) +#### Проверка закрытых функций (private) -Сообщество программистов не имеет однозначного мнения по поводу тестировать или нет приватные функции. В некоторых языках весьма сложно или даже невозможно тестировать такие функции. Независимо от того, какой технологии тестирования вы придерживаетесь, в Rust приватные функции можно тестировать. Рассмотрим листинг 11-12 с приватной функцией `internal_adder`. +Сообщество программистов не имеет однозначного мнения по поводу проверять или нет закрытые функции. В некоторых языках весьма сложно или даже невозможно проверять такие функции. Независимо от того, какой технологии проверки вы придерживаетесь, в Ржавчине закрытые функции можно проверять. Рассмотрим приложение 11-12 с закрытой функцией `internal_adder`. Файл: src/lib.rs @@ -32,19 +32,19 @@ {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-12/src/lib.rs}} ``` -Листинг 11-12: Тестирование приватных функций +Приложение 11-12: Проверка закрытых функций -Обратите внимание, что функция `internal_adder` не помечена как `pub`. Тесты — это просто Rust код, а модуль `tests` — это ещё один модуль. Как мы обсуждали в разделе [“Пути для ссылки на элемент в дереве модулей“], элементы в дочерних модулях могут использовать элементы из своих родительских модулей. В этом тесте мы помещаем все элементы родительского модуля `test` в область видимости с помощью `use super::*` и затем тест может вызывать `internal_adder`. Если вы считаете, что приватные функции не нужно тестировать, то Rust не заставит вас это сделать. +Обратите внимание, что функция `internal_adder` не помечена как `pub`. Проверки — это просто Ржавчина рукопись, а раздел `tests` — это ещё один раздел. Как мы обсуждали в разделе [“Пути для ссылки на переменную в дереве разделов“], переменные в дочерних разделах могут использовать переменные из своих родительских разделов. В этом проверке мы помещаем все переменные родительского раздела `test` в область видимости с помощью `use super::*` и затем проверка может вызывать `internal_adder`. Если вы считаете, что закрытые функции не нужно проверять, то Ржавчина не заставит вас это сделать. -### Интеграционные тесты +### Встраиваемые проверки -В Rust интеграционные тесты являются полностью внешними по отношению к вашей библиотеке. Они используют вашу библиотеку так же, как любой другой код, что означает, что они могут вызывать только функции, которые являются частью публичного API библиотеки. Их целью является проверка, много ли частей вашей библиотеки работают вместе правильно. У модулей кода правильно работающих самостоятельно, могут возникнуть проблемы при интеграции, поэтому тестовое покрытие интегрированного кода также важно. Для создания интеграционных тестов сначала нужен каталог *tests* . +В Ржавчине встроенные проверки являются полностью внешними по отношению к вашей библиотеке. Они используют вашу библиотеку так же, как любая другая рукопись, что означает, что они могут вызывать только функции, которые являются частью открытого API библиотеки. Их целью является проверка, много ли частей вашей библиотеки работают вместе правильно. У разделов рукописи правильно работающих самостоятельно, могут возникнуть сбои при встраивани, поэтому проверочное покрытие встроенной рукописи также важно. Для создания встроенных проверок сначала нужна папка *tests* . -#### Каталог *tests* +#### Папка *tests* -Мы создаём папку *tests* в корневой папке вашего проекта, рядом с папкой *src*. Cargo знает, что искать файлы с интеграционными тестами нужно в этой директории. После этого мы можем создать столько тестовых файлов, сколько захотим, и Cargo скомпилирует каждый из файлов в отдельный крейт. +Мы создаём папку *tests* в корневой папке вашего дела, рядом с папкой *src*. Cargo знает, что искать файлы с встроенными проверками нужно в этой папки. После этого мы можем создать столько проверочных файлов, сколько захотим, и Cargo собирает каждый из файлов в отдельный ящик. -Давайте создадим интеграционный тест. Рядом с кодом из листинга 11-12, который всё ещё в файле *src/lib.rs*, создайте каталог *tests*, создайте новый файл с именем *tests/integration_test.rs*. Структура директорий должна выглядеть так: +Давайте создадим встроенный проверку. Рядом с рукописью из приложения 11-12, который всё ещё в файле *src/lib.rs*, создайте папку *tests*, создайте новый файл с именем *tests/integration_test.rs*. Устройство папок должно выглядеть так: ```text adder @@ -56,7 +56,7 @@ adder └── integration_test.rs ``` -Введите код из листинга 11-13 в файл *tests/integration_test.rs* file: +Введите рукопись из приложения 11-13 в файл *tests/integration_test.rs* file: Файл: tests/integration_test.rs @@ -64,37 +64,37 @@ adder {{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs}} ``` -Листинг 11-13: Интеграционная тест функция из крейта adder +Приложение 11-13: Встраиваемая проверка функция из ящика adder -Каждый файл в каталоге `tests` представляет собой отдельный крейт, поэтому нам нужно подключить нашу библиотеку в область видимости каждого тестового крейта. По этой причине мы добавляем `use adder` в верхней части кода, что не нужно нам делать в модульных тестах. +Каждый файл в папке `tests` представляет собой отдельный ящик, поэтому нам нужно подключить нашу библиотеку в область видимости каждого проверочного ящика. По этой причине мы добавляем `use adder` в верхней части рукописи, что не нужно нам делать в состоящих из разделов проверках. -Нам не нужно комментировать код в *tests/integration_test.rs* с помощью `#[cfg(test)]`. Cargo специальным образом обрабатывает каталог `tests` и компилирует файлы в этом каталоге только тогда, когда мы запускаем команду `cargo test`. Запустите `cargo test` сейчас: +Нам не нужно вносить примечания в рукопись в *tests/integration_test.rs* с помощью `#[cfg(test)]`. Cargo особым образом обрабатывает папку `tests` и собирает файлы в этом папке только тогда, когда мы запускаем приказ `cargo test`. Запустите `cargo test` сейчас: ```console {{#include ../listings/ch11-writing-automated-tests/listing-11-13/output.txt}} ``` -Выходные данные представлены тремя разделами: модульные тесты, интеграционные тесты и тесты документации. Обратите внимание, что если какой-нибудь тест в одной из секций не пройдёт, последующие секции выполняться не будут. Например, если модульный тест провалился, не будет выведено результатов интеграционных и документационных тестов, потому что эти тесты будут выполняться только в том случае, если все модульные тесты завершатся успешно. +Выходные данные представлены тремя разделами: состоящие из разделов проверки, встроенные проверки и проверки пособия. Обратите внимание, что если какой-нибудь проверка в одной из разделов не пройдёт, последующие разделы выполняться не будут. Например, если состоящий из разделов проверка провалился, не будет выведено итогов встроенных и документационных проверок, потому что эти проверки будут выполняться только в том случае, если все состоящие из разделов проверки завершатся успешно. -Первый раздел для модульных тестов такой же, как мы видели: одна строка для каждого модульного теста (один с именем `internal`, который мы добавили в листинге 11-12), а затем сводная строка для модульных тестов. +Первый раздел для состоящих из разделов проверок такой же, как мы видели: одна строка для каждого состоящего из разделов проверки (один с именем `internal`, который мы добавили в приложении 11-12), а затем сводная строка для состоящих из разделов проверок. -Раздел интеграционных тестов начинается со строки `Running tests/integration_test.rs`. Далее идёт строка для каждой тестовой функции в этом интеграционном тесте и итоговая строка для результатов интеграционного теста непосредственно перед началом раздела `Doc-tests adder`. +Раздел встроенных проверок начинается со строки `Running tests/integration_test.rs`. Далее идёт строка для каждой проверочной функции в этой встроенной проверке и итоговая строка для итогов встроенной проверки непосредственно перед началом раздела `Doc-tests adder`. -Каждый файл интеграционного теста имеет свой собственный раздел, поэтому, если мы добавим больше файлов в каталог *tests*, то здесь будет больше разделов интеграционного теста. +Каждый файл встроенной проверки имеет свой собственный раздел, поэтому, если мы добавим больше файлов в папку *tests*, то здесь будет больше разделов встроенной проверки. -Мы всё ещё можем запустить определённую функцию в интеграционных тестах, указав имя тест функции в качестве аргумента в `cargo test`. Чтобы запустить все тесты в конкретном файле интеграционных тестов, используйте аргумент `--test` сопровождаемый именем файла у команды `cargo test`: +Мы всё ещё можем запустить определённую функцию во встроенных проверках, указав имя проверка функции в качестве переменной в `cargo test`. Чтобы запустить все проверки в определенном файле встроенных проверок, используйте переменная `--test` сопровождаемый именем файла у приказы `cargo test`: ```console {{#include ../listings/ch11-writing-automated-tests/output-only-05-single-integration/output.txt}} ``` -Эта команда запускает только тесты в файле *tests/integration_test.rs*. +Этот приказ запускает только проверки в файле *tests/integration_test.rs*. -#### Подмодули в интеграционных тестах +#### Подразделы во встроенных проверках -По мере добавления большего количества интеграционных тестов, можно создать более одного файла в каталоге *tests*, чтобы легче организовывать их; например, вы можете сгруппировать функции тестирования по функциональности, которую они проверяют. Как упоминалось ранее, каждый файл в каталоге *tests* скомпилирован как отдельный крейт, что полезно для создания отдельных областей видимости, чтобы более точно имитировать то, как конечные пользователи будут использовать ваш крейт. Однако это означает, что файлы в каталоге *tests* ведут себя не так, как файлы в *src*, как вы узнали в Главе 7 относительно того как разделить код на модули и файлы. +По мере добавления большего количества встроенных проверок, можно создать более одного файла в папке *tests*, чтобы легче создавать их; например, вы можете объединять функции проверки по возможности, которую они проверяют. Как упоминалось ранее, каждый файл в папке *tests* собран как отдельный ящик, что полезно для создания отдельных областей видимости, чтобы более точно создавать видимость то, как конечные пользователи будут использовать ваш ящик. Однако это означает, что файлы в папке *tests* ведут себя не так, как файлы в *src*, как вы узнали в Главе 7 относительно того как разделить рукопись на разделы и файлы. -Различное поведение файлов в каталоге *tests* наиболее заметно, когда у вас есть набор вспомогательных функций, которые будут полезны в нескольких интеграционных тестовых файлах. Представим, что вы пытаетесь выполнить действия, описанные в разделе [«Разделение модулей в разные файлы»](ch07-05-separating-modules-into-different-files.html) главы 7, чтобы извлечь их в общий модуль. Например, вы создали файл *tests/common.rs* и поместили в него функцию `setup`, содержащую некоторый код, который вы будете вызывать из разных тестовых функций в нескольких тестовых файлах +Различное поведение файлов в папке *tests* наиболее заметно, когда у вас есть набор вспомогательных функций, которые будут полезны в нескольких встроенных проверочных файлах. Представим, что вы пытаетесь выполнить действия, описанные в разделе [«Разделение разделов в разные файлы»](ch07-05-separating-modules-into-different-files.html) Главы 7, чтобы извлечь их в общее раздел. Например, вы создали файл *tests/common.rs* и поместили в него функцию `setup`, содержащую некоторую рукопись, которая вы будете вызывать из разных проверочных функций в нескольких проверочных файлах Файл: tests/common.rs @@ -102,15 +102,15 @@ adder {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs}} ``` -Когда мы снова запустим тесты, мы увидим новый раздел в результатах тестов для файла *common.rs*, хотя этот файл не содержит никаких тестовых функций, более того, мы даже не вызывали функцию `setup` откуда либо: +Когда мы снова запустим проверки, мы увидим новый раздел в итогах проверок для файла *common.rs*, хотя этот файл не содержит никаких проверочных функций, более того, мы даже не вызывали функцию `setup` откуда либо: ```console {{#include ../listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/output.txt}} ``` -Упоминание файла `common` и появление в результатах выполнения тестов сообщения типа `running 0 tests` - это не то, чего мы хотели. Мы только хотели выделить некоторый общий код, который будет использоваться другими файлами интеграционных тестов. +Упоминание файла `common` и появление в итогах выполнения проверок сообщения вида данных `running 0 tests` - это не то, чего мы хотели. Мы только хотели выделить некоторую общую рукопись, которая будет использоваться другими файлами встроенных проверок. -Чтобы модуль `common` больше не появлялся в результатах выполнения тестов, вместо файла *tests/common.rs* мы создадим файл *tests/common/mod.rs*. Директория проекта теперь выглядит следующим образом: +Чтобы раздел `common` больше не появлялся в итогах выполнения проверок, вместо файла *tests/common.rs* мы создадим файл *tests/common/mod.rs*. Содержимое дела теперь выглядит следующим образом: ```text ├── Cargo.lock @@ -123,9 +123,9 @@ adder └── integration_test.rs ``` -Здесь используется более раннее соглашение об именовании файлов, которое Rust также понимает. Мы говорили об этом в разделе [“Альтернативные пути к файлам”] главы 7. Именование файла таким образом говорит, что Rust не должен рассматривать модуль `common` как файл интеграционных тестов. Когда мы перемещаем код функции setup в файл *tests/common/mod.rs* и удаляем файл *tests/common.rs*, дополнительный раздел больше не будет отображаться в результатах тестов. Файлы в подкаталогах каталога tests не компилируются как отдельные крейты или не появляются в результатах выполнения тестов. +Здесь используется более раннее соглашение об именовании файлов, которое Ржавчина также понимает. Мы говорили об этом в разделе [“Иные пути к файлам”] Главы 7. Именование файла таким образом говорит, что Ржавчина не должна рассматривать раздел `common` как файл встроенных проверок. Когда мы перемещаем рукопись функции setup в файл *tests/common/mod.rs* и удаляем файл *tests/common.rs*, дополнительный раздел больше не будет отображаться в итогах проверок. Файлы в подпапках папки tests не собираются как отдельные ящики или не появляются в итогах выполнения проверок. -После того, как мы создали файл *tests/common/mod.rs*, мы можем использовать его в любых файлах интеграционных тестов как обычный модуль. Вот пример вызова функции `setup` из теста `it_adds_two` в файле *tests/integration_test.rs*: +После того, как мы создали файл *tests/common/mod.rs*, мы можем использовать его в любых файлах встроенных проверок как обычный раздел. Вот пример вызова функции `setup` из проверки `it_adds_two` в файле *tests/integration_test.rs*: Файл: tests/integration_test.rs @@ -133,20 +133,20 @@ adder {{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/tests/integration_test.rs}} ``` -Обратите внимание, что объявление `mod common;` совпадает с объявлением модуля, которое продемонстрировано в листинге 7-21. Затем в тестовой функции мы можем вызвать функцию `common::setup()`. +Обратите внимание, что объявление `mod common;` совпадает с объявлением раздела, которое отображено в приложении 7-21. Затем в проверочной функции мы можем вызвать функцию `common::setup()`. -#### Интеграционные тесты для бинарных крейтов +#### Встраиваемые проверки для двоичных ящиков -Если наш проект является бинарным крейтом, который содержит только *src/main.rs* и не содержит *src/lib.rs*, мы не сможем создать интеграционные тесты в папке *tests* и подключить функции определённые в файле *src/main.rs* в область видимости с помощью инструкции `use`. Только библиотечные крейты могут предоставлять функции, которые можно использовать в других крейтах; бинарные крейты предназначены только для самостоятельного запуска. +Если наше дело является двоичным ящиком, который содержит только *src/main.rs* и не содержит *src/lib.rs*, мы не сможем создать встроенные проверки в папке *tests* и подключить функции определённые в файле *src/main.rs* в область видимости с помощью указания `use`. Только библиотечные ящики могут предоставлять функции, которые можно использовать в других ящиках; двоичные ящики предназначены только для самостоятельного запуска. -Это одна из причин, почему проекты на Rust, которые генерируют исполняемые модули, обычно имеют простой файл *src/main.rs*, который в свою очередь вызывает логику, которая находится в файле *src/lib.rs*. Используя такую структуру, интеграционные тесты *могут* проверить библиотечный крейт, используя оператор `use` для подключения важного функционала. Если этот важный функционал работает, то и небольшое количество кода в файле *src/main.rs* также будет работать, а значит этот небольшой объём кода не нуждается в проверке. +Это одна из причин, почему дела на Ржавчине, которые порождают исполняемые разделы, обычно имеют простой файл *src/main.rs*, который в свою очередь вызывает ход мыслей, который находится в файле *src/lib.rs*. Используя такое устройство, встроенные проверки *могут* проверить библиотечный ящик, используя приказчик `use` для подключения важного возможностей. Если этот важный возможности работает, то и небольшое количество рукописи в файле *src/main.rs* также будет работать, а значит этот небольшой размер рукописи не нуждается в проверке. ## Итоги -Средства тестирования языка Rust предоставляют способ задать ожидаемое поведение кода, чтобы убедиться, что он всё ещё соответствует вашим ожиданиям даже после внесения изменений. Модульные тесты проверяют различные части библиотеки по отдельности и могут тестировать приватные детали реализации. Интеграционные тесты проверяют, что части библиотеки работают корректно сообща. Эти тесты используют для тестирования кода открытый API библиотеки, таким же образом, как его будет использовать внешний код. Хотя система типов Rust и правила владения помогают предотвратить некоторые виды ошибок, тесты по-прежнему важны для уменьшения количества логических ошибок, связанных с поведением вашего кода. +Средства проверки языка Ржавчина предоставляют способ задать ожидаемое поведение рукописи, чтобы убедиться, что она всё ещё соответствует вашим ожиданиям даже после внесения изменений. Состоящие из разделов проверки проверяют различные части библиотеки по отдельности и могут проверять закрытые подробности выполнения. Встраиваемые проверки проверяют, что части библиотеки работают правильно сообща. Их используют для проверки рукописи открытой API библиотеки, таким же образом, как его будет использовать внешняя рукопись. Хотя перечень видов данных Ржавчины и правила владения помогают предотвратить некоторые виды ошибок, проверки по-прежнему важны для уменьшения количества разумных ошибок, связанных с поведением вашей рукописи. -Давайте объединим знания, полученные в этой и предыдущей главах, чтобы поработать над проектом! +Давайте объединим знания, полученные в этой и предыдущей главах, чтобы поработать над делом! -[“Пути для ссылки на элемент в дереве модулей“]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html -[“Альтернативные пути к файлам”]: ch07-05-separating-modules-into-different-files.html#alternate-file-paths \ No newline at end of file +[“Пути для ссылки на переменную в дереве разделов“]: ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html +[“Иные пути к файлам”]: ch07-05-separating-modules-into-different-files.html#alternate-file-paths \ No newline at end of file diff --git a/rustbook-ru/src/ch12-00-an-io-project.md b/rustbook-ru/src/ch12-00-an-io-project.md index 941c9556c..560c04513 100644 --- a/rustbook-ru/src/ch12-00-an-io-project.md +++ b/rustbook-ru/src/ch12-00-an-io-project.md @@ -1,22 +1,22 @@ -# Проект с вводом/выводом (I/O): создание консольного приложения +# Дело с вводом/выводом (I/O): создание с окном вывода приложения -В этой главе вы примените многие знания, полученные ранее, а также познакомитесь с ещё неизученными API стандартной библиотеки. Мы создадим консольное приложение, которое будет взаимодействовать с файлом и с консольным вводом / выводом, чтобы попрактиковаться в некоторых концепциях Rust, с которыми вы уже знакомы. +В этой главе вы примените многие знания, полученные ранее, а также познакомитесь с ещё неизученными API встроенной библиотеки. Мы создадим приложение с окном вывода, которое будет взаимодействовать с файлом и вводом с окном ввода / выводом, чтобы применить в некоторых подходах Ржавчина, с которыми вы уже знакомы. -Скорость, безопасность, компиляция в один исполняемый файл и кроссплатформенность делают Rust идеальным языком для создания консольных инструментов, так что в нашем проекте мы создадим свою собственную версию классической утилиты поиска `grep`, что расшифровывается, как "глобальное средство поиска и печати" (**g**lobally search a **r**egular **e**xpression and **p**rint). В простейшем случае `grep` используется для поиска в выбранном файле указанного текста. Для этого утилита `grep` получает имя файла и текст в качестве аргументов. Далее она читает файл, находит и выводит строки, содержащие искомый текст. +Скорость, безопасность, сборка в один исполняемый файл и кроссплатформенность делают Ржавчина наилучшим языком для создания средств с окнами ввода/вывода, так что в нашем деле мы создадим свою собственную исполнение обычной утилиты поиска `grep`, что расшифровывается, как "вездесущеее средство поиска и выводе" (**g**lobally search a **r**egular **e**xpression and **p**rint). В простейшем случае `grep` используется для поиска в выбранном файле указанного писания. Для этого утилита `grep` получает имя файла и писание в качестве переменных. Далее она считывает файл, находит и выводит строки, содержащие искомый писание. -Попутно мы покажем, как сделать так, чтобы наше консольное приложение использовало возможности терминала, которые используются многими другими консольными инструментами. Мы будем читать значение переменной окружения, чтобы позволить пользователю настроить поведение нашего инструмента. Мы также будем печатать сообщения об ошибках в стандартный консольный поток ошибок ( `stderr` ) вместо стандартного вывода ( `stdout` ), чтобы, к примеру, пользователь мог перенаправить успешный вывод в файл, в то время, как сообщения об ошибках останутся на экране. +Попутно мы покажем, как сделать так, чтобы наше приложение с окном вывода использовало возможности окна вызова, которые используются многими другими средствами с окнами ввода/вывода. Мы будем читать значение переменной окружения, чтобы позволить пользователю настроить поведение нашего средства. Мы также будем выводить сообщения об ошибках в обычный поток ошибок ( `stderr` ) вместо принятого вывода ( `stdout` ), чтобы, к примеру, пользователь мог перенаправить успешный вывод в файл, в то время, как сообщения об ошибках останутся на экране. -Один из участников Rust-сообщества, Andrew Gallant, уже реализовал полнофункциональный, очень быстрый аналог программы `grep` и назвал его `ripgrep`. По сравнению с ним, наша версия будет довольно простой, но эта глава даст вам знания, которые нужны для понимания реальных проектов, таких как ripgrep. +Один из участников Ржавчины-сообщества, Andrew Gallant, уже выполнил полновозможный, очень быстрый подобие программы `grep` и назвал его `ripgrep`. По сравнению с ним, наша исполнение будет довольно простой, но эта глава даст вам знания, которые нужны для понимания существующих дел, таких как ripgrep. -Наш проект `grep` будет использовать ранее изученные концепции: +Наше дело `grep` будет использовать ранее изученные подходы: -- Организация кода (используя то, что вы узнали о модулях в [ главе 7]) -- Использование векторов и строк (коллекции, [глава 8]) +- Создание рукописи (используя то, что вы узнали о разделах в [ главе 7]) +- Использование векторов и строк (собрания, [глава 8]) - Обработка ошибок ([Глава 9]) -- Использование типажей и времени жизни там, где это необходимо ([глава 10]) -- Написание тестов ( [Глава 11]) +- Использование сущностей и времени жизни там, где это необходимо ([глава 10]) +- Написание проверок ( [Глава 11]) -Мы также кратко представим замыкания, итераторы и объекты типажи, которые будут объяснены подробно в главах [13] и [17]. +Мы также кратко представим замыкания, повторители и предметы сущности, которые будут объяснены подробно в главах [13] и [17]. [ главе 7]: ch07-00-managing-growing-projects-with-packages-crates-and-modules.html diff --git a/rustbook-ru/src/ch12-01-accepting-command-line-arguments.md b/rustbook-ru/src/ch12-01-accepting-command-line-arguments.md index 7e85a7c43..f694187af 100644 --- a/rustbook-ru/src/ch12-01-accepting-command-line-arguments.md +++ b/rustbook-ru/src/ch12-01-accepting-command-line-arguments.md @@ -1,6 +1,6 @@ -## Принятие аргументов командной строки +## Принятие переменных приказной строки -Создадим новый проект консольного приложения как обычно с помощью команды `cargo new`. Мы назовём проект `minigrep`, чтобы различать наше приложение от `grep`, которое возможно уже есть в вашей системе. +Создадим новое дело с окном вывода приложения как обычно с помощью приказов `cargo new`. Мы назовём дело `minigrep`, чтобы различать наше приложение от `grep`, которое возможно уже есть в вашей системе. ```console $ cargo new minigrep @@ -8,19 +8,19 @@ $ cargo new minigrep $ cd minigrep ``` -Первая задача - заставить `minigrep` принимать два аргумента командной строки: путь к файлу и строку для поиска. То есть мы хотим иметь возможность запускать нашу программу через `cargo run`, с использованием двойного дефиса, чтобы указать, что следующие аргументы предназначены для нашей программы, а не для `cargo`, строки для поиска и пути к файлу в котором нужно искать, как описано ниже: +Первая задача - заставить `minigrep` принимать две переменной приказной строки: путь к файлу и строку для поиска. То есть мы хотим иметь возможность запускать нашу программу через `cargo run`, с использованием двойного дефиса, чтобы указать, что следующие переменные предназначены для нашей программы, а не для `cargo`, строки для поиска и пути к файлу в котором нужно искать, как описано ниже: ```console $ cargo run -- searchstring example-filename.txt ``` -В данный момент программа сгенерированная `cargo new` не может обрабатывать аргументы, которые мы ей передаём. Некоторые существующие библиотеки на [crates.io](https://crates.io/) могут помочь с написанием программы, которая принимает аргументы командной строки, но так как вы просто изучаете эту концепцию, давайте реализуем эту возможность сами. +В данный мгновение программа созданная `cargo new` не может обрабатывать переменные, которые мы ей передаём. Некоторые существующие библиотеки на [crates.io](https://crates.io/) могут помочь с написанием программы, которая принимает переменные приказной строки, но так как вы просто изучаете этот подход, давайте применим эту возможность сами. -### Чтение значений аргументов +### Чтение значений переменных -Чтобы `minigrep` мог воспринимать значения аргументов командной строки, которые мы ему передаём, нам понадобится функция `std::env::args`, входящая в стандартную библиотеку Rust. Эта функция возвращает итератор аргументов командной строки, переданных в `minigrep`. Мы подробно рассмотрим итераторы в [главе 13]. Пока вам достаточно знать две вещи об итераторах: итераторы генерируют серию значений, и мы можем вызвать метод `collect` у итератора, чтобы создать из него коллекцию, например вектор, который будет содержать все элементы, произведённые итератором. +Чтобы `minigrep` мог воспринимать значения переменных приказной строки, которые мы ему передаём, нам понадобится функция `std::env::args`, входящая во встроенную библиотеку Ржавчины. Эта функция возвращает повторитель переменных приказной строки, переданных в `minigrep`. Мы подробно рассмотрим повторители в [главе 13]. Пока вам достаточно знать две вещи об повторителях: повторители порождают последовательность значений, и мы можем вызвать способ `collect` у повторителя, чтобы создать из него собрание, например вектор, который будет содержать все переменные, произведённые повторителем. -Код представленный в Листинге 12-1 позволяет вашей программе `minigrep` читать любые переданные ей аргументы командной строки, а затем собирать значения в вектор. +Рукопись представленный в Приложении 12-1 позволяет вашей программе `minigrep` читать любые переданные ей переменные приказной строки, а затем собирать значения в вектор. Файл: src/main.rs @@ -28,17 +28,17 @@ $ cargo run -- searchstring example-filename.txt {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-01/src/main.rs}} ``` -Листинг 12-1: Собираем аргументы командной строки в вектор и выводим их на печать +Приложение 12-1: Собираем переменные приказной строки в вектор и выводим их на вывод -Сначала мы вводим модуль `std::env` в область видимости с помощью инструкции `use`, чтобы мы могли использовать его функцию `args`. Обратите внимание, что функция `std::env::args` вложена в два уровня модулей. Как мы обсуждали в [главе 7], в случаях, когда нужная функция оказывается вложенной в более чем один модуль, рекомендуется выносить в область видимости родительский модуль, а не функцию. Таким образом, мы можем легко использовать другие функции из `std::env`. Это менее двусмысленно, чем добавление `use std::env::args` и последующий вызов функции только с `args`, потому что `args` может быть легко принят за функцию, определённую в текущем модуле. +Сначала мы вводим раздел `std::env` в область видимости с помощью указания `use`, чтобы мы могли использовать его функцию `args`. Обратите внимание, что функция `std::env::args` вложена в два уровня разделов. Как мы обсуждали в [главе 7], в случаях, когда нужная функция оказывается вложенной в более чем один раздел, советуется выносить в область видимости родительский раздел, а не функцию. Таким образом, мы можем легко использовать другие функции из `std::env`. Это менее двусмысленно, чем добавление `use std::env::args` и последующий вызов функции только с `args`, потому что `args` может быть легко принят за функцию, определённую в текущем разделе. -> ### Функция `args` и недействительный Юникод символ (Unicode) +> ### Функция `args` и недействительный Юнирукопись знак (Unicode) > -> Обратите внимание, что `std::env::args` вызовет панику, если какой-либо аргумент содержит недопустимый символ Юникода. Если вашей программе необходимо принимать аргументы, содержащие недопустимые символы Unicode, используйте вместо этого `std::env::args_os`. Эта функция возвращает итератор, который выдаёт значения `OsString` вместо значений `String`. Мы решили использовать `std::env::args` здесь для простоты, потому что значения `OsString` отличаются для каждой платформы и с ними сложнее работать, чем со значениями `String`. +> Обратите внимание, что `std::env::args` вызовет сбой, если какой-либо переменная содержит недопустимый знак Юнирукописи. Если вашей программе необходимо принимать переменные, содержащие недопустимые знаки Unicode, используйте вместо этого `std::env::args_os`. Эта функция возвращает повторитель , который выдаёт значения `OsString` вместо значений `String`. Мы решили использовать `std::env::args` здесь для простоты, потому что значения `OsString` отличаются для каждой площадки и с ними сложнее работать, чем со значениями `String`. -В первой строке кода функции `main` мы вызываем `env::args` и сразу используем метод `collect`, чтобы превратить итератор в вектор содержащий все полученные значения. Мы можем использовать функцию `collect` для создания многих видов коллекций, поэтому мы явно аннотируем тип `args` чтобы указать, что мы хотим вектор строк. Хотя нам очень редко нужно аннотировать типы в Rust, `collect` - это одна из функций, с которой вам часто нужна аннотация типа, потому что Rust не может сам вывести какую коллекцию вы хотите. +В первой строке рукописи функции `main` мы вызываем `env::args` и сразу используем способ `collect`, чтобы превратить повторитель в вектор содержащий все полученные значения. Мы можем использовать функцию `collect` для создания многих видов собраний, поэтому мы явно определяем вид данных `args` чтобы указать, что мы хотим вектор строк. Хотя нам очень редко нужно определять виды данных в Ржавчине, `collect` - это одна из функций, с которой вам часто нужно изложение вида данных, потому что Ржавчина не может сама вывести именно то собрание, какое вы хотите. -И в заключение мы печатаем вектор с помощью отладочного макроса. Попробуем запустить код сначала без аргументов, а затем с двумя аргументами: +И в заключение мы выводим вектор с помощью отладочного макроса. Попробуем запустить рукопись сначала без переменных, а затем с двумя переменными: ```console {{#include ../listings/ch12-an-io-project/listing-12-01/output.txt}} @@ -48,11 +48,11 @@ $ cargo run -- searchstring example-filename.txt {{#include ../listings/ch12-an-io-project/output-only-01-with-args/output.txt}} ``` -Обратите внимание, что первое значение в векторе `"target/debug/minigrep"` является названием нашего двоичного файла. Это соответствует поведению списка аргументов в Си, позволяя программам использовать название с которым они были вызваны при выполнении. Часто бывает удобно иметь доступ к имени программы, если вы хотите распечатать его в сообщениях или изменить поведение программы в зависимости от того, какой псевдоним командной строки был использован для вызова программы. Но для целей этой главы, мы проигнорируем его и сохраним только два аргумента, которые нам нужны. +Обратите внимание, что первое значение в векторе `"target/debug/minigrep"` является названием нашего двоичного файла. Это соответствует поведению списка переменных в Си, позволяя программам использовать название с которым они были вызваны при выполнении. Часто бывает удобно иметь доступ к имени программы, если вы хотите вывести его в сообщениях или изменить поведение программы в зависимости от того, какой псевдоним приказной строки был использован для вызова программы. Но для целей этой Главы, мы пренебрегаем им и сохраним только две переменной, которые нам нужны. -### Сохранения значений аргументов в переменные +### Сохранения значений переменных в переменные -На текущий момент программа может получить доступ к значениям, указанным в качестве аргументов командной строки. Теперь нам требуется сохранять значения этих двух аргументов в переменных, чтобы мы могли использовать их в остальных частях программы. Мы сделаем это в листинге 12-2. +На текущий мгновение программа может получить доступ к значениям, указанным в качестве переменных приказной строки. Теперь нам требуется сохранять значения этих двух переменных в переменных, чтобы мы могли использовать их в остальных частях программы. Мы сделаем это в приложении 12-2. Файл: src/main.rs @@ -60,17 +60,17 @@ $ cargo run -- searchstring example-filename.txt {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-02/src/main.rs}} ``` -Листинг 12-2: Создание переменных для хранения значений аргументов искомой подстроки и пути к файлу +Приложение 12-2: Создание переменных для хранения значений переменных искомой подстроки и пути к файлу -Как видно из распечатки вектора, имя программы занимает первое значение в векторе по адресу `args[0]`, значит, аргументы начинаются с индекса `1`. Первый аргумент `minigrep` - это строка, которую мы ищем, поэтому мы помещаем ссылку на первый аргумент в переменную `query`. Вторым аргументом является путь к файлу, поэтому мы помещаем ссылку на второй аргумент в переменную `file_path`. +Как видно из вывода вектора, имя программы занимает первое значение в векторе по адресу `args[0]`, значит, переменные начинаются с порядкового указателя `1`. Первая переменная `minigrep` - это строка, которую мы ищем, поэтому мы помещаем ссылку на первую переменную в переменную `query`. Второй переменной является путь к файлу, поэтому мы помещаем ссылку на вторую переменную в переменную `file_path`. -Для проверки корректности работы нашей программы, значения переменных выводятся в консоль. Далее, запустим нашу программу со следующими аргументами: `test` и `sample.txt`: +Для проверки соблюдения правил работы нашей программы, значения переменных выводятся в окно вывода. Далее, запустим нашу программу со следующими переменными: `test` и `sample.txt`: ```console {{#include ../listings/ch12-an-io-project/listing-12-02/output.txt}} ``` -Отлично, программа работает! Нам нужно чтобы значения аргументов были сохранены в правильных переменных. Позже мы добавим обработку ошибок с некоторыми потенциальными ошибочными ситуациями, например, когда пользователь не предоставляет аргументы; сейчас мы проигнорируем эту ситуацию и поработаем над добавлением возможности чтения файла. +Отлично, программа работает! Нам нужно чтобы значения переменных были сохранены в правильных переменных. Позже мы добавим обработку ошибок с некоторыми вероятными ошибочными случайми, например, когда пользователь не предоставляет переменные; сейчас мы пренебрегаем эту случай и поработаем над добавлением возможности чтения файла. [главе 13]: ch13-00-functional-features.html diff --git a/rustbook-ru/src/ch12-02-reading-a-file.md b/rustbook-ru/src/ch12-02-reading-a-file.md index 1d18b36c1..654d76dda 100644 --- a/rustbook-ru/src/ch12-02-reading-a-file.md +++ b/rustbook-ru/src/ch12-02-reading-a-file.md @@ -1,6 +1,6 @@ ## Чтение файла -Теперь добавим возможность чтения файла, указанного как аргумент командной строки `file_path`. Во-первых, нам нужен пример файла для тестирования: мы будем использовать файл с небольшим объёмом текста в несколько строк с несколькими повторяющимися словами. В листинге 12-3 представлено стихотворение Эмили Дикинсон, которое будет хорошо работать! Создайте файл с именем *poem.txt* в корне вашего проекта и введите стихотворение "I’m nobody! Who are you?" +Теперь добавим возможность чтения файла, указанного как переменная приказной строки `file_path`. Во-первых, нам нужен пример файла для проверки: мы будем использовать файл с небольшим размером писания в несколько строк с несколькими повторяющимися словами. В приложении 12-3 представлено стихотворение Эмили Дикинсон, которое будет хорошо работать! Создайте файл с именем *poem.txt* в корне вашего дела и введите стихотворение "I’m nobody! Who are you?" Файл: poem.txt @@ -8,9 +8,9 @@ {{#include ../listings/ch12-an-io-project/listing-12-03/poem.txt}} ``` -Листинг 12-3: Стихотворение Эмили Дикинсон - хороший пример для проверки +Приложение 12-3: Стихотворение Эмили Дикинсон - хороший пример для проверки -Текст на месте, отредактируйте *src/main.rs* и добавьте код для чтения файла, как показано в листинге 12-4. +Текст на месте, изменените *src/main.rs* и добавьте рукопись для чтения файла, как показано в приложении 12-4. Файл: src/main.rs @@ -18,18 +18,18 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-04/src/main.rs:here}} ``` -Листинг 12-4: Чтение содержимого файла указанного во втором аргументе +Приложение 12-4: Чтение содержимого файла указанного во втором переменной -Во-первых, мы добавляем ещё одну инструкцию `use` чтобы подключить соответствующую часть стандартной библиотеки: нам нужен `std::fs` для обработки файлов. +Во-первых, мы добавляем ещё одно указание `use` чтобы подключить соответствующую часть встроенной библиотеки: нам нужен `std::fs` для обработки файлов. -В `main` мы добавили новую инструкцию: функция `fs::read_to_string` принимает `file_path`, открывает этот файл и возвращает содержимое файла как `std::io::Result`. +В `main` мы добавили новую указанию: функция `fs::read_to_string` принимает `file_path`, открывает этот файл и возвращает содержимое файла как `std::io::Result`. -После этого, мы снова добавили временную инструкцию `println!` для печати значения `contents` после чтения файла, таким образом мы можем проверить, что программа отрабатывает до этого места. +После этого, мы снова добавили временную указанию `println!` для выводе значения `contents` после чтения файла, таким образом мы можем проверить, что программа отрабатывает до этого места. -Давайте запустим этот код с любой строкой в качестве первого аргумента командной строки (потому что мы ещё не реализовали поисковую часть) и файл *poem.txt* как второй аргумент: +Давайте запустим эту рукопись с любой строкой в качестве первой переменной приказной строки (потому что мы ещё не выполнили поисковую часть) и файл *poem.txt* как вторую переменную: ```console {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-04/output.txt}} ``` -Отлично! Этот код прочитал и затем напечатал содержимое файла. Но у программы есть несколько недостатков. Прежде всего, функция `main` решает слишком много задач: как правило функция понятнее и проще в обслуживании если она воплощает только одну идею. Другая проблема заключается в том, что мы не обрабатываем ошибки так хорошо, как могли бы. Пока наша программа небольшая, то эти недостатки не являются большой проблемой, но по мере роста программы эти недостатки будет всё труднее исправлять. Хорошей практикой является начинать рефакторинг на ранней стадии разработки программы, потому что гораздо проще рефакторить меньшие объёмы кода. Мы сделаем это далее. +Отлично! Эта рукопись прочитана и затем вывела содержимое файла. Но у программы есть несколько недостатков. Прежде всего, функция `main` решает слишком много задач: как правило функция понятнее и проще в обслуживании если она воплощает только одну мысль. Другая неполадка заключается в том, что мы не обрабатываем ошибки так хорошо, как могли бы. Пока наша программа небольшая, то эти недостатки не являются большой неполадкой, но по мере роста программы эти недостатки будет всё труднее исправлять. Хорошим решением является начинать переработку рукописи на раннем этапе разработки программы, потому что гораздо проще перерабатывать рукописи меньших размеров . Мы сделаем это далее. diff --git a/rustbook-ru/src/ch12-03-improving-error-handling-and-modularity.md b/rustbook-ru/src/ch12-03-improving-error-handling-and-modularity.md index 7e9062958..333b1eaa6 100644 --- a/rustbook-ru/src/ch12-03-improving-error-handling-and-modularity.md +++ b/rustbook-ru/src/ch12-03-improving-error-handling-and-modularity.md @@ -1,35 +1,35 @@ -## Рефакторинг для улучшения модульности и обработки ошибок +## Переработка рукописи для улучшения выделения на разделы и обработки ошибок -Для улучшения программы мы исправим 4 имеющихся проблемы, связанных со структурой программы и тем как обрабатываются потенциальные ошибки. Во-первых, функция `main` на данный момент решает две задачи: анализирует переменные командной строки и читает файлы. По мере роста программы количество отдельных задач, которые обрабатывает функция `main`, будет увеличиваться. Поскольку эта функция получает больше обязанностей, то становится все труднее понимать её, труднее тестировать и труднее изменять, не сломав одну из её частей. Лучше всего разделить функциональность, чтобы каждая функция отвечала за одну задачу. +Для улучшения программы мы исправим 4 имеющихся сбоя, связанных с устройством программы и тем как обрабатываются вероятные ошибки. Во-первых, функция `main` на данное мгновение решает две задачи: рассматривает переменные приказной строки и считывает файлы. По мере роста программы количество отдельных задач, которые обрабатывает функция `main`, будет увеличиваться. Поскольку эта функция получает больше обязанностей, то становится все труднее понимать её, труднее проверять и труднее изменять, не сломав одну из её частей. Лучше всего разделить возможность, чтобы каждая функция отвечала за одну задачу. -Эта проблема также связана со второй проблемой: хотя переменные `query` и `file_path` являются переменными конфигурации нашей программы, переменные типа `contents` используются для выполнения логики программы. Чем длиннее становится `main`, тем больше переменных нам нужно будет добавить в область видимости; чем больше у нас переменных в области видимости, тем сложнее будет отслеживать назначение каждой переменной. Лучше всего сгруппировать переменные конфигурации в одну структуру, чтобы сделать их назначение понятным. +Эта неполадка также связана со второй неполадкой: хотя переменные `query` и `file_path` являются переменными настройки нашей программы, переменные вида данных `contents` используются для выполнения хода мыслей программы. Чем длиннее становится `main`, тем больше переменных нам нужно будет добавить в область видимости; чем больше у нас переменных в области видимости, тем сложнее будет отслеживать назначение каждой переменной. Лучше всего объединять переменные настройки в одну `стопку`, чтобы сделать их назначение понятным. -Третья проблема заключается в том, что мы используем `expect` для вывода информации об ошибке при проблеме с чтением файла, но сообщение об ошибке просто выведет текст`Should have been able to read the file`. Чтение файла может не сработать по разным причинам, например: файл не найден или у нас может не быть разрешения на его чтение. Сейчас же, независимо от ситуации, мы напечатаем одно и то же сообщение об ошибке, что не даст пользователю никакой информации! +Третья неполадка заключается в том, что мы используем `expect` для вывода сведений об ошибке при неполадке с чтением файла, но сообщение об ошибке просто выведет сообщение `Should have been able to read the file`. Чтение файла может не сработать по разным причинам, например: файл не найден или у нас может не быть разрешения на его чтение. Сейчас же, независимо от случая, мы выведем одно и то же сообщение об ошибке, что не даст пользователю никакие сведений! -В-четвёртых, мы используем `expect` неоднократно для обработки различных ошибок и если пользователь запускает нашу программу без указания достаточного количества аргументов он получит ошибку `index out of bounds` из Rust, что не совсем понятно описывает проблему. Было бы лучше, если бы весь код обработки ошибок находился в одном месте, чтобы тем, кто будет поддерживать наш код в дальнейшем, нужно было бы вносить изменения только здесь, если потребуется изменить логику обработки ошибок. Наличие всего кода обработки ошибок в одном месте гарантирует, что мы напечатаем сообщения, которые будут иметь смысл для наших конечных пользователей. +В-четвёртых, мы используем `expect` неоднократно для обработки различных ошибок и если пользователь запускает нашу программу без указания достаточного количества переменных он получит ошибку `index out of bounds` из Ржавчины, что не совсем понятно описывает неполадку. Было бы лучше, если бы вся рукопись обработки ошибок находилась в одном месте, чтобы тем, кто будет поддерживать нашу рукопись в дальнейшем, нужно было бы вносить изменения только здесь, если потребуется изменить ход мыслей обработки ошибок. Наличие всего рукописи обработки ошибок в одном месте заверяет, что мы выведем сообщения, которые будут иметь смысл для наших конечных пользователей. -Давайте решим эти четыре проблемы путём рефакторинга нашего проекта. +Давайте решим эти четыре сбоя путём переработки рукописи нашего дела. -### Разделение ответственности для бинарных проектов +### Разделение ответственности для двоичных дел -Организационная проблема распределения ответственности за выполнение нескольких задач функции `main` является общей для многих бинарных проектов. В результате Rust сообщество разработало процесс для использования в качестве руководства по разделению ответственности бинарной программы, когда код в `main` начинает увеличиваться. Процесс имеет следующие шаги: +Внутренняя неполадка распределения ответственности за выполнение нескольких задач функции `main` является общей для многих двоичных дел. В итоге Ржавчина сообщество разработало этап для использования в качестве руководства по разделению ответственности двоичной программы, когда рукопись в `main` начинает увеличиваться. Этап имеет следующие шаги: -- Разделите код программы на два файла *main.rs* и *lib.rs*. Перенесите всю логику работы программы в файл *lib.rs*. -- Пока ваша логика синтаксического анализа командной строки мала, она может оставаться в файле *main.rs*. -- Когда логика синтаксического анализа командной строки становится сложной, извлеките её из *main.rs* и переместите в *lib.rs.* +- Разделите рукопись программы на два файла *main.rs* и *lib.rs*. Перенесите весь ход мыслей работы программы в файл *lib.rs*. +- Пока ваши знания правил написания оценки приказной строки находятся на начальном уровне, вся рукопись может оставаться в файле *main.rs*. +- Когда ход мыслей согласно правил написания оценки приказной строки становится сложным, извлеките её из *main.rs* и переместите в *lib.rs.* -Функциональные обязанности, которые остаются в функции `main` после этого процесса должно быть ограничено следующим: +Полезные обязанности, которые остаются в функции `main` после этого этапа должно быть ограничено следующим: -- Вызов логики разбора командной строки со значениями аргументов -- Настройка любой другой конфигурации +- Вызов хода мыслей разбора приказной строки со значениями переменных +- Настройка любой другой настройки - Вызов функции `run` в *lib.rs* - Обработка ошибки, если `run` возвращает ошибку -Этот шаблон о разделении ответственности: *main.rs* занимается запуском программы, а *lib.rs* обрабатывает всю логику задачи. Поскольку нельзя проверить функцию `main` напрямую, то такая структура позволяет проверить всю логику программы путём перемещения её в функции внутри *lib.rs*. Единственный код, который остаётся в *main.rs* будет достаточно маленьким, чтобы проверить его корректность прочитав код. Давайте переработаем нашу программу, следуя этому процессу. +Этот образец о разделении ответственности: *main.rs* занимается запуском программы, а *lib.rs* обрабатывает весь ход мыслей задачи. Поскольку нельзя проверить функцию `main` напрямую, то такое устройство позволяет проверить весь ход мыслей программы путём перемещения её в функции внутри *lib.rs*. Единственная рукопись, которая остаётся в *main.rs* будет достаточно маленькой, чтобы проверить ее соблюдение правил прочитав рукопись. Давайте переработаем нашу программу, следуя этому этапу. -#### Извлечение парсера аргументов +#### Извлечение обработчика переменных -Мы извлечём функциональность для разбора аргументов в функцию, которую вызовет `main` для подготовки к перемещению логики разбора командной строки в файл *src/lib.rs*. Листинг 12-5 показывает новый запуск `main`, который вызывает новую функцию `parse_config`, которую мы определим сначала в *src/main.rs.* +Мы извлечём возможность для разбора переменных в функцию, которую вызовет `main` для подготовки к перемещению хода мыслей разбора приказной строки в файл *src/lib.rs*. Приложение 12-5 показывает новый запуск `main`, который вызывает новую функцию `parse_config`, которую мы определим сначала в *src/main.rs.* Файл: src/main.rs @@ -37,19 +37,19 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-05/src/main.rs:here}} ``` -Листинг 12-5: Выделение функции parse_config из main +Приложение 12-5: Выделение функции parse_config из main -Мы все ещё собираем аргументы командной строки в вектор, но вместо присваивания значение аргумента с индексом 1 переменной `query` и значение аргумента с индексом 2 переменной с именем `file_path` в функции `main`, мы передаём весь вектор в функцию `parse_config`. Функция `parse_config` затем содержит логику, которая определяет, какой аргумент идёт в какую переменную и передаёт значения обратно в `main`. Мы все ещё создаём переменные `query` и `file_path` в `main`, но `main` больше не несёт ответственности за определение соответствия аргумента командной строки и соответствующей переменной. +Мы все ещё собираем переменные приказной строки в вектор, но вместо присваивания значение переменной с порядковым указателем 1 переменной `query` и значение переменной с порядковым указателем 2 переменной с именем `file_path` в функции `main`, мы передаём весь вектор в функцию `parse_config`. Функция `parse_config` затем содержит ход мыслей, который определяет, какой переменная идёт в какую переменную и передаёт значения обратно в `main`. Мы все ещё создаём переменные `query` и `file_path` в `main`, но `main` больше не несёт ответственности за определение соответствия переменной приказной строки и соответствующей переменной. -Эта доработка может показаться излишней для нашей маленькой программы, но мы проводим рефакторинг небольшими, постепенными шагами. После внесения этого изменения снова запустите программу и убедитесь, что анализ аргументов все ещё работает. Также хорошо часто проверять прогресс, чтобы помочь определить причину проблем, когда они возникают. +Эта доработка может показаться излишней для нашей маленькой программы, но мы проводим переработка рукописи небольшими, постепенными шагами. После внесения этого изменения снова запустите программу и убедитесь, что оценка переменных все ещё работает. Также хорошо часто проверять все этапы, чтобы помочь определить причину неполадок. когда они возникают. -#### Группировка конфигурационных переменных +#### Объединение настроечных переменных -Мы можем сделать ещё один маленький шаг для улучшения функции `parse_config`. На данный момент мы возвращаем кортеж, но затем мы немедленно разделяем его снова на отдельные части. Это признак того, что, возможно, пока у нас нет правильной абстракции. +Мы можем сделать ещё один маленький шаг для улучшения функции `parse_config`. На данное мгновение мы возвращаем упорядоченный ряд, но затем мы немедленно разделяем его снова на отдельные части. Это признак того, что, возможно, пока у нас нет правильной абстракции. -Ещё один индикатор, который показывает, что есть место для улучшения, это часть `config` из `parse_config`, что подразумевает, что два значения, которые мы возвращаем, связаны друг с другом и оба являются частью одного конфигурационного значения. В настоящее время мы не отражаем этого смысла в структуре данных, кроме группировки двух значений в кортеж; мы могли бы поместить оба значения в одну структуру и дать каждому из полей структуры понятное имя. Это облегчит будущую поддержку этого кода, чтобы понять, как различные значения относятся друг к другу и какое их назначение. +Ещё один показатель, который показывает, что есть место для улучшения, это часть `config` из `parse_config`, что подразумевает, что два значения, которые мы возвращаем, связаны друг с другом и оба являются частью одного настроечного значения. В настоящее время мы не отражаем этого смысла в стопке данных, кроме объединения двух значений в упорядоченный ряд; мы могли бы поместить оба значения в один вид данных - стопку и дать каждому из полей стопки понятное имя. Это облегчит будущую поддержку этой рукописи, чтобы понять, как различные значения относятся друг к другу и какое их назначение. -В листинге 12-6 показаны улучшения функции `parse_config` . +В приложении 12-6 показаны улучшения функции `parse_config` . Файл: src/main.rs @@ -57,24 +57,24 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-06/src/main.rs:here}} ``` -Листинг 12-6: Рефакторинг функции parse_config, чтобы возвращать экземпляр структуры Config +Приложение 12-6: Переработка рукописи функции parse_config, чтобы возвращать образец данных стопки Config -Мы добавили структуру с именем `Config` объявленную с полями назваными как `query` и `file_path`. Сигнатура `parse_config` теперь указывает, что она возвращает значение `Config`. В теле `parse_config`, где мы возвращали срезы строк, которые ссылаются на значения `String` в `args`, теперь мы определяем `Config` как содержащие собственные `String` значения. Переменная `args` в `main` является владельцем значений аргумента и позволяют функции `parse_config` только одалживать их, что означает, что мы бы нарушили правила заимствования Rust, если бы `Config` попытался бы взять во владение значения в `args` . +Мы добавили стопку с именем `Config` объявленную с полями назваными как `query` и `file_path`. Ярлык `parse_config` теперь указывает, что она возвращает значение `Config`. В теле `parse_config`, где мы возвращали срезы строк, которые ссылаются на значения `String` в `args`, теперь мы определяем `Config` как содержащие собственные `String` значения. Переменная `args` в `main` является владельцем значений переменной и позволяют функции `parse_config` только одалживать их, что означает, что мы бы нарушили правила заимствования Ржавчина, если бы `Config` попытался бы взять во владение значения в `args` . -Мы можем управлять данными `String` разным количеством способов, но самый простой, хотя и отчасти неэффективный это вызвать метод `clone` у значений. Он сделает полную копию данных для экземпляра `Config` для владения, что занимает больше времени и памяти, чем сохранение ссылки на строку данных. Однако клонирование данных также делает наш код очень простым, потому что нам не нужно управлять временем жизни ссылок; в этом обстоятельстве, отказ от небольшой производительности, чтобы получить простоту, стоит небольших компромисса. +Мы можем управлять данными `String` разным количеством способов, но самый простой, хотя и отчасти неразумный это вызвать способ `clone` у значений. Он сделает полный повтор данных для образца данных `Config` для владения, что занимает больше времени и памяти, чем сохранение ссылки на строку данных. Однако удваивание данных также делает наша рукопись очень простой, потому что нам не нужно управлять временем жизни ссылок; в этом обстоятельстве, отказ от небольшой производительности, чтобы получить простоту, стоит небольших соглашений. -> Компромиссы при использовании метода cloneСуществует тенденция в среде программистов Rust избегать использования `clone`, т.к. это понижает эффективность работы кода. В [Главе 13], вы изучите более эффективные методы, которые могут подойти в подобной ситуации. Но сейчас можно копировать несколько строк, чтобы продолжить работу, потому что вы сделаете эти копии только один раз, а ваше имя файла и строка запроса будут очень маленькими. Лучше иметь работающую программу, которая немного неэффективна, чем пытаться заранее оптимизировать код при первом написании. По мере приобретения опыта работы с Rust вам будет проще начать с наиболее эффективного решения, но сейчас вполне приемлемо вызвать `clone`. +> К при использовании способа cloneСуществует тенденция в среде программистов Ржавчине избегать использования `clone`, т.к. это понижает производительность работы рукописи. В [Главе 13], вы изучите более производительные способы, которые могут подойти в подобном случае. Но сейчас можно воспроизвести несколько строк, чтобы продолжить работу, потому что вы сделаете эти повторы только один раз, а ваше имя файла и строка запроса будут очень маленькими. Лучше иметь работающую программу, которая немного непроизводительна, чем пытаться заранее перерабатывать рукопись при первом написании. По мере приобретения опыта работы с Ржавчиной вам будет проще начать с наиболее качественного решения, но сейчас вполне приемлемо вызвать `clone`. > -Мы обновили код в `main` поэтому он помещает экземпляр `Config` возвращённый из `parse_config` в переменную с именем `config`, и мы обновили код, в котором ранее использовались отдельные переменные `query` и `file_path`, так что теперь он использует вместо этого поля в структуре `Config`. +Мы обновили рукопись в `main` поэтому он помещает образец данных `Config` возвращённый из `parse_config` в переменную с именем `config`, и мы обновили рукопись, в котором ранее использовались отдельные переменные `query` и `file_path`, так что теперь он использует вместо этого поля в стопке `Config`. -Теперь наш код более чётко передаёт то, что `query` и `file_path` связаны и что цель из использования состоит в том, чтобы настроить, как программа будет работать. Любой код, который использует эти значения знает, что может найти их в именованных полях экземпляра `config` по их назначению. +Теперь наша рукопись более чётко передаёт то, что `query` и `file_path` связаны и что цель из использования состоит в том, чтобы настроить, как программа будет работать. Любая рукопись, которая использует эти значения знает, что может найти их в именованных полях образца данных `config` по их назначению. -#### Создание конструктора для структуры `Config` +#### Создание строителя для стопки `Config` -Пока что мы извлекли логику, отвечающую за синтаксический анализ аргументов командной строки из `main` и поместили его в функцию `parse_config`. Это помогло нам увидеть, что значения `query` и `file_path` были связаны и что их отношения должны быть отражены в нашем коде. Затем мы добавили структуру `Config` в качестве названия связанных общей целью `query` и `file_path` и чтобы иметь возможность вернуть именованные значения как имена полей структуры из функции `parse_config`. +Пока что мы извлекли ход мыслей, отвечающую за связанную оценкупеременных приказной строки из `main` и поместили его в функцию `parse_config`. Это помогло нам увидеть, что значения `query` и `file_path` были связаны и что их отношения должны быть отражены в нашей рукописи. Затем мы добавили стопку `Config` в качестве названия связанных общей целью `query` и `file_path` и чтобы иметь возможность вернуть именованные значения как имена полей стопки из функции `parse_config`. -Итак, теперь целью функции `parse_config` является создание экземпляра `Config`, мы можем изменить `parse_config` из простой функции на функцию названную `new`, которая связана со структурой `Config`. Выполняя это изменение мы сделаем код более идиоматичным. Можно создавать экземпляры типов в стандартной библиотеке, такие как `String` с помощью вызова `String::new`. Точно так же изменив название `parse_config` на название функции `new`, связанную с `Config`, мы будем уметь создавать экземпляры `Config`, вызывая `Config::new`. Листинг 12-7 показывает изменения, которые мы должны сделать. +Итак, теперь целью функции `parse_config` является создание образца данных `Config`, мы можем изменить `parse_config` из простой функции на функцию названную `new`, которая связана со `стопкой` `Config`. Выполняя это изменение мы сделаем рукопись более идиоматичным. Можно создавать образцы видов данных во встроенной библиотеке, такие как `String` с помощью вызова `String::new`. Точно так же изменив название `parse_config` на название функции `new`, связанную с `Config`, мы будем уметь создавать образцы `Config`, вызывая `Config::new`. Приложение 12-7 показывает изменения, которые мы должны сделать. Файл: src/main.rs @@ -82,13 +82,13 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-07/src/main.rs:here}} ``` -Листинг 12-7: Переименование parse_config в Config::new +Приложение 12-7: Переименование parse_config в Config::new -Мы обновили `main` где вызывали `parse_config`, чтобы вместо этого вызывалась `Config::new`. Мы изменили имя `parse_config` на `new` и перенесли его внутрь блока `impl`, который связывает функцию `new` с `Config`. Попробуйте снова скомпилировать код, чтобы убедиться, что он работает. +Мы обновили `main` где вызывали `parse_config`, чтобы вместо этого вызывалась `Config::new`. Мы изменили имя `parse_config` на `new` и перенесли его внутрь раздела `impl`, который связывает функцию `new` с `Config`. Попробуйте снова собрать рукопись, чтобы убедиться, что она работает. ### Исправление ошибок обработки -Теперь мы поработаем над исправлением обработки ошибок. Напомним, что попытки получить доступ к значениям в векторе `args` с индексом 1 или индексом 2 приведут к панике, если вектор содержит менее трёх элементов. Попробуйте запустить программу без каких-либо аргументов; это будет выглядеть так: +Теперь мы поработаем над исправлением обработки ошибок. Напомним, что попытки получить доступ к значениям в векторе `args` с порядковым указателем 1 или порядковым указателем 2 приведут к сбою, если вектор содержит менее трёх переменных. Попробуйте запустить программу без каких-либо переменных; это будет выглядеть так: ```console {{#include ../listings/ch12-an-io-project/listing-12-07/output.txt}} @@ -98,7 +98,7 @@ #### Улучшение сообщения об ошибке -В листинге 12-8 мы добавляем проверку в функцию `new`, которая будет проверять, что срез достаточно длинный, перед попыткой доступа по индексам 1 и 2. Если срез не достаточно длинный, программа паникует и отображает улучшенное сообщение об ошибке. +В приложении 12-8 мы добавляем проверку в функцию `new`, которая будет проверять, что срез достаточно длинный, перед попыткой доступа по порядковым указателям 1 и 2. Если срез не достаточно длинный, программа вызывает сбой и отображает улучшенное сообщение об ошибке. Файл: src/main.rs @@ -106,17 +106,17 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-08/src/main.rs:here}} ``` -Листинг 12-8: Добавление проверки количества аргументов +Приложение 12-8: Добавление проверки количества переменных -Этот код похож на [функцию `Guess::new` написанную в листинге 9-13], где мы вызывали `panic!`, когда `value` аргумента вышло за пределы допустимых значений. Здесь вместо проверки на диапазон значений, мы проверяем, что длина `args` не менее 3 и остальная часть функции может работать при условии, что это условие было выполнено. Если в `args` меньше трёх элементов, это условие будет истинным и мы вызываем макрос `panic!` для немедленного завершения программы. +Эта рукопись похож на [функцию `Guess::new` написанную в приложении 9-13], где мы вызывали `panic!`, когда `value` переменной вышло за пределы допустимых значений. Здесь вместо проверки на рядзначений, мы проверяем, что длина `args` не менее 3 и остальная часть функции может работать при условии, что это условие было выполнено. Если в `args` меньше трёх переменных, это условие будет истинным и мы вызываем макрос `panic!` для немедленного завершения программы. -Имея нескольких лишних строк кода в `new`, давайте запустим программу снова без аргументов, чтобы увидеть, как выглядит ошибка: +Имея нескольких лишних строк рукописи в `new`, давайте запустим программу снова без переменных, чтобы увидеть, как выглядит ошибка: ```console {{#include ../listings/ch12-an-io-project/listing-12-08/output.txt}} ``` -Этот вывод лучше: у нас теперь есть разумное сообщение об ошибке. Тем не менее, мы также имеем постороннюю информацию, которую мы не хотим предоставлять нашим пользователям. Возможно, использованная техника, которую мы использовали в листинге 9-13, не является лучшей для использования: вызов `panic!` больше подходит для программирования проблемы, чем решения проблемы, [как обсуждалось в главе 9]. Вместо этого мы можем использовать другую технику, о которой вы узнали в главе 9 [возвращая `Result`], которая указывает либо на успех, либо на ошибку. +Этот вывод лучше: у нас теперь есть разумное сообщение об ошибке. Тем не менее, мы также имеем посторонние сведения, которые мы не хотим предоставлять нашим пользователям. Возможно, использованная техника, которую мы использовали в приложении 9-13, не является лучшей для использования: вызов `panic!` больше подходит для программирования сбоев, чем решения сбоев, [как обсуждалось в главе 9]. Вместо этого мы можем использовать другую технику, о которой вы узнали в главе 9 [возвращая `Result`], которая указывает либо на успех, либо на ошибку. @@ -124,9 +124,9 @@ #### Возвращение `Result` вместо вызова `panic!` -Мы можем вернуть значение `Result`, которое будет содержать экземпляр `Config` в успешном случае и опишет проблему в случае ошибки. Мы так же изменим функцию `new` на `build` потому что многие программисты ожидают что `new` никогда не завершится неудачей. Когда `Config::build` взаимодействует с `main`, мы можем использовать тип `Result` как сигнал возникновения проблемы. Затем мы можем изменить `main`, чтобы преобразовать вариант `Err` в более практичную ошибку для наших пользователей без окружающего текста вроде `thread 'main'` и `RUST_BACKTRACE`, что происходит при вызове `panic!`. +Мы можем вернуть значение `Result`, которое будет содержать образец данных `Config` в успешном случае и опишет неполадку в случае ошибки. Мы так же изменим функцию `new` на `build` потому что многие программисты ожидают что `new` никогда не завершится неудачей. Когда `Config::build` взаимодействует с `main`, мы можем использовать вид данных `Result` как сигнал возникновения сбоев. Затем мы можем изменить `main`, чтобы преобразовать исход `Err` в более применимую ошибку для наших пользователей без окружающего писания вроде `thread 'main'` и `RUST_BACKTRACE`, что происходит при вызове `panic!`. -Листинг 12-9 показывает изменения, которые нужно внести в возвращаемое значения функции `Config::build`, и в тело функции, необходимые для возврата типа `Result`. Заметьте, что этот код не скомпилируется, пока мы не обновим `main`, что мы и сделаем в следующем листинге. +Приложение 12-9 показывает изменения, которые нужно внести в возвращаемое значения функции `Config::build`, и в тело функции, необходимые для возврата вида данных `Result`. Заметьте, что эта рукопись не собирается, пока мы не обновим `main`, что мы и сделаем в следующем приложении. Файл: src/main.rs @@ -134,13 +134,13 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-09/src/main.rs:here}} ``` -Листинг 12-9. Возвращение типа Result из Config::build +Приложение 12-9: Возвращение вида данных Result из Config::build -Наша функция `build` теперь возвращает `Result` с экземпляром `Config` в случае успеха и `&'static str` в случае ошибки. Значения ошибок всегда будут строковыми литералами, которые имеют время жизни `'static`. +Наша функция `build` теперь возвращает `Result` с образцом `Config` в случае успеха и `&'static str` в случае ошибки. Значения ошибок всегда будут строковыми записями, которые имеют время жизни `'static`. -Мы внесли два изменения в тело функции `build`: вместо вызова `panic!`, когда пользователь не передаёт достаточно аргументов, мы теперь возвращаем `Err` значение и мы завернули возвращаемое значение `Config` в Ok . Эти изменения заставят функцию соответствовать своей новой сигнатуре типа. +Мы внесли два изменения в тело функции `build`: вместо вызова `panic!`, когда пользователь не передаёт достаточно переменных, мы теперь возвращаем `Err` значение и мы завернули возвращаемое значение `Config` в Ok . Эти изменения заставят функцию соответствовать своей новой ярлыке вида данных. -Возвращение значения `Err` из `Config::build` позволяет функции `main` обработать значение `Result` возвращённое из функции `build` и выйти из процесса более чисто в случае ошибки. +Возвращение значения `Err` из `Config::build` позволяет функции `main` обработать значение `Result` возвращённое из функции `build` и выйти из этапа более чисто в случае ошибки. @@ -148,7 +148,7 @@ #### Вызов `Config::build` и обработка ошибок -Чтобы обработать ошибку и вывести более дружественное сообщение об ошибке, нам нужно обновить код `main` для обработки `Result`, возвращаемого из `Config::build` как показано в листинге 12-10. Мы также возьмём на себя ответственность за выход из программы командной строки с ненулевым кодом ошибки `panic!` и реализуем это вручную. Не нулевой статус выхода - это соглашение, которое сигнализирует процессу, который вызывает нашу программу, что программа завершилась с ошибкой. +Чтобы обработать ошибку и вывести более дружественное сообщение об ошибке, нам нужно обновить рукопись `main` для обработки `Result`, возвращаемого из `Config::build` как показано в приложении 12-10. Мы также возьмём на себя ответственность за выход из программы приказной строки с ненулевой рукописью ошибки `panic!` и выполняем это вручную. Не нулевое значение выхода - это соглашение, которое указывает этапу, который вызывает нашу программу, что программа завершилась с ошибкой. Файл: src/main.rs @@ -156,11 +156,11 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-10/src/main.rs:here}} ``` -Листинг 12-10. Выход с кодом ошибки если создание новой Config терпит неудачу +Приложение 12-10: Выход с рукописью ошибки если создание новой Config терпит неудачу -В этом листинге мы использовали метод, который мы ещё не рассматривали детально: `unwrap_or_else`, который в стандартной библиотеке определён как `Result`. Использование `unwrap_or_else` позволяет нам определить некоторые пользовательские ошибки обработки, не содержащие `panic!`. Если `Result` является значением `Ok`, поведение этого метода аналогично `unwrap`: возвращает внутреннее значение из обёртки `Ok`. Однако, если значение является значением `Err`, то этот метод вызывает код *замыкания*, которое является анонимной функцией, определённой заранее и передаваемую в качестве аргумента в `unwrap_or_else`. Мы рассмотрим замыкания более подробно в [главе 13](ch13-00-functional-features.html). В данный момент, вам просто нужно знать, что `unwrap_or_else` передаст внутреннее значение `Err`, которое в этом случае является статической строкой `not enough arguments`, которое мы добавили в листинге 12-9, в наше замыкание как аргумент `err` указанное между вертикальными линиями. Код в замыкании может затем использовать значение `err` при выполнении. +В этом приложении мы использовали способ, который мы ещё не рассматривали подробно: `unwrap_or_else`, который во встроенной библиотеке определён как `Result`. Использование `unwrap_or_else` позволяет нам определить некоторые пользовательские ошибки обработки, не содержащие `panic!`. Если `Result` является значением `Ok`, поведение этого способа подобно `unwrap`: возвращает внутреннее значение из обёртки `Ok`. Однако, если значение является значением `Err`, то этот способ вызывает рукопись *замыкания*, которое является анонимной функцией, определённой заранее и передаваемую в качестве переменной в `unwrap_or_else`. Мы рассмотрим замыкания более подробно в [главе 13](ch13-00-functional-features.html). В данный мгновение, вам просто нужно знать, что `unwrap_or_else` передаст внутреннее значение `Err`, которое в этом случае является постоянной строкой `not enough arguments`, которое мы добавили в приложении 12-9, в наше замыкание как переменная `err` указанное между вертикальными линиями. Рукопись в замыкании может затем использовать значение `err` при выполнении. -Мы добавили новую строку `use`, чтобы подключить `process` из стандартной библиотеки в область видимости. Код в замыкании, который будет запущен в случае ошибки содержит только две строчки: мы печатаем значение `err` и затем вызываем `process::exit`. Функция `process::exit` немедленно остановит программу и вернёт номер, который был передан в качестве кода состояния выхода. Это похоже на обработку с помощью макроса `panic!`, которую мы использовали в листинге 12-8, но мы больше не получаем весь дополнительный вывод. Давай попробуем: +Мы добавили новую строку `use`, чтобы подключить `process` из встроенной библиотеки в область видимости. Рукопись в замыкании, который будет запущен в случае ошибки содержит только две строчки: мы выводим значение `err` и затем вызываем `process::exit`. Функция `process::exit` немедленно остановит программу и вернёт номер, который был передан в качестве рукописи состояния выхода. Это похоже на обработку с помощью макроса `panic!`, которую мы использовали в приложении 12-8, но мы больше не получаем весь дополнительный вывод. Давай попробуем: ```console {{#include ../listings/ch12-an-io-project/listing-12-10/output.txt}} @@ -168,11 +168,11 @@ Замечательно! Этот вывод намного дружелюбнее для наших пользователей. -### Извлечение логики из `main` +### Извлечение хода мыслей из `main` -Теперь, когда мы закончили рефакторинг разбора конфигурации, давайте обратимся к логике программы. Как мы указали в разделе [«Разделение ответственности в бинарных проектах»](#separation-of-concerns-for-binary-projects), мы извлечём функцию с именем `run`, которая будет содержать всю логику, присутствующую в настоящее время в функции `main` и которая не связана с настройкой конфигурации или обработкой ошибок. Когда мы закончим, то `main` будет краткой, легко проверяемой и мы сможем написать тесты для всей остальной логики. +Теперь, когда мы закончили переработка рукописи разбора настройки, давайте обратимся к ходу мыслей программы. Как мы указали в разделе [«Разделение ответственности в двоичных делах»](#separation-of-concerns-for-binary-projects), мы извлечём функцию с именем `run`, которая будет содержать весь ход мыслей, присутствующую в настоящее время в функции `main` и которая не связана с настройкой настройки или обработкой ошибок. Когда мы закончим, то `main` будет краткой, легко проверяемой и мы сможем написать проверки для всего остального хода мыслей. -Код 12-11 демонстрирует извлечённую логику в функцию `run`. Мы делаем маленькое, инкрементальное приближение к извлечению функции. Код всё ещё сосредоточен в файле *src/main.rs*: +Рукопись 12-11 отображает извлечённую ход мыслей в функцию `run`. Мы делаем маленькое, инкрементальное приближение к извлечению функции. Рукопись всё ещё сосредоточен в файле *src/main.rs*: Файл: src/main.rs @@ -180,13 +180,13 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-11/src/main.rs:here}} ``` -Листинг 12-11. Извлечение функции run, содержащей остальную логику программы +Приложение 12-11: Извлечение функции run, содержащей остальную ход мыслей программы -Функция `run` теперь содержит всю оставшуюся логику из `main`, начиная от чтения файла. Функция `run` принимает экземпляр `Config` как аргумент. +Функция `run` теперь содержит всю оставшуюся ход мыслей из `main`, начиная от чтения файла. Функция `run` принимает образец данных `Config` как переменная. #### Возврат ошибок из функции `run` -Оставшаяся логика программы выделена в функцию `run`, где мы можем улучшить обработку ошибок как мы уже делали с `Config::build` в листинге 12-9. Вместо того, чтобы позволить программе паниковать с помощью вызова `expect`, функция `run` вернёт `Result`, если что-то пойдёт не так. Это позволит далее консолидировать логику обработки ошибок в `main` удобным способом. Листинг 12-12 показывает изменения, которые мы должны внести в сигнатуру и тело `run`. +Оставшаяся ход мыслей программы выделена в функцию `run`, где мы можем улучшить обработку ошибок как мы уже делали с `Config::build` в приложении 12-9. Вместо того, чтобы позволить программе вызвать сбой с помощью вызова `expect`, функция `run` вернёт `Result`, если что-то пойдёт не так. Это позволит далее объединить ход мыслей обработки ошибок в `main` удобным способом. Приложение 12-12 показывает изменения, которые мы должны внести в ярлык и тело `run`. Файл: src/main.rs @@ -194,27 +194,27 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-12/src/main.rs:here}} ``` -Листинг 12-12. Изменение функции run для возврата Result +Приложение 12-12: Изменение функции run для возврата Result -Здесь мы сделали три значительных изменения. Во-первых, мы изменили тип возвращаемого значения функции `run` на `Result<(), Box>` . Эта функция ранее возвращала тип `()` и мы сохраняли его как значение, возвращаемое в случае `Ok`. +Здесь мы сделали три значительных изменения. Во-первых, мы изменили вид возвращаемого значения функции `run` на `Result<(), Box>` . Эта функция ранее возвращала вид данных `()` и мы сохраняли его как значение, возвращаемое в случае `Ok`. -Для типа ошибки мы использовали *объект типаж* `Box` (и вверху мы подключили тип `std::error::Error` в область видимости с помощью инструкции `use`). Мы рассмотрим типажи объектов в [главе 17]. Сейчас просто знайте, что `Box` означает, что функция будет возвращать тип реализующий типаж `Error`, но не нужно указывать, какой именно будет тип возвращаемого значения. Это даёт возможность возвращать значения ошибок, которые могут быть разных типов в разных случаях. Ключевое слово `dyn` сокращение для слова «динамический». +Для вида ошибки мы использовали *предмет сущность* `Box` (и вверху мы подключили вид данных `std::error::Error` в область видимости с помощью указания `use`). Мы рассмотрим особенности предметов в [главе 17]. Сейчас просто знайте, что `Box` означает, что функция будет возвращать вид данных использующий сущность `Error`, но не нужно указывать, какой именно будет вид данных возвращаемого значения. Это даёт возможность возвращать значения ошибок, которые могут быть разных видов в разных случаях. Ключевое слово `dyn` сокращение для слова «изменяемый». -Во-вторых, мы убрали вызов `expect` в пользу использования оператора `?`, как мы обсудили в [главе 9]. Скорее, чем вызывать `panic!` в случае ошибки, оператор `?` вернёт значение ошибки из текущей функции для вызывающего, чтобы он её обработал. +Во-вторых, мы убрали вызов `expect` в пользу использования приказчика `?`, как мы обсудили в [главе 9]. Скорее, чем вызывать `panic!` в случае ошибки, приказчик `?` вернёт значение ошибки из текущей функции для вызывающего, чтобы он её обработал. -В-третьих, функция `run` теперь возвращает значение `Ok` в случае успеха. В сигнатуре функции `run` успешный тип объявлен как `()`, который означает, что нам нужно обернуть значение единичного типа в значение `Ok`. Данный синтаксис `Ok(())` поначалу может показаться немного странным, но использование `()` выглядит как идиоматический способ указать, что мы вызываем `run` для его побочных эффектов; он не возвращает значение, которое нам нужно. +В-третьих, функция `run` теперь возвращает значение `Ok` в случае успеха. В ярлыке функции `run` успешный вид данных объявлен как `()`, который означает, что нам нужно обернуть значение единичного вида данных в значение `Ok`. Данные правила написания `Ok(())` поначалу может показаться немного странным, но использование `()` выглядит как принятый способ указать, что мы вызываем `run` для его побочных последствий; он не возвращает значение, которое нам нужно. -Когда вы запустите этот код, он скомпилируется, но отобразит предупреждение: +Когда вы запустите эту рукопись, она собирается, но отобразит предупреждение: ```console {{#include ../listings/ch12-an-io-project/listing-12-12/output.txt}} ``` -Rust говорит, что наш код проигнорировал `Result` значение и значение `Result` может указывать на то, что произошла ошибка. Но мы не проверяем, была ли ошибка и компилятор напоминает нам, что мы, вероятно, хотели здесь выполнить некоторый код обработки ошибок! Давайте исправим эту проблему сейчас. +Ржавчина говорит, что наша рукопись пренебрегла значением `Result` и значение `Result` может указывать на то, что произошла ошибка. Но мы не проверяем, была ли ошибка и сборщик напоминает нам, что мы, вероятно, хотели здесь выполнить некоторую рукопись обработки ошибок! Давайте исправим эту неполадку сейчас. #### Обработка ошибок, возвращённых из `run` в `main` -Мы будем проверять и обрабатывать ошибки используя методику, аналогичную той, которую мы использовали для `Config::build` в листинге 12-10, но с небольшой разницей: +Мы будем проверять и обрабатывать ошибки используя способику, подобную той, которую мы использовали для `Config::build` в приложении 12-10, но с небольшой разницей: Файл: src/main.rs @@ -222,22 +222,22 @@ Rust говорит, что наш код проигнорировал `Result` {{#rustdoc_include ../listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/src/main.rs:here}} ``` -Мы используем `if let` вместо `unwrap_or_else` чтобы проверить, возвращает ли `run` значение `Err` и вызывается `process::exit(1)`, если это так. Функция `run` не возвращает значение, которое мы хотим развернуть методом `unwrap`, таким же образом как `Config::build` возвращает экземпляр `Config`. Так как `run` возвращает `()` в случае успеха и мы заботимся только об обнаружении ошибки, то нам не нужно вызывать `unwrap_or_else`, чтобы вернуть развёрнутое значение, потому что оно будет только `()`. +Мы используем `if let` вместо `unwrap_or_else` чтобы проверить, возвращает ли `run` значение `Err` и вызывается `process::exit(1)`, если это так. Функция `run` не возвращает значение, которое мы хотим развернуть способом `unwrap`, таким же образом как `Config::build` возвращает образец данных `Config`. Так как `run` возвращает `()` в случае успеха и мы заботимся только об обнаружении ошибки, то нам не нужно вызывать `unwrap_or_else`, чтобы вернуть развёрнутое значение, потому что оно будет только `()`. -Тело функций `if let` и `unwrap_or_else` одинаковы в обоих случаях: мы печатаем ошибку и выходим. +Тело функций `if let` и `unwrap_or_else` одинаковы в обоих случаях: мы выводим ошибку и выходим. -### Разделение кода на библиотечный крейт +### Разделение рукописи на библиотечный ящик -Наш проект `minigrep` пока выглядит хорошо! Теперь мы разделим файл *src/main.rs* и поместим некоторый код в файл *src/lib.rs*. Таким образом мы сможем его тестировать и чтобы в файле *src/main.rs* было меньшее количество функциональных обязанностей. +Наше дело `minigrep` пока выглядит хорошо! Теперь мы разделим файл *src/main.rs* и поместим некоторую рукопись в файл *src/lib.rs*. Таким образом мы сможем его проверять и чтобы в файле *src/main.rs* было меньшее количество полезных обязанностей. -Давайте перенесём весь код не относящийся к функции `main` из файла *src/main.rs* в новый файл *src/lib.rs*: +Давайте перенесём всю рукопись не относящийся к функции `main` из файла *src/main.rs* в новый файл *src/lib.rs*: - Определение функции `run` -- Соответствующие инструкции `use` -- Определение структуры `Config` +- Соответствующие указания `use` +- Определение стопки `Config` - Определение функции `Config::build` -Содержимое *src/lib.rs* должно иметь сигнатуры, показанные в листинге 12-13 (мы опустили тела функций для краткости). Обратите внимание, что код не будет компилироваться пока мы не изменим *src/main.rs* в листинге 12-14. +Содержимое *src/lib.rs* должно иметь ярлыки, показанное в приложении 12-13 (мы опустили тела функций для краткости). Обратите внимание, что рукопись не будет собираться пока мы не изменим *src/main.rs* в приложении 12-14. Файл: src/lib.rs @@ -245,11 +245,11 @@ Rust говорит, что наш код проигнорировал `Result` {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-13/src/lib.rs:here}} ``` -Листинг 12-13. Перемещение Config и run в src/lib.rs +Приложение 12-13: Перемещение Config и run в src/lib.rs -Мы добавили спецификатор доступа `pub` к структуре `Config`, а также её полям, к методу `build` и функции `run`. Теперь у нас есть библиотечный крейт, который содержит публичный API, который мы можем протестировать! +Мы добавили определитель доступа `pub` к стопке `Config`, а также её полям, к способу `build` и функции `run`. Теперь у нас есть библиотечный ящик, который содержит открытый API, который мы можем проверять! -Теперь нам нужно подключить код, который мы переместили в *src/lib.rs,* в область видимости бинарного крейта внутри *src/main.rs*, как показано в листинге 12-14. +Теперь нам нужно подключить рукопись, которую мы переместили в *src/lib.rs,* в область видимости двоичного ящика внутри *src/main.rs*, как показано в приложении 12-14. Файл: src/main.rs @@ -257,17 +257,17 @@ Rust говорит, что наш код проигнорировал `Result` {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-14/src/main.rs:here}} ``` -Листинг 12-14. Использование крейта библиотеки minigrep внутри src/main.rs +Приложение 12-14: Использование ящика библиотеки minigrep внутри src/main.rs -Мы добавляем `use minigrep::Config` для подключения типа `Config` из крейта библиотеки в область видимости бинарного крейта и добавляем к имени функции `run` префикс нашего крейта. Теперь все функции должны быть подключены и должны работать. Запустите программу с `cargo run` и убедитесь, что все работает правильно. +Мы добавляем `use minigrep::Config` для подключения вида данных `Config` из ящика библиотеки в область видимости двоичного ящика и добавляем к имени функции `run` приставка нашего ящика. Теперь все функции должны быть подключены и должны работать. Запустите программу с `cargo run` и убедитесь, что все работает правильно. -Уф! Было много работы, но мы настроены на будущий успех. Теперь проще обрабатывать ошибки и мы сделали код более модульным. С этого момента почти вся наша работа будет выполняться внутри *src/lib.rs*. +Уф! Было много работы, но мы настроены на будущий успех. Теперь проще обрабатывать ошибки и мы сделали рукопись более состоящим из разделов. С этого времени почти вся наша работа будет выполняться внутри *src/lib.rs*. -Давайте воспользуемся этой новой модульностью, сделав что-то, что было бы трудно со старым кодом, но легко с новым кодом: мы напишем несколько тестов! +Давайте воспользуемся этой новой выделения на разделы, сделав что-то, что было бы трудно со старым рукописью, но легко с новым рукописью: мы напишем несколько проверок! [Главе 13]: ch13-00-functional-features.html -[функцию `Guess::new` написанную в листинге 9-13]: ch09-03-to-panic-or-not-to-panic.html#creating-custom-types-for-validation +[функцию `Guess::new` написанную в приложении 9-13]: ch09-03-to-panic-or-not-to-panic.html#creating-custom-types-for-validation [как обсуждалось в главе 9]: ch09-03-to-panic-or-not-to-panic.html#guidelines-for-error-handling [главе 17]: ch17-00-oop.html [главе 9]: ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator \ No newline at end of file diff --git a/rustbook-ru/src/ch12-04-testing-the-librarys-functionality.md b/rustbook-ru/src/ch12-04-testing-the-librarys-functionality.md index 720241186..4328b5af8 100644 --- a/rustbook-ru/src/ch12-04-testing-the-librarys-functionality.md +++ b/rustbook-ru/src/ch12-04-testing-the-librarys-functionality.md @@ -1,21 +1,21 @@ -## Развитие функциональности библиотеки разработкой на основе тестов +## Развитие возможности библиотеки разработкой на основе проверок -Теперь, когда мы извлекли логику в *src/lib.rs* и оставили разбор аргументов командной строки и обработку ошибок в *src/main.rs*, стало гораздо проще писать тесты для основной функциональности нашего кода. Мы можем вызывать функции напрямую с различными аргументами и проверить возвращаемые значения без необходимости вызова нашего двоичного файла из командной строки. +Теперь, когда мы извлекли ход мыслей в *src/lib.rs* и оставили разбор переменных приказной строки и обработку ошибок в *src/main.rs*, стало гораздо проще писать проверки для основной возможности нашей рукописи. Мы можем вызывать функции напрямую с различными переменными и проверить возвращаемые значения без необходимости вызова нашего двоичного файла из приказной строки. -В этом разделе в программу `minigrep` мы добавим логику поиска с использованием процесса разработки через тестирование (TDD), который следует этим шагам: +В этом разделе в программу `minigrep` мы добавим ход мыслей поиска с использованием этапа разработки через проверку (TDD), которая следует этим шагам: -1. Напишите тест, который завершается неудачей, и запустите его, чтобы убедиться, что он не сработал именно по той причине, которую вы ожидаете. -2. Пишите или изменяйте ровно столько кода, чтобы успешно выполнился новый тест. -3. Выполните рефакторинг кода, который вы только что добавили или изменили, и убедитесь, что тесты продолжают проходить. +1. Напишите проверку, которая завершается неудачей, и запустите его, чтобы убедиться, что он не сработал именно по той причине, которую вы ожидаете. +2. Пишите или изменяйте ровно столько рукописи, чтобы успешно выполнился новый проверку. +3. Выполните переработку рукописи, которую вы только что добавили или изменили, и убедитесь, что проверки продолжают проходить. 4. Повторите с шага 1! -Хотя это всего лишь один из многих способов написания программного обеспечения, TDD может помочь в разработке кода. Написание теста перед написанием кода, обеспечивающего прохождение теста, помогает поддерживать высокое покрытие тестами на протяжении всего процесса разработки. +Хотя это всего лишь один из многих способов написания программного обеспечения, TDD может помочь в разработке рукописи. Написание проверки перед написанием рукописи, обеспечивающего прохождение проверки, помогает поддерживать высокое покрытие проверками на протяжении всего этапа разработки. -Мы протестируем реализацию функциональности, которая делает поиск строки запроса в содержимом файла и создание списка строк, соответствующих запросу. Мы добавим эту функциональность в функцию под названием `search`. +Мы проверим выполнение возможности, которая делает поиск строки запроса в содержимом файла и создание списка строк, соответствующих запросу. Мы добавим эту возможность в функцию под названием `search`. -### Написание теста с ошибкой +### Написание проверки с ошибкой -Поскольку они нам больше не нужны, давайте удалим инструкции с `println!`, которые мы использовали для проверки поведения программы в *src/lib.rs* и *src/main.rs*. Затем в *src/lib.rs* мы добавим модуль `tests` с тестовой функцией, как делали это в [главе 11]. Тестовая функция определяет поведение, которое мы хотим проверить в функции `search`: она должна принимать запрос и текст для поиска, а возвращать только те строки из текста, которые содержат запрос. В листинге 12-15 показан этот тест, который пока не компилируется. +Поскольку они нам больше не нужны, давайте удалим указания с `println!`, которые мы использовали для проверки поведения программы в *src/lib.rs* и *src/main.rs*. Затем в *src/lib.rs* мы добавим раздел `tests` с проверочной функцией, как делали это в [главе 11]. Проверочная функция определяет поведение, которое мы хотим проверить в функции `search`: она должна принимать запрос и писание для поиска, а возвращать только те строки из писания, которые содержат запрос. В приложении 12-15 показана эта проверка, которая пока не собирается. Файл: src/lib.rs @@ -23,11 +23,11 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-15/src/lib.rs:here}} ``` -Листинг 12-15: Создание безуспешного теста для функции search, которую мы хотим создать +Приложение 12-15: Создание безуспешного проверки для функции search, которую мы хотим создать -Этот тест ищет строку `"duct"`. Текст, в котором мы ищем, состоит из трёх строк, только одна из которых содержит `"duct"` (обратите внимание, что обратная косая черта после открывающей двойной кавычки говорит Rust не помещать символ новой строки в начало содержимого этого строкового литерала). Мы проверяем, что значение, возвращаемое функцией `search`, содержит только ожидаемую нами строку. +Эта проверка ищет строку `"duct"`. Писание, в котором мы ищем, состоит из трёх строк, только одна из которых содержит `"duct"` (обратите внимание, что обратная косая черта после открывающей двойной кавычки говорит Ржавчине не помещать знак новой строки в начало содержимого этого строковой записи). Мы проверяем, что значение, возвращаемое функцией `search`, содержит только ожидаемую нами строку. -Мы не можем запустить этот тест и увидеть сбой, потому что тест даже не компилируется: функции `search` ещё не существует! В соответствии с принципами TDD мы добавим ровно столько кода, чтобы тест компилировался и запускался, добавив определение функции `search`, которая всегда возвращает пустой вектор, как показано в листинге 12-16. Потом тест должен скомпилироваться и потерпеть неудачу при запуске, потому что пустой вектор не равен вектору, содержащему строку `"safe, fast, productive."` +Мы не можем запустить эту проверка и увидеть сбой, потому что проверка даже не собирается: функции `search` ещё не существует! В соответствии с принципами TDD мы добавим ровно столько рукописи, чтобы проверка собиралась и запускалась, добавив определение функции `search`, которая всегда возвращает пустой вектор, как показано в приложении 12-16. Потом проверка должна собраться и потерпеть неудачу при запуске, потому что пустой вектор не равен вектору, содержащему строку `"safe, fast, productive."` Файл: src/lib.rs @@ -35,45 +35,45 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-16/src/lib.rs:here}} ``` -Листинг 12-16. Определение функции search, достаточное, чтобы тест скомпилировался +Приложение 12-16: Определение функции search, достаточное, чтобы проверка собрался -Заметьте, что в сигнатуре `search` нужно явно указать время жизни `'a` для аргумента `contents` и возвращаемого значения. Напомним из [Главы 10], что параметры времени жизни указывают с временем жизни какого аргумента связано время жизни возвращаемого значения. В данном случае мы говорим, что возвращаемый вектор должен содержать срезы строк, ссылающиеся на содержимое аргумента `contents` (а не аргумента `query`). +Заметьте, что в ярлыке `search` нужно явно указать время жизни `'a` для переменной `contents` и возвращаемого значения. Напомним из [Главы 10], что свойства времени жизни указывают с временем жизни какого переменной связано время жизни возвращаемого значения. В данном случае мы говорим, что возвращаемый вектор должен содержать срезы строк, ссылающиеся на содержимое переменной `contents` (а не переменной `query`). -Другими словами, мы говорим Rust, что данные, возвращаемые функцией `search`, будут жить до тех пор, пока живут данные, переданные в функцию `search` через аргумент `contents`. Это важно! Чтобы ссылки были действительными, данные, на которые ссылаются *с помощью* срезов тоже должны быть действительными; если компилятор предполагает, что мы делаем строковые срезы переменной `query`, а не переменной `contents`, он неправильно выполнит проверку безопасности. +Другими словами, мы говорим Ржавчине что данные, возвращаемые функцией `search`, будут жить до тех пор, пока живут данные, переданные в функцию `search` через переменную `contents`. Это важно! Чтобы ссылки были действительными, данные, на которые ссылаются *с помощью* срезов тоже должны быть действительными; если сборщик предполагает, что мы делаем строковые срезы переменной `query`, а не переменной `contents`, он неправильно выполнит проверку безопасности. -Если мы забудем аннотации времени жизни и попробуем скомпилировать эту функцию, то получим следующую ошибку: +Если мы забудем изложении времени жизни и попробуем собрать эту функцию, то получим следующую ошибку: ```console {{#include ../listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt}} ``` -Rust не может понять, какой из двух аргументов нам нужен, поэтому нужно сказать ему об этом. Так как `contents` является тем аргументом, который содержит весь наш текст, и мы хотим вернуть части этого текста, которые совпали при поиске, мы понимаем, что `contents` является аргументом, который должен быть связан с возвращаемым значением временем жизни. +Ржавчина не может понять, какая из двух переменных нам нужна, поэтому нужно сказать ему об этом. Так как `contents` является той переменной, которая содержит все наше писание, и мы хотим вернуть части этого писания, которые совпали при поиске, мы понимаем, что `contents` является переменной, которая должна быть связана с возвращаемым значением временем жизни. -Другие языки программирования не требуют от вас связывания в сигнатуре аргументов с возвращаемыми значениями, но после определённой практики вам станет проще. Можете сравнить этот пример с разделом [«Проверка ссылок с временами жизни»](ch10-03-lifetime-syntax.html#validating-references-with-lifetimes) главы 10. +Другие языки программирования не требуют от вас связывания в ярлыке переменных с возвращаемыми значениями, но после определённой опытов вам станет проще. Можете сравнить этот пример с разделом [«Проверка ссылок с временами жизни»](ch10-03-lifetime-syntax.html#validating-references-with-lifetimes) Главы 10. -Запустим тест: +Запустим проверку: ```console {{#include ../listings/ch12-an-io-project/listing-12-16/output.txt}} ``` -Отлично. Наш тест не сработал, как мы и ожидали. Давайте сделаем так, чтобы он срабатывал! +Отлично. Наша проверка не сработала, как мы и ожидали. Давайте сделаем так, чтобы она срабатывал! -### Написание кода для прохождения теста +### Написание рукописи для прохождения проверки -Сейчас наш тест не проходит, потому что мы всегда возвращаем пустой вектор. Чтобы исправить это и реализовать `search`, наша программа должна выполнить следующие шаги: +Сейчас наша проверка не проходит, потому что мы всегда возвращаем пустой вектор. Чтобы исправить это и использовать `search`, наша программа должна выполнить следующие шаги: -- Итерироваться по каждой строке содержимого. +- Повторение по каждой строке содержимого. - Проверить, содержит ли данная строка искомую. - Если это так, добавить её в список значений, которые мы возвращаем. - Если это не так, ничего не делать. -- Вернуть список результатов. +- Вернуть список итогов. Давайте проработаем каждый шаг, начиная с перебора строк. -#### Перебор строк с помощью метода `lines` +#### Перебор строк с помощью способа `lines` -В Rust есть полезный метод для построчной итерации строк, удобно названный `lines`, как показано в листинге 12-17. Обратите внимание, код пока не компилируется. +В Ржавчине есть полезный способ для построчной повторения строк, удобно названный `lines`, как показано в приложении 12-17. Обратите внимание, рукопись пока не собирается. Файл: src/lib.rs @@ -81,13 +81,13 @@ Rust не может понять, какой из двух аргументов {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-17/src/lib.rs:here}} ``` -Листинг 12-17: Итерация по каждой строке из contents +Приложение 12-17: Повторение по каждой строке из contents -Метод `lines` возвращает итератор. Мы подробно поговорим об итераторах в [Главе 13], но вспомните, что вы видели этот способ использования итератора в [Листинге 3-5], где мы использовали цикл `for` с итератором, чтобы выполнить некоторый код для каждого элемента в коллекции. +Способ `lines` возвращает повторитель . Мы подробно поговорим об повторителях в [Главе 13], но вспомните, что вы видели этот способ использования повторителя в [Приложении 3-5], где мы использовали круговорот `for` с повторителем, чтобы выполнить некоторую рукопись для каждой переменной в собрании. -#### Поиск в каждой строке текста запроса +#### Поиск в каждой строке писания запроса -Далее мы проверяем, содержит ли текущая строка нашу искомую строку. К счастью, у строк есть полезный метод `contains`, который именно это и делает! Добавьте вызов метода `contains` в функции `search`, как показано в листинге 12-18. Обратите внимание, что это все ещё не компилируется. +Далее мы проверяем, содержит ли текущая строка нашу искомую строку. К счастью, у строк есть полезный способ `contains`, который именно это и делает! Добавьте вызов способа `contains` в функции `search`, как показано в приложении 12-18. Обратите внимание, что это все ещё не собирается. Файл: src/lib.rs @@ -95,13 +95,13 @@ Rust не может понять, какой из двух аргументов {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-18/src/lib.rs:here}} ``` -Листинг 12-18. Добавление проверки, содержится ли query в строке +Приложение 12-18: Добавление проверки, содержится ли query в строке -На данный момент мы наращиваем функциональность. Чтобы заставить это компилироваться, нам нужно вернуть значение из тела функции, как мы указали в сигнатуре функции. +На данное мгновение мы наращиваем возможность. Чтобы заставить это собираться, нам нужно вернуть значение из тела функции, как мы указали в ярлыке функции. #### Сохранение совпавшей строки -Чтобы завершить эту функцию, нам нужен способ сохранить совпадающие строки, которые мы хотим вернуть. Для этого мы можем создать изменяемый вектор перед циклом `for` и вызывать метод `push` для сохранения `line` в векторе. После цикла `for` мы возвращаем вектор, как показано в листинге 12-19. +Чтобы завершить эту функцию, нам нужен способ сохранить совпадающие строки, которые мы хотим вернуть. Для этого мы можем создать изменяемый вектор перед круговоротом `for` и вызывать способ `push` для сохранения `line` в векторе. После круговорота `for` мы возвращаем вектор, как показано в приложении 12-19. Файл: src/lib.rs @@ -109,21 +109,21 @@ Rust не может понять, какой из двух аргументов {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-19/src/lib.rs:here}} ``` -Листинг 12-19: Сохраняем совпавшие строки, чтобы впоследствии их можно было вернуть +Приложение 12-19: Сохраняем совпавшие строки, чтобы впоследствии их можно было вернуть -Теперь функция `search` должна возвратить только строки, содержащие `query`, и тест должен пройти. Запустим его: +Теперь функция `search` должна возвратить только строки, содержащие `query`, и проверка должна пройти. Запустим её: ```console {{#include ../listings/ch12-an-io-project/listing-12-19/output.txt}} ``` -Наш тест пройден, значит он работает! +Наша проверка пройдена, значит она работает! -На этом этапе мы могли бы рассмотреть возможности изменения реализации функции поиска, сохраняя прохождение тестов и поддерживая имеющуюся функциональность. Код в функции поиска не так уж плох, но он не использует некоторые полезные функции итераторов. Вернёмся к этому примеру в [главе 13](ch13-02-iterators.html), где будем исследовать итераторы подробно, и посмотрим как его улучшить. +На этом этапе мы могли бы рассмотреть возможности изменения выполнения функции поиска, сохраняя прохождение проверок и поддерживая имеющуюся возможность. Рукопись в функции поиска не так уж плох, но он не использует некоторые полезные функции повторителей. Вернёмся к этому примеру в [главе 13](ch13-02-iterators.html), где будем исследовать повторители подробно, и посмотрим как его улучшить. #### Использование функции `search` в функции `run` -Теперь, когда функция `search` работает и протестирована, нужно вызвать `search` из нашей функции `run`. Нам нужно передать значение `config.query` и `contents`, которые `run` читает из файла, в функцию `search`. Тогда `run` напечатает каждую строку, возвращаемую из `search`: +Теперь, когда функция `search` работает и проверена, нужно вызвать `search` из нашей функции `run`. Нам нужно передать значение `config.query` и `contents`, которые `run` считывает из файла, в функцию `search`. Тогда `run` выведет каждую строку, возвращаемую из `search`: Файл: src/lib.rs @@ -131,7 +131,7 @@ Rust не может понять, какой из двух аргументов {{#rustdoc_include ../listings/ch12-an-io-project/no-listing-02-using-search-in-run/src/lib.rs:here}} ``` -Мы по-прежнему используем цикл `for` для возврата каждой строки из функции `search` и её печати. +Мы по-прежнему используем круговорот `for` для возврата каждой строки из функции `search` и её выводе. Теперь вся программа должна работать! Давайте попробуем сначала запустить её со словом «frog», которое должно вернуть только одну строчку из стихотворения Эмили Дикинсон: @@ -151,12 +151,12 @@ Rust не может понять, какой из двух аргументов {{#include ../listings/ch12-an-io-project/output-only-04-no-matches/output.txt}} ``` -Отлично! Мы создали собственную мини-версию классического инструмента и научились тому, как структурировать приложения. Мы также немного узнали о файловом вводе и выводе, временах жизни, тестировании и разборе аргументов командной строки. +Отлично! Мы создали собственную простое-исполнение обычного средства и научились тому, как внутренне выстроить приложения. Мы также немного узнали о файловом вводе и выводе, временах жизни, проверке и разборе переменных приказной строки. -Чтобы завершить этот проект, мы кратко продемонстрируем пару вещей: как работать с переменными окружения и как печатать в стандартный поток ошибок, обе из которых полезны при написании консольных программ. +Чтобы завершить это дело, мы кратко выполним пару вещей: как работать с переменными окружения и как выводить в обычный поток ошибок, обе из которых полезны при написании программ с окнами ввода/вывода. [главе 11]: ch11-01-writing-tests.html#the-anatomy-of-a-test-function [Главы 10]: ch10-03-lifetime-syntax.html -[Листинге 3-5]: ch03-05-control-flow.html#looping-through-a-collection-with-for +[Приложении 3-5]: ch03-05-control-flow.html#looping-through-a-collection-with-for [Главе 13]: ch13-02-iterators.html \ No newline at end of file diff --git a/rustbook-ru/src/ch12-05-working-with-environment-variables.md b/rustbook-ru/src/ch12-05-working-with-environment-variables.md index d5c7e2a00..074a32981 100644 --- a/rustbook-ru/src/ch12-05-working-with-environment-variables.md +++ b/rustbook-ru/src/ch12-05-working-with-environment-variables.md @@ -1,10 +1,10 @@ ## Работа с переменными окружения -Мы улучшим `minigrep`, добавив дополнительную функцию: опцию для поиска без учёта регистра, которую пользователь может включить с помощью переменной среды окружения. Мы могли бы сделать эту функцию параметром командной строки и потребовать, чтобы пользователи вводили бы её каждый раз при её применении, но вместо этого мы будем использовать переменную среды окружения, что позволит нашим пользователям устанавливать переменную среды один раз и все поиски будут не чувствительны к регистру в этом терминальном сеансе. +Мы улучшим `minigrep`, добавив дополнительную функцию: возможность для поиска без учёта заглавных или строчных букв, которую пользователь может включить с помощью переменной среды окружения. Мы могли бы сделать эту функцию свойством приказной строки и потребовать, чтобы пользователи вводили бы её каждый раз при её применении, но вместо этого мы будем использовать переменную среды окружения, что позволит нашим пользователям устанавливать переменную среды один раз и все поиски будут не чувствительны к заглавным или строчным буквам в этом окно онка вызова . -### Написание ошибочного теста для функции `search` с учётом регистра +### Написание ошибочного проверки для функции `search` с учётом заглавных или строчных букв -Мы, во-первых, добавим новую функцию `search_case_insensitive`, которую мы будем вызывать, когда переменная окружения содержит значение. Мы продолжим следовать процессу TDD, поэтому первый шаг - это снова написать не проходящий тест. Мы добавим новый тест для новой функции `search_case_insensitive` и переименуем наш старый тест из `one_result` в `case_sensitive`, чтобы прояснить различия между двумя тестами, как показано в листинге 12-20. +Мы, во-первых, добавим новую функцию `search_case_insensitive`, которую мы будем вызывать, когда переменная окружения содержит значение. Мы продолжим следовать этапу TDD, поэтому первый шаг - это снова написать не проходящий проверку. Мы добавим новую проверку для новой функции `search_case_insensitive` и переименуем нашу старую проверку из `one_result` в `case_sensitive`, чтобы прояснить различия между двумя проверками, как показано в приложении 12-20. Файл: src/lib.rs @@ -12,15 +12,15 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-20/src/lib.rs:here}} ``` -Листинг 12-20. Добавление нового не проходящего теста для функции поиска нечувствительной к регистру, которую мы собираемся добавить +Приложение 12-20: Добавление нового не проходящего проверки для функции поиска нечувствительной к заглавным или строчным буквам, которую мы собираемся добавить -Обратите внимание, что мы также отредактировали содержимое переменной `contents` из старого теста. Мы добавили новую строку с текстом `"Duct tape."`, используя заглавную D, которая не должна соответствовать запросу `"duct"` при поиске с учётом регистра. Такое изменение старого теста помогает избежать случайного нарушения функциональности поиска чувствительного к регистру, который мы уже реализовали. Этот тест должен пройти сейчас и должен продолжать выполняться успешно, пока мы работаем над поиском без учёта регистра. +Обратите внимание, что мы также изменили содержимое переменной `contents` из старого проверки. Мы добавили новую строку с писанием `"Duct tape."`, используя заглавную D, которая не должна соответствовать запросу `"duct"` при поиске с учётом заглавных или строчных букв. Такое изменение старого проверки помогает избежать случайного нарушения возможности поиска чувствительного к заглавным или строчным буквам, который мы уже выполнили. Эта проверка должна пройти сейчас и должна продолжать выполняться успешно, пока мы работаем над поиском без учёта заглавных или строчных букв. -Новый тест для поиска *нечувствительного* к регистру использует `"rUsT"` качестве строки запроса. В функции `search_case_insensitive`, которую мы собираемся реализовать, запрос `"rUsT"` должен соответствовать строке содержащей `"Rust:"` с большой буквы R и соответствовать строке `"Trust me."`, хотя обе имеют разные регистры из запроса. Это наш не проходящий тест, он не компилируется, потому что мы ещё не определили функцию `search_case_insensitive`. Не стесняйтесь добавлять скелет реализация, которая всегда возвращает пустой вектор, аналогично тому, как мы это делали для функции `search` в листинге 12-16, чтобы увидеть компиляцию теста и его сбой. +Новая проверка для поиска *нечувствительного* к заглавным или строчным буквам использует `"рЖавчинА"` качестве строки запроса. В функции `search_case_insensitive`, которую мы собираемся выполнить, запрос `"рЖавчинА"` должна соответствовать строке содержащей `"Ржавчина:"` с большой буквы R и соответствовать строке `"Trust me."`, хотя обе имеют разные буквы (строчные и заглавные) из запроса. Это наша не проходящая проверка, она не собирается, потому что мы ещё не определили функцию `search_case_insensitive`. Не стесняйтесь добавлять скелет выполнение, которая всегда возвращает пустой вектор, подобно тому, как мы это делали для функции `search` в приложении 12-16, чтобы увидеть сборку проверки и его сбой. -### Реализация функции `search_case_insensitive` +### Выполнение функции `search_case_insensitive` -Функция `search_case_insensitive`, показанная в листинге 12-21, будет почти такая же, как функция `search`. Разница лишь в том, что текст будет в нижнем регистре для `query` и для каждой `line`, так что для любого регистра входных аргументов это будет тот же случай, когда мы проверяем, содержит ли строка запрос. +Функция `search_case_insensitive`, показанная в приложении 12-21, будет почти такая же, как функция `search`. Разница лишь в том, что писание будет строчными буквами для `query` и для каждой `line`, так что для любых букв (строчных или заглавных) входных переменных это будет тот же случай, когда мы проверяем, содержит ли строка запрос. Файл: src/lib.rs @@ -28,21 +28,21 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-21/src/lib.rs:here}} ``` -Листинг 12-21. Определение функции search_case_insensitive с уменьшением регистра строки запроса и строки содержимого перед их сравнением +Приложение 12-21: Определение функции search_case_insensitive с уменьшением регистра строки запроса и строки содержимого перед их сравнением -Сначала преобразуем в нижний регистр строку `query` и сохраняем её в затенённой переменной с тем же именем. Вызов `to_lowercase` для строки запроса необходим, так что независимо от того, будет ли пользовательский запрос `"rust"` , `"RUST"`, `"Rust"` или `"rUsT"`, мы будем преобразовывать запрос к `"rust"` и делать значение нечувствительным к регистру. Хотя `to_lowercase` будет обрабатывать Unicode, он не будет точным на 100%. Если бы мы писали реальное приложение, мы бы хотели проделать здесь немного больше работы, но этот раздел посвящён переменным среды, а не Unicode, поэтому мы оставим это здесь. +Сначала преобразуем в нижний регистр строку `query` и сохраняем её в затенённой переменной с тем же именем. Вызов `to_lowercase` для строки запроса необходим, так что независимо от того, будет ли пользовательский запрос `"ржавчина"` , `"РЖАВЧИНА"`, `"Ржавчина"` или `"рЖавчина"`, мы будем преобразовывать запрос к `"ржавчина"` и делать значение нечувствительным к заглавным или строчным буквам. Хотя `to_lowercase` будет обрабатывать Unicode, он не будет точным на 100%. Если бы мы писали существующее приложение, мы бы хотели проделать здесь немного больше работы, но этот раздел посвящён переменным среды, а не Unicode, поэтому мы оставим это здесь. -Обратите внимание, что `query` теперь имеет тип `String`, а не срез строки, потому что вызов `to_lowercase` создаёт новые данные, а не ссылается на существующие. К примеру, запрос: `"rUsT"` это срез строки не содержащий строчных букв `u` или `t`, которые мы можем использовать, поэтому мы должны выделить новую `String`, содержащую `«rust»`. Когда мы передаём запрос `query` в качестве аргумента метода `contains`, нам нужно добавить амперсанд, поскольку сигнатура `contains`, определена для приёмы среза строки. +Обратите внимание, что `query` теперь имеет вид данных `String`, а не срез строки, потому что вызов `to_lowercase` создаёт новые данные, а не ссылается на существующие. К примеру, запрос: `"рЖавчина"` это срез строки не содержащий строчных букв `u` или `t`, которые мы можем использовать, поэтому мы должны выделить новую `String`, содержащую `«ржавчина»`. Когда мы передаём запрос `query` в качестве переменной способа `contains`, нам нужно добавить знак, поскольку ярлык `contains`, определена для приёмы среза строки. -Затем мы добавляем вызов `to_lowercase` для каждой строки `line` для преобразования к нижнему регистру всех символов. Теперь, когда мы преобразовали `line` и `query` в нижний регистр, мы найдём совпадения независимо от того, в каком регистре находится переменная с запросом. +Затем мы добавляем вызов `to_lowercase` для каждой строки `line` для преобразования всех знаков строчными. Теперь, когда мы преобразовали `line` и `query` в нижний регистр, мы найдём совпадения независимо от того, в каком регистре находится переменная с запросом. -Давайте посмотрим, проходит ли эта реализация тесты: +Давайте посмотрим, проходит ли эта выполнение проверки: ```console {{#include ../listings/ch12-an-io-project/listing-12-21/output.txt}} ``` -Отлично! Тесты прошли. Теперь давайте вызовем новую функцию `search_case_insensitive` из функции `run`. Во-первых, мы добавим параметр конфигурации в структуру `Config` для переключения между поиском с учётом регистра и без учёта регистра. Добавление этого поля приведёт к ошибкам компилятора, потому что мы ещё нигде не инициализируем это поле: +Отлично! Проверки прошли. Теперь давайте вызовем новую функцию `search_case_insensitive` из функции `run`. Во-первых, мы добавим свойство настройке в стопку `Config` для переключения между поиском с учётом заглавных или строчных букв и без учёта данного условия. Добавление этого поля приведёт к ошибкам сборщика, потому что мы ещё нигде не объявим это поле: Файл: src/lib.rs @@ -50,7 +50,7 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-22/src/lib.rs:here}} ``` -Мы добавили поле `ignore_case`, которое содержит логическое значение. Далее нам нужна функция `run`, чтобы проверить значение поля `ignore_case` и использовать его, чтобы решить, вызывать ли функцию `search` или функцию `search_case_insensitive`, как показано в листинге 12-22. Этот код все ещё не компилируется. +Мы добавили поле `ignore_case`, которое содержит разумное значение. Далее нам нужна функция `run`, чтобы проверить значение поля `ignore_case` и использовать его, чтобы решить, вызывать ли функцию `search` или функцию `search_case_insensitive`, как показано в приложении 12-22. Эта рукопись все ещё не собирается. Файл: src/lib.rs @@ -58,9 +58,9 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-22/src/lib.rs:there}} ``` -Листинг 12-22. Вызов либо search, либо search_case_insensitive на основе значения в config.ignore_case +Приложение 12-22: Вызов либо search, либо search_case_insensitive на основе значения в config.ignore_case -Наконец, нам нужно проверить переменную среды. Функции для работы с переменными среды находятся в модуле `env` стандартной библиотеки, поэтому мы хотим подключить этот модуль в область видимости в верхней части src/lib.rs. Затем мы будем использовать функцию `var` из модуля `env` для проверки установлено ли любое значение в переменной среды с именем `IGNORE_CASE`, как показано в листинге 12-23. +Наконец, нам нужно проверить переменную среды. Функции для работы с переменными среды находятся в разделе `env` встроенной библиотеки, поэтому мы хотим подключить это раздел в область видимости в верхней части src/lib.rs. Затем мы будем использовать функцию `var` из раздела `env` для проверки установлено ли любое значение в переменной среды с именем `IGNORE_CASE`, как показано в приложении 12-23. Файл: src/lib.rs @@ -68,13 +68,13 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-23/src/lib.rs:here}} ``` -Листинг 12-23. Проверка переменной среды с именем IGNORE_CASE +Приложение 12-23: Проверка переменной среды с именем IGNORE_CASE -Здесь мы создаём новую переменную `ignore_case`. Чтобы установить её значение, мы вызываем функцию `env::var` и передаём ей имя переменной окружения `IGNORE_CASE`. Функция `env::var` возвращает `Result`, который будет успешным вариантом `Ok` содержащий значение переменной среды, если переменная среды установлена. Он вернёт вариант `Err`, если переменная окружения не установлена. +Здесь мы создаём новую переменную `ignore_case`. Чтобы установить её значение, мы вызываем функцию `env::var` и передаём ей имя переменной окружения `IGNORE_CASE`. Функция `env::var` возвращает `Result`, который будет успешным исходом `Ok` содержащий значение переменной среды, если переменная среды установлена. Он вернёт исход `Err`, если переменная окружения не установлена. -Мы используем метод `is_ok` у `Result`, чтобы проверить установлена ли переменная окружения, что будет означать, что программа должна выполнить поиск без учёта регистра. Если переменная среды `IGNORE_CASE` не содержит любого значения, то `is_ok` вернёт значение false и программа выполнит поиск c учётом регистра. Мы не заботимся о значении переменной среды, нас интересует только установлена она или нет, поэтому мы проверяем `is_ok`, а не используем `unwrap`, `expect` или любой другой метод, который мы видели у `Result`. +Мы используем способ `is_ok` у `Result`, чтобы проверить установлена ли переменная окружения, что будет означать, что программа должна выполнить поиск без учёта заглавных или строчных букв. Если переменная среды `IGNORE_CASE` не содержит любого значения, то `is_ok` вернёт значение false и программа выполнит поиск c учётом заглавных или строчных букв. Мы не заботимся о значении переменной среды, нас важно только установлена она или нет, поэтому мы проверяем `is_ok`, а не используем `unwrap`, `expect` или любой другой способ, который мы видели у `Result`. -Мы передаём значение переменной `ignore_case` экземпляру `Config`, чтобы функция `run` могла прочитать это значение и решить, следует ли вызывать `search` или `search_case_insensitive`, как мы реализовали в листинге 12-22. +Мы передаём значение переменной `ignore_case` образцу данных `Config`, чтобы функция `run` могла прочитать это значение и решить, следует ли вызывать `search` или `search_case_insensitive`, как мы выполнили в приложении 12-22. Давайте попробуем! Во-первых, мы запустим нашу программу без установленной переменной среды и с помощью значения запроса `to`, который должен соответствовать любой строке, содержащей слово «to» в нижнем регистре: @@ -88,13 +88,13 @@ $ IGNORE_CASE=1 cargo run -- to poem.txt ``` -Если вы используете PowerShell, вам нужно установить переменную среды и запустить программу двумя командами, а не одной: +Если вы используете PowerShell, вам нужно установить переменную среды и запустить программу двумя приказами, а не одним: ```console PS> $Env:IGNORE_CASE=1; cargo run -- to poem.txt ``` -Это заставит переменную окружения `IGNORE_CASE` сохраниться до конца сеанса работы консоли. Переменную можно отключить с помощью команды `Remove-Item`: +Это заставит переменную окружения `IGNORE_CASE` сохраниться до конца сеанса работы окне вывода. Переменную можно отключить с помощью приказов `Remove-Item`: ```console PS> Remove-Item Env:IGNORE_CASE @@ -115,8 +115,8 @@ To tell your name the livelong day To an admiring bog! ``` -Отлично, мы также получили строки, содержащие «To»! Наша программа `minigrep` теперь может выполнять поиск без учёта регистра, управляемая переменной среды. Теперь вы знаете, как управлять параметрами, заданными с помощью аргументов командной строки или переменных среды. +Отлично, мы также получили строки, содержащие «To»! Наша программа `minigrep` теперь может выполнять поиск без учёта заглавных или строчных букв, управляемая переменной среды. Теперь вы знаете, как управлять свойствами, заданными с помощью переменных приказной строки или переменных среды. -Некоторые программы допускают использование аргументов *и* переменных среды для одной и той же конфигурации. В таких случаях программы решают, что из них имеет больший приоритет. Для другого самостоятельного упражнения попробуйте управлять чувствительностью к регистру с помощью аргумента командной строки или переменной окружения. Решите, аргумент командной строки или переменная среды будет иметь приоритет, если программа выполняется со значениями "учитывать регистр" в одном случае, и "игнорировать регистр" в другом. +Некоторые программы допускают использование переменных *и* переменных среды для одной и той же настройке. В таких случаях программы решают, что из них имеет больший приоритет. Для другого самостоятельного упражнения попробуйте управлять чувствительностью к заглавным или строчным буквам с помощью переменной приказной строки или переменной окружения. Решите, переменная приказной строки или переменная среды будет иметь приоритет, если программа выполняется со значениями "учитывать регистр" в одном случае, и "пренебрегать регистр" в другом. -Модуль `std::env` содержит много других полезных функций для работы с переменными среды: ознакомьтесь с его документацией, чтобы узнать доступные. +Раздел `std::env` содержит много других полезных функций для работы с переменными среды: ознакомьтесь с его пособием, чтобы узнать доступные. diff --git a/rustbook-ru/src/ch12-06-writing-to-stderr-instead-of-stdout.md b/rustbook-ru/src/ch12-06-writing-to-stderr-instead-of-stdout.md index 6742bc836..762d741e7 100644 --- a/rustbook-ru/src/ch12-06-writing-to-stderr-instead-of-stdout.md +++ b/rustbook-ru/src/ch12-06-writing-to-stderr-instead-of-stdout.md @@ -1,32 +1,32 @@ -## Запись сообщений ошибок в поток ошибок вместо стандартного потока вывода +## Запись сообщений ошибок в поток ошибок вместо принятого потока вывода -В данный момент мы записываем весь наш вывод в терминал, используя функцию `println!`. В большинстве терминалов предоставлено два вида вывода: *стандартный поток вывода* ( `stdout` ) для общей информации и *стандартный поток ошибок* ( `stderr` ) для сообщений об ошибках. Это различие позволяет пользователям выбирать, направлять ли успешный вывод программы в файл, но при этом выводить сообщения об ошибках на экран. +В данный мгновение мы записываем весь наш вывод в окно вызова, используя функцию `println!`. В большинстве окон вызовов предоставлено два вида вывода: *обычный поток вывода* ( `stdout` ) для общей сведений и *обычный поток ошибок* ( `stderr` ) для сообщений об ошибках. Это различие позволяет пользователям выбирать, направлять ли успешный вывод программы в файл, но при этом выводить сообщения об ошибках на экран. -Функция `println!` может печатать только в стандартный вывод, поэтому мы должны использовать что-то ещё для печати в стандартный поток ошибок. +Функция `println!` может выводить только в обычный вывод, поэтому мы должны использовать что-то ещё для выводе в обычный поток ошибок. ### Проверка, куда записываются ошибки -Во-первых, давайте посмотрим, как содержимое, напечатанное из `minigrep` в настоящее время записывается в стандартный вывод, включая любые сообщения об ошибках, которые мы хотим вместо этого записать в стандартный поток ошибок. Мы сделаем это, перенаправив стандартный поток вывода в файл и намеренно вызовем ошибку. Мы не будем перенаправлять стандартный поток ошибок, поэтому любой контент, отправленный в поток стандартных ошибок будет продолжать отображаться на экране. +Во-первых, давайте посмотрим, как содержимое, выведенное из `minigrep` в настоящее время записывается в обычный вывод, включая любые сообщения об ошибках, которые мы хотим вместо этого записать в обычный поток ошибок. Мы сделаем это, перенаправив обычный поток вывода в файл и намеренно вызовем ошибку. Мы не будем перенаправлять обычный поток ошибок, поэтому любой содержание, отправленный в поток принятых ошибок будет продолжать отображаться на экране. -Ожидается, что программы командной строки будут отправлять сообщения об ошибках в стандартный поток ошибок, поэтому мы все равно можем видеть сообщения об ошибках на экране, даже если мы перенаправляем стандартный поток вывода в файл. Наша программа в настоящее время не ведёт себя правильно: мы увидим, что она сохраняет вывод сообщения об ошибке в файл! +Ожидается, что программы приказной строки будут отправлять сообщения об ошибках в обычный поток ошибок, поэтому мы все равно можем видеть сообщения об ошибках на экране, даже если мы перенаправляем обычный поток вывода в файл. Наша программа в настоящее время не ведёт себя правильно: мы увидим, что она сохраняет вывод сообщения об ошибке в файл! -Чтобы продемонстрировать это поведение, мы запустим программу с помощью `>` и именем файла *output.txt* в который мы хотим перенаправить стандартный поток вывода. Мы не будем передавать никаких аргументов, что должно вызвать ошибку: +Чтобы отобразить это поведение, мы запустим программу с помощью `>` и именем файла *output.txt* в который мы хотим перенаправить обычный поток вывода. Мы не будем передавать никаких переменных, что должно вызвать ошибку: ```console $ cargo run > output.txt ``` -Синтаксис `>` указывает оболочке записывать содержимое стандартного вывода в *output.txt* вместо экрана. Мы не увидели сообщение об ошибке, которое мы ожидали увидеть на экране, так что это означает, что оно должно быть в файле. Вот что содержит *output.txt*: +Согласно правил написания `>` указывает оболочке записывать содержимое принятого вывода в *output.txt* вместо экрана. Мы не увидели сообщение об ошибке, которое мы ожидали увидеть на экране, так что это означает, что оно должно быть в файле. Вот что содержит *output.txt*: ```text Problem parsing arguments: not enough arguments ``` -Да, наше сообщение об ошибке выводится в стандартный вывод. Гораздо более полезнее, чтобы подобные сообщения об ошибках печатались в стандартной поток ошибок, поэтому в файл попадают только данные из успешного запуска. Мы поменяем это. +Да, наше сообщение об ошибке выводится в обычный вывод. Гораздо более полезнее, чтобы подобные сообщения об ошибках выводились во встроенной поток ошибок, поэтому в файл попадают только данные из успешного запуска. Мы поменяем это. -### Печать ошибок в поток ошибок +### вывод ошибок в поток ошибок -Мы будем использовать код в листинге 12-24, чтобы изменить способ вывода сообщений об ошибках. Из-за рефакторинга, который мы делали ранее в этой главе, весь код, который печатает сообщения об ошибках, находится в одной функции: `main`. Стандартная библиотека предоставляет макрос `eprintln!`который печатает в стандартный поток ошибок, поэтому давайте изменим два места, где мы вызывали `println!` для печати ошибок, чтобы использовать `eprintln!` вместо этого. +Мы будем использовать рукопись в приложении 12-24, чтобы изменить способ вывода сообщений об ошибках. Из-за переработки рукописи, которую мы делали ранее в этой главе, вся рукопись, которая выводит сообщения об ошибках, находится в одной функции: `main`. Обычная библиотека предоставляет макрос `eprintln!`который выводит в обычный поток ошибок, поэтому давайте изменим два места, где мы вызывали `println!` для выводе ошибок, чтобы использовать `eprintln!` вместо этого. Файл: src/main.rs @@ -36,22 +36,22 @@ Problem parsing arguments: not enough arguments Запись сообщений об ошибках в Standard Error вместо Standard Output используя eprintln! -Давайте снова запустим программу таким же образом, без каких-либо аргументов и перенаправим стандартный вывод с помощью `>`: +Давайте снова запустим программу таким же образом, без каких-либо переменных и перенаправим обычный вывод с помощью `>`: ```console $ cargo run > output.txt Problem parsing arguments: not enough arguments ``` -Теперь мы видим ошибку на экране и *output.txt* не содержит ничего, что мы ожидаем от программы командной строки. +Теперь мы видим ошибку на экране и *output.txt* не содержит ничего, что мы ожидаем от программы приказной строки. -Давайте снова запустим программу с аргументами, которые не вызывают ошибку, но все же перенаправляют стандартный вывод в файл, например так: +Давайте снова запустим программу с переменными, которые не вызывают ошибку, но все же перенаправляют обычный вывод в файл, например так: ```console $ cargo run -- to poem.txt > output.txt ``` -Мы не увидим никакого вывода в терминал, а *output.txt* будет содержать наши результаты: +Мы не увидим никакого вывода в окно вызова, а *output.txt* будет содержать наши итоги: Файл: output.txt @@ -60,10 +60,10 @@ Are you nobody, too? How dreary to be somebody! ``` -Это демонстрирует, что в зависимости от ситуации мы теперь используем стандартный поток вывода для успешного текста и стандартный поток ошибок для вывода ошибок. +Это отображает, что в зависимости от случая мы теперь используем обычный поток вывода для успешного писания и обычный поток ошибок для вывода ошибок. ## Итоги -В этой главе были повторены некоторые основные концепции, которые вы изучили до сих пор и было рассказано, как выполнять обычные операции ввода-вывода в Rust. Используя аргументы командной строки, файлы, переменные среды и макрос`eprintln!` для печати ошибок и вы теперь готовы писать приложения командной строки. В сочетании с концепциями из предыдущих главах, ваш код будет хорошо организован, будет эффективно хранить данные в соответствующих структурах, хорошо обрабатывать ошибки и хорошо тестироваться. +В этой главе были повторены некоторые основные подходы, которые вы изучили до сих пор и было рассказано, как выполнять обычные действия ввода-вывода в Ржавчине. Используя переменные приказной строки, файлы, переменные среды и макрос`eprintln!` для выводе ошибок и вы теперь готовы писать приложения приказной строки. В сочетании с подходами из предыдущих глав, Ваша рукопись будет хорошо согласована, будет правильно хранить данные в соответствующих стопках, хорошо обрабатывать ошибки и хорошо проверяться. -Далее мы рассмотрим некоторые возможности Rust, на которые повлияли функциональные языки: замыкания и итераторы. +Далее мы рассмотрим некоторые возможности Ржавчины, на которые повлияли полезные языки: замыкания и повторители. diff --git a/rustbook-ru/src/ch13-00-functional-features.md b/rustbook-ru/src/ch13-00-functional-features.md index 68904f1c6..fb5ee1ebf 100644 --- a/rustbook-ru/src/ch13-00-functional-features.md +++ b/rustbook-ru/src/ch13-00-functional-features.md @@ -1,14 +1,14 @@ -# Функциональные возможности языка: итераторы и замыкания +# Полезные возможности языка: повторители и замыкания -Дизайн языка Rust черпал вдохновение из многих других языков и техник, среди которых значительное влияние оказало *функциональное программирование*. Программирование в функциональном стиле подразумевает использование функций в роли объектов, передавая их в качестве аргументов, возвращая их из других функций, присваивая их переменным для последующего выполнения и так далее. +Внешний вид языка Ржавчина черпал вдохновение из многих других языков и техник, среди которых значительное влияние оказало *функциональное программирование*. Программирование в функциональном исполнении подразумевает использование функций взначении предметов, передавая их в качестве переменных, возвращая их из других функций, присваивая их переменным для последующего выполнения и так далее. -В этой главе мы не будем рассуждать о том, что из себя представляет функциональное программирование, а обсудим возможности Rust, присущие многим языкам, которые принято называть функциональными. +В этой главе мы не будем рассуждать о том, что из себя представляет функциональное программирование, а обсудим возможности Ржавчины, присущие многим языкам, которые принято называть функциональными. Более подробно мы поговорим про: -- *Замыкания* - конструкции, подобные функциям, которые можно помещать в переменные -- *Итераторы* — способ обработки последовательности элементов, -- То, как, используя замыкания и итераторы, улучшить работу с операциями ввода-вывода в проекте из главы 12 -- Производительность замыканий и итераторов (спойлер: они быстрее, чем вы думаете!) +- *Замыкания* - устройства, подобные функциям, которые можно помещать в переменные +- *Повторители* — способ обработки последовательности переменных, +- То, как, используя замыкания и повторители, улучшить работу с действиеми ввода-вывода в деле из Главы 12 +- Производительность замыканий и повторителей (К сведению: они быстрее, чем вы думаете!) -Мы уже рассмотрели другие возможности Rust, такие как сопоставление с образцом и перечисления, которые также появились под влиянием функционального стиля. Поскольку освоение замыканий и итераторов — важная часть написания идиоматичного, быстрого кода на Rust, мы посвятим им всю эту главу. +Мы уже рассмотрели другие возможности Ржавчины, такие как сопоставление с образцом и перечисления, которые также появились под влиянием функционального исполнения. Поскольку освоение замыканий и повторителей — важная часть написания идиоматичного, быстрого рукописи на Ржавчине, мы посвятим им всю эту главу. diff --git a/rustbook-ru/src/ch13-01-closures.md b/rustbook-ru/src/ch13-01-closures.md index 932970ebe..032eb31de 100644 --- a/rustbook-ru/src/ch13-01-closures.md +++ b/rustbook-ru/src/ch13-01-closures.md @@ -4,7 +4,7 @@ ## Замыкания: анонимные функции, которые запечатлевают ("захватывают") своё окружение -Замыкания в Rust - это анонимные функции, которые можно сохранять в переменных или передавать в качестве аргументов другим функциям. Вы можете создать замыкание в одном месте, а затем вызвать его в каком-нибудь другом, чтобы выполнить обработку в ином контексте. В отличие от функций, замыкания могут использовать значения из области видимости в которой они были определены. Мы продемонстрируем, как эти функции замыканий открывают возможности для повторного использования кода и изменения его поведения. +Замыкания в Ржавчине - это анонимные функции, которые можно сохранять в переменных или передавать в качестве переменных другим функциям. Вы можете создать замыкание в одном месте, а затем вызвать его в каком-нибудь другом, чтобы выполнить обработку в ином среде. В отличие от функций, замыкания могут использовать значения из области видимости в которой они были определены. Мы выполним, как эти функции замыканий открывают возможности для повторного использования рукописи и изменения его поведения. @@ -14,9 +14,9 @@ ### Захват переменных окружения с помощью замыкания -Сначала мы рассмотрим, как с помощью замыканий можно использовать объекты из области, в которой они вместе были определены, для их последующего использования. Вот сценарий: Время от времени наша компания по производству футболок в качестве акции дарит эксклюзивные футболки, выпущенные ограниченным тиражом, каким-нибудь пользователям из нашего списка рассылки. Люди из списка рассылки при желании могут выбрать любимый цвет в своём профиле. Если человек, выбранный для получения бесплатной футболки, указал свой любимый цвет, он получает футболку этого цвета. Если человек не указал свой любимый цвет, он получит рубашку того цвета, которых у компании на данный момент больше всего. +Сначала мы рассмотрим, как с помощью замыканий можно использовать предметы из области, в которой они вместе были определены, для их последующего использования. Вот задумка: Время от времени наше предприятие по производству футболок в качестве акции дарит эксклюзивные футболки, выпущенные ограниченным тиражом, каким-нибудь пользователям из нашего списка рассылки. Люди из списка рассылки при желании могут выбрать любимый цвет в своём профиле. Если человек, выбранный для получения бесплатной футболки, указал свой любимый цвет, он получает футболку этого цвета. Если человек не указал свой любимый цвет, он получит рубашку того цвета, которых у предприятия на данное мгновение больше всего. -Существует множество способов реализовать это. В данном примере мы будем использовать перечисление `ShirtColor`, которое может быть двух вариантов `Red` и `Blue` (для простоты ограничим количество доступных цветов этими двумя). Запасы компании мы представим структурой `Inventory`, которая состоит из поля `shirts`, содержащего `Vec`, в котором перечислены рубашки тех цветов, которые есть в наличии. Метод `giveaway`, определённый в `Inventory`, принимает необязательный параметр - цвет, предпочитаемый пользователем, выбранным для получения бесплатной рубашки, и возвращает тот цвет рубашки, который он получит фактически. Эта схема показана в листинге 13-1: +Существует множество способов выполнить это. В данном примере мы будем использовать перечисление `ShirtColor`, которое может быть двух исходов `Red` и `Blue` (для простоты ограничим количество доступных цветов этими двумя). Запасы предприятия мы представим стопкой `Inventory`, которая состоит из поля `shirts`, содержащего `Vec`, в котором перечислены рубашки тех цветов, которые есть в наличии. Способ `giveaway`, определённый в `Inventory`, принимает необязательный свойство - цвет, предпочитаемый пользователем, выбранным для получения бесплатной рубашки, и возвращает тот цвет рубашки, который он получит в действительности. Эта схема показана в приложении 13-1: Имя файла: src/main.rs @@ -24,29 +24,29 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-01/src/main.rs}} ``` -Листинг 13-1: Ситуация с раздачей рубашек компанией +Приложение 13-1: Случай с раздачей рубашек предприятием -В магазине `store`, определённом в `main`, осталось две синие и одна красная рубашки для этой ограниченной акции. Мы вызываем метод `giveaway` для пользователя предпочитающего красную рубашку и для пользователя без каких-либо предпочтений. +В магазине `store`, определённом в `main`, осталось две синие и одна красная рубашки для этой ограниченной акции. Мы вызываем способ `giveaway` для пользователя предпочитающего красную рубашку и для пользователя без каких-либо предпочтений. -Опять же, этот код мог быть реализован множеством способов, но в данном случае, чтобы сосредоточиться на замыканиях, мы придерживались изученных ранее концепций, за исключением тела метода `giveaway`, в котором используется замыкание. В методе `giveaway` мы получаем пользовательское предпочтение цвета как параметр типа `Option` и вызываем метод `unwrap_or_else` на `user_preference`. Метод `unwrap_or_else` перечисления `Option` определён стандартной библиотекой. Он принимает один аргумент: замыкание без аргументов, которое возвращает значение `T` (преобразуется в тип значения, которое окажется в варианте `Some` перечисления `Option`, в нашем случае `ShirtColor`). Если `Option` окажется вариантом `Some`, `unwrap_or_else` вернёт значение из `Some`. А если `Option` будет является вариантом `None`, `unwrap_or_else` вызовет замыкание и вернёт значение, возвращённое замыканием. +Опять же, эта рукопись могла быть выполнена множеством способов, но в данном случае, чтобы сосредоточиться на замыканиях, мы придерживались изученных ранее подходов, за исключением тела способа `giveaway`, в котором используется замыкание. В способе `giveaway` мы получаем пользовательское предпочтение цвета как свойство вида данных `Option` и вызываем способ `unwrap_or_else` на `user_preference`. Способ `unwrap_or_else` перечисления `Option` определён встроенной библиотекой. Он принимает одну переменную: замыкание без переменных, которое возвращает значение `T` (преобразуется в вид значения, которое окажется в исходе `Some` перечисления `Option`, в нашем случае `ShirtColor`). Если `Option` окажется исходом `Some`, `unwrap_or_else` вернёт значение из `Some`. А если `Option` будет является исходом `None`, `unwrap_or_else` вызовет замыкание и вернёт значение, возвращённое замыканием. -В качестве аргумента `unwrap_or_else` мы передаём замыкание `|| self.most_stocked()`. Это замыкание, которое не принимает никаких параметров (если бы у замыкания были параметры, они были бы перечислены между двумя вертикальными полосами). В теле замыкания вызывается `self.most_stocked()`. Здесь мы определили замыкание, а реализация `unwrap_or_else` такова, что выполнится оно позднее, когда потребуется получить результат. +В качестве переменной `unwrap_or_else` мы передаём замыкание `|| self.most_stocked()`. Это замыкание, которое не принимает никаких свойств (если бы у замыкания были свойства, они были бы перечислены между двумя вертикальными полосами). В теле замыкания вызывается `self.most_stocked()`. Здесь мы определили замыкание, а использование `unwrap_or_else` такова, что выполнится оно позднее, когда потребуется получить итог. -Выполнение этого кода выводит: +Выполнение этой рукописи выводит: ```console {{#include ../listings/ch13-functional-features/listing-13-01/output.txt}} ``` -Интересным аспектом здесь является то, что мы передали замыкание, которое вызывает `self.most_stocked()` текущего экземпляра `Inventory`. Стандартной библиотеке не нужно знать ничего о типах `Inventory` или `ShirtColor`, которые мы определили, или о логике, которую мы хотим использовать в этом сценарии. Замыкание фиксирует неизменяемую ссылку на `self` `Inventory` и передаёт её с указанным нами кодом в метод `unwrap_or_else`. А вот функции не могут фиксировать своё окружение таким образом. +Важной особенностью здесь является то, что мы передали замыкание, которое вызывает `self.most_stocked()` текущего образца данных `Inventory`. Обычной библиотеке не нужно знать ничего о видах `Inventory` или `ShirtColor`, которые мы определили, или о ходу мыслей, которую мы хотим использовать в этом задумки. Замыкание определяет неизменяемую ссылку на `self` `Inventory` и передаёт её с указанным нами рукописью в способ `unwrap_or_else`. А вот функции не могут определять своё окружение таким образом. -### Выведение и аннотация типов замыкания +### Выведение и изложение видов замыкания -Есть и другие различия между функциями и замыканиями. Замыкания обычно не требуют аннотирования типов входных параметров или возвращаемого значения, как это делается в функциях `fn`. Аннотации типов требуются для функций, потому что типы являются частью явного интерфейса, предоставляемого пользователям. Жёсткое определение таких интерфейсов важно для того, чтобы все были согласованы в том, какие типы значений использует и возвращает функция. А вот замыкания, напротив, не употребляются в роли подобных публичных интерфейсов: они хранятся в переменных, используются не имея имени и незримо для пользователей нашей библиотеки. +Есть и другие различия между функциями и замыканиями. Замыкания обычно не требуют определенния видо данныхв входных свойств или возвращаемого значения, как это делается в функциях `fn`. Изложения видов данных требуются для функций, потому что виды данных являются частью явного внешней оболочки, предоставляемого пользователям. Жёсткое определение таких внешних оболочек важно для того, чтобы все были согласованы в том, какие виды значений использует и возвращает функция. А вот замыкания, напротив, не употребляются взначении подобных открытых внешних оболочек: они хранятся в переменных, используются не имея имени и незримо для пользователей нашей библиотеки. -Замыкания, как правило, небольшие и уместны в каком-то узкоспециализированном контексте, а не в произвольных случаях. В этих ограниченных контекстах компилятор может вывести типы параметров и возвращаемого типа, подобно тому, как он может вывести типы большинства переменных (есть редкие случаи, когда компилятору также нужны аннотации типов замыканий). +Замыкания, как правило, небольшие и уместны в каком-то узконаправленном среде, а не в произвольных случаях. В этих ограниченных средах сборщик может вывести виды свойств и возвращаемого вида данных, подобно тому, как он может вывести виды данных большинства переменных (есть редкие случаи, когда сборщику также нужны изложении видов замыканий). -Как и в случае с переменными, мы можем добавить аннотации типов, если хотим повысить ясность и чёткость описания ценой увеличения многословности, большей чем это необходимо. Аннотирование типов для замыкания будет выглядеть как определение, показанное в листинге 13-2. В этом примере мы определяем замыкание и храним его в переменной, а не определяем замыкание в том месте, куда мы передаём его в качестве аргумента, как это было в листинге 13-1. +Как и в случае с переменными, мы можем добавить изложении видов данных, если хотим повысить ясность и чёткость описания ценой увеличения многословности, большей чем это необходимо. Определение видов данных для замыкания будет выглядеть как определение, показанное в приложении 13-2. В этом примере мы определяем замыкание и храним его в переменной, а не определяем замыкание в том месте, куда мы передаём его в качестве переменной, как это было в приложении 13-1. Имя файла: src/main.rs @@ -54,9 +54,9 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-02/src/main.rs:here}} ``` -Листинг 13-2: Добавление необязательных аннотаций типов параметров и возвращаемых значений в замыкании +Приложение 13-2: Добавление необязательных наставлений видов свойств и возвращаемых значений в замыкании -С добавлением аннотаций типов синтаксис замыканий выглядит более похожим на синтаксис функций. Здесь мы, для сравнения, определяем функцию, которая добавляет 1 к своему параметру, и замыкание, которое имеет такое же поведение. Мы добавили несколько пробелов, чтобы выровнять соответствующие части. Это показывает, что синтаксис замыкания похож на синтаксис функции, за исключением использования труб (вертикальная черта) и количества необязательного синтаксиса: +С добавлением наставлений видов данных правила написания замыканий выглядит более похожим на правила написания функций. Здесь мы, для сравнения, определяем функцию, которая добавляет 1 к своему свойству, и замыкание, которое имеет такое же поведение. Мы добавили несколько пробелов, чтобы выровнять соответствующие части. Это показывает, что правила написания замыкания похож на правила написания функции, за исключением использования труб (вертикальная черта) и количества необязательного правил написания: ```rust,ignore fn add_one_v1 (x: u32) -> u32 { x + 1 } @@ -65,9 +65,9 @@ let add_one_v3 = |x| { x + 1 }; let add_one_v4 = |x| x + 1 ; ``` -В первой строке показано определение функции, а во второй - полностью аннотированное определение замыкания. В третьей строке мы удаляем аннотации типов из определения замыкания. В четвёртой строке мы убираем скобки, которые являются необязательными, поскольку тело замыкания содержит только одну операцию. Это всё правильные определения, которые будут иметь одинаковое поведение при вызове. Строки `add_one_v3` и `add_one_v4` требуют, чтобы замыкания были вычислены до компиляции, поскольку типы будут выведены из их использования. Это похоже на `let v = Vec::new();`, когда в `Vec` необходимо вставить либо аннотации типов, либо значения некоторого типа, чтобы Rust смог вывести тип. +В первой строке показано определение функции, а во второй - полностью определенное определение замыкания. В третьей строке мы удаляем изложении видов данных из определения замыкания. В четвёртой строке мы убираем скобки, которые являются необязательными, поскольку тело замыкания содержит только одно действие. Это всё правильные определения, которые будут иметь одинаковое поведение при вызове. Строки `add_one_v3` и `add_one_v4` требуют, чтобы замыкания были вычислены до сборки, поскольку виды данных будут выведены из их использования. Это похоже на `let v = Vec::new();`, когда в `Vec` необходимо вставить либо изложении видов данных, либо значения некоторого вида данных, чтобы Ржавчина смогла вывести вид данных. -Для определений замыкания компилятор выводит конкретные типы для каждого из параметров и возвращаемого значения. Например, в листинге 13-3 показано определение короткого замыкания, которое просто возвращает значение, полученное в качестве параметра. Это замыкание не очень полезно, кроме как для целей данного примера. Обратите внимание, что мы не добавили в определение никаких аннотаций типов. Поскольку аннотаций типов нет, мы можем вызвать замыкание для любого типа, что мы и сделали в первый раз с `String`. Если затем мы попытаемся вызвать `example_closure` для целого числа, мы получим ошибку. +Для определений замыкания сборщик выводит определенные виды данных для каждого из свойств и возвращаемого значения. Например, в приложении 13-3 показано определение короткого замыкания, которое просто возвращает значение, полученное в качестве свойства. Это замыкание не очень полезно, кроме как для целей данного примера. Обратите внимание, что мы не добавили в определение никаких наставлений видо данных. Поскольку наставлений видов данных нет, мы можем вызвать замыкание для любого вида данных, что мы и сделали в первый раз с `String`. Если затем мы попытаемся вызвать `example_closure` для целого числа, мы получим ошибку. Имя файла: src/main.rs @@ -75,21 +75,21 @@ let add_one_v4 = |x| x + 1 ; {{#rustdoc_include ../listings/ch13-functional-features/listing-13-03/src/main.rs:here}} ``` -Листинг 13-3: Попытка вызова замыкания, типы которого выводятся из двух разных типов +Приложение 13-3: Попытка вызова замыкания, виды которого выводятся из двух разных видов данных -Компилятор вернёт нам вот такую ошибку: +Сборщик вернёт нам вот такую ошибку: ```console {{#include ../listings/ch13-functional-features/listing-13-03/output.txt}} ``` -При первом вызове `example_closure` со значением `String` компилятор определяет тип `x` и возвращаемый тип замыкания как `String`. Эти типы затем фиксируются в замыкании в `example_closure`, и мы получаем ошибку типа при следующей попытке использовать другой тип с тем же замыканием. +При первом вызове `example_closure` со значением `String` сборщик определяет вид данных `x` и возвращаемый вид данных замыкания как `String`. Эти виды данных затем определятся в замыкании в `example_closure`, и мы получаем ошибку вида данных при следующей попытке использовать другой вид данных с тем же замыканием. ### Захват ссылок или передача владения -Замыкания могут захватывать значения из своего окружения тремя способами, которые соответствуют тем же трём способам, которыми функция может принимать параметры: заимствование неизменяемых, заимствование изменяемых и получение владения. Замыкание самостоятельно определяет, какой из этих способов использовать, исходя из того, что тело функции делает с полученными значениями. +Замыкания могут захватывать значения из своего окружения тремя способами, которые соответствуют тем же трём способам, которыми функция может принимать свойства: заимствование неизменяемых, заимствование изменяемых и получение владения. Замыкание самостоятельно определяет, какой из этих способов использовать, исходя из того, что тело функции делает с полученными значениями. -В листинге 13-4 мы определяем замыкание, которое захватывает неизменяемую ссылку на вектор с именем `list`, поскольку неизменяемой ссылки достаточно для печати значения: +В приложении 13-4 мы определяем замыкание, которое захватывает неизменяемую ссылку на вектор с именем `list`, поскольку неизменяемой ссылки достаточно для выводе значения: Имя файла: src/main.rs @@ -97,17 +97,17 @@ let add_one_v4 = |x| x + 1 ; {{#rustdoc_include ../listings/ch13-functional-features/listing-13-04/src/main.rs}} ``` -Листинг 13-4: Определение и вызов замыкания, которое захватывает неизменяемую ссылку +Приложение 13-4: Определение и вызов замыкания, которое захватывает неизменяемую ссылку -Этот пример также иллюстрирует, то что переменная может быть привязана к определению замыкания, и в дальнейшем мы можем вызвать замыкание, используя имя переменной и круглые скобки, как если бы имя переменной было именем функции. +Этот пример также отображает, то что переменная может быть привязана к определению замыкания, и в дальнейшем мы можем вызвать замыкание, используя имя переменной и круглые скобки, как если бы имя переменной было именем функции. -Поскольку мы можем иметь несколько неизменяемых ссылок на `list` одновременно, `list` остаётся доступным из кода до определения замыкания, после определения замыкания, а также до вызова замыкания и после. Этот код компилируется, выполняется и печатает: +Поскольку мы можем иметь несколько неизменяемых ссылок на `list` одновременно, `list` остаётся доступным из рукописи до определения замыкания, после определения замыкания, а также до вызова замыкания и после. Эта рукопись собирается, выполняется и выводит: ```console {{#include ../listings/ch13-functional-features/listing-13-04/output.txt}} ``` -В следующем листинге 13-5 мы изменили тело замыкания так, чтобы оно добавляло элемент в вектор `list`. Теперь замыкание захватывает изменяемую ссылку: +В следующем приложении 13-5 мы изменили тело замыкания так, чтобы оно добавляло переменную в вектор `list`. Теперь замыкание захватывает изменяемую ссылку: Имя файла: src/main.rs @@ -115,19 +115,19 @@ let add_one_v4 = |x| x + 1 ; {{#rustdoc_include ../listings/ch13-functional-features/listing-13-05/src/main.rs}} ``` -Листинг 13-5. Определение и вызов замыкания, захватывающего изменяемую ссылку +Приложение 13-5. Определение и вызов замыкания, захватывающего изменяемую ссылку -Этот код компилируется, запускается и печатает: +Эта рукопись собирается, запускается и выводит: ```console {{#include ../listings/ch13-functional-features/listing-13-05/output.txt}} ``` -Обратите внимание, что между определением и вызовом замыкания `borrows_mutably` больше нет `println!`: когда определяется `borrows_mutably`, оно захватывает изменяемую ссылку на `list`. После вызова замыкания мы больше не используем его, поэтому изменяемое заимствование заканчивается. Между определением замыкания и вызовом замыкания неизменяемое заимствование для печати недоступно, потому что при наличии изменяемого заимствования никакие другие заимствования недопустимы. Попробуйте добавить туда `println!` и посмотрите, какое сообщение об ошибке вы получите! +Обратите внимание, что между определением и вызовом замыкания `borrows_mutably` больше нет `println!`: когда определяется `borrows_mutably`, оно захватывает изменяемую ссылку на `list`. После вызова замыкания мы больше не используем его, поэтому изменяемое заимствование заканчивается. Между определением замыкания и вызовом замыкания неизменяемое заимствование для выводе недоступно, потому что при наличии изменяемого заимствования никакие другие заимствования недопустимы. Попробуйте добавить туда `println!` и посмотрите, какое сообщение об ошибке вы получите! -Если вы хотите заставить замыкание принять владение значениями, которые оно использует в окружении, даже если в теле замыкания нет кода, требующего владения, вы можете использовать ключевое слово `move` перед списком параметров. +Если вы хотите заставить замыкание принять владение значениями, которые оно использует в окружении, даже если в теле замыкания нет рукописи, требующего владения, вы можете использовать ключевое слово `move` перед списком свойств. -Эта техника в основном полезна при передаче замыкания новому потоку, чтобы переместить данные так, чтобы они принадлежали новому потоку. Мы подробно обсудим потоки и то, зачем их использовать, в главе 16, когда будем говорить о параллелизме, а пока давайте вкратце рассмотрим порождение нового потока с помощью замыкания, в котором используется ключевое слово `move`. В листинге 13-6 показан код из листинга 13-4, модифицированный для печати вектора в новом потоке, а не в основном потоке: +Эта техника в основном полезна при передаче замыкания новому потоку, чтобы переместить данные так, чтобы они принадлежали новому потоку. Мы подробно обсудим потоки и то, зачем их использовать, в главе 16, когда будем говорить о одновременности, а пока давайте вкратце рассмотрим порождение нового потока с помощью замыкания, в котором используется ключевое слово `move`. В приложении 13-6 показана рукопись из приложения 13-4, измененный для выводе вектора в новом потоке, а не в основном потоке: Файл: src/main.rs @@ -135,9 +135,9 @@ let add_one_v4 = |x| x + 1 ; {{#rustdoc_include ../listings/ch13-functional-features/listing-13-06/src/main.rs}} ``` -Листинг 13-6: Использование move для принуждения замыкания потока принять на себя владение list +Приложение 13-6: Использование move для принуждения замыкания потока принять на себя владение list -Мы порождаем новый поток, передавая ему в качестве аргумента замыкание для выполнения. Тело замыкания распечатывает список. В листинге 13-4 замыкание захватило `list` только с помощью неизменяемой ссылки, потому что это минимально необходимый доступ к `list` для его печати. В этом примере, несмотря на то, что тело замыкания по-прежнему требует только неизменяемой ссылки, нам нужно указать, что `list` должен быть перемещён в замыкание, поместив ключевое слово `move` в начало определения замыкания. Новый поток может завершиться раньше, чем завершится основной поток, или основной поток может завершиться первым. Если основной поток сохранил владение `list`, но завершился раньше нового потока и удалил `list`, то неизменяемая ссылка в потоке будет недействительной. Поэтому компилятор требует, чтобы `list` был перемещён в замыкание, переданное новому потоку, чтобы ссылка была действительной. Попробуйте убрать ключевое слово `move` или использовать `list` в основном потоке после определения замыкания и посмотрите, какие ошибки компилятора вы получите! +Мы порождаем новый поток, передавая ему в качестве переменной замыкание для выполнения. Тело замыкания выводит список. В приложении 13-4 замыкание захватило `list` только с помощью неизменяемой ссылки, потому что это наименьше необходимый доступ к `list` для его выводе. В этом примере, несмотря на то, что тело замыкания по-прежнему требует только неизменяемой ссылки, нам нужно указать, что `list` должен быть перемещён в замыкание, поместив ключевое слово `move` в начало определения замыкания. Новый поток может завершиться раньше, чем завершится основной поток, или основной поток может завершиться первым. Если основной поток сохранил владение `list`, но завершился раньше нового потока и удалил `list`, то неизменяемая ссылка в потоке будет недействительной. Поэтому сборщик требует, чтобы `list` был перемещён в замыкание, переданное новому потоку, чтобы ссылка была действительной. Попробуйте убрать ключевое слово `move` или использовать `list` в основном потоке после определения замыкания и посмотрите, какие ошибки сборщика вы получите! @@ -145,17 +145,17 @@ let add_one_v4 = |x| x + 1 ; -### Перемещение захваченных значений из замыканий и трейты `Fn` +### Перемещение захваченных значений из замыканий и сущности `Fn` -После того, как замыкание захватило ссылку или владение значением из среды, в которой оно определено (тем самым влияя на то, что перемещается *в* замыкание), код в теле замыкания определяет, что происходит со ссылками или значениями, в момент последующего выполнения замыкания (тем самым влияя на то, что перемещается *из* замыкания). Тело замыкания может делать любое из следующих действий: перемещать захваченное значение из замыкания, изменять захваченное значение, не перемещать и не изменять значение или вообще ничего не захватывать из среды. +После того, как замыкание захватило ссылку или владение значением из среды, в которой оно определено (тем самым влияя на то, что перемещается *в* замыкание), рукопись в теле замыкания определяет, что происходит со ссылками или значениями, в мгновение последующего выполнения замыкания (тем самым влияя на то, что перемещается *из* замыкания). Тело замыкания может делать любое из следующих действий: перемещать захваченное значение из замыкания, изменять захваченное значение, не перемещать и не изменять значение или вообще ничего не захватывать из среды. -То, как замыкание получает и обрабатывает значения из своего окружения, указывает на то, какие трейты реализует замыкание, а с помощью трейтов функции и структуры могут определять, какие типы замыканий они могут использовать. Замыканиям автоматически присваивается реализация одного, двух или всех трёх из нижеперечисленных трейтов `Fn`, аддитивным образом, в зависимости от того, как тело замыкания обрабатывает значения: +То, как замыкание получает и обрабатывает значения из своего окружения, указывает на то, какие сущности используют замыкание, а с помощью сущностей функции и стопки могут определять, какие виды замыканий они могут использовать. Замыканиям самостоятельно присваивается выполнение одного, двух или всех трёх из нижеперечисленных сущностей `Fn`, аддитивным образом, в зависимости от того, как тело замыкания обрабатывает значения: -1. `FnOnce` применяется к замыканиям, которые могут быть вызваны один раз. Все замыкания реализуют по крайней мере этот трейт, потому что все замыкания могут быть вызваны. Замыкание, которое перемещает захваченные значения из своего тела, реализует только `FnOnce` и ни один из других признаков `Fn`, потому что оно может быть вызвано только один раз. +1. `FnOnce` применяется к замыканиям, которые могут быть вызваны один раз. Все замыкания используют по крайней мере эту сущность, потому что все замыкания могут быть вызваны. Замыкание, которое перемещает захваченные значения из своего тела, использует только `FnOnce` и ни один из других признаков `Fn`, потому что оно может быть вызвано только один раз. 2. `FnMut` применяется к замыканиям, которые не перемещают захваченные значения из своего тела, но могут изменять захваченные значения. Такие замыкания могут вызываться более одного раза. -3. `Fn` применяется к замыканиям, которые не перемещают захваченные значения из своего тела и не модифицируют захваченные значения, а также к замыканиям, которые ничего не захватывают из своего окружения. Такие замыкания могут выполняться более одного раза и не меняют ничего в своём окружении, что важно в таких случаях, как одновременный вызов замыкания несколько раз. +3. `Fn` применяется к замыканиям, которые не перемещают захваченные значения из своего тела и не изменяют захваченные значения, а также к замыканиям, которые ничего не захватывают из своего окружения. Такие замыкания могут выполняться более одного раза и не меняют ничего в своём окружении, что важно в таких случаях, как одновременный вызов замыкания несколько раз. -Давайте рассмотрим определение метода `unwrap_or_else` у `Option`, который мы использовали в листинге 13-1: +Давайте рассмотрим определение способа `unwrap_or_else` у `Option`, который мы использовали в приложении 13-1: ```rust,ignore impl Option { @@ -171,15 +171,15 @@ impl Option { } ``` -Напомним, что `T` - это универсальный тип, отображающий тип значения в `Some` варианте `Option`. Этот тип `T` также является возвращаемым типом функции `unwrap_or_else`: например, код, вызывающий `unwrap_or_else` у `Option`, получит `String`. +Напомним, что `T` - это гибкий вид данных, отображающий вид значения в `Some` исходе `Option`. Этот вид данных `T` также является возвращаемым видом функции `unwrap_or_else`: например, рукопись, вызывающая `unwrap_or_else` у `Option`, получит `String`. -Далее, обратите внимание, что функция `unwrap_or_else` имеет дополнительный параметр универсального типа `F`. Здесь `F` - это тип входного параметра `f`, который является замыканием, заданным нами при вызове `unwrap_or_else`. +Далее, обратите внимание, что функция `unwrap_or_else` имеет дополнительное свойство гибкого вида данных `F`. Здесь `F` - это вид входного свойства `f`, который является замыканием, заданным нами при вызове `unwrap_or_else`. -Ограничением трейта, заданным для обобщённого типа `F`, является `FnOnce() -> T`, что означает, что `F` должен вызываться один раз, не принимать никаких аргументов и возвращать `T`. Использование `FnOnce` в ограничении трейта говорит о том, что `unwrap_or_else` должен вызывать `f` не более одного раза. В теле `unwrap_or_else` мы видим, что если `Option` будет равен `Some`, то `f` не будет вызван. Если же значение `Option` будет равным `None`, то `f` будет вызван один раз. Поскольку все замыкания реализуют `FnOnce`, `unwrap_or_else` принимает самые разные виды замыканий и является настолько гибким, насколько это возможно. +Ограничением сущности, заданным для обобщённого вида данных `F`, является `FnOnce() -> T`, что означает, что `F` должен вызываться один раз, не принимать никаких переменных и возвращать `T`. Использование `FnOnce` в ограничении сущности говорит о том, что `unwrap_or_else` должен вызывать `f` не более одного раза. В теле `unwrap_or_else` мы видим, что если `Option` будет равен `Some`, то `f` не будет вызван. Если же значение `Option` будет равным `None`, то `f` будет вызван один раз. Поскольку все замыкания используют `FnOnce`, `unwrap_or_else` принимает самые разные виды замыканий и является настолько гибким, насколько это возможно. -> Примечание: Функции также могут реализовывать все три трейта `Fn`. Если то, что мы хотим сделать, не требует захвата значения из среды, мы можем передавать имя какой-либо функции, а не замыкания, когда нам нужно что-то, реализующее один из трейтов `Fn`. Например, для значения `Option>` мы можем вызвать `unwrap_or_else(Vec::new)`, чтобы получить новый пустой вектор, если значение окажется `None`. +> Примечание: Функции также могут использовать все три сущности `Fn`. Если то, что мы хотим сделать, не требует захвата значения из среды, мы можем передавать имя какой-либо функции, а не замыкания, когда нам нужно что-то, выполняющее одну из сущностей `Fn`. Например, для значения `Option>` мы можем вызвать `unwrap_or_else(Vec::new)`, чтобы получить новый пустой вектор, если значение окажется `None`. -Теперь рассмотрим метод стандартной библиотеки `sort_by_key`, определённый у срезов, чтобы увидеть, чем он отличается от `unwrap_or_else` и почему `sort_by_key` использует `FnMut` вместо `FnOnce` для ограничения трейта. Замыкание принимает единственный аргумент в виде ссылки на текущий элемент в рассматриваемом срезе и возвращает значение типа `K`, к которому применима сортировка. Эта функция полезна, когда вы хотите отсортировать срез по определённому атрибуту каждого элемента. В листинге 13-7 у нас есть список экземпляров `Rectangle`, и мы используем `sort_by_key`, чтобы упорядочить их по атрибуту `width` от меньшего к большему: +Теперь рассмотрим способ встроенной библиотеки `sort_by_key`, определённый у срезов, чтобы увидеть, чем он отличается от `unwrap_or_else` и почему `sort_by_key` использует `FnMut` вместо `FnOnce` для ограничения сущности. Замыкание принимает единственная переменная в виде ссылки на текущую переменную в рассматриваемом срезе и возвращает значение вида данных `K`, к которому применимо упорядочивание. Эта функция полезна, когда вы хотите упорядочить срез по определённому свойству каждой переменной. В приложении 13-7 у нас есть список образцов `Rectangle`, и мы используем `sort_by_key`, чтобы упорядочить их по свойству `width` от меньшего к большему: Файл: src/main.rs @@ -187,17 +187,17 @@ impl Option { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-07/src/main.rs}} ``` -Листинг 13-7: Использование sort_by_key для сортировки прямоугольников по ширине +Приложение 13-7: Использование sort_by_key для упорядочивания прямоугольников по ширине -Этот код печатает: +Эта рукопись выводит: ```console {{#include ../listings/ch13-functional-features/listing-13-07/output.txt}} ``` -Причина, по которой `sort_by_key` определена как принимающая замыкание `FnMut`, заключается в том, что она вызывает замыкание несколько раз: по одному разу для каждого элемента в срезе. Замыкание `|r| r.width` не захватывает, не изменяет и не перемещает ничего из своего окружения, поэтому оно удовлетворяет требованиям связанности признаков. +Причина, по которой `sort_by_key` определена как принимающая замыкание `FnMut`, заключается в том, что она вызывает замыкание несколько раз: по одному разу для каждой переменной в срезе. Замыкание `|r| r.width` не захватывает, не изменяет и не перемещает ничего из своего окружения, поэтому оно удовлетворяет требованиям связанности признаков. -И наоборот, в листинге 13-8 показан пример замыкания, которое реализует только признак `FnOnce`, потому что оно перемещает значение из среды. Компилятор не позволит нам использовать это замыкание с `sort_by_key`: +И наоборот, в приложении 13-8 показан пример замыкания, которое использует только признак `FnOnce`, потому что оно перемещает значение из среды. Сборщик не позволит нам использовать это замыкание с `sort_by_key`: Файл: src/main.rs @@ -205,15 +205,15 @@ impl Option { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-08/src/main.rs}} ``` -Листинг 13-8: Попытка использовать замыкание FnOnce с sort_by_key +Приложение 13-8: Попытка использовать замыкание FnOnce с sort_by_key -Это надуманный, замысловатый способ (который не работает) подсчёта количества вызовов `sort_by_key` при сортировке `list`. Этот код пытается выполнить подсчёт, перемещая `value` - `String` из окружения замыкания - в вектор `sort_operations`. Замыкание захватывает `value`, затем перемещает `value` из замыкания, передавая владение на `value` вектору `sort_operations`. Это замыкание можно вызвать один раз; попытка вызвать его второй раз не сработает, потому что `value` уже не будет находиться в той среде, из которой его можно будет снова поместить в `sort_operations`! Поэтому это замыкание реализует только `FnOnce`. Когда мы попытаемся скомпилировать этот код, мы получим ошибку сообщающую о том что `value` не может быть перемещено из замыкания, потому что замыкание должно реализовывать `FnMut`: +Это надуманный, замысловатый способ (который не работает) подсчёта количества вызовов `sort_by_key` при упорядочиванию `list`. Эта рукопись пытается выполнить подсчёт, перемещая `value` - `String` из окружения замыкания - в вектор `sort_operations`. Замыкание захватывает `value`, затем перемещает `value` из замыкания, передавая владение на `value` вектору `sort_operations`. Это замыкание можно вызвать один раз; попытка вызвать его второй раз не сработает, потому что `value` уже не будет находиться в той среде, из которой его можно будет снова поместить в `sort_operations`! Поэтому это замыкание использует только `FnOnce`. Когда мы попытаемся собрать эту рукопись, мы получим ошибку сообщающую о том что `value` не может быть перемещено из замыкания, потому что замыкание должно использовать `FnMut`: ```console {{#include ../listings/ch13-functional-features/listing-13-08/output.txt}} ``` -Ошибка указывает на строку в теле замыкания, которая перемещает `value` из окружения. Чтобы исправить это, нужно изменить тело замыкания так, чтобы оно не перемещало значения из окружения. Для подсчёта количества вызовов `sort_by_key` более простым способом является хранение счётчика в окружении и увеличение его значения в теле замыкания. Замыкание в листинге 13-9 работает с `sort_by_key`, поскольку оно фиксирует только изменяемую ссылку на счётчик `num_sort_operations` и поэтому может быть вызвано более одного раза: +Ошибка указывает на строку в теле замыкания, которая перемещает `value` из окружения. Чтобы исправить это, нужно изменить тело замыкания так, чтобы оно не перемещало значения из окружения. Для подсчёта количества вызовов `sort_by_key` более простым способом является хранение счётчика в окружении и увеличение его значения в теле замыкания. Замыкание в приложении 13-9 работает с `sort_by_key`, поскольку оно определяет только изменяемую ссылку на счётчик `num_sort_operations` и поэтому может быть вызвано более одного раза: Файл: src/main.rs @@ -221,8 +221,8 @@ impl Option { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-09/src/main.rs}} ``` -Листинг 13-9: Использование замыкания FnMut с sort_by_key разрешено +Приложение 13-9: Использование замыкания FnMut с sort_by_key разрешено -Трейты `Fn` важны при определении или использовании функций или типов, использующих замыкания. В следующем разделе мы обсудим итераторы. Многие методы итераторов принимают аргументы в виде замыканий, поэтому не забывайте об этих деталях, пока мы продвигаемся дальше! +Сущности `Fn` важны при определении или использовании функций или видов данных, использующих замыкания. В следующем разделе мы обсудим повторители. Многие способы повторителей принимают переменные в виде замыканий, поэтому не забывайте об этих подробностях, пока мы продвигаемся дальше! diff --git a/rustbook-ru/src/ch13-02-iterators.md b/rustbook-ru/src/ch13-02-iterators.md index 8cba6b317..b6f5d48ef 100755 --- a/rustbook-ru/src/ch13-02-iterators.md +++ b/rustbook-ru/src/ch13-02-iterators.md @@ -1,32 +1,32 @@ -## Обработка последовательности элементов с помощью итераторов +## Обработка последовательности переменных с помощью повторителей -Использование паттерна Итератор помогает при необходимости поочерёдного выполнения какой-либо операции над элементами последовательности. Итератор отвечает за логику перебора элементов и определение момента завершения последовательности. Используя итераторы, вам не нужно самостоятельно реализовывать всю эту логику. +Использование образца Повторитель помогает при необходимости поочерёдного выполнения какой-либо действия над переменными в последовательности. Повторитель отвечает за ход перебора переменных и определение времени завершения последовательности. Используя повторители, вам не нужно самостоятельно выполнить весь этот ход мыслей. -В Rust итераторы *ленивые (lazy)*, то есть они не делают ничего, пока вы не вызовете специальные методы, потребляющие итератор, чтобы задействовать его. Например, код в листинге 13-10 создаёт итератор элементов вектора `v1`, вызывая метод `iter`, определённый у `Vec`. Сам по себе этот код не делает ничего полезного. +В Ржавчине повторители *ленивые (lazy)*, то есть они не делают ничего, пока вы не вызовете особые способы, потребляющие повторитель , чтобы задействовать его. Например, рукопись в приложении 13-10 создаёт повторитель переменных вектора `v1`, вызывая способ `iter`, определённый у `Vec`. Сама по себе эта рукопись не делает ничего полезного. ```rust {{#rustdoc_include ../listings/ch13-functional-features/listing-13-10/src/main.rs:here}} ``` -Листинг 13-10: Создание итератора +Приложение 13-10: Создание повторителя -Итератор хранится в переменной `v1_iter`. Создав итератор, мы можем использовать его различными способами. В листинге 3-5 главы 3 мы совершали обход элементов массива используя цикл `for` для выполнения какого-то кода над каждым из его элементов. Под капотом это неявно создавало, а затем потребляло итератор, но до сих пор мы не касались того, как именно это работает. +Повторитель хранится в переменной `v1_iter`. Создав повторитель , мы можем использовать его различными способами. В приложении 3-5 Главы 3 мы совершали обход переменных массива используя круговорот `for` для выполнения какого-то рукописи над каждым из его переменных. Под капотом это неявно создавало, а затем потребляло повторитель , но до сих пор мы не касались того, как именно это работает. -В примере из листинга 13-11 мы отделили создание итератора от его использования в цикле for. В цикле for, использующем итератор в v1_iter, каждый элемент итератора участвует только в одной итерации цикла, в ходе которой выводится на экран его значение. +В примере из приложения 13-11 мы отделили создание повторителя от его использования в круговороте for. В круговороте for, использующем повторитель в v1_iter, каждая переменная повторителя участвует только в одной повторения круговорота, в ходе которой выводится на экран его значение. ```rust {{#rustdoc_include ../listings/ch13-functional-features/listing-13-11/src/main.rs:here}} ``` -Листинг 13-11: Использование итератора в цикле for +Приложение 13-11: Использование повторителя в круговороте for -В языках, стандартные библиотеки которых не предоставляют итераторы, вы, скорее всего, напишите эту же функциональность так: создадите переменную со значением 0 затем, в цикле, использовав её для получения элемента вектора по индексу, будете увеличивать её значение, и так, пока оно не достигнет числа равного количеству элементов в векторе. +В языках, обычные библиотеки которых не предоставляют повторители, вы, скорее всего, напишите эту же возможность так: создадите переменную со значением 0 затем, в круговороте, использовав её для получения переменной вектора по порядковому указателю, будете увеличивать её значение, и так, пока оно не достигнет числа равного количеству переменных в векторе. -Итераторы выполняют всю эту логику за вас, сокращая количество повторяющегося кода, который потенциально может быть написан неправильно. Итераторы дают вам гибкость, позволяя использовать одинаковые принципы работы с различными видами последовательностей, а не только со структурами данных, которые можно индексировать, например, векторами. Давайте рассмотрим, как итераторы это делают. +Повторители выполняют весь этот ход мыслей за вас, сокращая количество повторяющейся рукописи, которая возможно может была написана неправильно. Повторители дают вам гибкость, позволяя использовать одинаковые принципы работы с различными видами последовательностей, а не только с видами данных, которые можно упорядочивать, например, векторами. Давайте рассмотрим, как повторители это делают. -### Типаж `Iterator` и метод `next` +### Сущность `Iterator` и способ `next` -Все итераторы реализуют типаж `Iterator`, который определён в стандартной библиотеке. Его определение выглядит так: +Все повторители используют сущность `Iterator`, который определён во встроенной библиотеке. Его определение выглядит так: ```rust pub trait Iterator { @@ -38,11 +38,11 @@ pub trait Iterator { } ``` -Обратите внимание данное объявление использует новый синтаксис: `type Item` и `Self::Item`, которые определяют *ассоциированный тип* (associated type) с этим типажом. Мы подробнее поговорим о ассоциированных типах в главе 19. Сейчас вам нужно знать, что этот код требует от реализаций типажа `Iterator` определить требуемый им тип `Item` и данный тип `Item` используется в методе `next`. Другими словами, тип `Item` будет являться типом элемента, который возвращает итератор. +Обратите внимание данное объявление использует новые правила написания: `type Item` и `Self::Item`, которые определяют *сопряженный вид данных* (associated type) с этим сущностью. Мы подробнее поговорим о сопряженных видах данных в главе 19. Сейчас вам нужно знать, что эта рукопись требует от выполнений сущности `Iterator` определить требуемый им вид данных `Item` и данный вид данных `Item` используется в способе `next`. Другими словами, вид данных `Item` будет являться видом переменной, который возвращает повторитель . -Типаж `Iterator` требует, чтобы разработчики определяли только один метод: метод `next`, который возвращает один элемент итератора за раз обёрнутый в вариант `Some` и когда итерация завершена, возвращает `None`. +Сущность `Iterator` требует, чтобы разработчики определяли только один способ: способ `next`, который возвращает одну переменную повторителя за раз обёрнутый в исход `Some` и когда повторение завершено, возвращает `None`. -Мы можем вызывать метод `next` у итераторов напрямую; в листинге 13-12 показано, какие значения возвращаются при повторных вызовах `next` у итератора, созданного из вектора. +Мы можем вызывать способ `next` у повторителей напрямую; в приложении 13-12 показано, какие значения возвращаются при повторных вызовах `next` у повторителя, созданного из вектора. Файл: src/lib.rs @@ -50,17 +50,17 @@ pub trait Iterator { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-12/src/lib.rs:here}} ``` -Листинг 13-12: Вызов метода next итератора +Приложение 13-12: Вызов способа next повторителя -Обратите внимание, что нам нужно сделать переменную `v1_iter` изменяемой: вызов метода `next` итератора изменяет внутреннее состояние итератора, которое итератор использует для отслеживания того, где он находится в последовательности. Другими словами, этот код *потребляет* (consume) или использует итератор. Каждый вызов `next` потребляет элемент из итератора. Нам не нужно было делать изменяемой `v1_iter` при использовании цикла `for`, потому что цикл забрал во владение `v1_iter` и сделал её изменяемой неявно для нас. +Обратите внимание, что нам нужно сделать переменную `v1_iter` изменяемой: вызов способа `next` повторителя изменяет внутреннее состояние повторителя, которое повторитель использует для отслеживания того, где он находится в последовательности. Другими словами, эта рукопись *потребляет* (consume) или использует повторитель . Каждый вызов `next` потребляет переменную из повторителя. Нам не нужно было делать изменяемой `v1_iter` при использовании круговорота `for`, потому что круговорот забрал во владение `v1_iter` и сделал её изменяемой неявно для нас. -Заметьте также, что значения, которые мы получаем при вызовах `next` являются неизменяемыми ссылками на значения в векторе. Метод `iter` создаёт итератор по неизменяемым ссылкам. Если мы хотим создать итератор, который становится владельцем `v1` и возвращает принадлежащие ему значения, мы можем вызвать `into_iter` вместо `iter`. Точно так же, если мы хотим перебирать изменяемые ссылки, мы можем вызвать `iter_mut` вместо `iter`. +Заметьте также, что значения, которые мы получаем при вызовах `next` являются неизменяемыми ссылками на значения в векторе. Способ `iter` создаёт повторитель по неизменяемым ссылкам. Если мы хотим создать повторитель , который становится владельцем `v1` и возвращает принадлежащие ему значения, мы можем вызвать `into_iter` вместо `iter`. Точно так же, если мы хотим перебирать изменяемые ссылки, мы можем вызвать `iter_mut` вместо `iter`. -### Методы, которые потребляют итератор +### Способы, которые потребляют повторитель -У типажа `Iterator` есть несколько методов, реализация которых по умолчанию предоставляется стандартной библиотекой; вы можете узнать об этих методах, просмотрев документацию API стандартной библиотеки для `Iterator`. Некоторые из этих методов вызывают `next` в своём определении, поэтому вам необходимо реализовать метод `next` при реализации типажа `Iterator`. +У сущности `Iterator` есть несколько способов, выполнение которых по умолчанию предоставляется встроенной библиотекой; вы можете узнать об этих способах, просмотрев пособие API встроенной библиотеки для `Iterator`. Некоторые из этих способов вызывают `next` в своём определении, поэтому вам необходимо использовать способ `next` при выполнения сущности `Iterator`. -Методы, вызывающие `next`, называются *потребляющими адаптерами*, поскольку их вызов потребляет итератор. Примером может служить метод `sum`, который забирает во владение итератор и перебирает элементы, многократно вызывая `next`, тем самым потребляя итератор. В процессе итерации он добавляет каждый элемент к текущей сумме и возвращает итоговое значение по завершении итерации. В листинге 13-13 приведён тест, иллюстрирующий использование метода `sum`: +Способы, вызывающие `next`, называются *потребляющими переходниками*, поскольку их вызов потребляет повторитель . Примером может служить способ `sum`, который забирает во владение повторитель и перебирает переменные, многократно вызывая `next`, тем самым потребляя повторитель . В этапе повторения он добавляет каждая переменная к текущей итогу сложения и возвращает итоговое значение по завершении повторения. В приложении 13-13 приведён проверка, отображающий использование способа `sum`: Файл: src/lib.rs @@ -68,15 +68,15 @@ pub trait Iterator { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-13/src/lib.rs:here}} ``` -Листинг 13-13: Вызов метода sum для получения суммы всех элементов в итераторе +Приложение 13-13: Вызов способа sum для получения итога сложения всех переменных в повторителе -Мы не можем использовать `v1_iter` после вызова метода `sum`, потому что `sum` забирает во владение итератор у которого вызван метод. +Мы не можем использовать `v1_iter` после вызова способа `sum`, потому что `sum` забирает во владение повторитель у которого вызван способ. -### Методы, которые создают другие итераторы +### Способы, которые создают другие повторители -*Адаптеры итераторов* - это методы, определённые для трейта `Iterator`, которые не потребляют итератор. Вместо этого они создают различные итераторы, изменяя некоторые аспекты исходного итератора. +*Переходники повторителей* - это способы, определённые для сущности `Iterator`, которые не потребляют повторитель . Вместо этого они создают различные повторители, изменяя некоторые особенности исходного повторителя. -В листинге 13-14 показан пример вызова метода адаптера итератора `map`, который принимает замыкание и вызывает его для каждого элемента по мере итерации элементов. Метод `map` возвращает новый итератор, который создаёт изменённые элементы. Замыкание здесь создаёт новый итератор, в котором каждый элемент из вектора будет увеличен на 1: +В приложении 13-14 показан пример вызова способа переходника повторителя `map`, который принимает замыкание и вызывает его для каждой переменной по мере повторения переменных. Способ `map` возвращает новый повторитель , который создаёт изменённые переменные. Замыкание здесь создаёт новый повторитель , в котором каждая переменная из вектора будет увеличен на 1: Файл: src/main.rs @@ -84,19 +84,19 @@ pub trait Iterator { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-14/src/main.rs:here}} ``` -Листинг 13-14: Вызов адаптера итератора map для создания нового итератора +Приложение 13-14: Вызов переходника повторителя map для создания нового повторителя -Однако этот код выдаёт предупреждение: +Однако эта рукопись выдаёт предупреждение: ```console {{#include ../listings/ch13-functional-features/listing-13-14/output.txt}} ``` -Код в листинге 13-14 ничего не делает; указанное нами замыкание никогда не вызывается. Предупреждение напоминает нам, почему: адаптеры итераторов ленивы, и здесь нам нужно потребить итератор. +Рукопись в приложении 13-14 ничего не делает; указанное нами замыкание никогда не вызывается. Предупреждение напоминает нам, почему: переходники повторителей ленивы, и здесь нам нужно потребить повторитель . -Чтобы устранить это предупреждение и потребить итератор, мы воспользуемся методом `collect`, который мы использовали в главе 12 с `env::args` в листинге 12-1. Этот метод потребляет итератор и собирает полученные значения в коллекцию указанного типа. +Чтобы устранить это предупреждение и потребить повторитель , мы воспользуемся способом `collect`, который мы использовали в главе 12 с `env::args` в приложении 12-1. Этот способ потребляет повторитель и собирает полученные значения в собрание указанного вида данных. -В листинге 13-15 мы собираем в вектор результаты перебора итератора, который возвращается в результате вызова `map`. Этот вектор в итоге будет содержать каждый элемент исходного вектора, увеличенный на 1. +В приложении 13-15 мы собираем в вектор итоги перебора повторителя, который возвращается в итоге вызова `map`. Этот вектор в итоге будет содержать каждая переменная исходного вектора, увеличенный на 1. Файл: src/main.rs @@ -104,19 +104,19 @@ pub trait Iterator { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-15/src/main.rs:here}} ``` -Листинг 13-15: Вызов метода map для создания нового итератора, а затем вызов метода collect для потребления нового итератора и создания вектора +Приложение 13-15: Вызов способа map для создания нового повторителя, а затем вызов способа collect для потребления нового повторителя и создания вектора -Поскольку `map` принимает замыкание, мы можем указать любую операцию, которую хотим выполнить над каждым элементом. Это отличный пример того, как замыкания позволяют задавать желаемое поведение, используя при этом особенности итерации, которые обеспечивает трейт `Iterator`. +Поскольку `map` принимает замыкание, мы можем указать любое действие, которое хотим выполнить над каждой переменной. Это отличный пример того, как замыкания позволяют задавать желаемое поведение, используя при этом особенности повторения, которые предоставляет сущность `Iterator`. -Вы можете выстроить цепочку из нескольких вызовов адаптеров итератора для выполнения сложных действий в удобочитаемом виде. Но поскольку все итераторы являются "ленивыми", для получения результатов вызовов адаптеров итератора необходимо вызвать один из методов потребляющего адаптера. +Вы можете выстроить цепочку из нескольких вызовов переходников повторителя для выполнения сложных действий удобном для прочтения виде. Но поскольку все повторители являются "ленивыми", для получения итогов вызовов переходников повторителя необходимо вызвать один из способов потребляющего переходника. ### Использование замыканий, которые захватывают переменные окружения -Многие адаптеры итераторов принимают замыкания в качестве аргументов, и обычно замыкания, которые мы будем указывать в качестве аргументов адаптерам итераторов, это замыкания, которые фиксируют (захватывают) своё окружение. +Многие переходники повторителей принимают замыкания в качестве переменных, и обычно замыкания, которые мы будем указывать в качестве переменных переходникам повторителей, это замыкания, которые определяют (захватывают) своё окружение. -В этом примере мы будем использовать метод `filter`, который принимает замыкание. Замыкание получает элемент из итератора и возвращает `bool`. Если замыкание возвращает `true`, значение будет включено в итерацию, создаваемую `filter`. Если замыкание возвращает `false`, значение не будет включено. +В этом примере мы будем использовать способ `filter`, который принимает замыкание. Замыкание получает переменную из повторителя и возвращает `bool`. Если замыкание возвращает `true`, значение будет включено в повторение, создаваемую `filter`. Если замыкание возвращает `false`, значение не будет включено. -В листинге 13-16 мы используем `filter` с замыканием, которое захватывает переменную `shoe_size` из своего окружения для итерации по коллекции экземпляров структуры `Shoe`. Он будет возвращать обувь только указанного размера. +В приложении 13-16 мы используем `filter` с замыканием, которое захватывает переменную `shoe_size` из своего окружения для повторения по собрания образцов стопки `Shoe`. Он будет возвращать обувь только указанного размера. Файл: src/lib.rs @@ -124,12 +124,12 @@ pub trait Iterator { {{#rustdoc_include ../listings/ch13-functional-features/listing-13-16/src/lib.rs}} ``` -Листинг 13-16. Использование метода filter с замыканием, фиксирующим shoe_size +Приложение 13-16: Использование способа filter с замыканием, определяющим shoe_size -Функция `shoes_in_size` принимает в качестве параметров вектор с экземплярами обуви и размер обуви, а возвращает вектор, содержащий только обувь указанного размера. +Функция `shoes_in_size` принимает в качестве свойств вектор с образцами обуви и размер обуви, а возвращает вектор, содержащий только обувь указанного размера. -В теле `shoes_in_my_size` мы вызываем `into_iter` чтобы создать итератор, который становится владельцем вектора. Затем мы вызываем `filter`, чтобы превратить этот итератор в другой, который содержит только элементы, для которых замыкание возвращает `true`. +В теле `shoes_in_my_size` мы вызываем `into_iter` чтобы создать повторитель , который становится владельцем вектора. Затем мы вызываем `filter`, чтобы превратить этот повторитель в другой, который содержит только переменные, для которых замыкание возвращает `true`. -Замыкание захватывает параметр `shoe_size` из окружения и сравнивает его с размером каждой пары обуви, оставляя только обувь указанного размера. Наконец, вызов `collect` собирает значения, возвращаемые адаптированным итератором, в вектор, возвращаемый функцией. +Замыкание захватывает свойство `shoe_size` из окружения и сравнивает его с размером каждой пары обуви, оставляя только обувь указанного размера. Наконец, вызов `collect` собирает значения, возвращаемые приспособленным повторителем, в вектор, возвращаемый функцией. -Тест показывает, что когда мы вызываем `shoes_in_my_size`, мы возвращаем только туфли, размер которых совпадает с указанным нами значением. +Проверка показывает, что когда мы вызываем `shoes_in_my_size`, мы возвращаем только туфли, размер которых совпадает с указанным нами значением. diff --git a/rustbook-ru/src/ch13-03-improving-our-io-project.md b/rustbook-ru/src/ch13-03-improving-our-io-project.md index 459ea2fbd..4d819f3f7 100644 --- a/rustbook-ru/src/ch13-03-improving-our-io-project.md +++ b/rustbook-ru/src/ch13-03-improving-our-io-project.md @@ -1,10 +1,10 @@ -## Улучшение нашего проекта с вводом/выводом +## Улучшение нашего дела с вводом/выводом -Вооружившись полученными знаниями об итераторах, мы можем улучшить реализацию работы с вводом/выводом в проекте главы 12, применяя итераторы для того, чтобы сделать некоторые места в коде более понятными и лаконичными. Давайте рассмотрим, как итераторы могут улучшить нашу реализацию функции `Config::build` и функции `search`. +Вооружившись полученными знаниями об повторителях, мы можем улучшить выполнение работы с вводом/выводом в деле Главы 12, применяя повторители для того, чтобы сделать некоторые места в рукописи более понятными и краткими. Давайте рассмотрим, как повторители могут улучшить нашу выполнение функции `Config::build` и функции `search`. -### Удаляем `clone`, используем итератор +### Удаляем `clone`, используем повторитель -В листинге 12-6 мы добавили код, который принимает срез значений `String` и создаёт экземпляр структуры `Config` путём индексации среза и клонирования значений, позволяя структуре `Config` владеть этими значениями. В листинге 13-17 мы воспроизвели реализацию функции `Config::build`, как это было в листинге 12-23: +В приложении 12-6 мы добавили рукопись, которая принимает срез значений `String` и создаёт образец данных стопки `Config` путём упорядочивания среза и удваивания значений, позволяя стопке `Config` владеть этими значениями. В приложении 13-17 мы воспроизвели выполнение функции `Config::build`, как это было в приложении 12-23: Файл: src/lib.rs @@ -12,19 +12,19 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-12-23-reproduced/src/lib.rs:ch13}} ``` -Листинг 13-17: Репродукция функции Config::build из листинга 12-23 +Приложение 13-17: Репродукция функции Config::build из приложения 12-23 -Ранее мы говорили, что не стоит беспокоиться о неэффективных вызовах `clone`, потому что мы удалим их в будущем. Ну что же, время пришло! +Ранее мы говорили, что не стоит беспокоиться о бесполезных вызовах `clone`, потому что мы удалим их в будущем. Ну что же, время пришло! -Нам понадобился здесь `clone`, потому что в параметре `args` у нас срез с элементами `String`, но функция `build` не владеет `args`. Чтобы экземпляр `Config` владел значениями, нам пришлось клонировать их из `args` в переменные `query` и `file_path`. +Нам понадобился здесь `clone`, потому что в свойстве `args` у нас срез с переменными `String`, но функция `build` не владеет `args`. Чтобы образец данных `Config` владел значениями, нам пришлось удваивать их из `args` в переменные `query` и `file_path`. -Благодаря нашим новым знаниям об итераторах мы можем изменить функцию `build`, чтобы вместо заимствования среза она принимала в качестве аргумента итератор. Мы будем использовать функциональность итератора вместо кода, который проверяет длину среза и обращается по индексу к определённым значениям. Это позволит лучше понять, что делает функция `Config::build`, поскольку итератор будет обращаться к значениям. +Благодаря нашим новым знаниям об повторителях мы можем изменить функцию `build`, чтобы вместо заимствования среза она принимала в качестве переменной повторитель . Мы будем использовать возможность повторителя вместо рукописи, которая проверяет длину среза и обращается по порядковому указателю к определённым значениям. Это позволит лучше понять, что делает функция `Config::build`, поскольку повторитель будет обращаться к значениям. -Как только `Config::build` получит в своё распоряжение итератор и перестанет использовать операции индексирования с заимствованием, мы сможем переместить значения `String` из итератора в `Config` вместо того, чтобы вызывать `clone` и создавать новое выделение памяти. +Как только `Config::build` получит в своё распоряжение повторитель и перестанет использовать действия упорядочивания с заимствованием, мы сможем переместить значения `String` из повторителя в `Config` вместо того, чтобы вызывать `clone` и создавать новое выделение памяти. -#### Использование возвращённого итератора напрямую +#### Использование возвращённого повторителя напрямую -Откройте файл *src/main.rs* проекта ввода-вывода, который должен выглядеть следующим образом: +Откройте файл *src/main.rs* дела ввода-вывода, который должен выглядеть следующим образом: Файл: src/main.rs @@ -32,7 +32,7 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-12-24-reproduced/src/main.rs:ch13}} ``` -Сначала мы изменим начало функции `main`, которая была в листинге 12-24, на код в листинге 13-18, который теперь использует итератор. Это не будет компилироваться, пока мы не обновим `Config::build`. +Сначала мы изменим начало функции `main`, которая была в приложении 12-24, на рукопись в приложении 13-18, который теперь использует повторитель . Это не будет собираться, пока мы не обновим `Config::build`. Файл: src/main.rs @@ -40,11 +40,11 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-18/src/main.rs:here}} ``` -Листинг 13-18: Передача возвращаемого значения из env::args в Config::build +Приложение 13-18: Передача возвращаемого значения из env::args в Config::build -Функция `env::args` возвращает итератор! Вместо того чтобы собирать значения итератора в вектор и затем передавать срез в `Config::build`, теперь мы передаём владение итератором, возвращённым из `env::args` в `Config::build` напрямую. +Функция `env::args` возвращает повторитель ! Вместо того чтобы собирать значения повторителя в вектор и затем передавать срез в `Config::build`, теперь мы передаём владение повторителем, возвращённым из `env::args` в `Config::build` напрямую. -Далее нам нужно обновить определение `Config::build`. В файле *src/lib.rs* вашего проекта ввода-вывода изменим сигнатуру `Config::build` так, чтобы она выглядела как в листинге 13-19. Это все ещё не скомпилируется, потому что нам нужно обновить тело функции. +Далее нам нужно обновить определение `Config::build`. В файле *src/lib.rs* вашего дела ввода-вывода изменим ярлык `Config::build` так, чтобы она выглядела как в приложении 13-19. Это все ещё не собирается, потому что нам нужно обновить тело функции. Файл: src/lib.rs @@ -52,17 +52,17 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-19/src/lib.rs:here}} ``` -Листинг 13-19: Обновление сигнатуры Config::build для определения итератора как ожидаемого параметра +Приложение 13-19: Обновление ярлыки Config::build для определения повторителя как ожидаемого свойства -Документация стандартной библиотеки для функции `env::args` показывает, что тип возвращаемого ею итератора - `std::env::Args`, и этот тип реализует признак `Iterator` и возвращает значения `String`. +Пособие встроенной библиотеки для функции `env::args` показывает, что вид данных возвращаемого ею повторителя - `std::env::Args`, и этот вид данных использует признак `Iterator` и возвращает значения `String`. -Мы обновили сигнатуру функции `Config::build`, чтобы параметр `args` имел универсальный тип ограниченный трейтом `impl Iterator` вместо `&[String]`. Такое использование синтаксиса `impl Trait`, который мы обсуждали в разделе [" Трейты как параметры"] главы 10, означает, что `args` может быть любым типом, реализующим тип `Iterator` и возвращающим элементы `String`. +Мы обновили ярлык функции `Config::build`, чтобы свойство `args` имел гибкий вид данных ограниченный сущностью `impl Iterator` вместо `&[String]`. Такое использование правил написания `impl Trait`, который мы обсуждали в разделе [" Сущности как свойства"] Главы 10, означает, что `args` может быть любым видом данных, выполняющим вид данных `Iterator` и возвращающим переменные `String`. -Поскольку мы владеем `args` и будем изменять `args` в процессе итерации над ним, мы можем добавить ключевое слово `mut` в спецификацию параметра `args`, чтобы сделать его изменяемым. +Поскольку мы владеем `args` и будем изменять `args` в этапе повторения над ним, мы можем добавить ключевое слово `mut` в свод требований свойства `args`, чтобы сделать его изменяемым. -#### Использование методов типажа `Iterator` вместо индексов +#### Использование способов сущности `Iterator` вместо порядковых указателей -Далее мы подправим содержимое `Config::build`. Поскольку `args` реализует признак `Iterator`, мы знаем, что можем вызвать у него метод `next`! В листинге 13-20 код из листинга 12-23 обновлён для использования метода `next`: +Далее мы подправим содержимое `Config::build`. Поскольку `args` использует признак `Iterator`, мы знаем, что можем вызвать у него способ `next`! В приложении 13-20 рукопись из приложения 12-23 обновлён для использования способа `next`: Файл: src/lib.rs @@ -70,13 +70,13 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-20/src/lib.rs:here}} ``` -Листинг 13-20: Изменяем тело Config::build так, чтобы использовать методы итератора +Приложение 13-20: Изменяем тело Config::build так, чтобы использовать способы повторителя -Помните, что первое значение в возвращаемых данных `env::args` - это имя программы. Мы хотим проигнорировать его и перейти к следующему значению, поэтому сперва мы вызываем `next` и ничего не делаем с возвращаемым значением. Затем мы вызываем `next`, чтобы получить значение, которое мы хотим поместить в поле `query` в `Config`. Если `next` возвращает `Some`, мы используем `match` для извлечения значения. Если возвращается `None`, это означает, что было задано недостаточно аргументов, и мы досрочно возвращаем значение `Err`. То же самое мы делаем для значения `file_path`. +Помните, что первое значение в возвращаемых данных `env::args` - это имя программы. Мы хотим пренебрегать его и перейти к следующему значению, поэтому сперва мы вызываем `next` и ничего не делаем с возвращаемым значением. Затем мы вызываем `next`, чтобы получить значение, которое мы хотим поместить в поле `query` в `Config`. Если `next` возвращает `Some`, мы используем `match` для извлечения значения. Если возвращается `None`, это означает, что было задано недостаточно переменных, и мы досрочно возвращаем значение `Err`. То же самое мы делаем для значения `file_path`. -### Делаем код понятнее с помощью адаптеров итераторов +### Делаем рукопись понятнее с помощью переходников повторителей -Мы также можем воспользоваться преимуществами итераторов в функции `search` в нашем проекте с операциями ввода-вывода, которая воспроизведена здесь в листинге 13-21 так же, как и в листинге 12-19: +Мы также можем воспользоваться преимуществами повторителей в функции `search` в нашем деле с действиеми ввода-вывода, которая воспроизведена здесь в приложении 13-21 так же, как и в приложении 12-19: Файл: src/lib.rs @@ -84,9 +84,9 @@ {{#rustdoc_include ../listings/ch12-an-io-project/listing-12-19/src/lib.rs:ch13}} ``` -Листинг 13-21: Реализация функции search из листинга 12-19 +Приложение 13-21: Выполнение функции search из приложения 12-19 -Мы можем написать этот код в более сжатом виде, используя методы адаптера итератора. Это также позволит нам избежать наличия изменяемого временного вектора `results`. Функциональный стиль программирования предпочитает минимизировать количество изменяемого состояния, чтобы сделать код более понятным. Удаление изменяемого состояния может позволить в будущем сделать поиск параллельным, поскольку нам не придётся управлять одновременным доступом к вектору `results`. В листинге 13-22 показано это изменение: +Мы можем написать эту рукопись в более сжатом виде, используя способы переходника повторителя. Это также позволит нам избежать наличия изменяемого временного вектора `results`. Функциональное исполнение программирования предпосчитывает уменьшить количество изменяемого состояния, чтобы сделать рукопись более понятной. Удаление изменяемого состояния может позволить в будущем сделать поиск одновременным, поскольку нам не придётся управлять одновременным доступом к вектору `results`. В приложении 13-22 показано это изменение: Файл: src/lib.rs @@ -94,15 +94,15 @@ {{#rustdoc_include ../listings/ch13-functional-features/listing-13-22/src/lib.rs:here}} ``` -Листинг 13-22: Использование методов адаптера итератора в реализации функции search +Приложение 13-22: Использование способов переходника повторителя в выполнении функции search -Напомним, что назначение функции `search` - вернуть все строки в `contents`, которые содержат `query`. Подобно примеру `filter` в листинге 13-16, этот код использует адаптер `filter`, чтобы сохранить только те строки, для которых `line.contains(query)` возвращает `true`. Затем мы собираем совпадающие строки в другой вектор с помощью `collect`. Так гораздо проще! Не стесняйтесь сделать такое же изменение для использования методов итератора в функции `search_case_insensitive`. +Напомним, что назначение функции `search` - вернуть все строки в `contents`, которые содержат `query`. Подобно примеру `filter` в приложении 13-16, эта рукопись использует переходник `filter`, чтобы сохранить только те строки, для которых `line.contains(query)` возвращает `true`. Затем мы собираем совпадающие строки в другой вектор с помощью `collect`. Так гораздо проще! Не стесняйтесь сделать такое же изменение для использования способов повторителя в функции `search_case_insensitive`. -### Выбор между циклами или итераторами +### Выбор между круговоротами или повторителями -Следующий логичный вопрос - какой стиль вы должны выбрать в своём коде и почему: оригинальную реализацию в листинге 13-21 или версию с использованием итераторов в листинге 13-22. Большинство программистов на языке Rust предпочитают использовать стиль итераторов. Сначала разобраться с ним немного сложно, но как только вы почувствуете, что такое различные адаптеры итераторов и что они делают, понять итераторы станет проще. Вместо того чтобы возиться с различными элементами цикла и создавать новые векторы, код фокусируется на высокоуровневой цели цикла. Это абстрагирует часть обычного кода, поэтому легче увидеть концепции, уникальные для этого кода, такие как условие фильтрации, которое должен пройти каждый элемент в итераторе. +Следующий здоровый вопрос - какое исполнение вы должны выбрать в своей рукописи и почему: подлинное исполнение в приложении 13-21 или исполнение с использованием повторителей в приложении 13-22. Большинство программистов на языке Ржавчина предпочитают использовать исполнение повторителей. Сначала разобраться с ним немного сложно, но как только вы почувствуете, что такое различные переходники повторителей и что они делают, понять повторители станет проще. Вместо того чтобы возиться с различными переменными круговорота и создавать новые векторы, рукопись сосредотачивается на высокоуровневой цели круговорота. Это абстрагирует часть обычного рукописи, поэтому легче увидеть подходы, единственные для этой рукописи, такие как условие выборки, которое должен пройти каждая переменная в повторителе. -Но действительно ли эти две реализации эквивалентны? Интуитивно можно предположить, что более низкоуровневый цикл будет быстрее. Давайте поговорим о производительности. +Но действительно ли эти две выполнения равнозначны? Интуитивно можно предположить, что более низкоуровневый круговорот будет быстрее. Давайте поговорим о производительности. -[" Трейты как параметры"]: ch10-02-traits.html#traits-as-parameters \ No newline at end of file +[" Сущности как свойства"]: ch10-02-traits.html#traits-as-parameters \ No newline at end of file diff --git a/rustbook-ru/src/ch13-04-performance.md b/rustbook-ru/src/ch13-04-performance.md index 87fdf5775..1785571f7 100644 --- a/rustbook-ru/src/ch13-04-performance.md +++ b/rustbook-ru/src/ch13-04-performance.md @@ -1,21 +1,21 @@ -## Сравнение производительности циклов и итераторов +## Сравнение производительности круговоротов и повторителей -Чтобы определить, что лучше использовать циклы или итераторы, нужно знать, какая реализация быстрее: версия функции `search` с явным циклом `for` или версия с итераторами. +Чтобы определить, что лучше использовать круговороты или повторители, нужно знать, какая выполнение быстрее: исполнение функции `search` с явным круговоротом `for` или исполнение с повторителями. -Мы выполнили тест производительности, разместив всё содержимое книги *(“The Adventures of Sherlock Holmes” by Sir Arthur Conan Doyle)* в строку типа `String` и поискали слово *the* в её содержимом. Вот результаты теста функции `search` с использованием цикла `for` и с использованием итераторов: +Мы выполнили проверка производительности, разместив всё содержимое книги *(“The Adventures of Sherlock Holmes” by Sir Arthur Conan Doyle)* в строку вида данных `String` и поискали слово *the* в её содержимом. Вот итоги проверки функции `search` с использованием круговорота `for` и с использованием повторителей: ```text test bench_search_for ... bench: 19,620,300 ns/iter (+/- 915,700) test bench_search_iter ... bench: 19,234,900 ns/iter (+/- 657,200) ``` -Версия с использованием итераторов была немного быстрее! Мы не будем приводить здесь непосредственно код теста, поскольку идея не в том, чтобы доказать, что решения в точности эквивалентны, а в том, чтобы получить общее представление о том, как эти две реализации близки по производительности. +Исполнение с использованием повторителей была немного быстрее! Мы не будем приводить здесь непосредственно рукопись проверки, поскольку мысль не в том, чтобы доказать, что решения в точности равнозначны, а в том, чтобы получить общее представление о том, как эти две выполнения близки по производительности. -Для более исчерпывающего теста, вам нужно проверить различные тексты разных размеров в качестве содержимого для `contents`, разные слова и слова различной длины в качестве `query` и всевозможные другие варианты. Дело в том, что итераторы, будучи высокоуровневой абстракцией, компилируются примерно в тот же код, как если бы вы написали его низкоуровневый вариант самостоятельно. Итераторы - это одна из *абстракций с нулевой стоимостью* ( zero-cost abstractions ) в Rust, под которой мы подразумеваем, что использование абстракции не накладывает дополнительных расходов во время выполнения. Аналогично тому, как Бьёрн Страуструп, дизайнер и разработчик C++, определяет *нулевые накладные расходы* ( zero-overhead ) в книге “Foundations of C++” (2012): +Для более исчерпывающего проверки, вам нужно проверить различные писания разных размеров в качестве содержимого для `contents`, разные слова и слова различной длины в качестве `query` и всевозможные другие исходы. Дело в том, что повторители, будучи высокоуровневой абстракцией, собираются примерно в тот же рукопись, как если бы вы написали его низкоуровневый исход самостоятельно. Повторители - это одна из *абстракций с нулевой стоимостью* ( zero-cost abstractions ) в Ржавчине под которой мы подразумеваем, что использование абстракции не накладывает дополнительных расходов во время выполнения. Подобно тому, как Бьёрн Страуструп, внешнем видер и разработчик C++, определяет *нулевые накладные расходы* ( zero-overhead ) в книге “Foundations of C++” (2012): -> В целом, реализация C++ подчиняется принципу отсутствия накладных расходов: за то, чем вы не пользуетесь, платить не нужно. И далее: тот код, что вы используете, нельзя сделать ещё лучше. +> В целом, выполнение C++ подчиняется принципу отсутствия накладных расходов: за то, чем вы не пользуетесь, платить не нужно. И далее: тот рукопись, что вы используете, нельзя сделать ещё лучше. -В качестве другого примера приведём код, взятый из аудио декодера. Алгоритм декодирования использует математическую операцию линейного предсказания для оценки будущих значений на основе линейной функции предыдущих выборок. Код использует комбинирование вызовов итератора для выполнения математических вычислений для трёх переменных в области видимости: срез данных `buffer`, массив из 12 коэффициентов `coefficients` и число для сдвига данных в переменной `qlp_shift`. Переменные определены в примере, но не имеют начальных значений. Хотя этот код не имеет большого значения вне контекста, он является кратким, реальным примером того, как Rust переводит идеи высокого уровня в код низкого уровня. +В качестве другого примера приведём рукопись, взятую из аудио декодера. Распорядок обратного преобразования использует математическое действие последовательного предсказания для оценки будущих значений на основе последовательной функции предыдущих выборок. Рукопись использует соединение вызовов повторителя для выполнения математических вычислений для трёх переменных в области видимости: срез данных `buffer`, массив из 12 множителей `coefficients` и число для сдвига данных в переменной `qlp_shift`. Переменные определены в примере, но не имеют начальных значений. Хотя эта рукопись не имеет большого значения вне среды, она является кратким, существующим примером того, как Ржавчина переводит мысли высокого уровня в рукопись низкого уровня. ```rust,ignore let buffer: &mut [i32]; @@ -32,14 +32,14 @@ for i in 12..buffer.len() { } ``` -Чтобы вычислить значение переменной `prediction`, этот код перебирает каждое из 12 значений в переменной `coefficients` и использует метод `zip` для объединения значений коэффициентов с предыдущими 12 значениями в переменной `buffer`. Затем, для каждой пары мы перемножаем значения, суммируем все результаты и у суммы сдвигаем биты вправо в переменную `qlp_shift`. +Чтобы вычислить значение переменной `prediction`, эта рукопись перебирает каждое из 12 значений в переменной `coefficients` и использует способ `zip` для объединения значений множителей с предыдущими 12 значениями в переменной `buffer`. Затем, для каждой пары мы перемножаем значения, складываем все итоги и у итога сложения сдвигаем биты вправо в переменную `qlp_shift`. -Для вычислений в таких приложениях, как аудио декодеры, часто требуется производительность. Здесь мы создаём итератор, используя два адаптера, впоследствии потребляющих значение. В какой ассемблерный код будет компилироваться этот код на Rust? На момент написания этой главы он компилируется в то же самое, что вы написали бы руками. Не существует цикла, соответствующего итерации по значениям в «коэффициентах»`coefficients`: Rust знает, что существует двенадцать итераций, поэтому он «разворачивает» цикл. *Разворачивание* - это оптимизация, которая устраняет издержки кода управления циклом и вместо этого генерирует повторяющийся код для каждой итерации цикла. +Для вычислений в таких приложениях, как аудио декодеры, часто требуется производительность. Здесь мы создаём повторитель , используя два переходника, впоследствии потребляющих значение. В какой ассемблерный рукописи будет собираться эта рукопись на Ржавчине? На время написания этой Главы она собирается в то же самое, что вы написали бы руками. Не существует круговорота, соответствующего повторения по значениям в «множителях»`coefficients`: Ржавчина знает, что существует двенадцать повторений, поэтому она «разворачивает» круговорот. *Разворачивание* - это улучшение, которая устраняет издержки рукописи управления круговоротом и вместо этого порождает повторяющуюся рукопись для каждом повторении круговорота. -Все коэффициенты сохраняются в регистрах, что означает очень быстрый доступ к значениям. Нет никаких проверок границ доступа к массиву во время выполнения. Все эти оптимизации, которые может применить Rust, делают полученный код чрезвычайно эффективным. Теперь, когда вы это знаете, используйте итераторы и замыкания без страха! Они представляют код в более высокоуровневом виде, но без потери производительности во время выполнения. +Все множители сохраняются в регистрах, что означает очень быстрый доступ к значениям. Нет никаких проверок границ доступа к массиву во время выполнения. Все эти переработки, которые может применить Ржавчина делают полученный рукопись чрезвычайно производительным. Теперь, когда вы это знаете, используйте повторители и замыкания без страха! Они представляют рукопись в более высокоуровневом виде, но без потери производительности во время выполнения. ## Итоги -Замыкания (closures) и итераторы (iterators) это возможности Rust, вдохновлённые идеями функциональных языков. Они позволяют Rust ясно выражать идеи высокого уровня с производительностью низкоуровневого кода. Реализации замыканий и итераторов таковы, что нет влияния на производительность выполнения кода. Это одна из целей Rust, направленных на обеспечение абстракций с нулевой стоимостью (zero-cost abstractions). +Замыкания (closures) и повторители (iterators) это возможности Ржавчины, вдохновлённые мыслями полезных языков. Они позволяют Ржавчина ясно выражать мысли высокого уровня с производительностью низкоуровневого рукописи. Выполнения замыканий и повторителей таковы, что нет влияния на производительность выполнения рукописи. Это одна из целей Ржавчина направленных на обеспечение абстракций с нулевой стоимостью (zero-cost abstractions). -Теперь, когда мы улучшили представление кода в нашем проекте, рассмотрим некоторые возможности, которые нам предоставляет `cargo` для публикации нашего кода в репозитории. +Теперь, когда мы улучшили представление рукописи в нашем деле, рассмотрим некоторые возможности, которые нам предоставляет `cargo` для обнародования нашей рукописи в хранилища. diff --git a/rustbook-ru/src/ch14-00-more-about-cargo.md b/rustbook-ru/src/ch14-00-more-about-cargo.md index 16edde5e9..34d66e256 100644 --- a/rustbook-ru/src/ch14-00-more-about-cargo.md +++ b/rustbook-ru/src/ch14-00-more-about-cargo.md @@ -1,11 +1,11 @@ # Больше о Cargo и Crates.io -До сих пор мы использовали только самые основные возможности Cargo для сборки, запуска и тестирования нашего кода, но он может гораздо больше. В этой главе мы обсудим некоторые другие, более продвинутые возможности, чтобы показать вам, как делать следующее: +До сих пор мы использовали только самые основные возможности Cargo для сборки, запуска и проверки нашей рукописи, но он может гораздо больше. В этой главе мы обсудим некоторые другие, более продвинутые возможности, чтобы показать вам, как делать следующее: -- Настройка сборки с помощью релизных профилей -- Публикация библиотеки на [crates.io](https://crates.io/) -- Управление крупными проектами с помощью рабочих пространств -- Установка бинарных файлов с [crates.io](https://crates.io/) -- Расширение возможностей Cargo с помощью возможности добавления собственных команд +- Настройка сборки с помощью готовых профилей +- Обнародование библиотеки на [crates.io](https://crates.io/) +- Управление крупными делами с помощью рабочих пространств +- Установка двоичных файлов с [crates.io](https://crates.io/) +- Расширение возможностей Cargo с помощью возможности добавления собственных приказов -Cargo может делать значительно больше того, что мы рассмотрим в этой главе, полное описание всех его функций см. в [документации](https://doc.rust-lang.org/cargo/). +Cargo может делать значительно больше того, что мы рассмотрим в этой главе, полное описание всех его функций см. в [пособия](https://doc.rust-lang.org/cargo/). diff --git a/rustbook-ru/src/ch14-01-release-profiles.md b/rustbook-ru/src/ch14-01-release-profiles.md index 052c36217..832953418 100644 --- a/rustbook-ru/src/ch14-01-release-profiles.md +++ b/rustbook-ru/src/ch14-01-release-profiles.md @@ -1,10 +1,10 @@ -## Настройка сборок с профилями релизов +## Настройка сборок с профилями исполнений -В Rust *профили выпуска* — это предопределённые и настраиваемые профили с различными конфигурациями, которые позволяют программисту лучше контролировать различные параметры компиляции кода. Каждый профиль настраивается независимо от других. +В Ржавчине *профили выпуска* — это предопределённые и настраиваемые профили с различными настройками, которые позволяют программисту лучше управлять различные свойства сборки рукописи. Каждый профиль настраивается независимо от других. -Cargo имеет два основных профиля: профиль `dev`, используемый Cargo при запуске `cargo build`, и профиль `release`, используемый Cargo при запуске `cargo build --release`. Профиль `dev` определён со значениями по умолчанию для разработки, а профиль `release` имеет значения по умолчанию для сборок в релиз. +Cargo имеет два основных профиля: профиль `dev`, используемый Cargo при запуске `cargo build`, и профиль `release`, используемый Cargo при запуске `cargo build --release`. Профиль `dev` определён со значениями по умолчанию для разработки, а профиль `release` имеет значения по умолчанию для сборок в исполнение. -Эти имена профилей могут быть знакомы по результатам ваших сборок: +Эти имена профилей могут быть знакомы по итогам ваших сборок: в качестве зависимостей нашего проекта, но вы также можете поделиться своим кодом с другими людьми, опубликовав свои собственные пакеты. Реестр библиотек по адресу [crates.io](https://crates.io/) распространяет исходный код ваших пакетов, поэтому он в основном размещает код с открытым исходным кодом. +Мы использовали дополнения из [crates.io](https://crates.io/) в качестве дополнений в нашем деле, но вы также можете поделиться своими примерами наработок с другими людьми, обнародовав свои собственные дополнения. Перечень библиотек по адресу [crates.io](https://crates.io/) распространяет исходную рукопись ваших дополнений, поэтому он в основном размещает примеры с открытой исходной рукописью. -В Rust и Cargo есть функции, которые облегчают поиск и использование опубликованного пакета. Далее мы поговорим о некоторых из этих функций, а затем объясним, как опубликовать пакет. +В Ржавчине и Cargo есть функции, которые облегчают поиск и использование обнародованного дополнения. Далее мы поговорим о некоторых из этих функций, а затем объясним, как обнародовать дополнение. -### Создание полезных комментариев к документации +### Создание полезных примечаний к пособию -Аккуратное документирование ваших пакетов поможет другим пользователям знать, как и когда их использовать, поэтому стоит потратить время на написание документации. В главе 3 мы обсуждали, как комментировать код Rust, используя две косые черты, `//`. В Rust также есть особый вид комментариев к документации, который обычно называется *комментарием к документации*, который генерирует документацию HTML. HTML-код отображает содержимое комментариев к документации для публичных элементов API, предназначенных для программистов, заинтересованных в знании того, как *использовать* вашу библиотеку, в отличие от того, как она *реализована*. +Правильное документирование ваших дополнений поможет другим пользователям знать, как и когда их использовать, поэтому стоит потратить время на написание пособия. В главе 3 мы обсуждали, как вносить примечания в рукопись Ржавчины, используя две косые черты, `//`. В Ржавчине также есть особый вид примечаний к пособию, который обычно называется *примечанием к пособию*, который порождает пособие HTML. HTML-рукопись отображает содержимое примечаний к пособию для открытых переменных API, предназначенных для программистов, увлеченных в знании того, как *использовать* вашу библиотеку, в отличие от того, как она *выполнена*. -Комментарии к документации используют три слеша, `///` вместо двух и поддерживают нотацию Markdown для форматирования текста. Размещайте комментарии к документации непосредственно перед элементом, который они документируют. В листинге 14-1 показаны комментарии к документации для функции `add_one` в библиотеке с именем `my_crate`: +Примечания к пособию используют три слеша, `///` вместо двух и поддерживают наставление Markdown для разметки писания. Размещайте примечания к пособию непосредственно перед элементом, который они документируют. В приложении 14-1 показаны примечания к пособию для функции `add_one` в библиотеке с именем `my_crate`: Файл: src/lib.rs @@ -16,29 +16,29 @@ {{#rustdoc_include ../listings/ch14-more-about-cargo/listing-14-01/src/lib.rs}} ``` -Листинг 14-1: Комментарий к документации для функции +Приложение 14-1: Примечание к пособию для функции -Здесь мы даём описание того, что делает функция `add_one`, начинаем раздел с заголовка `Examples`, а затем предоставляем код, который демонстрирует, как использовать функцию `add_one`. Мы можем сгенерировать документацию HTML из этого комментария к документации, запустив `cargo doc`. Эта команда запускает инструмент `rustdoc`, поставляемый с Rust, и помещает сгенерированную HTML-документацию в каталог *target/doc*. +Здесь мы даём описание того, что делает функция `add_one`, начинаем раздел с заголовка `Examples`, а затем предоставляем рукопись, которая отображает, как использовать функцию `add_one`. Мы можем создать пособие HTML из этого примечания к пособию, запустив `cargo doc`. Этот приказ запускает средство `rustdoc`, поставляемое с Ржавчиной, и помещает созданное HTML-пособие в папку *target/doc*. -Для удобства, запустив `cargo doc --open`, мы создадим HTML для документации вашей текущей библиотеки (а также документацию для всех зависимостей вашей библиотеки) и откроем результат в веб-браузере. Перейдите к функции `add_one` и вы увидите, как отображается текст в комментариях к документации, что показано на рисунке 14-1: +Для удобства, запустив `cargo doc --open`, мы создадим HTML для пособия вашей текущей библиотеки (а также пособие для всех дополнений вашей библиотеки) и откроем итог в сетевого-обозревателе. Перейдите к функции `add_one` и вы увидите, как отображается писание в примечаниях к пособию, что показано на рисунке 14-1: - HTML-документация для функции `add_one`` my_crate` + HTML-пособие для функции `add_one`` my_crate` -Рисунок 14-1: HTML документация для функции add_one +Рисунок 14-1: HTML пособие для функции add_one #### Часто используемые разделы -Мы использовали Markdown заголовок `# Examples` в листинге 14-1 для создания раздела в HTML с заголовком "Examples". Вот некоторые другие разделы, которые авторы библиотек обычно используют в своей документации: +Мы использовали Markdown заголовок `# Examples` в приложении 14-1 для создания раздела в HTML с заголовком "Examples". Вот некоторые другие разделы, которые составители библиотек обычно используют в своей пособия: -- **Panics**: Сценарии, в которых документированная функция может вызывать панику. Вызывающие функцию, которые не хотят, чтобы их программы паниковали, должны убедиться, что они не вызывают функцию в этих ситуациях. -- **Ошибки**: Если функция возвращает `Result`, описание типов ошибок, которые могут произойти и какие условия могут привести к тому, что эти ошибки могут быть возвращены, может быть полезным для вызывающих, так что они могут написать код для обработки различных типов ошибок разными способами. -- **Безопасность**: Если функция является `unsafe` для вызова (мы обсуждаем безопасность в главе 19), должен быть раздел, объясняющий, почему функция небезопасна и охватывающий инварианты, которые функция ожидает от вызывающих сторон. +- **Panics**: Задумки, в которых документированная функция может вызывать сбой. Вызывающие функцию, которые не хотят, чтобы их программы вызвал сбои, должны убедиться, что они не вызывают функцию в этих случаях. +- **Ошибки**: Если функция возвращает `Result`, описание видов ошибок, которые могут произойти и какие условия могут привести к тому, что эти ошибки могут быть возвращены, может быть полезным для вызывающих, так что они могут написать рукопись для обработки различных видов ошибок разными способами. +- **Безопасность**: Если функция является `unsafe` для вызова (мы обсуждаем безопасность в главе 19), должен быть раздел, объясняющий, почему функция небезопасна и охватывающий неизменные величины, которые функция ожидает от вызывающих сторон. -В подавляющем большинстве случаев комментарии к документации не нуждаются во всех этих разделах, но это хорошая подсказка, напоминающая вам о тех аспектах вашего кода, о которых пользователям будет интересно узнать. +В подавляющем большинстве случаев примечания к пособию не нуждаются во всех этих разделах, но это хорошая подсказка, напоминающая вам о тех особенностях вашей рукописи, о которых пользователям будет важно узнать. -#### Комментарии к документации как тесты +#### Примечания к пособию как проверки -Добавление примеров кода в комментарии к документации может помочь продемонстрировать, как использовать вашу библиотеку, и это даёт дополнительный бонус: запуск `cargo test` запустит примеры кода в вашей документации как тесты! Нет ничего лучше, чем документация с примерами. Но нет ничего хуже, чем примеры, которые не работают, потому что код изменился с момента написания документации. Если мы запустим `cargo test` с документацией для функции `add_one` из листинга 14-1, мы увидим раздел результатов теста, подобный этому: +Добавление примеров рукописи в примечания к пособию может помочь отобразить, как использовать вашу библиотеку, и это даёт дополнительное преимущество: запуск `cargo test` запустит примеры рукописи в вашем пособии как проверки! Нет ничего лучше, чем пособие с примерами. Но нет ничего хуже, чем примеры, которые не работают, потому что рукопись изменилась со времени написания пособия. Если мы запустим `cargo test` с пособием для функции `add_one` из приложения 14-1, мы увидим раздел итогов проверки, подобный этому: и получить API токен. Для этого зайдите на домашнюю страницу [crates.io](https://crates.io/) и войдите в систему через учётную запись GitHub. (В настоящее время требуется наличие учётной записи GitHub, но сайт может поддерживать другие способы создания учётной записи в будущем.) Сразу после входа в систему перейдите в настройки своей учётной записи по адресу [https://crates.io/me/](https://crates.io/me/) и получите свой ключ API. Затем выполните команду `cargo login` с вашим ключом API, например: +Прежде чем вы сможете обнародовать любые библиотеки, вам необходимо создать учётную запись на [crates.io](https://crates.io/) и получить API токен. Для этого зайдите на домашнюю страницу [crates.io](https://crates.io/) и войдите в систему через учётную запись GitHub. (В настоящее время требуется наличие учётной записи GitHub, но сайт может поддерживать другие способы создания учётной записи в будущем.) Сразу после входа в систему перейдите в настройки своей учётной записи по адресу [https://crates.io/me/](https://crates.io/me/) и получите свой ключ API. Затем выполните приказ `cargo login` с вашим ключом API, например: ```console $ cargo login abcdefghijklmnopqrstuvwxyz012345 ``` -Эта команда сообщит Cargo о вашем API token и сохранит его локально в *~/.cargo/credentials*. Обратите внимание, что этот токен является *секретным*: не делитесь им ни с кем другим. Если вы по какой-либо причине поделитесь им с кем-либо, вы должны отозвать его и сгенерировать новый токен на [crates.io](https://crates.io/). +Этот приказ сообщит Cargo о вашем API token и сохранит его местно в *~/.cargo/credentials*. Обратите внимание, что этот токен является *тайным*: не делитесь им ни с кем другим. Если вы по какой-либо причине поделитесь им с кем-либо, вы должны отозвать его и создать новый токен на [crates.io](https://crates.io/). ### Добавление метаданных в новую библиотеку -Допустим, у вас есть крейт, который вы хотите опубликовать. Перед публикацией вам нужно добавить некоторые метаданные в раздел `[package]` файла *Cargo.toml* крейта. +Допустим, у вас есть ящик, который вы хотите обнародовать. Перед обнародованием вам нужно добавить некоторые метаданные в раздел `[package]` файла *Cargo.toml* ящика. -Вашему крейту понадобится уникальное имя. Пока вы работаете над крейтом локально, вы можете назвать его как угодно. Однако названия крейтов на [crates.io](https://crates.io/) фиксируются в момент первой публикации. Как только крейту присвоено название, никто другой не сможет опубликовать крейт с таким же именем. Перед тем как опубликовать крейт, поищите название, которое вы хотите использовать. Если такое имя уже используется, вам придётся подобрать другое и отредактировать поле `name` в файле *Cargo.toml* в разделе `[package]`, чтобы использовать новое имя в качестве публикуемого, например, так: +Вашему ящику понадобится не повторяющееся имя. Пока вы работаете над ящиком местно, вы можете назвать его как угодно. Однако названия ящиков на [crates.io](https://crates.io/) определятся в мгновение первой обнародования. Как только ящику присвоено название, никто другой не сможет обнародовать ящик с таким же именем. Перед тем как обнародовать ящик, поищите название, которое вы хотите использовать. Если такое имя уже используется, вам придётся подобрать другое и изменить поле `name` в файле *Cargo.toml* в разделе `[package]`, чтобы использовать новое имя в качестве размещаяемого, например, так: Файл: Cargo.toml @@ -172,7 +172,7 @@ $ cargo login abcdefghijklmnopqrstuvwxyz012345 name = "guessing_game" ``` -Даже если вы выбрали уникальное имя, когда вы запустите `cargo publish` чтобы опубликовать крейт, вы получите предупреждение, а затем ошибку: +Даже если вы выбрали не повторяющееся имя, когда вы запустите `cargo publish` чтобы обнародовать ящик, вы получите предупреждение, а затем ошибку: для использования другими. +Теперь, когда вы создали учётную запись, сохранили свой токен API, выбрали имя для своего ящика и указали необходимые метаданные, вы готовы к обнародования! Обнародование библиотеки загружает определённую исполнение в [crates.io](https://crates.io/) для использования другими. -Будьте осторожны, потому что публикация является *перманентной* операцией. Версия никогда не сможет быть перезаписана, а код не подлежит удалению. Одна из основных целей [crates.io](https://crates.io/) - служить постоянным архивом кода, чтобы сборки всех проектов, зависящих от crates из [crates.io](https://crates.io/) продолжали работать. Предоставление возможности удаления версий сделало бы выполнение этой цели невозможным. При этом количество версий крейтов, которые вы можете опубликовать, не ограничено. +Будьте осторожны, потому что обнародование является *перманентной* действием. Исполнение никогда не сможет быть перезаписана, а рукопись не подлежит удалению. Одна из основных целей [crates.io](https://crates.io/) - служить постоянным архивом рукописи, чтобы сборки всех дел, зависящих от crates из [crates.io](https://crates.io/) продолжали работать. Предоставление возможности удаления исполнений сделало бы выполнение этой цели невозможным. При этом количество исполнений ящиков, которые вы можете обнародовать, не ограничено. -Запустите команду `cargo publish` ещё раз. Сейчас эта команда должна выполниться успешно: +Запустите приказ `cargo publish` ещё раз. Сейчас этот приказ должен выполниться успешно: -### Устранение устаревших версий с Crates.io с помощью `cargo yank` +### Устранение устаревших исполнений с Crates.io с помощью `cargo yank` -Хотя вы не можете удалить предыдущие версии крейта, вы можете помешать любым будущим проектам добавлять его в качестве новой зависимости. Это полезно, когда версия крейта сломана по той или иной причине. В таких ситуациях Cargo поддерживает *выламывание* (yanking) версии крейта. +Хотя вы не можете удалить предыдущие исполнения ящика, вы можете помешать любым будущим делам добавлять его в качестве нового дополнения. Это полезно, когда исполнение ящика сломана по той или иной причине. В таких случаях Cargo поддерживает *выламывание* (yanking) исполнения ящика. -Вычёркивание версии не позволяет новым проектам зависеть от этой версии, но при этом позволяет всем существующим проектам, зависящим от неё, продолжать работу. По сути, исключение означает, что все проекты с *Cargo.lock* не сломаются, а любые файлы *Cargo.lock*, которые будут генерироваться в будущем, не смогут использовать исключённую версию. +Вычёркивание исполнения не позволяет новым делам зависеть от этой исполнения, но при этом позволяет всем существующим делам, зависящим от неё, продолжать работу. По сути, исключение означает, что все дела с *Cargo.lock* не сломаются, а любые файлы *Cargo.lock*, которые будут порождаться в будущем, не смогут использовать исключённую исполнение. -Чтобы вычеркнуть версию крейта, в директории крейта, который вы опубликовали ранее, выполните команду `cargo yank` и укажите, какую версию вы хотите вычеркнуть. Например, если мы опубликовали крейт под названием `guessing_game` версии 1.0.1 и хотим вычеркнуть её, в каталоге проекта для `guessing_game` мы выполним: +Чтобы вычеркнуть исполнение ящика, в папки ящика, который вы обнародовали ранее, выполните приказ `cargo yank` и укажите, какую исполнение вы хотите вычеркнуть. Например, если мы обнародовали ящик под названием `guessing_game` исполнения 1.0.1 и хотим вычеркнуть её, в папке дела для `guessing_game` мы выполним: является частью того, что делает экосистему Rust полезной для множества различных задач. Стандартная библиотека Rust небольшая и стабильная, но крейты легко распространять, использовать и улучшать независимо от самого языка. Не стесняйтесь делиться кодом, который был вам полезен, через [crates.io](https://crates.io/); скорее всего, он будет полезен и кому-то ещё! +Совместное использование рукописи с Cargo и [crates.io](https://crates.io/) является частью того, что делает внутреннее устройство Ржавчины полезной для множества различных задач. Обычная библиотека Ржавчины небольшая и безотказная, но ящики легко распространять, использовать и улучшать независимо от самого языка. Не стесняйтесь делиться рукописью, который был вам полезен, через [crates.io](https://crates.io/); скорее всего, он будет полезен и кому-то ещё! diff --git a/rustbook-ru/src/ch15-00-smart-pointers.md b/rustbook-ru/src/ch15-00-smart-pointers.md index 9f45c433d..08b772847 100644 --- a/rustbook-ru/src/ch15-00-smart-pointers.md +++ b/rustbook-ru/src/ch15-00-smart-pointers.md @@ -1,21 +1,21 @@ # Умные указатели -*Указатель* — это общая концепция для переменной, которая содержит адрес участка памяти. Этот адрес «относится к», или «указывает на» некоторые другие данные. Наиболее общая разновидность указателя в Rust — это ссылка, о которой вы узнали из главы 4. Ссылки обозначаются символом `&` и заимствуют значение, на которое указывают. Они не имеют каких-либо специальных возможностей, кроме как ссылаться на данные, и не имеют никаких накладных расходов. +*Указатель* — это общая подход для переменной, которая содержит адрес участка памяти. Этот адрес «относится к», или «указывает на» некоторые другие данные. Наиболее общая разновидность указателя в Ржавчине — это ссылка, о которой вы узнали из Главы 4. Ссылки обозначаются знаком `&` и заимствуют значение, на которое указывают. Они не имеют каких-либо особых возможностей, кроме как ссылаться на данные, и не имеют никаких накладных расходов. -*Умные указатели*, с другой стороны, являются структурами данных, которые не только действуют как указатель, но также имеют дополнительные метаданные и возможности. Концепция умных указателей не уникальна для Rust: умные указатели возникли в C++ и существуют в других языках. В Rust есть разные умные указатели, определённые в стандартной библиотеке, которые обеспечивают функциональность, выходящую за рамки ссылок. Одним из примеров, который мы рассмотрим в этой главе, является тип умного указателя *reference counting* (подсчёт ссылок). Этот указатель позволяет иметь несколько владельцев с помощью отслеживания количества владельцев и, когда владельцев не остаётся, очищает данные. +*Умные указатели*, с другой стороны, являются видами данных, которые не только действуют как указатель, но также имеют дополнительные метаданные и возможности. Подход умных указателей не неповторим для Ржавчины: умные указатели возникли в C++ и существуют в других языках. В Ржавчине есть разные умные указатели, определённые во встроенной библиотеке, которые обеспечивают возможность, выходящую за рамки ссылок. Одним из примеров, который мы рассмотрим в этой главе, является вид умного указателя *reference counting* (подсчёт ссылок). Этот указатель позволяет иметь несколько владельцев с помощью отслеживания количества владельцев и, когда владельцев не остаётся, очищает данные. -Rust с его концепцией владения и заимствования имеет дополнительное различие между ссылками и умными указателями: в то время, как ссылки только заимствуют данные, умные указатели часто *владеют* данными, на которые указывают. +Ржавчина с его подходом владения и заимствования имеет дополнительное различие между ссылками и умными указателями: в то время, как ссылки только заимствуют данные, умные указатели часто *владеют* данными, на которые указывают. -Ранее мы уже сталкивались с умными указателями в этой книге, хотя и не называли их так, например `String` и `Vec` в главе 8. Оба этих типа считаются умными указателями, потому что они владеют некоторой областью памяти и позволяют ею манипулировать. У них также есть метаданные и дополнительные возможности или гарантии. `String`, например, хранит свой размер в виде метаданных и гарантирует, что содержимое строки всегда будет в кодировке UTF-8. +Ранее мы уже сталкивались с умными указателями в этой книге, хотя и не называли их так, например `String` и `Vec` в главе 8. Оба этих вида данных считаются умными указателями, потому что они владеют некоторой областью памяти и позволяют ею управлять. У них также есть метаданные и дополнительные возможности или заверения. `String`, например, хранит свой размер в виде метаданных и заверяет, что содержимое строки всегда будет в представлении UTF-8. -Умные указатели обычно реализуются с помощью структур. Характерной чертой, которая отличает умный указатель от обычной структуры, является то, что для умных указателей реализованы типажи `Deref` и `Drop`. Типаж `Deref` позволяет экземпляру умного указателя вести себя как ссылка, так что вы можете написать код, работающий с ним как со ссылкой, так и как с умным указателем. Типаж `Drop` позволяет написать код, который будет запускаться когда экземпляр умного указателя выйдет из области видимости. В этой главе мы обсудим оба типажа и продемонстрируем, почему они важны для умных указателей. +Умные указатели обычно выполняются с помощью видов данных. Присущей чертой, которая отличает умный указатель от обычного вида данных, является то, что для умных указателей выполнены сущности `Deref` и `Drop`. Сущность `Deref` позволяет образцу умного указателя вести себя как ссылка, так что вы можете написать рукопись, работающей с ним как со ссылкой, так и как с умным указателем. Сущность `Drop` позволяет написать рукопись, которая будет запускаться когда образец данных умного указателя выйдет из области видимости. В этой главе мы обсудим обе сущности и выясним, почему они важны для умных указателей. -Учитывая, что паттерн умного указателя является общим паттерном проектирования, часто используемым в Rust, эта глава не описывает все существующие умные указатели. Множество библиотек имеют свои умные указатели, и вы также можете написать свои. Мы охватим наиболее распространённые умные указатели из стандартной библиотеки: +Учитывая, что образец данных умного указателя является общим образцом разработки, часто используемым в Ржавчине, эта глава не описывает все существующие умные указатели. Множество библиотек имеют свои умные указатели, и вы также можете написать свои. Мы охватим наиболее распространённые умные указатели из встроенной библиотеки: - `Box` для распределения значений в куче (памяти) -- `Rc` тип счётчика ссылок, который допускает множественное владение -- Типы `Ref` и `RefMut`, доступ к которым осуществляется через тип `RefCell`, который обеспечивает правила заимствования во время выполнения вместо времени компиляции +- `Rc` вид счётчика ссылок, который допускает множественное владение +- Виды данных `Ref` и `RefMut`, доступ к которым осуществляется через вид данных `RefCell`, который обеспечивает правила заимствования во время выполнения вместо времени сборки -Дополнительно мы рассмотрим паттерн *внутренней изменчивости (interior mutability)*, где неизменяемый тип предоставляет API для изменения своего внутреннего значения. Мы также обсудим *ссылочные зацикленности (reference cycles)*: как они могут приводить к утечке памяти и как это предотвратить. +Дополнительно мы рассмотрим образец данных *внутренней изменчивости (interior mutability)*, где неизменяемый вид данных предоставляет API для изменения своего внутреннего значения. Мы также обсудим *ссылочные замкнутости (reference cycles)*: как они могут приводить к утечке памяти и как это предотвратить. Приступим! diff --git a/rustbook-ru/src/ch15-01-box.md b/rustbook-ru/src/ch15-01-box.md index 8be84c5ba..90ced75c1 100644 --- a/rustbook-ru/src/ch15-01-box.md +++ b/rustbook-ru/src/ch15-01-box.md @@ -1,20 +1,20 @@ ## Использование `Box` для ссылки на данные в куче -Наиболее простой умный указатель - это *box*, чей тип записывается как `Box`. Такие переменные позволяют хранить данные в куче, а не в стеке. То, что остаётся в стеке, является указателем на данные в куче. Обратитесь к Главе 4, чтобы рассмотреть разницу между стеком и кучей. +Наиболее простой умный указатель - это *box*, чей вид данных записывается как `Box`. Такие переменные позволяют хранить данные в куче, а не в обойме. То, что остаётся в обойме, является указателем на данные в куче. Обратитесь к Главе 4, чтобы рассмотреть разницу между обоймой и кучей. -У Box нет проблем с производительностью, кроме хранения данных в куче вместо стека. Но он также и не имеет множества дополнительных возможностей. Вы будете использовать его чаще всего в следующих ситуациях: +У Box нет неполадок с производительностью, кроме хранения данных в куче вместо обоймы. Но он также и не имеет множества дополнительных возможностей. Вы будете использовать его чаще всего в следующих случаях: -- Когда у вас есть тип, размер которого невозможно определить во время компиляции, а вы хотите использовать значение этого типа в контексте, требующем точного размера. -- Когда у вас есть большой объем данных и вы хотите передать владение, но при этом быть уверенным, что данные не будут скопированы -- Когда вы хотите получить значение во владение и вас интересует только то, что оно относится к типу, реализующему определённый трейт, а не то, является ли оно значением какого-то конкретного типа +- Когда у вас есть вид данных, размер которого невозможно определить во время сборки, а вы хотите использовать значение этого вида в среде, требующем точного размера; +- Когда у вас есть большой размер данных и вы хотите передать владение, но при этом быть уверенным, что данные не будут воспроизведены; +- Когда вы хотите получить значение во владение и вас важно только то, что оно относится к виду данных, выполняющему определённую сущность, а не то, является ли оно значением какого-то определенного вида данных; -Мы продемонстрируем первую ситуацию в разделе ["Реализация рекурсивных типов с помощью Box"](#%D0%92%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-%D1%80%D0%B5%D0%BA%D1%83%D1%80%D1%81%D0%B8%D0%B2%D0%BD%D1%8B%D1%85-%D1%82%D0%B8%D0%BF%D0%BE%D0%B2-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-Boxes). Во втором случае, передача владения на большой объем данных может занять много времени, потому что данные копируются через стек. Для повышения производительности в этой ситуации, мы можем хранить большое количество данных в куче с помощью Box. Затем только небольшое количество данных указателя копируется в стеке, в то время как данные, на которые он ссылается, остаются в одном месте кучи. Третий случай известен как *типаж объект* (trait object) и глава 17 посвящает целый раздел ["Использование типаж объектов, которые допускают значения разных типов"] только этой теме. Итак, то, что вы узнаете здесь, вы примените снова в Главе 17! +Мы выясним первую случай в разделе ["Выполнение рекурсивных видов данных с помощью Box"](#%D0%92%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-%D1%80%D0%B5%D0%BA%D1%83%D1%80%D1%81%D0%B8%D0%B2%D0%BD%D1%8B%D1%85-%D1%82%D0%B8%D0%BF%D0%BE%D0%B2-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-Boxes). Во втором случае, передача владения на большой размер данных может занять много времени, потому что данные повторяются через обойма. Для повышения производительности в этой случае, мы можем хранить большое количество данных в куче с помощью Box. Затем только небольшое количество данных указателя воспроизводится в обойме, в то время как данные, на которые он ссылается, остаются в одном месте кучи. Третий случай известен как *сущность предмет* (trait object) и глава 17 посвящает целый раздел ["Использование сущность предметов, которые допускают значения разных видов данных"] только этой теме. Итак, то, что вы узнаете здесь, вы примените снова в Главе 17! ### Использование `Box` для хранения данных в куче -Прежде чем мы обсудим этот вариант использования `Box`, мы рассмотрим синтаксис и то, как взаимодействовать со значениями, хранящимися в `Box`. +Прежде чем мы обсудим этот исход использования `Box`, мы рассмотрим правила написания и то, как взаимодействовать со значениями, хранящимися в `Box`. -В листинге 15-1 показано, как использовать поле для хранения значения `i32` в куче: +В приложении 15-1 показано, как использовать поле для хранения значения `i32` в куче: Файл: src/main.rs @@ -22,33 +22,33 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-01/src/main.rs}} ``` -Листинг 15-1: Сохранение значения i32 в куче с использованием box +Приложение 15-1: Сохранение значения i32 в куче с использованием box -Мы объявляем переменную `b` со значением `Box`, указывающим на число `5`, размещённое в куче. Эта программа выведет `b = 5`; в этом случае мы получаем доступ к данным в box так же, как если бы эти данные находились в стеке. Как и любое другое значение, когда box выйдет из области видимости, как `b` в конце `main`, он будет удалён. Деаллокация происходит как для box ( хранящегося в стеке), так и для данных, на которые он указывает (хранящихся в куче). +Мы объявляем переменную `b` со значением `Box`, указывающим на число `5`, размещённое в куче. Эта программа выведет `b = 5`; в этом случае мы получаем доступ к данным в box так же, как если бы эти данные находились в обойме. Как и любое другое значение, когда box выйдет из области видимости, как `b` в конце `main`, он будет удалён. Деаллокация происходит как для box ( хранящегося в обойме), так и для данных, на которые он указывает (хранящихся в куче). -Размещать одиночные значения в куче не слишком целесообразно, поэтому вряд ли вы будете часто использовать box'ы таким образом. В большинстве ситуаций более уместно размещать такие значения, как `i32`, в стеке, где они и сохраняются по умолчанию. Давайте рассмотрим ситуацию, когда box позволяет нам определить типы, которые мы не могли бы иметь, если бы у нас не было box. +Размещать одиночные значения в куче не слишком целесообразно, поэтому вряд ли вы будете часто использовать box'ы таким образом. В большинстве случаев более уместно размещать такие значения, как `i32`, в обойме, где они и сохраняются по умолчанию. Давайте рассмотрим случай, когда box позволяет нам определить виды данных, которые мы не могли бы иметь, если бы у нас не было box. -### Включение рекурсивных типов с помощью Boxes +### Включение рекурсивных видов с помощью Boxes -Значение *рекурсивного типа* может иметь другое значение такого же типа как свой компонент. Рекурсивные типы представляют собой проблему, поскольку во время компиляции Rust должен знать, сколько места занимает тип. Однако вложенность значений рекурсивных типов теоретически может продолжаться бесконечно, поэтому Rust не может определить, сколько места потребуется. Поскольку box имеет известный размер, мы можем включить рекурсивные типы, добавив box в определение рекурсивного типа. +Значение *рекурсивного вида* может иметь другое значение такого же вида данных как свой составляющая. Рекурсивные виды представляют собой неполадку, поскольку во время сборки Ржавчина должна знать, сколько места занимает вид. Однако вложенность значений рекурсивных видов предположительно может продолжаться бесконечно, поэтому Ржавчина не может определить, сколько места потребуется. Поскольку box имеет известный размер, мы можем включить рекурсивные виды, добавив box в определение рекурсивного вида. -В качестве примера рекурсивного типа рассмотрим *cons list*. Это тип данных, часто встречающийся в функциональных языках программирования. Тип cons list, который мы определим, достаточно прост, за исключением наличия рекурсии; поэтому концепции, заложенные в примере, с которым мы будем работать, пригодятся вам в любой более сложной ситуации, связанной с рекурсивными типами. +В качестве примера рекурсивного вида рассмотрим *cons list*. Это вид данных, часто встречающийся в полезных языках программирования. Вид cons list, который мы определим, достаточно прост, за исключением наличия рекурсии; поэтому подходы, заложенные в примере, с которым мы будем работать, пригодятся вам в любом более сложной случае, связанной с рекурсивными видами. -#### Больше информации о cons списке +#### Больше сведений о cons списке -*cons list* - это структура данных из языка программирования Lisp и его диалектов, представляющая собой набор вложенных пар и являющаяся Lisp-версией связного списка. Его название происходит от функции `cons` (сокращение от "construct function") в Lisp, которая формирует пару из двух своих аргументов. Вызывая `cons` для пары, которая состоит из некоторого значения и другой пары, мы можем конструировать списки cons, состоящие из рекурсивных пар. +*cons list* - это стопки данных из языка программирования Lisp и его диалектов, представляющая собой набор вложенных пар и являющаяся Lisp-исполнением связного списка. Его название происходит от функции `cons` (сокращение от "construct function") в Lisp, которая создает пару из двух своих переменных. Вызывая `cons` для пары, которая состоит из некоторого значения и другой пары, мы можем выстраивать списки cons, состоящие из рекурсивных пар. -Вот, пример cons list в виде псевдокода, содержащий список 1, 2, 3, где каждая пара заключена в круглые скобки: +Вот, пример cons list в виде псевдорукописи, содержащий список 1, 2, 3, где каждая пара заключена в круглые скобки: ```text (1, (2, (3, Nil))) ``` -Каждый элемент в cons списке содержит два элемента: значение текущего элемента и следующий элемент. Последний элемент в списке содержит только значение называемое `Nil` без следующего элемента. Cons список создаётся путём рекурсивного вызова функции `cons`. Каноничное имя для обозначения базового случая рекурсии - `Nil`. Обратите внимание, что это не то же самое, что понятие “null” или “nil” из главы 6, которая является недействительным или отсутствующим значением. +Каждая переменная в cons списке содержит две вещи: значение текущей переменной и следующая переменная. Последняя переменная в списке содержит только значение, называемое `Nil` без следующей переменной. Cons список создаётся путём рекурсивного вызова функции `cons`. Каноничное имя для обозначения основного случая рекурсии - `Nil`. Обратите внимание, что это не то же самое, что понятие “пустота/null” или “nil” из Главы 6, которая является недействительным или отсутствующим значением. -Cons list не является часто используемой структурой данных в Rust. В большинстве случаев, когда вам нужен список элементов при использовании Rust, лучше использовать `Vec`. Другие, более сложные рекурсивные типы данных *полезны* в определённых ситуациях, но благодаря тому, что в этой главе мы начнём с cons list, мы сможем выяснить, как box позволяет нам определить рекурсивный тип данных без особого напряжения. +Cons list не является часто используемым видом данных в Ржавчине. В большинстве случаев, когда вам нужен список переменных при использовании Ржавчины, лучше использовать `Vec`. Другие, более сложные рекурсивные виды данных *полезны* в определённых случаях, но благодаря тому, что в этой главе мы начнём с cons list, мы сможем выяснить, как box позволяет нам определить рекурсивный вид данных без особого напряжения. -Листинг 15-2 содержит объявление перечисления cons списка. Обратите внимание, что этот код не будет компилироваться, потому что тип `List` не имеет известного размера, что мы и продемонстрируем. +Приложение 15-2 содержит объявление перечисления cons списка. Обратите внимание, что эта рукопись не будет собираться, потому что вид данных `List` не имеет известного размера, что мы и выясним. Файл: src/main.rs @@ -56,11 +56,11 @@ Cons list не является часто используемой структ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-02/src/main.rs:here}} ``` -Листинг 15-2: Первая попытка определить перечисление в качестве структуры данных cons list, состоящей из i32 значений. +Приложение 15-2: Первая попытка определить перечисление в качестве стопки данных cons list, состоящей из i32 значений. -> Примечание: В данном примере мы реализуем cons list, который содержит только значения `i32`. Мы могли бы реализовать его с помощью generics, о которых мы говорили в главе 10, чтобы определить тип cons list, который мог бы хранить значения любого типа. +> Примечание: В данном примере мы выполняем cons list, который содержит только значения `i32`. Мы могли бы использовать его с помощью generics, о которых мы говорили в главе 10, чтобы определить вид cons list, который мог бы хранить значения любого вида данных. -Использование типа `List` для хранения списка `1, 2, 3` будет выглядеть как код в листинге 15-3: +Использование вида данных `List` для хранения списка `1, 2, 3` будет выглядеть как рукопись в приложении 15-3: Файл: src/main.rs @@ -68,39 +68,39 @@ Cons list не является часто используемой структ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-03/src/main.rs:here}} ``` -Листинг 15-3: Использование перечисления List для хранения списка 1, 2, 3 +Приложение 15-3: Использование перечисления List для хранения списка 1, 2, 3 -Первое значение `Cons` содержит `1` и другой `List`. Это значение `List` является следующим значением `Cons`, которое содержит `2` и другой `List`. Это значение `List` является ещё один значением `Cons`, которое содержит `3` и значение `List`, которое наконец является `Nil`, не рекурсивным вариантом, сигнализирующим об окончании списка. +Первое значение `Cons` содержит `1` и другой `List`. Это значение `List` является следующим значением `Cons`, которое содержит `2` и другой `List`. Это значение `List` является ещё один значением `Cons`, которое содержит `3` и значение `List`, которое наконец является `Nil`, не рекурсивным исходом, сигнализирующим об окончании списка. -Если мы попытаемся скомпилировать код в листинге 15-3, мы получим ошибку, показанную в листинге 15-4: +Если мы попытаемся собрать рукопись в приложении 15-3, мы получим ошибку, показанную в приложении 15-4: ```console {{#include ../listings/ch15-smart-pointers/listing-15-03/output.txt}} ``` -Листинг 15-4: Ошибка, которую мы получаем при попытке определить рекурсивное перечисление +Приложение 15-4: Ошибка, которую мы получаем при попытке определить рекурсивное перечисление -Ошибка говорит о том, что этот тип "имеет бесконечный размер". Причина в том, что мы определили `List` в форме, которая является рекурсивной: она непосредственно хранит другое значение своего собственного типа. В результате Rust не может определить, сколько места ему нужно для хранения значения `List`. Давайте разберёмся, почему мы получаем эту ошибку. Сначала мы рассмотрим, как Rust решает, сколько места ему нужно для хранения значения нерекурсивного типа. +Ошибка говорит о том, что этот вид данных "имеет бесконечный размер". Причина в том, что мы определили `List` в виде данных, которая является рекурсивной: она непосредственно хранит другое значение своего собственного вида данных. В итоге Ржавчина не может определить, сколько места ему нужно для хранения значения `List`. Давайте разберёмся, почему мы получаем эту ошибку. Сначала мы рассмотрим, как Ржавчина решает, сколько места ему нужно для хранения значения нерекурсивного вида. -#### Вычисление размера нерекурсивного типа +#### Вычисление размера нерекурсивного вида -Вспомните перечисление `Message` определённое в листинге 6-2, когда обсуждали объявление enum в главе 6: +Вспомните перечисление `Message` определённое в приложении 6-2, когда обсуждали объявление enum в главе 6: ```rust {{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs:here}} ``` -Чтобы определить, сколько памяти выделять под значение `Message`, Rust проходит каждый из вариантов, чтобы увидеть, какой вариант требует наибольшее количество памяти. Rust видит, что для `Message::Quit` не требуется места, `Message::Move` хватает места для хранения двух значений `i32` и т.д. Так как будет использоваться только один вариант, то наибольшее пространство, которое потребуется для значения `Message`, это пространство, которое потребуется для хранения самого большого из вариантов перечисления. +Чтобы определить, сколько памяти выделять под значение `Message`, Ржавчина проходит каждый из исходов, чтобы увидеть, какой исход требует наибольшее количество памяти. Ржавчина видит, что для `Message::Quit` не требуется места, `Message::Move` хватает места для хранения двух значений `i32` и т.д. Так как будет использоваться только один исход, то наибольшее пространство, которое потребуется для значения `Message`, это пространство, которое потребуется для хранения самого большого из исходов перечисления. -Сравните это с тем, что происходит, когда Rust пытается определить, сколько места необходимо рекурсивному типу, такому как перечисление `List` в листинге 15-2. Компилятор смотрит на вариант `Cons`, который содержит значение типа `i32` и значение типа `List`. Следовательно, `Cons` нужно пространство, равное размеру `i32` плюс размер `List`. Чтобы выяснить, сколько памяти необходимо типу `List`, компилятор смотрит на варианты, начиная с `Cons`. Вариант `Cons` содержит значение типа `i32` и значение типа `List`, и этот процесс продолжается бесконечно, как показано на рисунке 15-1. +Сравните это с тем, что происходит, когда Ржавчина пытается определить, сколько места необходимо рекурсивному виду, такому как перечисление `List` в приложении 15-2. Сборщик смотрит на исход `Cons`, который содержит значение вида данных `i32` и значение вида данных `List`. Следовательно, `Cons` нужно пространство, равное размеру `i32` дополнительно размер `List`. Чтобы выяснить, сколько памяти необходимо виду `List`, сборщик смотрит на исходы, начиная с `Cons`. Исход `Cons` содержит значение вида данных `i32` и значение вида данных `List`, и этот этап продолжается бесконечно, как показано на рисунке 15-1. Бесконечный список Cons -Рисунок 15-1: Бесконечный List, состоящий из нескончаемого числа вариантов Cons +Рисунок 15-1: Бесконечный List, состоящий из нескончаемого числа исходов Cons -#### Использование `Box` для получения рекурсивного типа с известным размером +#### Использование `Box` для получения рекурсивного вида с известным размером -Поскольку Rust не может определить, сколько места нужно выделить для типов с рекурсивным определением, компилятор выдаёт ошибку с этим полезным предложением: +Поскольку Ржавчина не может определить, сколько места нужно выделить для видов с рекурсивным определением, сборщик выдаёт ошибку с этим полезным предложением: @@ -12,7 +12,7 @@ ### Следуя за указателем на значение -Обычная ссылка - это разновидность указателя, а указатель можно рассматривать как своеобразную стрелочку направляющую к значению, хранящемуся в другом месте. В листинге 15-6 мы создаём ссылку на значение `i32`, а затем используем оператор разыменования для перехода от ссылки к значению: +Обычная ссылка - это разновидность указателя, а указатель можно рассматривать как своеобразную стрелочку направляющую к значению, хранящемуся в другом месте. В приложении 15-6 мы создаём ссылку на значение `i32`, а затем используем приказчик разыменования для перехода от ссылки к значению: Файл: src/main.rs @@ -20,21 +20,21 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-06/src/main.rs}} ``` -Листинг 15-6: Использование оператора разыменования для следования по ссылке к значению i32 +Приложение 15-6: Использование приказчика разыменования для следования по ссылке к значению i32 -Переменной `x` присвоено значение`5` типа `i32`. Мы установили в качестве значения `y` ссылку на `x`. Мы можем утверждать, что значение `x` равно `5`. Однако, если мы хотим сделать утверждение о значении в `y`, мы должны использовать `*y`, чтобы перейти по ссылке к значению, на которое она указывает (таким образом, происходит *разыменование*), для того чтобы компилятор при сравнении мог использовать фактическое значение. Как только мы разыменуем `y`, мы получим доступ к целочисленному значению, на которое указывает `y`, которое и будем сравнивать с `5`. +Переменной `x` присвоено значение`5` вида данных `i32`. Мы установили в качестве значения `y` ссылку на `x`. Мы можем утверждать, что значение `x` равно `5`. Однако, если мы хотим сделать утверждение о значении в `y`, мы должны использовать `*y`, чтобы перейти по ссылке к значению, на которое она указывает (таким образом, происходит *разыменование*), для того чтобы сборщик при сравнении мог использовать действительное значение. Как только мы разыменуем `y`, мы получим доступ к целочисленному значению, на которое указывает `y`, которое и будем сравнивать с `5`. -Если бы мы попытались написать `assert_eq!(5, y);`, то получили ошибку компиляции: +Если бы мы попытались написать `assert_eq!(5, y);`, то получили ошибку сборки: ```console {{#include ../listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt}} ``` -Сравнение числа и ссылки на число не допускается, потому что они различных типов. Мы должны использовать оператор разыменования, чтобы перейти по ссылке на значение, на которое она указывает. +Сравнение числа и ссылки на число не допускается, потому что они различных видов данных. Мы должны использовать приказчик разыменования, чтобы перейти по ссылке на значение, на которое она указывает. ### Использование `Box` как ссылку -Мы можем переписать код в листинге 15-6, чтобы использовать `Box` вместо ссылки; оператор разыменования, используемый для `Box` в листинге 15-7, работает так же, как оператор разыменования, используемый для ссылки в листинге 15-6: +Мы можем переписать рукопись в приложении 15-6, чтобы использовать `Box` вместо ссылки; приказчик разыменования, используемый для `Box` в приложении 15-7, работает так же, как приказчик разыменования, используемый для ссылки в приложении 15-6: Файл: src/main.rs @@ -42,15 +42,15 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-07/src/main.rs}} ``` -Листинг 15-7: Использование оператора разыменования с типом Box<i32> +Приложение 15-7: Использование приказчика разыменования с видом данных Box<i32> -Основное различие между листингом 15-7 и листингом 15-6 заключается в том, что здесь мы устанавливаем `y` как экземпляр `Box`, указывающий на скопированное значение `x`, а не как ссылку, указывающую на значение `x`. В последнем утверждении мы можем использовать оператор разыменования, чтобы проследовать за указателем `Box` так же, как мы это делали, когда `y` был ссылкой. Далее мы рассмотрим, что особенного в `Box`, что позволяет нам использовать оператор разыменования, определяя наш собственный тип. +Основное различие между приложением 15-7 и приложением 15-6 заключается в том, что здесь мы устанавливаем `y` как образец данных `Box`, указывающий на воспроизведенное значение `x`, а не как ссылку, указывающую на значение `x`. В последнем утверждении мы можем использовать приказчик разыменования, чтобы проследовать за указателем `Box` так же, как мы это делали, когда `y` был ссылкой. Далее мы рассмотрим, что особенного в `Box`, что позволяет нам использовать приказчик разыменования, определяя наш собственный вид данных. ### Определение собственного умного указателя -Давайте создадим умный указатель, похожий на тип `Box` предоставляемый стандартной библиотекой, чтобы понять как поведение умных указателей отличается от поведения обычной ссылки. Затем мы рассмотрим вопрос, как добавить возможность использовать оператор разыменования. +Давайте создадим умный указатель, похожий на вид данных `Box` предоставляемый встроенной библиотекой, чтобы понять как поведение умных указателей отличается от поведения обычной ссылки. Затем мы рассмотрим вопрос, как добавить возможность использовать приказчик разыменования. -Тип `Box` в конечном итоге определяется как структура кортежа с одним элементом, поэтому в листинге 15-8 аналогичным образом определяется `MyBox`. Мы также определим функцию `new`, чтобы она соответствовала функции `new`, определённой в `Box`. +Вид данных `Box` в конечном итоге определяется как стопки упорядоченного ряда с одной переменной, поэтому в приложении 15-8 подобным образом определяется `MyBox`. Мы также определим функцию `new`, чтобы она соответствовала функции `new`, определённой в `Box`. Файл: src/main.rs @@ -58,11 +58,11 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-08/src/main.rs:here}} ``` -Листинг 15-8: Определение типа MyBox<T> +Приложение 15-8: Определение вида данных MyBox<T> -Мы определяем структуру с именем `MyBox` и объявляем обобщённый параметр `T`, потому что мы хотим, чтобы наш тип хранил значения любого типа. Тип `MyBox` является структурой кортежа с одним элементом типа `T`. Функция `MyBox::new` принимает один параметр типа `T` и возвращает экземпляр `MyBox`, который содержит переданное значение. +Мы определяем стопку с именем `MyBox` и объявляем Обобщённое свойство `T`, потому что мы хотим, чтобы наш вид данных хранил значения любого вида данных. Стопка `MyBox` является видом данных упорядоченного ряда с одной переменной вида данных `T`. Функция `MyBox::new` принимает одно свойство вида данных `T` и возвращает образец данных `MyBox`, который содержит переданное значение. -Давайте попробуем добавить функцию `main` из листинга 15-7 в листинг 15-8 и изменим её на использование типа `MyBox`, который мы определили вместо `Box`. Код в листинге 15-9 не будет компилироваться, потому что Rust не знает, как разыменовывать `MyBox`. +Давайте попробуем добавить функцию `main` из приложения 15-7 в приложение 15-8 и изменим её на использование вида данных `MyBox`, который мы определили вместо `Box`. Рукопись в приложении 15-9 не будет собираться, потому что Ржавчина не знает, как разыменовывать `MyBox`. Файл: src/main.rs @@ -70,19 +70,19 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-09/src/main.rs:here}} ``` -Листинг 15-9. Попытка использовать MyBox<T> таким же образом, как мы использовали ссылки и Box<T> +Приложение 15-9: Попытка использовать MyBox<T> таким же образом, как мы использовали ссылки и Box<T> -Вот результат ошибки компиляции: +Вот итог ошибки сборки: ```console {{#include ../listings/ch15-smart-pointers/listing-15-09/output.txt}} ``` -Наш тип `MyBox` не может быть разыменован, потому что мы не реализовали эту возможность. Чтобы включить разыменование с помощью оператора `*`, мы реализуем типаж `Deref`. +Наш вид данных `MyBox` не может быть разыменован, потому что мы не выполнили эту возможность. Чтобы включить разыменование с помощью приказчика `*`, мы выполняем сущность `Deref`. -### Трактование типа как ссылки реализуя типаж `Deref` +### Трактование вида данных как ссылки выполняя сущность `Deref` -Как обсуждалось в разделе [“Реализация трейта для типа”] Главы 10, для реализации типажа нужно предоставить реализации требуемых методов типажа. Типаж `Deref`, предоставляемый стандартной библиотекой требует от нас реализации одного метода с именем `deref`, который заимствует `self` и возвращает ссылку на внутренние данные. Листинг 15-10 содержит реализацию `Deref` добавленную к определению `MyBox`: +Как обсуждалось в разделе [“Использование сущности для вида данных”] Главы 10, для выполнения сущности нужно предоставить выполнения требуемых способов сущности. Сущность `Deref`, предоставляемый встроенной библиотекой требует от нас выполнения одного способа с именем `deref`, который заимствует `self` и возвращает ссылку на внутренние данные. Приложение 15-10 содержит использование `Deref` добавленную к определению `MyBox`: Файл: src/main.rs @@ -90,33 +90,33 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-10/src/main.rs:here}} ``` -Листинг 15-10: Реализация Deref для типа MyBox<T> +Приложение 15-10: Выполнение Deref для вида данных MyBox<T> -Синтаксис `type Target = T;` определяет связанный тип для использования у типажа `Deref`. Связанные типы - это немного другой способ объявления обобщённого параметра, но пока вам не нужно о них беспокоиться; мы рассмотрим их более подробно в главе 19. +Согласно правил написания `type Target = T;` определяет связанный вид данных для использования у сущности `Deref`. Связанные виды данных - это немного другой способ объявления обобщённого свойства, но пока вам не нужно о них беспокоиться; мы рассмотрим их более подробно в главе 19. -Мы заполним тело метода `deref` оператором `&self.0 `, чтобы `deref` вернул ссылку на значение, к которому мы хотим получить доступ с помощью оператора `*`; вспомним из раздела ["Using Tuple Structs without Named Fields to Create Different Types"] главы 5, что `.0` получает доступ к первому значению в кортежной структуре. Функция `main` в листинге 15-9, которая вызывает `*` для значения `MyBox`, теперь компилируется, и проверки проходят! +Мы исполним тело способа `deref` приказчиком `&self.0 `, чтобы `deref` вернул ссылку на значение, к которому мы хотим получить доступ с помощью приказчика `*`; вспомним из раздела ["Using Tuple Structs without Named Fields to Create Different Types"] Главы 5, что `.0` получает доступ к первому значению в упорядоченной в ряд стопке. Функция `main` в приложении 15-9, которая вызывает `*` для значения `MyBox`, теперь собирается, и проверки проходят! -Без типажа `Deref` компилятор может только разыменовывать `&` ссылки. Метод `deref` даёт компилятору возможность принимать значение любого типа, реализующего `Deref` и вызывать метод `deref` чтобы получить ссылку `&`, которую он знает, как разыменовывать. +Без сущности `Deref` сборщик может только разыменовывать `&` ссылки. Способ `deref` даёт сборщику возможность принимать значение любого данных, выполняющего `Deref` и вызывать способ `deref` чтобы получить ссылку `&`, которую он знает, как разыменовывать. -Когда мы ввели `*y` в листинге 15-9, Rust фактически выполнил за кулисами такой код: +Когда мы ввели `*y` в приложении 15-9, Ржавчина в действительности выполнила за кулисами такую рукопись: ```rust,ignore *(y.deref()) ``` -Rust заменяет оператор `*` вызовом метода `deref` и затем простое разыменование, поэтому нам не нужно думать о том, нужно ли нам вызывать метод `deref`. Эта функция Rust позволяет писать код, который функционирует одинаково, независимо от того, есть ли у нас обычная ссылка или тип, реализующий типаж `Deref`. +Ржавчина заменяет приказчик `*` вызовом способа `deref` и затем простое разыменование, поэтому нам не нужно думать о том, нужно ли нам вызывать способ `deref`. Эта функция Ржавчины позволяет писать рукопись, которая исполняется одинаково, независимо от того, есть ли у нас обычная ссылка или вид данных, выполняющий сущность `Deref`. -Причина, по которой метод `deref` возвращает ссылку на значение, и что простое разыменование вне круглых скобок в `*(y.deref())` все ещё необходимо, связана с системой владения. Если бы метод `deref` возвращал значение напрямую, а не ссылку на него, значение переместилось бы из `self`. Мы не хотим передавать владение внутренним значением внутри `MyBox` в этом случае и в большинстве случаев, когда мы используем оператор разыменования. +Причина, по которой способ `deref` возвращает ссылку на значение, и что простое разыменование вне круглых скобок в `*(y.deref())` все ещё необходимо, связана с системой владения. Если бы способ `deref` возвращал значение напрямую, а не ссылку на него, значение переместилось бы из `self`. Мы не хотим передавать владение внутренним значением внутри `MyBox` в этом случае и в большинстве случаев, когда мы используем приказчик разыменования. -Обратите внимание, что оператор `*` заменён вызовом метода `deref`, а затем вызовом оператора `*` только один раз, каждый раз, когда мы используем `*` в коде. Поскольку замена оператора `*` не повторяется бесконечно, мы получаем данные типа `i32`, которые соответствуют `5` в `assert_eq!` листинга 15-9. +Обратите внимание, что приказчик `*` заменён вызовом способа `deref`, а затем вызовом приказчика `*` только один раз, каждый раз, когда мы используем `*` в рукописи. Поскольку замена приказчика `*` не повторяется бесконечно, мы получаем данные вида данных `i32`, которые соответствуют `5` в `assert_eq!` приложения 15-9. -### Неявные разыменованные приведения с функциями и методами +### Неявные разыменованные приведения с функциями и способами -*Разыменованное приведение* преобразует ссылку на тип, который реализует признак `Deref`, в ссылку на другой тип. Например, deref coercion может преобразовать `&String` в `&str`, потому что `String` реализует признак `Deref`, который возвращает `&str`. Deref coercion - это удобный механизм, который Rust использует для аргументов функций и методов, и работает только для типов, реализующих признак `Deref`. Это происходит автоматически, когда мы передаём в качестве аргумента функции или метода ссылку на значение определённого типа, которое не соответствует типу параметра в определении функции или метода. В результате серии вызовов метода `deref` тип, который мы передали, преобразуется в тип, необходимый для параметра. +*Разыменованное приведение* преобразует ссылку на вид данных, который использует признак `Deref`, в ссылку на другой вид. Например, deref coercion может преобразовать `&String` в `&str`, потому что `String` использует признак `Deref`, который возвращает `&str`. Deref coercion - это удобный рычаг, который Ржавчина использует для переменных функций и способов, и работает только для видов данных, выполняющих признак `Deref`. Это происходит самостоятельно , когда мы передаём в качестве переменной функции или способа ссылку на значение определённого вида данных, которое не соответствует виду свойства в определении функции или способа. В итоге последовательности вызовов способа `deref` вид данных, который мы передали, преобразуется в вид, необходимый для свойства. -Разыменованное приведение было добавлено в Rust, так что программистам, пишущим вызовы функций и методов, не нужно добавлять множество явных ссылок и разыменований с помощью использования `&` и `*`. Функциональность разыменованного приведения также позволяет писать больше кода, который может работать как с ссылками, так и с умными указателями. +Разыменованное приведение было добавлено в Ржавчине так, что программистам, пишущим вызовы функций и способов, не нужно добавлять множество явных ссылок и разыменований с помощью использования `&` и `*`. Возможность разыменованного приведения также позволяет писать больше рукописи, которая может работать как с ссылками, так и с умными указателями. -Чтобы увидеть разыменованное приведение в действии, давайте воспользуемся типом `MyBox` определённым в листинге 15-8, а также реализацию `Deref` добавленную в листинге 15-10. Листинг 15-11 показывает определение функции, у которой есть параметр типа срез строки: +Чтобы увидеть разыменованное приведение в действии, давайте воспользуемся видом данных `MyBox` определённым в приложении 15-8, а также использование `Deref` добавленную в приложении 15-10. Приложение 15-11 показывает определение функции, у которой есть свойство вида данных срез строки: Файл: src/main.rs @@ -124,9 +124,9 @@ Rust заменяет оператор `*` вызовом метода `deref` {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-11/src/main.rs:here}} ``` -Листинг 15-11: Функция hello имеющая параметр name типа &str +Приложение 15-11: Функция hello имеющая свойство name вида данных &str -Можно вызвать функцию `hello` со срезом строки в качестве аргумента, например `hello("Rust");`. Разыменованное приведение делает возможным вызов `hello` со ссылкой на значение типа `MyBox`, как показано в листинге 15-12. +Можно вызвать функцию `hello` со срезом строки в качестве переменной, например `hello("Ржавчина");`. Разыменованное приведение делает возможным вызов `hello` со ссылкой на значение вида данных `MyBox`, как показано в приложении 15-12. Файл: src/main.rs @@ -134,11 +134,11 @@ Rust заменяет оператор `*` вызовом метода `deref` {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-12/src/main.rs:here}} ``` -Листинг 15-12: Вызов hello со ссылкой на значение MyBox<String>, которое работает из-за разыменованного приведения +Приложение 15-12: Вызов hello со ссылкой на значение MyBox<String>, которое работает из-за разыменованного приведения -Здесь мы вызываем функцию `hello` с аргументом `&m`, который является ссылкой на значение `MyBox`. Поскольку мы реализовали типаж `Deref` для `MyBox` в листинге 15-10, то Rust может преобразовать `&MyBox` в `&String` вызывая `deref`. Стандартная библиотека предоставляет реализацию типажа `Deref` для типа `String`, которая возвращает срез строки, это описано в документации API типажа `Deref`. Rust снова вызывает `deref`, чтобы превратить `&String` в `&str`, что соответствует определению функции `hello`. +Здесь мы вызываем функцию `hello` с переменной `&m`, которая является ссылкой на значение `MyBox`. Поскольку мы выполнили сущность `Deref` для `MyBox` в приложении 15-10, то Ржавчина может преобразовать `&MyBox` в `&String` вызывая `deref`. Обычная библиотека предоставляет использование сущности `Deref` для вида данных `String`, которая возвращает срез строки, это описано в пособии API сущности `Deref`. Ржавчина снова вызывает `deref`, чтобы превратить `&String` в `&str`, что соответствует определению функции `hello`. -Если бы Rust не реализовал разыменованное приведение, мы должны были бы написать код в листинге 15-13 вместо кода в листинге 15-12 для вызова метода `hello` со значением типа `&MyBox`. +Если бы Ржавчина не выполнила разыменованное приведение, мы должны были бы написать рукопись в приложении 15-13 вместо рукописи в приложении 15-12 для вызова способа `hello` со значением вида данных `&MyBox`. Файл: src/main.rs @@ -146,26 +146,26 @@ Rust заменяет оператор `*` вызовом метода `deref` {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-13/src/main.rs:here}} ``` -Листинг 15-13: Код, который нам пришлось бы написать, если бы в Rust не было разыменованного приведения ссылок +Приложение 15-13: Рукопись, которую нам пришлось бы написать, если бы в Ржавчине не было разыменованного приведения ссылок -Код `(*m)` разыменовывает `MyBox` в `String`. Затем `&` и `[..]` принимают строковый срез `String`, равный всей строке, чтобы соответствовать сигнатуре `hello`. Код без разыменованного приведения сложнее читать, писать и понимать со всеми этими символами. Разыменованное приведение позволяет Rust обрабатывать эти преобразования для нас автоматически. +Рукопись `(*m)` разыменовывает `MyBox` в `String`. Затем `&` и `[..]` принимают строковый срез `String`, равный всей строке, чтобы соответствовать ярлыке `hello`. Рукопись без разыменованного приведения сложнее читать, писать и понимать со всеми этими знаками. Разыменованное приведение позволяет Ржавчине обрабатывать эти преобразования для нас самостоятельно . -Когда типаж `Deref` определён для задействованных типов, Rust проанализирует типы и будет использовать `Deref::deref` столько раз, сколько необходимо, чтобы получить ссылку, соответствующую типу параметра. Количество раз, которое нужно вставить `Deref::deref` определяется во время компиляции, поэтому использование разыменованного приведения не имеет накладных расходов во время выполнения! +Когда сущность `Deref` определена для задействованных видов, Ржавчина прорассматривает виды данных и будет использовать `Deref::deref` столько раз, сколько необходимо, чтобы получить ссылку, соответствующую виду данных свойства. Количество раз, которое нужно вставить `Deref::deref` определяется во время сборки, поэтому использование разыменованного приведения не имеет накладных расходов во время выполнения! ### Как разыменованное приведение взаимодействует с изменяемостью -Подобно тому, как вы используете типаж `Deref` для переопределения оператора `*` у неизменяемых ссылок, вы можете использовать типаж `DerefMut` для переопределения оператора `*` у изменяемых ссылок. +Подобно тому, как вы используете сущность `Deref` для переопределения приказчика `*` у неизменяемых ссылок, вы можете использовать сущность `DerefMut` для переопределения приказчика `*` у изменяемых ссылок. -Rust выполняет разыменованное приведение, когда находит типы и реализации типажей в трёх случаях: +Ржавчина использует разыменованное приведение, когда находит виды данных и выполнения сущностей в трёх случаях: -- Из типа `&T` в тип `&U` когда верно `T: Deref` -- Из типа `&mut T` в тип `&mut U` когда верно `T: DerefMut` -- Из типа `&mut T` в тип `&U` когда верно `T: Deref` +- Из вида данных `&T` в вид данных `&U` когда верно `T: Deref` +- Из вида данных `&mut T` в вид данных `&mut U` когда верно `T: DerefMut` +- Из вида данных `&mut T` в вид данных `&U` когда верно `T: Deref` -Первые два случая идентичны друг другу, за исключением того, что второй реализует изменяемость. В первом случае говорится, что если у вас есть `&T`, а `T` реализует `Deref` для некоторого типа `U`, вы сможете прозрачно получить `&U`. Во втором случае говорится, что такое же разыменованное приведение происходит и для изменяемых ссылок. +Первые два случая равноценны друг другу, за исключением того, что второй использует изменяемость. В первом случае говорится, что если у вас есть `&T`, а `T` использует `Deref` для некоторого вида данных `U`, вы сможете прозрачно получить `&U`. Во втором случае говорится, что такое же разыменованное приведение происходит и для изменяемых ссылок. -Третий случай хитрее: Rust также приводит изменяемую ссылку к неизменяемой. Но обратное *не* представляется возможным: неизменяемые ссылки никогда не приводятся к изменяемым ссылкам. Из-за правил заимствования, если у вас есть изменяемая ссылка, эта изменяемая ссылка должна быть единственной ссылкой на данные (в противном случае программа не будет компилироваться). Преобразование одной изменяемой ссылки в неизменяемую ссылку никогда не нарушит правила заимствования. Преобразование неизменяемой ссылки в изменяемую ссылку потребует наличия только одной неизменяемой ссылки на эти данные, и правила заимствования не гарантируют этого. Следовательно, Rust не может сделать предположение, что преобразование неизменяемой ссылки в изменяемую ссылку возможно. +Третий случай хитрее: Ржавчина также приводит изменяемую ссылку к неизменяемой. Но обратное *не* представляется возможным: неизменяемые ссылки никогда не приводятся к изменяемым ссылкам. Из-за правил заимствования, если у вас есть изменяемая ссылка, эта изменяемая ссылка должна быть единственной ссылкой на данные (в противном случае программа не будет собираться). Преобразование одной изменяемой ссылки в неизменяемую ссылку никогда не нарушит правила заимствования. Преобразование неизменяемой ссылки в изменяемую ссылку потребует наличия только одной неизменяемой ссылки на эти данные, и правила заимствования не заверяют этого. Следовательно, Ржавчина не может сделать предположение, что преобразование неизменяемой ссылки в изменяемую ссылку возможно. -[“Реализация трейта для типа”]: ch10-02-traits.html#implementing-a-trait-on-a-type +[“Использование сущности для вида данных”]: ch10-02-traits.html#implementing-a-trait-on-a-type ["Using Tuple Structs without Named Fields to Create Different Types"]: ch05-01-defining-structs.html#using-tuple-structs-without-named-fields-to-create-different-types \ No newline at end of file diff --git a/rustbook-ru/src/ch15-03-drop.md b/rustbook-ru/src/ch15-03-drop.md index 7145bb815..3486cafc2 100644 --- a/rustbook-ru/src/ch15-03-drop.md +++ b/rustbook-ru/src/ch15-03-drop.md @@ -1,14 +1,14 @@ -## Запуск кода при очистке с помощью типажа `Drop` +## Запуск рукописи при очистке с помощью сущности `Drop` -Вторым важным типажом умного указателя является Drop, который позволяет регулировать, что происходит, когда значение вот-вот выйдет из области видимости. Вы можете реализовать типаж Drop для любого типа, а также использовать этот код для высвобождения ресурсов, таких как файлы или сетевые соединения. +Второй важной особенностью умного указателя является Drop, который позволяет управлять, что происходит, когда значение вот-вот выйдет из области видимости. Вы можете использовать сущность Drop для любого вида данных, а также использовать эту рукопись для высвобождения памяти, таких как файлы или сетевые соединения. -Мы рассматриваем `Drop` в контексте умных указателей, потому что функциональность свойства `Drop` практически всегда используется при реализации умного указателя. Например, при сбросе `Box` происходит деаллокация пространства на куче, на которое указывает box. +Мы рассматриваем `Drop` в среде умных указателей, потому что возможность свойства `Drop` по сути всегда используется при выполнения умного указателя. Например, при сбросе `Box` происходит деаллокация пространства на куче, на которое указывает box. -В некоторых языках для некоторых типов программист должен вызывать код для освобождения памяти или ресурсов каждый раз, когда он завершает использование экземпляров этих типов. Примерами могут служить дескрипторы файлов, сокеты или блокировки. Если забыть об этом, система окажется перегруженной и может упасть. В Rust вы можете указать, что определённый фрагмент кода должен выполняться всякий раз, когда значение выходит из области видимости, и компилятор автоматически будет его вставлять. Как следствие, вам не нужно заботиться о размещении кода очистки везде в программе, где завершается работа экземпляра определённого типа - утечки ресурсов все равно не будет! +В ряде языков программирования для некоторых видов данных программист должен каждый раз самостоятельно освобождать память, когда он завершает использование этими переменными, которые занимают память. Примерами могут служить указатели файлов, сокеты или запреты. Если забыть об этом, программа может достичь предела свободной памяти и завершиться со сбоем. В Ржавчине вы можете указать, что определённый отрывок рукописи должен выполняться всякий раз, когда значение выходит из области видимости, и сборщик самостоятельно будет его вставлять. Как следствие, вам не нужно заботиться о очистке памяти неиспользуемых переменных в программе, где завершается работа образца определённого вида данных - утечки памяти все равно не будет! -Вы можете задать определённую логику, которая будет выполняться, когда значение выходит за пределы области видимости, реализовав признак `Drop`. Типаж `Drop` требует от вас реализации одного метода `drop`, который принимает изменяемую ссылку на `self`. Чтобы увидеть, когда Rust вызывает `drop`, давайте реализуем `drop` с помощью инструкций `println!`. +Вы можете задать определённый ход мыслей, который будет выполняться, когда значение выходит за пределы области видимости, применив сущность `Drop`. Сущность `Drop` требует от вас выполнения одного способа `drop`, который принимает изменяемую ссылку на `self`. Чтобы увидеть, когда Ржавчина вызывает `drop`, давайте выполняем `drop` с помощью указаний `println!`. -В листинге 15-14 показана структура `CustomSmartPointer`, единственной уникальной функциональностью которой является печать `Dropping CustomSmartPointer!`, когда экземпляр выходит из области видимости, чтобы показать, когда Rust выполняет функцию `drop`. +В приложении 15-14 показана стопка `CustomSmartPointer`, единственная не имеющая себе подобных, возможностью которой является вывод `Dropping CustomSmartPointer!`, когда образец данных выходит из области видимости, чтобы показать, когда Ржавчина использует функцию `drop`. Файл: src/main.rs @@ -16,11 +16,11 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-14/src/main.rs}} ``` -Листинг 15-14: Структура CustomSmartPointer, реализующая типаж Drop, куда мы поместим наш код очистки +Приложение 15-14: Стопка CustomSmartPointer, использующая сущность Drop, куда мы поместим нашу рукопись очистки -Типаж `Drop` включён в прелюдию, поэтому нам не нужно вводить его в область видимости. Мы реализуем типаж `Drop` для `CustomSmartPointer` и реализуем метод `drop`, который будет вызывать `println!`. Тело функции `drop` - это место, где должна располагаться вся логика, которую вы захотите выполнять, когда экземпляр вашего типа выйдет из области видимости. Мы печатаем здесь текст, чтобы наглядно продемонстрировать, когда Rust вызовет `drop`. +Сущность `Drop` включена во встроенный набор, поэтому нам не нужно вводить её в область видимости. Мы используем сущность `Drop` для `CustomSmartPointer` и вызываем способ `drop`, который будет вызывать макрос `println!`. Тело функции `drop` - это место, где должен располагаться весь ход мыслей, который вы захотите выполнить, когда образец данных вашего вида данных выйдет из области видимости. Мы выводим здесь писание, чтобы наглядно отобразить, когда Ржавчина вызовет `drop`. -В `main` мы создаём два экземпляра `CustomSmartPointer` и затем печатаем `CustomSmartPointers created` . В конце `main` наши экземпляры `CustomSmartPointer` выйдут из области видимости и Rust вызовет код, который мы добавили в метод `drop`, который и напечатает наше окончательное сообщение. Обратите внимание, что нам не нужно вызывать метод `drop` явно. +В `main` мы создаём два образца данных `CustomSmartPointer` и затем выводим `CustomSmartPointers created` . В конце `main` наши образцы `CustomSmartPointer` выйдут из области видимости и Ржавчина вызовет рукопись, которую мы добавили в способ `drop`, который и выведет наше окончательное сообщение. Обратите внимание, что нам не нужно вызывать способ `drop` явно. Когда мы запустим эту программу, мы увидим следующий вывод: @@ -28,13 +28,13 @@ {{#include ../listings/ch15-smart-pointers/listing-15-14/output.txt}} ``` -Rust автоматически вызывал `drop` в момент выхода наших экземпляров из области видимости, тем самым выполнив заданный нами код. Переменные удаляются в обратном порядке их создания, поэтому `d` была удалена до `c`. Цель этого примера — дать вам наглядное представление о том, как работает метод `drop`; в типичных случаях вы будете задавать код очистки, который должен выполнить ваш тип, а не печатать сообщение. +Ржавчина самостоятельно вызывала `drop` в мгновение выхода наших образцов из области видимости, тем самым выполнив заданную нами рукопись. Переменные удаляются в обратном порядке их создания, поэтому `d` была удалена до `c`. Цель этого примера — дать вам наглядное представление о том, как работает способ `drop`; в обычных случаях вы будете задавать указание очистки, которое должно использовать ваш вид данных, а не выводить сообщение. ### Раннее удаление значения с помощью `std::mem::drop` -К сожалению, отключение функции автоматического удаления с помощью `drop` является не простым. Отключение `drop` обычно не требуется; весь смысл типажа `Drop` в том, чтобы о функции позаботились автоматически. Иногда, однако, вы можете захотеть очистить значение рано. Одним из примеров является использование умных указателей, которые управляют блокировками: вы могли бы потребовать принудительный вызов метода `drop` который снимает блокировку, чтобы другой код в той же области видимости мог получить блокировку. Rust не позволяет вызвать метод типажа `Drop` вручную; вместо этого вы должны вызвать функцию `std::mem::drop` предоставляемую стандартной библиотекой, если хотите принудительно удалить значение до конца области видимости. +К сожалению, отключение функции самостоятельного удаления с помощью `drop` является не простым. Отключение `drop` обычно не требуется; весь смысл сущности `Drop` в том, чтобы о функции позаботились самостоятельно . Иногда, однако, вы можете захотеть очистить значение самостоятельно раньше, чем переменная выйдет из области видимости. Одним из примеров является использование умных указателей, которые управляют запретами: вы могли бы принудительно вызвать способ `drop`, который снимает запрет на очистку памяти, чтобы другая рукопись в той же области видимости могла получить запрет. Ржавчина не позволяет вызвать способ сущности `Drop` вручную; вместо этого вы должны вызвать функцию `std::mem::drop` предоставляемую встроенной библиотекой, если хотите принудительно удалить вид данных или переменную до конца области видимости. -Если попытаться вызвать метод `drop` типажа `Drop` вручную, изменяя функцию `main` листинга 15-14 так, как показано в листинге 15-15, мы получим ошибку компилятора: +Если попытаться вызвать способ `drop` сущности `Drop` вручную, изменяя функцию `main` приложения 15-14 так, как показано в приложении 15-15, мы получим ошибку сборщика: Файл: src/main.rs @@ -42,21 +42,21 @@ Rust автоматически вызывал `drop` в момент выход {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-15/src/main.rs:here}} ``` -Листинг 15-15: Попытка вызвать метод drop из трейта Drop вручную для досрочной очистки +Приложение 15-15: Попытка вызвать способ drop из сущности Drop вручную для досрочной очистки -Когда мы попытаемся скомпилировать этот код, мы получим ошибку: +Когда мы попытаемся собрать эту рукопись, мы получим ошибку: ```console {{#include ../listings/ch15-smart-pointers/listing-15-15/output.txt}} ``` -Это сообщение об ошибке говорит, что мы не можем явно вызывать `drop`. В сообщении об ошибке используется термин *деструктор (destructor)*, который является общим термином программирования для функции, которая очищает экземпляр. *Деструктор* аналогичен *конструктору*, который создаёт экземпляр. Функция `drop` в Rust является определённым деструктором. +Это сообщение об ошибке говорит, что мы не можем явно вызывать `drop`. В сообщении об ошибке используется понятие *уничтожитель (destructor)*, который является общим понятием программирования для функции, которая очищает образец данных. *Уничтожитель* подобен *строителю*, который создаёт образец данных. Функция `drop` в Ржавчине является определённым уничтожителем. -Rust не позволяет обращаться к `drop` напрямую, потому что он все равно автоматически вызовет `drop` в конце `main`. Это вызвало бы ошибку *double free*, потому что в этом случае Rust попытался бы дважды очистить одно и то же значение. +Ржавчина не позволяет обращаться к `drop` напрямую, потому что он все равно самостоятельно вызовет `drop` в конце `main`. Это вызвало бы ошибку *double free*, потому что в этом случае Ржавчина попытался бы дважды очистить одно и то же значение. -Невозможно отключить автоматическую подстановку вызова `drop`, когда значение выходит из области видимости, и нельзя вызвать метод `drop` напрямую. Поэтому, если нам нужно принудительно избавиться от значения раньше времени, следует использовать функцию `std::mem::drop`. +Невозможно отключить самостоятельную подстановку вызова `drop`, когда значение выходит из области видимости, и нельзя вызвать способ `drop` напрямую. Поэтому, если нам нужно принудительно избавиться от значения раньше времени, следует использовать функцию `std::mem::drop`. -Функция `std::mem::drop` отличается от метода `drop` трейта `Drop`. Мы вызываем её, передавая в качестве аргумента значение, которое хотим принудительно уничтожить. Функция находится в прелюдии, поэтому мы можем изменить `main` в листинге 15-15 так, чтобы вызвать функцию `drop`, как показано в листинге 15-16: +Функция `std::mem::drop` отличается от способа `drop` сущности `Drop`. Мы вызываем её, передавая в качестве переменной значение, которое хотим принудительно уничтожить. Функция находится во встроенном наборе, поэтому мы можем изменить `main` в приложении 15-15 так, чтобы вызвать функцию `drop`, как показано в приложении 15-16: Файл: src/main.rs @@ -64,18 +64,18 @@ Rust не позволяет обращаться к `drop` напрямую, п {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-16/src/main.rs:here}} ``` -Листинг 15-16: Вызов std::mem::drop для принудительного удаления значения до того, как оно выйдет из области видимости +Приложение 15-16: Вызов std::mem::drop для принудительного удаления значения до того, как оно выйдет из области видимости -Выполнение данного кода выведет следующий результат:: +Выполнение данной рукописи выведет следующий итог:: ```console {{#include ../listings/ch15-smart-pointers/listing-15-16/output.txt}} ``` -Текст `Dropping CustomSmartPointer with data `some data`!`, напечатанный между `CustomSmartPointer created.` и текстом `CustomSmartPointer dropped before the end of main.`, показывает, что код метода `drop` вызывается для удаления `c` в этой точке. +Текст `Dropping CustomSmartPointer with data `some data`!`, выведенный между `CustomSmartPointer created.` и писанием `CustomSmartPointer dropped before the end of main.`, показывает, что рукопись способа `drop` вызывается для удаления `c` в этой точке. -Вы можете использовать код, указанный в реализации типажа `Drop`, чтобы сделать очистку удобной и безопасной: например, вы можете использовать её для создания своего собственного менеджера памяти! С помощью типажа `Drop` и системы владения Rust не нужно специально заботиться о том, чтобы освобождать ресурсы, потому что Rust делает это автоматически. +Вы можете использовать рукопись, указанную в выполнении сущности `Drop`, чтобы сделать очистку удобной и безопасной: например, вы можете использовать её для создания своего собственного управленца памяти! С помощью сущности `Drop` и системы владения Ржавчины не нужно целенаправленно заботиться о том, чтобы освобождать мощности, потому что Ржавчина делает это самостоятельно . -Также не нужно беспокоиться о проблемах, возникающих в результате случайной очистки значений, которые всё ещё используются: система владения, которая гарантирует, что ссылки всегда действительны, также гарантирует, что `drop` вызывается только один раз, когда значение больше не используется. +Также не нужно беспокоиться о неполадках, возникающих в итоге случайной очистки значений, которые всё ещё используются: устройство управления владением, которое заверяет, что ссылки всегда действительны, также заверяет, что `drop` вызывается только один раз, когда значение больше не используется. -После того, как мы познакомились с `Box` и характеристиками умных указателей, познакомимся с другими умными указателями, определёнными в стандартной библиотеке. +После того, как мы познакомились с `Box` и свойствами умных указателей, познакомимся с другими умными указателями, определёнными во встроенной библиотеке. diff --git a/rustbook-ru/src/ch15-04-rc.md b/rustbook-ru/src/ch15-04-rc.md index 393704658..7a325abca 100644 --- a/rustbook-ru/src/ch15-04-rc.md +++ b/rustbook-ru/src/ch15-04-rc.md @@ -1,18 +1,18 @@ ## `Rc`, умный указатель с подсчётом ссылок -В большинстве ситуаций владение является однозначным: вы точно знаете, какая переменная владеет данным значением. Однако бывают случаи, когда у одного значения может быть несколько владельцев. Например, в Графовых структурах может быть несколько рёбер, указывающих на один и тот же узел — таким образом, этот узел становится фактически собственностью всех этих рёбер. Узел не подлежит удалению, за исключением тех случаев, когда на него не указывает ни одно ребро и, соответственно, у него нет владельцев. +В большинстве случаев владение является однозначным: вы точно знаете, какая переменная владеет данным значением. Однако бывают случаи, когда у одного значения может быть несколько владельцев. Например, в Графовых видах данных может быть несколько рёбер, указывающих на один и тот же узел — таким образом, этот узел становится в действительности собственностью всех этих рёбер. Узел не подлежит удалению, за исключением тех случаев, когда на него не указывает ни одно ребро и, соответственно, у него нет владельцев. -Вы должны включить множественное владение явно, используя тип Rust `Rc`, который является аббревиатурой для *подсчёта ссылок*. Тип `Rc` отслеживает количество ссылок на значение, чтобы определить, используется ли оно ещё. Если ссылок на значение нет, значение может быть очищено и при этом ни одна ссылка не станет недействительной. +Вы должны включить множественное владение явно, используя вид данных Ржавчины `Rc`, которое является условным обозначением для *подсчёта ссылок*. Вид данных `Rc` отслеживает количество ссылок на значение, чтобы определить, используется ли оно ещё. Если ссылок на значение нет, значение может быть очищено и при этом ни одна ссылка не станет недействительной. Представьте себе `Rc` как телевизор в гостиной. Когда один человек входит, чтобы смотреть телевизор, он включает его. Другие могут войти в комнату и посмотреть телевизор. Когда последний человек покидает комнату, он выключает телевизор, потому что он больше не используется. Если кто-то выключит телевизор во время его просмотра другими, то оставшиеся телезрители устроят шум! -Тип `Rc` используется, когда мы хотим разместить в куче некоторые данные для чтения несколькими частями нашей программы и не можем определить во время компиляции, какая из частей завершит использование данных последней. Если бы мы знали, какая часть завершит использование последней то, мы могли бы сделать эту часть владельцем данных и вступили бы в силу обычные правила владения, применяемые во время компиляции. +Вид данных `Rc` используется, когда мы хотим разместить в куче некоторые данные для чтения несколькими частями нашей программы и не можем определить во время сборки, какая из частей завершит использование данных последней. Если бы мы знали, какая часть завершит использование последней то, мы могли бы сделать эту часть владельцем данных и вступили бы в силу обычные правила владения, применяемые во время сборки. -Обратите внимание, что `Rc` используется только в однопоточных сценариях. Когда мы обсудим конкурентность в главе 16, мы рассмотрим, как выполнять подсчёт ссылок во многопоточных программах. +Обратите внимание, что `Rc` используется только в однопоточных задумках. Когда мы обсудим состязательность в главе 16, мы рассмотрим, как выполнять подсчёт ссылок во многопоточных программах. ### Использование `Rc` для совместного использования данных -Давайте вернёмся к нашему примеру с cons списком в листинге 15-5. Напомним, что мы определили его с помощью типа `Box`. В этот раз мы создадим два списка, оба из которых будут владеть третьим списком. Концептуально это похоже на рисунок 15-3: +Давайте вернёмся к нашему примеру с cons списком в приложении 15-5. Напомним, что мы определили его с помощью способа `Box`. В этот раз мы создадим два списка, оба из которых будут владеть третьим списком. Мировозренческо это похоже на рисунок 15-3: Two lists that share ownership of a third list @@ -20,7 +20,7 @@ Мы создадим список `a`, содержащий 5 и затем 10. Затем мы создадим ещё два списка: `b` начинающийся с 3 и `c` начинающийся с 4. Оба списка `b` и `c` затем продолжать первый список `a`, содержащий 5 и 10. Другими словами, оба списка будут разделять первый список, содержащий 5 и 10. -Попытка реализовать этот сценарий, используя определение `List` с типом `Box` не будет работать, как показано в листинге 15-17: +Попытка выполнить эту задумку, используя определение `List` с видом данных `Box` не будет работать, как показано в приложении 15-17: Файл: src/main.rs @@ -28,19 +28,19 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-17/src/main.rs}} ``` -Листинг 15-17: Демонстрация того, что нельзя иметь два списка, использующих Box<T>, которые пытаются совместно владеть третьим списком +Приложение 15-17: Отображение того, что нельзя иметь два списка, использующих Box<T>, которые пытаются совместно владеть третьим списком -При компиляции этого кода, мы получаем эту ошибку: +При сборке этой рукописи, мы получаем эту ошибку: ```console {{#include ../listings/ch15-smart-pointers/listing-15-17/output.txt}} ``` -Варианты `Cons` владеют данными, которые они содержат, поэтому, когда мы создаём список `b`, то `a` перемещается в `b`, а `b` становится владельцем `a`. Затем, мы пытаемся использовать `a` снова при создании `c`, но нам не разрешают, потому что `a` был перемещён. +Исходы `Cons` владеют данными, которые они содержат, поэтому, когда мы создаём список `b`, то `a` перемещается в `b`, а `b` становится владельцем `a`. Затем, мы пытаемся использовать `a` снова при создании `c`, но нам не разрешают, потому что `a` был перемещён. -Мы могли бы изменить определение `Cons`, чтобы вместо этого хранить ссылки, но тогда нам пришлось бы указывать параметры времени жизни. Указывая параметры времени жизни, мы бы указали, что каждый элемент в списке будет жить как минимум столько же, сколько и весь список. Это относится к элементам и спискам в листинге 15.17, но не во всех сценариях. +Мы могли бы изменить определение `Cons`, чтобы вместо этого хранить ссылки, но тогда нам пришлось бы указывать свойства времени жизни. Указывая свойства времени жизни, мы бы указали, что каждая переменная в списке будет жить как самое меньшее столько же, сколько и весь список. Это относится к переменным и спискам в приложении 15.17, но не во всех задумках. -Вместо этого мы изменим наше определение типа `List` так, чтобы использовать `Rc` вместо `Box`, как показано в листинге 15-18. Каждый вариант `Cons` теперь будет содержать значение и тип `Rc`, указывающий на `List`. Когда мы создадим `b` то, вместо того чтобы стал владельцем `a`, мы будем клонировать `Rc` который содержит `a`, тем самым увеличивая количество ссылок с единицы до двойки и позволяя переменным `a` и `b` разделять владение на данные в типе `Rc`. Мы также клонируем `a` при создании `c`, увеличивая количество ссылок с двух до трёх. Каждый раз, когда мы вызываем `Rc::clone`, счётчик ссылок на данные внутри `Rc` будет увеличиваться и данные не будут очищены, если на них нет нулевых ссылок. +Вместо этого мы изменим наше определение вида данных `List` так, чтобы использовать `Rc` вместо `Box`, как показано в приложении 15-18. Каждый исход `Cons` теперь будет содержать значение и вид данных `Rc`, указывающий на `List`. Когда мы создадим `b` то, вместо того чтобы стал владельцем `a`, мы будем удваивать `Rc` который содержит `a`, тем самым увеличивая количество ссылок с единицы до двойки и позволяя переменным `a` и `b` разделять владение на данные в виде данных `Rc`. Мы также удвоим `a` при создании `c`, увеличивая количество ссылок с двух до трёх. Каждый раз, когда мы вызываем `Rc::clone`, счётчик ссылок на данные внутри `Rc` будет увеличиваться и данные не будут очищены, если на них нет пустых ссылок. Файл: src/main.rs @@ -48,17 +48,17 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-18/src/main.rs}} ``` -Листинг 15-18: Определение List, использующее Rc<T> +Приложение 15-18: Определение List, использующее Rc<T> -Нам нужно добавить инструкцию `use`, чтобы подключить тип `Rc` в область видимости, потому что он не входит в список автоматического импорта прелюдии. В `main`, мы создаём список владеющий 5 и 10, сохраняем его в новом `Rc` переменной `a`. Затем при создании `b` и `c`, мы называем функцию `Rc::clone` и передаём ей ссылку на `Rc` как аргумент `a`. +Нам нужно добавить указанию `use`, чтобы подключить вид данных `Rc` в область видимости, потому что он не входит в список самостоятельного подключения встроенного набора. В `main`, мы создаём список владеющий 5 и 10, сохраняем его в новом `Rc` переменной `a`. Затем при создании `b` и `c`, мы называем функцию `Rc::clone` и передаём ей ссылку на `Rc` как переменная `a`. -Мы могли бы вызвать `a.clone()`, а не `Rc::clone(&a)`, но в Rust принято использовать `Rc::clone` в таком случае. Внутренняя реализация `Rc::clone` не делает глубокого копирования всех данных, как это происходит в типах большинства реализаций `clone`. Вызов `Rc::clone` только увеличивает счётчик ссылок, что не занимает много времени. Глубокое копирование данных может занимать много времени. Используя `Rc::clone` для подсчёта ссылок, можно визуально различать виды клонирования с глубоким копированием и клонирования, которые увеличивают количество ссылок. При поиске в коде проблем с производительностью нужно рассмотреть только клонирование с глубоким копированием и игнорировать вызовы `Rc::clone` . +Мы могли бы вызвать `a.clone()`, а не `Rc::clone(&a)`, но в Ржавчине принято использовать `Rc::clone` в таком случае. Внутреннее использование `Rc::clone` не делает глубокого повторения всех данных, как это происходит в видах данных большинства выполнений `clone`. Вызов `Rc::clone` только увеличивает счётчик ссылок, что не занимает много времени. Глубокое повторение данных может занимать много времени. Используя `Rc::clone` для подсчёта ссылок, можно внешне различать виды удваивания с глубоким повторением и удваивания, которые увеличивают количество ссылок. При поиске в рукописи неполадок с производительностью нужно рассмотреть только удваивание с глубоким повторением и пренебрегать вызовы `Rc::clone` . -### Клонирование `Rc` увеличивает количество ссылок +### Удваивание `Rc` увеличивает количество ссылок -Давайте изменим рабочий пример в листинге 15-18, чтобы увидеть как изменяется число ссылок при создании и удалении ссылок на `Rc` внутри переменной `a`. +Давайте изменим рабочий пример в приложении 15-18, чтобы увидеть как изменяется число ссылок при создании и удалении ссылок на `Rc` внутри переменной `a`. -В листинге 15-19 мы изменим `main` так, чтобы она имела внутреннюю область видимости вокруг списка `c`; тогда мы сможем увидеть, как меняется счётчик ссылок при выходе `c` из внутренней области видимости. +В приложении 15-19 мы изменим `main` так, чтобы она имела внутреннюю область видимости вокруг списка `c`; тогда мы сможем увидеть, как меняется счётчик ссылок при выходе `c` из внутренней области видимости. Файл: src/main.rs @@ -66,20 +66,20 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-19/src/main.rs:here}} ``` -Листинг 15-19: Печать количества ссылок +Приложение 15-19: вывод количества ссылок -В каждой части программы, где количество ссылок меняется, мы выводим количество ссылок, которое получаем, вызывая функцию `Rc::strong_count`. Эта функция названа `strong_count`, а не `count`, потому что тип `Rc` также имеет `weak_count`; мы увидим, для чего используется `weak_count` в разделе "Предотвращение циклических ссылок: Превращение `Rc` в Weak<T>". +В каждой части программы, где количество ссылок меняется, мы выводим количество ссылок, которое получаем, вызывая функцию `Rc::strong_count`. Эта функция названа `strong_count`, а не `count`, потому что вид данных `Rc` также имеет `weak_count`; мы увидим, для чего используется `weak_count` в разделе "Предотвращение замкнутых ссылок: Превращение `Rc` в Weak<T>". -Код выводит в консоль: +Рукопись выводит в окно вывода: ```console {{#include ../listings/ch15-smart-pointers/listing-15-19/output.txt}} ``` -Можно увидеть, что `Rc` в переменной `a` имеет начальный счётчик ссылок равный 1; затем каждый раз при вызове `clone` счётчик увеличивается на 1. Когда `c` выходит из области видимости, счётчик уменьшается на 1. Нам не нужно вызывать функцию уменьшения счётчика ссылок, как при вызове `Rc::clone` для увеличения счётчика ссылок: реализация `Drop` автоматически уменьшает счётчик ссылок, когда значение `Rc` выходит из области видимости. +Можно увидеть, что `Rc` в переменной `a` имеет начальный счётчик ссылок равный 1; затем каждый раз при вызове `clone` счётчик увеличивается на 1. Когда `c` выходит из области видимости, счётчик уменьшается на 1. Нам не нужно вызывать функцию уменьшения счётчика ссылок, как при вызове `Rc::clone` для увеличения счётчика ссылок: использование `Drop` самостоятельно уменьшает счётчик ссылок, когда значение `Rc` выходит из области видимости. -В этом примере мы не наблюдаем того, что когда `b`, а затем `a` выходят из области видимости в конце `main`, счётчик становится равным 0, и `Rc` полностью очищается. Использование `Rc` позволяет одному значению иметь несколько владельцев, а счётчик гарантирует, что значение остаётся действительным до тех пор, пока любой из владельцев ещё существует. +В этом примере мы не наблюдаем того, что когда `b`, а затем `a` выходят из области видимости в конце `main`, счётчик становится равным 0, и `Rc` полностью очищается. Использование `Rc` позволяет одному значению иметь несколько владельцев, а счётчик заверяет, что значение остаётся действительным до тех пор, пока любой из владельцев ещё существует. -С помощью неизменяемых ссылок, тип `Rc` позволяет обмениваться данными между несколькими частями вашей программы только для чтения данных. Если тип `Rc` позволял бы иметь несколько изменяемых ссылок, вы могли бы нарушить одно из правил заимствования, описанных в главе 4: множественные изменяемые заимствования в одном и том же месте могут вызвать гонки данных (data races) и несогласованность данных. Но возможность изменять данные очень полезна! В следующем разделе мы обсудим шаблон внутренней изменчивости и тип `RefCell`, который можно использовать вместе с `Rc` для работы с этим ограничением. +С помощью неизменяемых ссылок, вид данных `Rc` позволяет обмениваться данными между несколькими частями вашей программы только для чтения данных. Если вид данных `Rc` позволял бы иметь несколько изменяемых ссылок, вы могли бы нарушить одно из правил заимствования, описанных в главе 4: множественные изменяемые заимствования в одном и том же месте могут вызвать гонки данных (data races) и несогласованность данных. Но возможность изменять данные очень полезна! В следующем разделе мы обсудим образец данных внутренней изменчивости и вид данных `RefCell`, который можно использовать вместе с `Rc` для работы с этим ограничением. diff --git a/rustbook-ru/src/ch15-05-interior-mutability.md b/rustbook-ru/src/ch15-05-interior-mutability.md index 0a24c367c..a73965d8b 100644 --- a/rustbook-ru/src/ch15-05-interior-mutability.md +++ b/rustbook-ru/src/ch15-05-interior-mutability.md @@ -1,63 +1,63 @@ -## `RefCell` и шаблон внутренней изменяемости +## `RefCell` и образец данных внутренней изменяемости -*Внутренняя изменяемость* - это паттерн проектирования Rust, который позволяет вам изменять данные даже при наличии неизменяемых ссылок на эти данные; обычно такое действие запрещено правилами заимствования. Для изменения данных паттерн использует `unsafe` код внутри структуры данных, чтобы обойти обычные правила Rust, регулирующие изменяемость и заимствование. Небезопасный (unsafe) код даёт понять компилятору, что мы самостоятельно следим за соблюдением этих правил, а не полагаемся на то, что компилятор будет делать это для нас; подробнее о небезопасном коде мы поговорим в главе 19. +*Внутренняя изменяемость* - это образец разработки Ржавчина, который позволяет вам изменять данные даже при наличии неизменяемых ссылок на эти данные; обычно такое действие запрещено правилами заимствования. Для изменения данных образец использует `unsafe` рукопись внутри вида данных, чтобы обойти обычные правила Ржавчины управляющие изменчивостью и заимствование. Небезопасная (unsafe) рукопись даёт понять сборщику, что мы самостоятельно следим за соблюдением этих правил, а не полагаемся на то, что сборщик будет делать это для нас; подробнее о небезопасной рукописи мы поговорим в главе 19. -Мы можем использовать типы, в которых применяется паттерн внутренней изменяемости, только если мы можем гарантировать, что правила заимствования будут соблюдаться во время выполнения, несмотря на то, что компилятор не сможет этого гарантировать. В этом случае `небезопасный` код оборачивается безопасным API, и внешне тип остаётся неизменяемым. +Мы можем использовать виды данных, в которых применяется образец внутренней изменяемости, только если мы можем обеспечить, что правила заимствования будут соблюдаться во время выполнения, несмотря на то, что сборщик не сможет этого обеспечить. В этом случае `небезопасный` рукопись оборачивается безопасным API, и внешне вид остаётся неизменяемым. -Давайте изучим данную концепцию с помощью типа данных `RefCell`, который реализует этот шаблон. +Давайте изучим данную подход с помощью способа данных `RefCell`, который использует этот образец. ### Применение правил заимствования во время выполнения с помощью `RefCell` -В отличие от `Rc` тип `RefCell` предоставляет единоличное владение данными, которые он содержит. В чем же отличие типа `RefCell` от `Box`? Давайте вспомним правила заимствования из Главы 4: +В отличие от `Rc` вид данных `RefCell` предоставляет единоличное владение данными, которые он содержит. В чем же отличие вида данных `RefCell` от `Box`? Давайте вспомним правила заимствования из Главы 4: -- В любой момент времени вы можете иметь *либо* одну изменяемую ссылку либо сколько угодно неизменяемых ссылок (но не оба типа ссылок одновременно). +- В этот подход времени вы можете иметь *либо* одну изменяемую ссылку либо сколько угодно неизменяемых ссылок (но не оба вида ссылок одновременно). - Ссылки всегда должны быть действительными. -С помощью ссылок и типа `Box` инварианты правил заимствования применяются на этапе компиляции. С помощью `RefCell` они применяются *во время работы программы*. Если вы нарушите эти правила, работая с ссылками, то будет ошибка компиляции. Если вы работаете с `RefCell` и нарушите эти правила, то программа вызовет панику и завершится. +С помощью ссылок и вида данных `Box` неизменные величины правил заимствования применяются на этапе сборки. С помощью `RefCell` они применяются *во время работы программы*. Если вы нарушите эти правила, работая с ссылками, то будет ошибка сборки. Если вы работаете с `RefCell` и нарушите эти правила, то программа вызовет сбой и завершится. -Преимущества проверки правил заимствования во время компиляции заключаются в том, что ошибки будут обнаруживаться раньше - ещё в процессе разработки, а производительность во время выполнения не пострадает, поскольку весь анализ завершён заранее. По этим причинам проверка правил заимствования во время компиляции является лучшим выбором в большинстве случаев, и именно поэтому она используется в Rust по умолчанию. +Преимущества проверки правил заимствования во время сборки заключаются в том, что ошибки будут обнаруживаться раньше - ещё в этапе разработки, а производительность во время выполнения не пострадает, поскольку весь оценка завершена заранее. По этим причинам проверка правил заимствования во время сборки является лучшим выбором в большинстве случаев, и именно поэтому она используется в Ржавчине по умолчанию. -Преимущество проверки правил заимствования во время выполнения заключается в том, что определённые сценарии, безопасные для памяти, разрешаются там, где они были бы запрещены проверкой во время компиляции. Статический анализ, как и компилятор Rust, по своей сути консервативен. Некоторые свойства кода невозможно обнаружить, анализируя код: самый известный пример - проблема остановки, которая выходит за рамки этой книги, но является интересной темой для исследования. +Преимущество проверки правил заимствования во время выполнения заключается в том, что определённые задумки, безопасные для памяти, разрешаются там, где они были бы запрещены проверкой во время сборки. Постоянной оценка, как и сборщик Ржавчины по своей сути устоявшийся. Некоторые свойства рукописи невозможно обнаружить, рассмотривая рукопись: самый известный пример - неполадка остановки, которая выходит за рамки этой книги, но является важной темой для исследования. -Поскольку некоторый анализ невозможен, то если компилятор Rust не может быть уверен, что код соответствует правилам владения, он может отклонить корректную программу; таким образом он является консервативным. Если Rust принял некорректную программу, то пользователи не смогут доверять гарантиям, которые даёт Rust. Однако, если Rust отклонит корректную программу, то программист будет испытывать неудобства, но ничего катастрофического не произойдёт. Тип `RefCell` полезен, когда вы уверены, что ваш код соответствует правилам заимствования, но компилятор не может понять и гарантировать этого. +Поскольку некоторый оценка невозможен, то если сборщик Ржавчины не может быть уверен, что рукопись соответствует правилам владения, он может отклонить правильную программу; таким образом он является консервативным. Если Ржавчина приняла неправильную программу, то пользователи не смогут доверять заверениям, которые даёт Ржавчина. Однако, если Ржавчина отклонит правильную программу, то программист будет испытывать неудобства, но ничего катастрофического не произойдёт. Вид данных `RefCell` полезен, когда вы уверены, что Ваша рукопись соответствует правилам заимствования, но сборщик не может понять и обеспечить этого. -Подобно типу `Rc`, тип `RefCell` предназначен только для использования в однопоточных сценариях и выдаст ошибку времени компиляции, если вы попытаетесь использовать его в многопоточном контексте. Мы поговорим о том, как получить функциональность `RefCell` во многопоточной программе в главе 16. +Подобно виду данных `Rc`, вид `RefCell` предназначен только для использования в однопоточных задумках и выдаст ошибку времени сборки, если вы попытаетесь использовать его в многопоточном среде. Мы поговорим о том, как получить возможность `RefCell` во многопоточной программе в главе 16. -Вот список причин выбора типов `Box`, `Rc` или `RefCell`: +Вот список причин выбора видов данных `Box`, `Rc` или `RefCell`: -- Тип `Rc` разрешает множественное владение одними и теми же данными; типы `Box` и `RefCell` разрешают иметь единственных владельцев. -- Тип `Box` разрешает неизменяемые или изменяемые владения, проверенные при компиляции; тип `Rc` разрешает только неизменяемые владения, проверенные при компиляции; тип `RefCell` разрешает неизменяемые или изменяемые владения, проверенные во время выполнения. +- Вид данных `Rc` разрешает множественное владение одними и теми же данными; виды данных `Box` и `RefCell` разрешают иметь единственных владельцев. +- Вид данных `Box` разрешает неизменяемые или изменяемые владения, проверенные при сборке; вид данных `Rc` разрешает только неизменяемые владения, проверенные при сборке; вид данных `RefCell` разрешает неизменяемые или изменяемые владения, проверенные во время выполнения. - Поскольку `RefCell` разрешает изменяемые заимствования, проверенные во время выполнения, можно изменять значение внутри `RefCell` даже если `RefCell` является неизменным. -Изменение значения внутри неизменного значения является шаблоном *внутренней изменяемости* (interior mutability). Давайте посмотрим на ситуацию, в которой внутренняя изменяемость полезна и рассмотрим, как это возможно. +Изменение значения внутри неизменного значения является образцом *внутренней изменяемости* (interior mutability). Давайте посмотрим на случай, в котором внутренняя изменяемость полезна и рассмотрим, как это возможно. ### Внутренняя изменяемость: изменяемое заимствование неизменяемого значения -Следствием правил заимствования является то, что когда у вас есть неизменяемое значение, вы не можете заимствовать его с изменением. Например, этот код не будет компилироваться: +Следствием правил заимствования является то, что когда у вас есть неизменяемое значение, вы не можете заимствовать его с изменением. Например, эта рукопись не будет собираться: ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/src/main.rs}} ``` -Если вы попытаетесь скомпилировать этот код, вы получите следующую ошибку: +Если вы попытаетесь собрать эту рукопись, вы получите следующую ошибку: ```console {{#include ../listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt}} ``` -Однако бывают ситуации, в которых было бы полезно, чтобы объект мог изменять себя при помощи своих методов, но казался неизменным для прочего кода. Код вне методов этого объекта не должен иметь возможности изменять его содержимое. Использование `RefCell` - один из способов получить возможность внутренней изменяемости, но при этом `RefCell` не позволяет полностью обойти правила заимствования: средство проверки правил заимствования в компиляторе позволяет эту внутреннюю изменяемость, однако правила заимствования проверяются во время выполнения. Если вы нарушите правила, то вместо ошибки компиляции вы получите `panic!`. +Однако бывают случаи, в которых было бы полезно, чтобы предмет мог изменять себя при помощи своих способов, но казался неизменным для прочего рукописи. Рукопись вне способов этого предмета не должна иметь возможности изменять его содержимое. Использование `RefCell` - один из способов получить возможность внутренней изменяемости, но при этом `RefCell` не позволяет полностью обойти правила заимствования: средство проверки правил заимствования в сборщике позволяет эту внутреннюю изменчивость, однако правила заимствования проверяются во время выполнения. Если вы нарушите правила, то вместо ошибки сборки вы получите `panic!`. -Давайте разберём практический пример, в котором мы можем использовать `RefCell` для изменения неизменяемого значения и посмотрим, почему это полезно. +Давайте разберём опытный пример, в котором мы можем использовать `RefCell` для изменения неизменяемого значения и посмотрим, почему это полезно. -#### Вариант использования внутренней изменяемости: мок объекты +#### Исход использования внутренней изменяемости: мок предметы -Иногда во время тестирования программист использует один тип вместо другого для того, чтобы проверить определённое поведение и убедиться, что оно реализовано правильно. Такой тип-заместитель называется *тестовым дублёром*. Воспринимайте его как «каскадёра» в кинематографе, когда дублёр заменяет актёра для выполнения определённой сложной сцены. Тестовые дублёры заменяют другие типы при выполнении тестов. *Инсценировочные (mock) объекты* — это особый тип тестовых дублёров, которые сохраняют данные происходящих во время теста действий тем самым позволяя вам убедиться впоследствии, что все действия были выполнены правильно. +Иногда во время проверки программист использует один вид данных вместо другого для того, чтобы проверить определённое поведение и убедиться, что оно выполнено правильно. Такой вид данных-заместитель называется *проверочным повторителем*. Воспринимайте его как «каскадёра» в кинематографе, когда повторитель заменяет актёра для выполнения определённой сложной сцены. Проверочные повторители заменяют другие виды данных при выполнении проверок. *Инсценировочные (mock) предметы* — это особый вид данных проверочных повторителей, которые сохраняют данные происходящих во время проверки действий тем самым позволяя вам убедиться впоследствии, что все действия были выполнены правильно. -В Rust нет объектов в том же смысле, в каком они есть в других языках и в Rust нет функциональности мок объектов, встроенных в стандартную библиотеку, как в некоторых других языках. Однако вы определённо можете создать структуру, которая будет служить тем же целям, что и мок объект. +В Ржавчине нет предметов в том же смысле, в каком они есть в других языках и в Ржавчине нет возможности мок предметов, встроенных во встроенную библиотеку, как в некоторых других языках. Однако вы определённо можете создать устройство, которое будет служить тем же целям, что и мок предмет. -Вот сценарий, который мы будем тестировать: мы создадим библиотеку, которая отслеживает значение по отношению к заранее определённому максимальному значению и отправляет сообщения в зависимости от того, насколько текущее значение находится близко к такому максимальному значению. Эта библиотека может использоваться, например, для отслеживания квоты количества вызовов API пользователя, которые ему разрешено делать. +Вот задумка, которую мы будем проверять: мы создадим библиотеку, которая отслеживает значение по отношению к заранее определённому наивысшему значению и отправляет сообщения в зависимости от того, насколько текущее значение находится близко к такому наивысшему значению. Эта библиотека может использоваться, например, для отслеживания квоты количества вызовов API пользователя, которые ему разрешено делать. -Наша библиотека будет предоставлять только функции отслеживания того, насколько близко к максимальному значению находится значение и какие сообщения должны быть внутри в этот момент. Ожидается, что приложения, использующие нашу библиотеку, предоставят механизм для отправки сообщений: приложение может поместить сообщение в приложение, отправить электронное письмо, отправить текстовое сообщение или что-то ещё. Библиотеке не нужно знать эту деталь. Все что ему нужно - это что-то, что реализует типаж, который мы предоставим с названием `Messenger`. Листинг 15-20 показывает код библиотеки: +Наша библиотека будет предоставлять только функции отслеживания того, насколько близко к наивысшему значению находится значение и какие сообщения должны быть внутри в это мгновение. Ожидается, что приложения, использующие нашу библиотеку, предоставят рычаг для отправки сообщений: приложение может поместить сообщение в приложение, отправить электронное письмо, отправить письменное сообщение или что-то ещё. Библиотеке не нужно знать эту подробность. Все что ему нужно - это что-то, что использует сущность, который мы предоставим с названием `Messenger`. Приложение 15-20 показывает рукопись библиотеки: Файл: src/lib.rs @@ -65,11 +65,11 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-20/src/lib.rs}} ``` -Листинг 15-20: Библиотека для отслеживания степени приближения того или иного значения к максимально допустимой величине и предупреждения, в случае если значение достигает определённого уровня +Приложение 15-20: Библиотека для отслеживания степени приближения того или иного значения к наиболее допустимой величине и предупреждения, в случае если значение достигает определённого уровня -Одна важная часть этого кода состоит в том, что типаж `Messenger` имеет один метод `send`, принимающий аргументами неизменяемую ссылку на `self` и текст сообщения. Он является интерфейсом, который должен иметь наш мок объект. Другой важной частью является то, что мы хотим проверить поведение метода `set_value` у типа `LimitTracker`. Мы можем изменить значение, которое передаём параметром `value`, но `set_value` ничего не возвращает и нет основания, чтобы мы могли бы проверить утверждения о выполнении метода. Мы хотим иметь возможность сказать, что если мы создаём `LimitTracker` с чем-то, что реализует типаж `Messenger` и с определённым значением для `max`, то когда мы передаём разные числа в переменной `value` экземпляр self.messenger отправляет соответствующие сообщения. +Одна важная часть этой рукописи состоит в том, что сущность `Messenger` имеет один способ `send`, принимающий переменными неизменяемую ссылку на `self` и писание сообщения. Он является внешней оболочкой, который должен иметь наш мок предмет. Другой важной частью является то, что мы хотим проверить поведение способа `set_value` у вида данных `LimitTracker`. Мы можем изменить значение, которое передаём свойством `value`, но `set_value` ничего не возвращает и нет основания, чтобы мы могли бы проверить утверждения о выполнении способа. Мы хотим иметь возможность сказать, что если мы создаём `LimitTracker` с чем-то, что использует сущность `Messenger` и с определённым значением для `max`, то когда мы передаём разные числа в переменной `value` образец self.messenger отправляет соответствующие сообщения. -Нам нужен мок объект, который вместо отправки электронного письма или текстового сообщения будет отслеживать сообщения, которые были ему поручены для отправки через `send`. Мы можем создать новый экземпляр мок объекта, создать `LimitTracker` с использованием мок объект для него, вызвать метод `set_value` у экземпляра `LimitTracker`, а затем проверить, что мок объект имеет ожидаемое сообщение. В листинге 15-21 показана попытка реализовать мок объект, чтобы сделать именно то что хотим, но анализатор заимствований не разрешит такой код: +Нам нужен мок предмет, который вместо отправки электронного письма или письменного сообщения будет отслеживать сообщения, которые были ему поручены для отправки через `send`. Мы можем создать новый образец мок предмета. создать `LimitTracker` с использованием мок предмет для него, вызвать способ `set_value` у образца данных `LimitTracker`, а затем проверить, что мок предмет имеет ожидаемое сообщение. В приложении 15-21 показана попытка использовать мок предмет, чтобы сделать именно то что хотим, но оценщик заимствований не разрешит такую рукопись: Файл: src/lib.rs @@ -77,21 +77,21 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-21/src/lib.rs:here}} ``` -Листинг 15-21: Попытка реализовать MockMessenger, которая не была принята механизмом проверки заимствований +Приложение 15-21: Попытка выполнить MockMessenger, которая не была принята рычагом проверки заимствований -Этот тестовый код определяет структуру `MockMessenger`, в которой есть поле `sent_messages` со значениями типа `Vec` из `String` для отслеживания сообщений, которые поручены структуре для отправки. Мы также определяем ассоциированную функцию `new`, чтобы было удобно создавать новые экземпляры `MockMessenger`, которые создаются с пустым списком сообщений. Затем мы реализуем типаж `Messenger` для типа `MockMessenger`, чтобы передать `MockMessenger` в `LimitTracker`. В сигнатуре метода `send` мы принимаем сообщение для передачи в качестве параметра и сохраняем его в `MockMessenger` внутри списка `sent_messages`. +Эта проверочная рукопись определяет стопку `MockMessenger`, в которой есть поле `sent_messages` со значениями вида данных `Vec` из `String` для отслеживания сообщений, которые поручены стопке для отправки. Мы также определяем сопряженную функцию `new`, чтобы было удобно создавать новые образцы `MockMessenger`, которые создаются с пустым списком сообщений. Затем мы выполняем сущность `Messenger` для вида данных `MockMessenger`, чтобы передать `MockMessenger` в `LimitTracker`. В ярлыке способа `send` мы принимаем сообщение для передачи в качестве свойства и сохраняем его в `MockMessenger` внутри списка `sent_messages`. -В этом тесте мы проверяем, что происходит, когда `LimitTracker` сказано установить `value` в значение, превышающее 75 процентов от значения `max`. Сначала мы создаём новый `MockMessenger`, который будет иметь пустой список сообщений. Затем мы создаём новый `LimitTracker` и передаём ему ссылку на новый `MockMessenger` и `max` значение равное 100. Мы вызываем метод `set_value` у `LimitTracker` со значением 80, что составляет более 75 процентов от 100. Затем мы с помощью утверждения проверяем, что `MockMessenger` должен содержать одно сообщение из списка внутренних сообщений. +В этом проверке мы проверяем, что происходит, когда `LimitTracker` сказано установить `value` в значение, превышающее 75 процентов от значения `max`. Сначала мы создаём новый `MockMessenger`, который будет иметь пустой список сообщений. Затем мы создаём новый `LimitTracker` и передаём ему ссылку на новый `MockMessenger` и `max` значение равное 100. Мы вызываем способ `set_value` у `LimitTracker` со значением 80, что составляет более 75 процентов от 100. Затем мы с помощью утверждения проверяем, что `MockMessenger` должен содержать одно сообщение из списка внутренних сообщений. -Однако с этим тестом есть одна проблема, показанная ниже: +Однако с этим проверкой есть одна неполадка, показанная ниже: ```console {{#include ../listings/ch15-smart-pointers/listing-15-21/output.txt}} ``` -Мы не можем изменять `MockMessenger` для отслеживания сообщений, потому что метод `send` принимает неизменяемую ссылку на `self`. Мы также не можем принять предложение из текста ошибки, чтобы использовать `&mut self`, потому что тогда сигнатура `send` не будет соответствовать сигнатуре в определении типажа `Messenger` (не стесняйтесь попробовать и посмотреть, какое сообщение об ошибке получите вы). +Мы не можем изменять `MockMessenger` для отслеживания сообщений, потому что способ `send` принимает неизменяемую ссылку на `self`. Мы также не можем принять предложение из писания ошибки, чтобы использовать `&mut self`, потому что тогда ярлык `send` не будет соответствовать ярлыке в определении сущности `Messenger` (не стесняйтесь попробовать и посмотреть, какое сообщение об ошибке получите вы). -Это ситуация, в которой внутренняя изменяемость может помочь! Мы сохраним `sent_messages` внутри типа `RefCell`, а затем в методе `send` сообщение сможет изменить список `sent_messages` для хранения сообщений, которые мы видели. Листинг 15-22 показывает, как это выглядит: +Это случай, в котором внутренняя изменяемость может помочь! Мы сохраним `sent_messages` внутри вида данных `RefCell`, а затем в способе `send` сообщение сможет изменить список `sent_messages` для хранения сообщений, которые мы видели. Приложение 15-22 показывает, как это выглядит: Файл: src/lib.rs @@ -99,23 +99,23 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-22/src/lib.rs:here}} ``` -Листинг 15-22: Использование RefCell<T> для изменения внутреннего значения, в то время как внешнее значение считается неизменяемым +Приложение 15-22: Использование RefCell<T> для изменения внутреннего значения, в то время как внешнее значение считается неизменяемым -Поле `sent_messages` теперь имеет тип `RefCell>` вместо `Vec`. В функции `new` мы создаём новый экземпляр `RefCell>` для пустого вектора. +Поле `sent_messages` теперь имеет вид данных `RefCell>` вместо `Vec`. В функции `new` мы создаём новый образец данных `RefCell>` для пустого вектора. -Для реализации метода `send` первый параметр по-прежнему является неизменяемым для заимствования `self`, которое соответствует определению типажа. Мы вызываем `borrow_mut` для `RefCell>` в `self.sent_messages`, чтобы получить изменяемую ссылку на значение внутри `RefCell>`, которое является вектором. Затем мы можем вызвать `push` у изменяемой ссылки на вектор, чтобы отслеживать сообщения, отправленные во время теста. +Для выполнения способа `send` первое свойство по-прежнему является неизменяемым для заимствования `self`, которое соответствует определению сущности. Мы вызываем `borrow_mut` для `RefCell>` в `self.sent_messages`, чтобы получить изменяемую ссылку на значение внутри `RefCell>`, которое является вектором. Затем мы можем вызвать `push` у изменяемой ссылки на вектор, чтобы отслеживать сообщения, отправленные во время проверки. -Последнее изменение, которое мы должны сделать, заключается в утверждении для проверки: чтобы увидеть, сколько элементов находится во внутреннем векторе, мы вызываем метод `borrow` у `RefCell>`, чтобы получить неизменяемую ссылку на внутренний вектор сообщений. +Последнее изменение, которое мы должны сделать, заключается в утверждении для проверки: чтобы увидеть, сколько переменных находится во внутреннем векторе, мы вызываем способ `borrow` у `RefCell>`, чтобы получить неизменяемую ссылку на внутренний вектор сообщений. Теперь, когда вы увидели как использовать `RefCell`, давайте изучим как он работает! #### Отслеживание заимствований во время выполнения с помощью `RefCell` -При создании неизменных и изменяемых ссылок мы используем синтаксис `&` и `&mut` соответственно. У типа `RefCell`, мы используем методы `borrow` и `borrow_mut`, которые являются частью безопасного API, который принадлежит `RefCell`. Метод `borrow` возвращает тип умного указателя `Ref`, метод `borrow_mut` возвращает тип умного указателя `RefMut`. Оба типа реализуют типаж `Deref`, поэтому мы можем рассматривать их как обычные ссылки. +При создании неизменных и изменяемых ссылок мы используем правила написания `&` и `&mut` соответственно. У вида данных `RefCell`, мы используем способы `borrow` и `borrow_mut`, которые являются частью безопасного API, который принадлежит `RefCell`. Способ `borrow` возвращает вид умного указателя `Ref`, способ `borrow_mut` возвращает вид умного указателя `RefMut`. Оба вида данных используют сущность `Deref`, поэтому мы можем рассматривать их как обычные ссылки. -Тип `RefCell` отслеживает сколько умных указателей `Ref` и `RefMut` активны в данное время. Каждый раз, когда мы вызываем `borrow`, тип `RefCell` увеличивает количество активных заимствований. Когда значение `Ref` выходит из области видимости, то количество неизменяемых заимствований уменьшается на единицу. Как и с правилами заимствования во время компиляции, `RefCell` позволяет иметь много неизменяемых заимствований или одно изменяемое заимствование в любой момент времени. +Вид данных `RefCell` отслеживает сколько умных указателей `Ref` и `RefMut` действительо в данное время. Каждый раз, когда мы вызываем `borrow`, вид данных `RefCell` увеличивает количество действующих заимствований. Когда значение `Ref` выходит из области видимости, то количество неизменяемых заимствований уменьшается на единицу. Как и с правилами заимствования во время сборки, `RefCell` позволяет иметь много неизменяемых заимствований или одно изменяемое заимствование в этот подход времени. -Если попытаться нарушить эти правила, то вместо получения ошибки компилятора, как это было бы со ссылками, реализация `RefCell` будет вызывать панику во время выполнения. В листинге 15-23 показана модификация реализации `send` из листинга 15-22. Мы намеренно пытаемся создать два изменяемых заимствования активных для одной и той же области видимости, чтобы показать как `RefCell` не позволяет нам делать так во время выполнения. +Если попытаться нарушить эти правила, то вместо получения ошибки сборщика, как это было бы со ссылками, использование `RefCell` будет вызывать сбой во время выполнения. В приложении 15-23 показана изменение выполнения `send` из приложения 15-22. Мы намеренно пытаемся создать два изменяемых заимствования действующих для одной и той же области видимости, чтобы показать как `RefCell` не позволяет нам делать так во время выполнения. Файл: src/lib.rs @@ -123,23 +123,23 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-23/src/lib.rs:here}} ``` -Листинг 15-23: Создание двух изменяемых ссылок в одной области видимости, чтобы убедиться, что RefCell<T> вызовет панику +Приложение 15-23: Создание двух изменяемых ссылок в одной области видимости, чтобы убедиться, что RefCell<T> вызовет сбой -Мы создаём переменную `one_borrow` для умного указателя `RefMut` возвращаемого из метода `borrow_mut`. Затем мы создаём другое изменяемое заимствование таким же образом в переменной `two_borrow`. Это создаёт две изменяемые ссылки в одной области видимости, что недопустимо. Когда мы запускаем тесты для нашей библиотеки, код в листинге 15-23 компилируется без ошибок, но тест завершится неудачно: +Мы создаём переменную `one_borrow` для умного указателя `RefMut` возвращаемого из способа `borrow_mut`. Затем мы создаём другое изменяемое заимствование таким же образом в переменной `two_borrow`. Это создаёт две изменяемые ссылки в одной области видимости, что недопустимо. Когда мы запускаем проверки для нашей библиотеки, рукопись в приложении 15-23 собирается без ошибок, но проверка завершится неудачно: ```console {{#include ../listings/ch15-smart-pointers/listing-15-23/output.txt}} ``` -Обратите внимание, что код вызвал панику с сообщением `already borrowed: BorrowMutError`. Вот так тип `RefCell` обрабатывает нарушения правил заимствования во время выполнения. +Обратите внимание, что рукопись вызвал сбой с сообщением `already borrowed: BorrowMutError`. Вот так вид данных `RefCell` обрабатывает нарушения правил заимствования во время выполнения. -Решение отлавливать ошибки заимствования во время выполнения, а не во время компиляции, как мы сделали здесь, означает, что вы потенциально будете находить ошибки в своём коде на более поздних этапах разработки: возможно, не раньше, чем ваш код будет развернут в рабочем окружении. Кроме того, ваш код будет иметь небольшие потери производительности в процессе работы, поскольку заимствования будут отслеживаться во время выполнения, а не во время компиляции. Однако использование `RefCell` позволяет написать объект-имитатор, который способен изменять себя, чтобы сохранять сведения о тех значениях, которые он получал, пока вы использовали его в контексте, где разрешены только неизменяемые значения. Вы можете использовать `RefCell`, несмотря на его недостатки, чтобы получить больше функциональности, чем дают обычные ссылки. +Решение отлавливать ошибки заимствования во время выполнения, а не во время сборки, как мы сделали здесь, означает, что вы возможно будете находить ошибки в своей рукописи на более поздних этапах разработки: возможно, не раньше, чем Ваша рукопись будет развернута в рабочем окружении. Кроме того, Ваша рукопись будет иметь небольшие потери производительности в этапе работы, поскольку заимствования будут отслеживаться во время выполнения, а не во время сборки. Однако использование `RefCell` позволяет написать предмет-имитатор, который способен изменять себя, чтобы сохранять сведения о тех значениях, которые он получал, пока вы использовали его в среде, где разрешены только неизменяемые значения. Вы можете использовать `RefCell`, несмотря на его недостатки, чтобы получить больше возможности, чем дают обычные ссылки. -### Наличие нескольких владельцев изменяемых данных путём объединения типов `Rc` и `RefCell` +### Наличие нескольких владельцев изменяемых данных путём объединения видов данных `Rc` и `RefCell` -Обычный способ использования `RefCell` заключается в его сочетании с типом `Rc`. Напомним, что тип `Rc` позволяет иметь нескольких владельцев некоторых данных, но даёт только неизменяемый доступ к этим данным. Если у вас есть `Rc`, который внутри содержит тип `RefCell`, вы можете получить значение, которое может иметь несколько владельцев *и* которое можно изменять! +Обычный способ использования `RefCell` заключается в его сочетании с видом данных `Rc`. Напомним, что вид данных `Rc` позволяет иметь нескольких владельцев некоторых данных, но даёт только неизменяемый доступ к этим данным. Если у вас есть `Rc`, который внутри содержит вид данных `RefCell`, вы можете получить значение, которое может иметь несколько владельцев *и* которое можно изменять! -Например, вспомните пример cons списка листинга 15-18, где мы использовали `Rc`, чтобы несколько списков могли совместно владеть другим списком. Поскольку `Rc` содержит только неизменяемые значения, мы не можем изменить ни одно из значений в списке после того, как мы их создали. Давайте добавим тип `RefCell`, чтобы получить возможность изменять значения в списках. В листинге 15-24 показано использование `RefCell` в определении `Cons` так, что мы можем изменить значение хранящееся во всех списках: +Например, вспомните пример cons списка приложения 15-18, где мы использовали `Rc`, чтобы несколько списков могли совместно владеть другим списком. Поскольку `Rc` содержит только неизменяемые значения, мы не можем изменить ни одно из значений в списке после того, как мы их создали. Давайте добавим вид данных `RefCell`, чтобы получить возможность изменять значения в списках. В приложении 15-24 показано использование `RefCell` в определении `Cons` так, что мы можем изменить значение хранящееся во всех списках: Файл: src/main.rs @@ -147,21 +147,21 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-24/src/main.rs}} ``` -Листинг 15-24: Использование Rc<RefCell<i32>> для создания List, который мы можем изменять +Приложение 15-24: Использование Rc<RefCell<i32>> для создания List, который мы можем изменять -Мы создаём значение, которое является экземпляром `Rc>` и сохраняем его в переменной с именем `value`, чтобы получить к ней прямой доступ позже. Затем мы создаём `List` в переменной `a` с вариантом `Cons`, который содержит `value`. Нам нужно вызвать клонирование `value`, так как обе переменные `a` и `value` владеют внутренним значением `5`, а не передают владение из `value` в переменную `a` или не выполняют заимствование с помощью `a` переменной `value`. +Мы создаём значение, которое является образцом `Rc>` и сохраняем его в переменной с именем `value`, чтобы получить к ней прямой доступ позже. Затем мы создаём `List` в переменной `a` с исходом `Cons`, который содержит `value`. Нам нужно вызвать удваивание `value`, так как обе переменные `a` и `value` владеют внутренним значением `5`, а не передают владение из `value` в переменную `a` или не выполняют заимствование с помощью `a` переменной `value`. -Мы оборачиваем список у переменной `a` в тип `Rc`, поэтому при создании списков в переменные `b` и `c` они оба могут ссылаться на `a`, что мы и сделали в листинге 15-18. +Мы оборачиваем список у переменной `a` в вид данных `Rc`, поэтому при создании списков в переменные `b` и `c` они оба могут ссылаться на `a`, что мы и сделали в приложении 15-18. -После создания списков `a`, `b` и `c` мы хотим добавить 10 к значению в `value`. Для этого вызовем `borrow_mut` у `value`, который использует функцию автоматического разыменования, о которой мы говорили в главе 5 (см. раздел ["Где находится оператор `->`?"]) во внутреннее значение `RefCell`. Метод `borrow_mut` возвращает умный указатель `RefMut`, и мы используя оператор разыменования, изменяем внутреннее значение. +После создания списков `a`, `b` и `c` мы хотим добавить 10 к значению в `value`. Для этого вызовем `borrow_mut` у `value`, которые используют функцию самостоятельного разыменования, о которой мы говорили в главе 5 (см. раздел ["Где находится приказчик `->`?"]) во внутреннее значение `RefCell`. Способ `borrow_mut` возвращает умный указатель `RefMut`, и мы используя приказчик разыменования, изменяем внутреннее значение. -Когда мы печатаем `a`, `b` и `c` то видим, что все они имеют изменённое значение равное 15, а не 5: +Когда мы выводим `a`, `b` и `c` то видим, что все они имеют изменённое значение равное 15, а не 5: ```console {{#include ../listings/ch15-smart-pointers/listing-15-24/output.txt}} ``` -Эта техника довольно изящна! Используя `RefCell`, мы получаем внешне неизменяемое значение `List`. Но мы можем использовать методы `RefCell`, которые предоставляют доступ к его внутренностям, чтобы мы могли изменять наши данные, когда это необходимо. Проверка правил заимствования во время выполнения защищает нас от гонок данных, и иногда стоит немного пожертвовать производительностью ради такой гибкости наших структур данных. Обратите внимание, что `RefCell` не работает для многопоточного кода! `Mutex` - это thread-safe версия `RefCell`, а `Mutex` мы обсудим в главе 16. +Эта техника довольно изящна! Используя `RefCell`, мы получаем внешне неизменяемое значение `List`. Но мы можем использовать способы `RefCell`, которые предоставляют доступ к его внутренностям, чтобы мы могли изменять наши данные, когда это необходимо. Проверка правил заимствования во время выполнения защищает нас от гонок данных, и иногда стоит немного пожертвовать производительностью ради такой гибкости наших стопок данных. Обратите внимание, что `RefCell` не работает для многопоточного рукописи! `Mutex` - это thread-safe исполнение `RefCell`, а `Mutex` мы обсудим в главе 16. -["Где находится оператор `->`?"]: ch05-03-method-syntax.html#wheres-the---operator \ No newline at end of file +["Где находится приказчик `->`?"]: ch05-03-method-syntax.html#wheres-the---operator \ No newline at end of file diff --git a/rustbook-ru/src/ch15-06-reference-cycles.md b/rustbook-ru/src/ch15-06-reference-cycles.md index 606a3fad5..457964b22 100644 --- a/rustbook-ru/src/ch15-06-reference-cycles.md +++ b/rustbook-ru/src/ch15-06-reference-cycles.md @@ -1,10 +1,10 @@ -## Ссылочные зацикливания могут приводить к утечке памяти +## Ссылочные замыкания могут приводить к утечке памяти -Гарантии безопасности памяти в Rust затрудняют, но не делают невозможным случайное выделение памяти, которое никогда не очищается (известное как *утечка памяти* ). Полное предотвращение утечек памяти не является одной из гарантий Rust, а это означает, что утечки памяти безопасны в Rust. Мы видим, что Rust допускает утечку памяти с помощью `Rc` и `RefCell`: можно создавать ссылки, в которых элементы ссылаются друг на друга в цикле. Это создаёт утечки памяти, потому что счётчик ссылок каждого элемента в цикле никогда не достигнет 0, а значения никогда не будут удалены. +Заверения безопасности памяти в Ржавчине затрудняют, но не делают невозможным случайное выделение памяти, которое никогда не очищается (известное как *утечка памяти* ). Полное предотвращение утечек памяти не является одной из заверений Ржавчина, а это означает, что утечки памяти безопасны в Ржавчине. Мы видим, что Ржавчина допускает утечку памяти с помощью `Rc` и `RefCell`: можно создавать ссылки, в которых переменные ссылаются друг на друга в круговороте. Это создаёт утечки памяти, потому что счётчик ссылок каждой переменной в круговороте никогда не достигнет 0, а значения никогда не будут удалены. -### Создание ссылочного зацикливания +### Создание ссылочного замыкания -Давайте посмотрим, как может произойти ситуация ссылочного зацикливания и как её предотвратить, начиная с определения перечисления `List` и метода `tail` в листинге 15-25: +Давайте посмотрим, как может произойти случай ссылочного замыкания и как её предотвратить, начиная с определения перечисления `List` и способа `tail` в приложении 15-25: Файл: src/main.rs @@ -12,11 +12,11 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-25/src/main.rs}} ``` -Листинг 15-25: Объявление cons list, который содержит RefCell<T>, чтобы мы могли изменять то, на что ссылается экземпляр Cons +Приложение 15-25: Объявление cons list, который содержит RefCell<T>, чтобы мы могли изменять то, на что ссылается образец данных Cons -Мы используем другую вариацию определения `List` из листинга 15-5. Второй элемент в варианте `Cons` теперь `RefCell>`, что означает, что вместо возможности менять значение `i32`, как мы делали в листинге 15-24, мы хотим менять значение `List`, на которое указывает вариант `Cons`. Мы также добавляем метод `tail`, чтобы нам было удобно обращаться ко второму элементу, если у нас есть вариант `Cons`. +Мы используем другую вариацию определения `List` из приложения 15-5. Вторая переменная в исходе `Cons` теперь `RefCell>`, что означает, что вместо возможности менять значение `i32`, как мы делали в приложении 15-24, мы хотим менять значение `List`, на которое указывает исход `Cons`. Мы также добавляем способ `tail`, чтобы нам было удобно обращаться ко второй переменной, если у нас есть исход `Cons`. -В листинге 15-26 мы добавляем `main` функцию, которая использует определения листинга 15-25. Этот код создаёт список в переменной `a` и список `b`, который указывает на список `a`. Затем он изменяет список внутри `a` так, чтобы он указывал на `b`, создавая ссылочное зацикливание. В коде есть инструкции `println!`, чтобы показать значения счётчиков ссылок в различных точках этого процесса. +В приложении 15-26 мы добавляем `main` функцию, которая использует определения приложения 15-25. Эта рукопись создаёт список в переменной `a` и список `b`, который указывает на список `a`. Затем он изменяет список внутри `a` так, чтобы он указывал на `b`, создавая ссылочное замыкание. В рукописи есть указания `println!`, чтобы показать значения счётчиков ссылок в различных точках этого этапа. Файл: src/main.rs @@ -24,45 +24,45 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-26/src/main.rs:here}} ``` -Листинг 15-26: Создание ссылочного цикла из двух значений List, указывающих друг на друга +Приложение 15-26: Создание ссылочного круговорота из двух значений List, указывающих друг на друга -Мы создаём экземпляр `Rc` содержащий значение `List` в переменной `a` с начальным списком `5, Nil`. Затем мы создаём экземпляр `Rc` содержащий другое значение `List` в переменной `b`, которое содержит значение 10 и указывает на список в `a`. +Мы создаём образец данных `Rc` содержащий значение `List` в переменной `a` с начальным списком `5, Nil`. Затем мы создаём образец данных `Rc` содержащий другое значение `List` в переменной `b`, которое содержит значение 10 и указывает на список в `a`. -Мы меняем `a` так, чтобы он указывал на `b` вместо `Nil`, создавая зацикленность. Мы делаем это с помощью метода `tail`, чтобы получить ссылку на `RefCell>` из переменной `a`, которую мы помещаем в переменную `link`. Затем мы используем метод `borrow_mut` из типа `RefCell>`, чтобы изменить внутреннее значение типа `Rc`, содержащего начальное значение `Nil` на значение типа `Rc` взятое из переменной `b`. +Мы меняем `a` так, чтобы он указывал на `b` вместо `Nil`, создавая замкнутость. Мы делаем это с помощью способа `tail`, чтобы получить ссылку на `RefCell>` из переменной `a`, которую мы помещаем в переменную `link`. Затем мы используем способ `borrow_mut` из вида данных `RefCell>`, чтобы изменить внутреннее значение вида данных `Rc`, содержащего начальное значение `Nil` на значение вида данных `Rc` взятое из переменной `b`. -Когда мы запускаем этот код, оставив последний `println!` закомментированным в данный момент, мы получим вывод: +Когда мы запускаем эту рукопись, оставив последний `println!` с примечаниями в данный мгновение, мы получим вывод: ```console {{#include ../listings/ch15-smart-pointers/listing-15-26/output.txt}} ``` -Количество ссылок на экземпляры `Rc` как в `a`, так и в `b` равно 2 после того, как мы заменили список в `a` на ссылку на `b`. В конце `main` Rust уничтожает переменную `b`, что уменьшает количество ссылок на `Rc` из `b` с 2 до 1. Память, которую `Rc` занимает в куче, не будет освобождена в этот момент, потому что количество ссылок на неё равно 1, а не 0. Затем Rust удаляет `a`, что уменьшает количество ссылок экземпляра `Rc` в `a` с 2 до 1. Память этого экземпляра также не может быть освобождена, поскольку другой экземпляр `Rc` по-прежнему ссылается на него. Таким образом, память, выделенная для списка не будет освобождена никогда. Чтобы наглядно представить этот цикл ссылок, мы создали диаграмму на рисунке 15-4. +Количество ссылок на образцы `Rc` как в `a`, так и в `b` равно 2 после того, как мы заменили список в `a` на ссылку на `b`. В конце `main` Ржавчина уничтожает переменную `b`, что уменьшает количество ссылок на `Rc` из `b` с 2 до 1. Память, которую `Rc` занимает в куче, не будет освобождена в это мгновение, потому что количество ссылок на неё равно 1, а не 0. Затем Ржавчина удаляет `a`, что уменьшает количество ссылок образца данных `Rc` в `a` с 2 до 1. Память этого образца данных также не может быть освобождена, поскольку другой образец данных `Rc` по-прежнему ссылается на него. Таким образом, память, выделенная для списка не будет освобождена никогда. Чтобы наглядно представить этот круговорот ссылок, мы создали рисунок на рисунке 15-4. Reference cycle of lists -Рисунок 15-4: Ссылочный цикл списков a и b, указывающих друг на друга +Рисунок 15-4: Ссылочный круговорот списков a и b, указывающих друг на друга -Если вы удалите последний комментарий с `println!` и запустите программу, Rust будет пытаться печатать зацикленность в `a`, указывающей на `b`, указывающей на `a` и так далее, пока не переполниться стек. +Если вы удалите последний примечание с `println!` и запустите программу, Ржавчина будет пытаться выводить замкнутость в `a`, указывающей на `b`, указывающей на `a` и так далее, пока не переполниться обойма. -По сравнению с реальной программой, последствия создания цикла ссылок в этом примере не так страшны: сразу после создания цикла ссылок программа завершается. Однако если более сложная программа выделит много памяти в цикле и будет удерживать её в течение длительного времени, программа будет потреблять больше памяти, чем ей нужно, и может перенапрячь систему, что приведёт к исчерпанию доступной памяти. +По сравнению с существующей программой, последствия создания круговорота ссылок в этом примере не так страшны: сразу после создания круговорота ссылок программа завершается. Однако если более сложная программа выделит много памяти в круговороте и будет удерживать её в течение длительного времени, программа будет потреблять больше памяти, чем ей нужно, и может перенапрячь систему, что приведёт к исчерпанию доступной памяти. -Вызвать образование ссылочной зацикленности не просто, но и не невозможно. Если у вас есть значения `RefCell` которые содержат значения `Rc` или аналогичные вложенные комбинации типов с внутренней изменчивостью и подсчётом ссылок, вы должны убедиться, что вы не создаёте зацикленность; Вы не можете полагаться на то, что Rust их обнаружит. Создание ссылочной зацикленности являлось бы логической ошибкой в программе, для которой вы должны использовать автоматические тесты, проверку кода и другие практики разработки программного обеспечения для её минимизации. +Вызвать образование ссылочной замкнутости не просто, но и не невозможно. Если у вас есть значения `RefCell` которые содержат значения `Rc` или подобные вложенные сочетания видов данных с внутренней изменчивостью и подсчётом ссылок, вы должны убедиться, что вы не создаёте замкнутость; Вы не можете полагаться на то, что Ржавчина их обнаружит. Создание ссылочной замкнутости являлось бы разумной ошибкой в программе, для которой вы должны использовать самостоятельно е проверки, проверку рукописи и другие опытов разработки программного обеспечения для её уменьшения. -Другое решение для избежания ссылочной зацикленности - это реорганизация ваших структур данных, чтобы некоторые ссылки выражали владение, а другие - отсутствие владения. В результате можно иметь циклы, построенные на некоторых отношениях владения и некоторые не основанные на отношениях владения, тогда только отношения владения влияют на то, можно ли удалить значение. В листинге 15-25 мы всегда хотим, чтобы варианты `Cons` владели своим списком, поэтому реорганизация структуры данных невозможна. Давайте рассмотрим пример с использованием графов, состоящих из родительских и дочерних узлов, чтобы увидеть, когда отношения владения не являются подходящим способом предотвращения ссылочной зацикленности. +Другое решение для избежания ссылочной замкнутости - это пересоздание ваших стопок данных, чтобы некоторые ссылки выражали владение, а другие - отсутствие владения. В итоге можно иметь круговороты, построенные на некоторых отношениях владения и некоторые не основанные на отношениях владения, тогда только отношения владения влияют на то, можно ли удалить значение. В приложении 15-25 мы всегда хотим, чтобы исходы `Cons` владели своим списком, поэтому пересоздание вида данных невозможно. Давайте рассмотрим пример с использованием графов, состоящих из родительских и дочерних узлов, чтобы увидеть, когда отношения владения не являются подходящим способом предотвращения ссылочной замкнутости. -### Предотвращение ссылочной зацикленности: замена умного указателя `Rc` на `Weak` +### Предотвращение ссылочной замкнутости: замена умного указателя `Rc` на `Weak` -До сих пор мы демонстрировали, что вызов `Rc::clone` увеличивает `strong_count` экземпляра `Rc`, а экземпляр `Rc` удаляется, только если его `strong_count` равен 0. Вы также можете создать *слабую ссылку* на значение внутри экземпляра `Rc`, вызвав `Rc::downgrade` и передав ссылку на `Rc`. Сильные ссылки - это то с помощью чего вы можете поделиться владением экземпляра `Rc`. Слабые ссылки не отражают связи владения, и их подсчёт не влияет на то, когда экземпляр `Rc` будет очищен. Они не приведут к ссылочному циклу, потому что любой цикл, включающий несколько слабых ссылок, будет разорван, как только количество сильных ссылок для задействованных значений станет равным 0. +До сих пор мы выясняли, что вызов `Rc::clone` увеличивает `strong_count` образца данных `Rc`, а образец данных `Rc` удаляется, только если его `strong_count` равен 0. Вы также можете создать *слабую ссылку* на значение внутри образца данных `Rc`, вызвав `Rc::downgrade` и передав ссылку на `Rc`. Сильные ссылки - это то с помощью чего вы можете поделиться владением образца данных `Rc`. Слабые ссылки не отражают связи владения, и их подсчёт не влияет на то, когда образец данных `Rc` будет очищен. Они не приведут к ссылочному круговороту, потому что любой круговорот, включающий несколько слабых ссылок, будет разорван, как только количество сильных ссылок для задействованных значений станет равным 0. -Когда вы вызываете `Rc::downgrade`, вы получаете умный указатель типа `Weak`. Вместо того чтобы увеличить `strong_count` в экземпляре `Rc` на 1, вызов `Rc::downgrade` увеличивает `weak_count` на 1. Тип `Rc` использует `weak_count` для отслеживания количества существующих ссылок `Weak`, аналогично `strong_count`. Разница в том, что `weak_count` не должен быть равен 0, чтобы экземпляр `Rc` мог быть удалён. +Когда вы вызываете `Rc::downgrade`, вы получаете умный указатель вида данных `Weak`. Вместо того чтобы увеличить `strong_count` в образце `Rc` на 1, вызов `Rc::downgrade` увеличивает `weak_count` на 1. Вид данных `Rc` использует `weak_count` для отслеживания количества существующих ссылок `Weak`, подобно `strong_count`. Разница в том, что `weak_count` не должен быть равен 0, чтобы образец данных `Rc` мог быть удалён. -Поскольку значение, на которое ссылается `Weak` могло быть удалено, то необходимо убедиться, что это значение все ещё существует, чтобы сделать что-либо со значением на которое указывает `Weak`. Делайте это вызывая метод `upgrade` у экземпляра типа `Weak`, который вернёт `Option>`. Вы получите результат `Some`, если значение `Rc` ещё не было удалено и результат `None`, если значение `Rc` было удалено. Поскольку `upgrade` возвращает тип `Option`, Rust обеспечит обработку обоих случаев `Some` и `None` и не будет некорректного указателя. +Поскольку значение, на которое ссылается `Weak` могло быть удалено, то необходимо убедиться, что это значение все ещё существует, чтобы сделать что-либо со значением на которое указывает `Weak`. Делайте это вызывая способ `upgrade` у образца вида данных `Weak`, который вернёт `Option>`. Вы получите итог `Some`, если значение `Rc` ещё не было удалено и итог `None`, если значение `Rc` было удалено. Поскольку `upgrade` возвращает вид данных `Option`, Ржавчина обеспечит обработку обоих случаев `Some` и `None` и не будет неправильного указателя. -В качестве примера, вместо того чтобы использовать список чей элемент знает только о следующем элементе, мы создадим дерево, чьи элементы знают о своих дочерних элементах *и* о своих родительских элементах. +В качестве примера, вместо того чтобы использовать список, чья переменная или способ знает только о следующей переменной или способе, мы создадим дерево, чьи переменные знают о своих дочерних и родительских переменных или способах *и*. -#### Создание древовидной структуры данных: `Node` с дочерними узлами +#### Создание древовидной устройства данных: `Node` с дочерними узлами -Для начала мы построим дерево с узлами, которые знают о своих дочерних узлах. Мы создадим структуру с именем `Node`, которая будет содержать собственное значение `i32`, а также ссылки на его дочерние значения `Node`: +Для начала мы построим дерево с узлами, которые знают о своих дочерних узлах. Мы создадим вид данных с именем `Node`, который будет содержать собственное значение с видом данных `i32`, а также ссылки на его дочерние значения `Node`: Файл: src/main.rs @@ -70,9 +70,9 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-27/src/main.rs:here}} ``` -Мы хотим, чтобы `Node` владел своими дочерними узлами и мы хотим поделиться этим владением с переменными так, чтобы мы могли напрямую обращаться к каждому `Node` в дереве. Для этого мы определяем внутренние элементы типа `Vec` как значения типа `Rc`. Мы также хотим изменять те узлы, которые являются дочерними по отношению к другому узлу, поэтому у нас есть тип `RefCell` в поле `children` оборачивающий тип `Vec>`. +Мы хотим, чтобы `Node` владел своими дочерними узлами и мы хотим поделиться этим владением с переменными так, чтобы мы могли напрямую обращаться к каждому `Node` в дереве. Для этого мы определяем внутренние переменные вида данных `Vec` как значения вида данных `Rc`. Мы также хотим изменять те узлы, которые являются дочерними по отношению к другому узлу, поэтому у нас есть вид данных `RefCell` в поле `children` оборачивающий вид данных `Vec>`. -Далее мы будем использовать наше определение структуры и создадим один экземпляр `Node` с именем `leaf` со значением 3 и без дочерних элементов, а другой экземпляр с именем `branch` со значением 5 и `leaf` в качестве одного из его дочерних элементов, как показано в листинге 15-27: +Далее мы будем использовать наше определение вида данных и создадим один образец данных `Node` с именем `leaf` со значением 3 и без дочерних переменных, а другой образец с именем `branch` со значением 5 и `leaf` в качестве одного из его дочерних переменных, как показано в приложении 15-27: Файл: src/main.rs @@ -80,17 +80,17 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-27/src/main.rs:there}} ``` -Листинг 15-27: Создание узла leaf без дочерних элементов и узла branch с leaf в качестве одного из дочерних элементов +Приложение 15-27: Создание узла leaf без дочерних переменных и узла branch с leaf в качестве одного из дочерних переменных -Мы клонируем содержимое `Rc` из переменной `leaf` и сохраняем его в переменной `branch`, что означает, что `Node` в `leaf` теперь имеет двух владельцев: `leaf` и `branch`. Мы можем получить доступ из `branch` к `leaf` через обращение `branch.children`, но нет способа добраться из `leaf` к `branch`. Причина в том, что `leaf` не имеет ссылки на `branch` и не знает, что они связаны. Мы хотим, чтобы `leaf` знал, что `branch` является его родителем. Мы сделаем это далее. +Мы удвоим содержимое `Rc` из переменной `leaf` и сохраняем его в переменной `branch`, что означает, что `Node` в `leaf` теперь имеет двух владельцев: `leaf` и `branch`. Мы можем получить доступ из `branch` к `leaf` через обращение `branch.children`, но нет способа добраться из `leaf` к `branch`. Причина в том, что `leaf` не имеет ссылки на `branch` и не знает, что они связаны. Мы хотим, чтобы `leaf` знал, что `branch` является его родителем. Мы сделаем это далее. #### Добавление ссылки от ребёнка к его родителю -Для того, чтобы дочерний узел знал о своём родительском узле нужно добавить поле `parent` в наше определение структуры `Node`. Проблема в том, чтобы решить, каким должен быть тип `parent`. Мы знаем, что он не может содержать `Rc`, потому что это создаст ссылочную зацикленность с `leaf.parent` указывающей на `branch` и `branch.children`, указывающей на `leaf`, что приведёт к тому, что их значения `strong_count` никогда не будут равны 0. +Для того, чтобы дочерний узел знал о своём родительском узле нужно добавить поле `parent` в наше определение стопки `Node`. Неполадка в том, чтобы решить, каким должен быть вид данных `parent`. Мы знаем, что он не может содержать `Rc`, потому что это создаст ссылочную замкнутость с `leaf.parent` указывающей на `branch` и `branch.children`, указывающей на `leaf`, что приведёт к тому, что их значения `strong_count` никогда не будут равны 0. Подумаем об этих отношениях по-другому, родительский узел должен владеть своими потомками: если родительский узел удаляется, его дочерние узлы также должны быть удалены. Однако дочерний элемент не должен владеть своим родителем: если мы удаляем дочерний узел то родительский элемент все равно должен существовать. Это случай для использования слабых ссылок! -Поэтому вместо `Rc` мы сделаем так, чтобы поле `parent` использовало тип `Weak`, а именно `RefCell>`. Теперь наше определение структуры `Node` выглядит так: +Поэтому вместо `Rc` мы сделаем так, чтобы поле `parent` использовало вид данных `Weak`, а именно `RefCell>`. Теперь наше определение стопки `Node` выглядит так: Файл: src/main.rs @@ -98,7 +98,7 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-28/src/main.rs:here}} ``` -Узел сможет ссылаться на свой родительский узел, но не владеет своим родителем. В листинге 15-28 мы обновляем `main` на использование нового определения так, чтобы у узла `leaf` был бы способ ссылаться на его родительский узел `branch`: +Узел сможет ссылаться на свой родительский узел, но не владеет своим родителем. В приложении 15-28 мы обновляем `main` на использование нового определения так, чтобы у узла `leaf` был бы способ ссылаться на его родительский узел `branch`: Файл: src/main.rs @@ -106,19 +106,19 @@ {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-28/src/main.rs:there}} ``` -Листинг 15-28: Узел leaf со слабой ссылкой на его родительский узел branch +Приложение 15-28: Узел leaf со слабой ссылкой на его родительский узел branch -Создание узла `leaf` выглядит аналогично примеру из Листинга 15-27, за исключением поля `parent`: `leaf` изначально не имеет родителя, поэтому мы создаём новый, пустой экземпляр ссылки `Weak`. +Создание узла `leaf` выглядит подобно примеру из Приложения 15-27, за исключением поля `parent`: `leaf` изначально не имеет родителя, поэтому мы создаём новый, пустой образец ссылки `Weak`. -На этом этапе, когда мы пытаемся получить ссылку на родительский узел у узла `leaf` с помощью метода `upgrade`, мы получаем значение `None`. Мы видим это в выводе первой инструкции `println!`: +На этом этапе, когда мы пытаемся получить ссылку на родительский узел у узла `leaf` с помощью способа `upgrade`, мы получаем значение `None`. Мы видим это в выводе первой указания `println!`: ```text leaf parent = None ``` -Когда мы создаём узел `branch` у него также будет новая ссылка типа `Weak` в поле `parent`, потому что узел `branch` не имеет своего родительского узла. У нас все ещё есть `leaf` как один из потомков узла `branch`. Когда мы получили экземпляр `Node` в переменной `branch`, мы можем изменить переменную `leaf` чтобы дать ей `Weak` ссылку на её родителя. Мы используем метод `borrow_mut` у типа `RefCell>` поля `parent` у `leaf`, а затем используем функцию `Rc::downgrade` для создания `Weak` ссылки на `branch` из `Rc` в `branch`. +Когда мы создаём узел `branch` у него также будет новая ссылка вида данных `Weak` в поле `parent`, потому что узел `branch` не имеет своего родительского узла. У нас все ещё есть `leaf` как один из потомков узла `branch`. Когда мы получили образец данных `Node` в переменной `branch`, мы можем изменить переменную `leaf` чтобы дать ей `Weak` ссылку на её родителя. Мы используем способ `borrow_mut` у вида данных `RefCell>` поля `parent` у `leaf`, а затем используем функцию `Rc::downgrade` для создания `Weak` ссылки на `branch` из `Rc` в `branch`. -Когда мы снова напечатаем родителя `leaf` то в этот раз мы получим вариант `Some` содержащий `branch`, теперь `leaf` может получить доступ к своему родителю! Когда мы печатаем `leaf`, мы также избегаем цикла, который в конечном итоге заканчивался переполнением стека, как в листинге 15-26; ссылки типа `Weak` печатаются как `(Weak)`: +Когда мы снова выведем родителя `leaf` то в этот раз мы получим исход `Some` содержащий `branch`, теперь `leaf` может получить доступ к своему родителю! Когда мы выводим `leaf`, мы также избегаем круговорота, который в конечном итоге заканчивался переполнением обоймы, как в приложении 15-26; ссылки вида данных `Weak` выводятся как `(Weak)`: ```text leaf parent = Some(Node { value: 5, parent: RefCell { value: (Weak) }, @@ -126,11 +126,11 @@ children: RefCell { value: [Node { value: 3, parent: RefCell { value: (Weak) }, children: RefCell { value: [] } }] } }) ``` -Отсутствие бесконечного вывода означает, что этот код не создал ссылочной зацикленности. Мы также можем сказать это, посмотрев на значения, которые мы получаем при вызове `Rc::strong_count` и `Rc::weak_count`. +Отсутствие бесконечного вывода означает, что эта рукопись не создала ссылочной замкнутости. Мы также можем сказать это, посмотрев на значения, которые мы получаем при вызове `Rc::strong_count` и `Rc::weak_count`. -#### Визуализация изменений в `strong_count` и `weak_count` +#### Отображение изменений в `strong_count` и `weak_count` -Давайте посмотрим, как изменяются значения `strong_count` и `weak_count` экземпляров типа `Rc` с помощью создания новой внутренней области видимости и перемещая создания экземпляра `branch` в эту область. Таким образом можно увидеть, что происходит, когда `branch` создаётся и затем удаляется при выходе из области видимости. Изменения показаны в листинге 15-29: +Давайте посмотрим, как изменяются значения `strong_count` и `weak_count` образцов вида данных `Rc` с помощью создания новой внутренней области видимости и перемещая создания образца данных `branch` в эту область. Таким образом можно увидеть, что происходит, когда `branch` создаётся и затем удаляется при выходе из области видимости. Изменения показаны в приложении 15-29: Файл: src/main.rs @@ -138,24 +138,24 @@ children: RefCell { value: [] } }] } }) {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-29/src/main.rs:here}} ``` -Листинг 15-29: Создание branch во внутренней области видимости и подсчёт сильных и слабых ссылок +Приложение 15-29: Создание branch во внутренней области видимости и подсчёт сильных и слабых ссылок -После того, как `leaf` создан его `Rc` имеет значения strong count равное 1 и weak count равное 0. Во внутренней области мы создаём `branch` и связываем её с `leaf`, после чего при печати значений счётчиков `Rc` в `branch` они будет иметь strong count 1 и weak count 1 (для `leaf.parent` указывающего на `branch` с `Weak` ). Когда мы распечатаем счётчики из `leaf`, мы увидим, что они будут иметь strong count 2, потому что `branch` теперь имеет клон `Rc` переменной `leaf` хранящийся в `branch.children`, но все равно будет иметь weak count 0. +После того, как `leaf` создан его `Rc` имеет значения strong count равное 1 и weak count равное 0. Во внутренней области мы создаём `branch` и связываем её с `leaf`, после чего при выводе значений счётчиков `Rc` в `branch` они будет иметь strong count 1 и weak count 1 (для `leaf.parent` указывающего на `branch` с `Weak` ). Когда мы выведем счётчики из `leaf`, мы увидим, что они будут иметь strong count 2, потому что `branch` теперь имеет двойник `Rc` переменной `leaf` хранящийся в `branch.children`, но все равно будет иметь weak count 0. Когда заканчивается внутренняя область видимости, `branch` выходит из области видимости и strong count `Rc` уменьшается до 0, поэтому его `Node` удаляется. Weak count 1 из `leaf.parent` не имеет никакого отношения к тому, был ли `Node` удалён, поэтому не будет никаких утечек памяти! Если мы попытаемся получить доступ к родителю переменной `leaf` после окончания области видимости, мы снова получим значение `None`. В конце программы `Rc` внутри `leaf` имеет strong count 1 и weak count 0 потому что переменная `leaf` снова является единственной ссылкой на `Rc`. -Вся логика, которая управляет счётчиками и сбросом их значений, встроена внутри `Rc` и `Weak` и их реализаций типажа `Drop`. Указав, что отношение из дочернего к родительскому элементу должно быть ссылкой типа `Weak` в определении `Node`, делает возможным иметь родительские узлы, указывающие на дочерние узлы и наоборот, не создавая ссылочной зацикленности и утечек памяти. +весь ход мыслей, который управляет счётчиками и сбросом их значений, встроена внутри `Rc` и `Weak` и их выполнений сущности `Drop`. Указав, что отношение из дочернего к родительской переменной должно быть ссылкой вида данных `Weak` в определении `Node`, делает возможным иметь родительские узлы, указывающие на дочерние узлы и наоборот, не создавая ссылочной замкнутости и утечек памяти. ## Итоги -В этой главе рассказано как использовать умные указатели для обеспечения различных гарантий и компромиссов по сравнению с обычными ссылками, которые Rust использует по умолчанию. Тип `Box` имеет известный размер и указывает на данные размещённые в куче. Тип `Rc` отслеживает количество ссылок на данные в куче, поэтому данные могут иметь несколько владельцев. Тип `RefCell` с его внутренней изменяемостью предоставляет тип, который можно использовать при необходимости неизменного типа, но необходимости изменить внутреннее значение этого типа; он также обеспечивает соблюдение правил заимствования во время выполнения, а не во время компиляции. +В этой главе рассказано как использовать умные указатели для обеспечения различных заверений и соглашений по сравнению с обычными ссылками, которые Ржавчина использует по умолчанию. Вид данных `Box` имеет известный размер и указывает на данные размещённые в куче. Вид данных `Rc` отслеживает количество ссылок на данные в куче, поэтому данные могут иметь несколько владельцев. Вид данных `RefCell` с его внутренней изменяемостью предоставляет вид, который можно использовать при необходимости неизменного вида данных, но необходимости изменить внутреннее значение этого вида данных; он также обеспечивает соблюдение правил заимствования во время выполнения, а не во время сборки. -Мы обсудили также типажи `Deref` и `Drop`, которые обеспечивают большую функциональность умных указателей. Мы исследовали ссылочную зацикленность, которая может вызывать утечки памяти и как это предотвратить с помощью типа `Weak`. +Мы обсудили также сущности `Deref` и `Drop`, которые обеспечивают большую возможность умных указателей. Мы исследовали ссылочную замкнутость, которая может вызывать утечки памяти и как это предотвратить с помощью способа `Weak`. -Если эта глава вызвала у вас интерес и вы хотите реализовать свои собственные умные указатели, обратитесь к ["The Rustonomicon"](https://doc.rust-lang.org/nomicon/index.html) за более полезной информацией. +Если эта глава вызвала у вас влечение и вы хотите использовать свои собственные умные указатели, обратитесь к ["The Rustonomicon"](https://doc.rust-lang.org/nomicon/index.html) за более полезной сведениями. -Далее мы поговорим о параллелизме в Rust. Вы даже узнаете о нескольких новых умных указателях. +Далее мы поговорим о одновременности в Ржавчине Вы даже узнаете о нескольких новых умных указателях. diff --git a/rustbook-ru/src/ch16-00-concurrency.md b/rustbook-ru/src/ch16-00-concurrency.md index 3f0b9f810..950f5c437 100644 --- a/rustbook-ru/src/ch16-00-concurrency.md +++ b/rustbook-ru/src/ch16-00-concurrency.md @@ -1,16 +1,16 @@ # Многопоточность без страха -Безопасное и эффективное управление многопоточным программированием — ещё одна из основных целей Rust. *Многопоточное программирование*, когда разные части программы выполняются независимо, и *параллельное программирование*, когда разные части программы выполняются одновременно, становятся всё более важными, поскольку всё больше компьютеров используют преимущества нескольких процессоров. Исторически программирование в этих условиях было сложным и подверженным ошибкам: Rust надеется изменить это. +Безопасное и качественное управление многопоточным программированием — ещё одна из основных целей Ржавчина*Многопоточное программирование*, когда разные части программы выполняются независимо, и *одновременное программирование*, когда разные части программы выполняются одновременно, становятся всё более важными, поскольку всё больше компьютеров используют преимущества нескольких процессоров. Так сложилось, что программирование в этих условиях было сложным и подверженным ошибкам: Ржавчина надеется изменить это. -Первоначально команда Rust считала, что обеспечение безопасности памяти и предотвращение проблем многопоточности — это две отдельные проблемы, которые необходимо решать различными методами. Со временем команда обнаружила, что системы владения и система типов являются мощным набором инструментов, помогающих управлять безопасностью памяти *и* проблемами многопоточного параллелизма! Используя владение и проверку типов, многие ошибки многопоточности являются ошибками времени компиляции в Rust, а не ошибками времени выполнения. Поэтому вместо того, чтобы тратить много времени на попытки воспроизвести точные обстоятельства, при которых возникает ошибка многопоточности во время выполнения, некорректный код будет отклонён с ошибкой. В результате вы можете исправить свой код во время работы над ним, а не после развёртывания на рабочем сервере. Мы назвали этот аспект Rust *бесстрашной* *многопоточностью*. Бесстрашная многопоточность позволяет вам писать код, который не содержит скрытых ошибок и легко реорганизуется без внесения новых. +Первоначально объединение разработчиков Ржавчины считало, что обеспечение безопасности памяти и предотвращение неполадок многопоточности — это два отдельных сбоя, которые необходимо решать различными способами. Со временем объединение разработчиков обнаружило, что системы владения и перечень видов данных являются мощным набором средств, помогающих управлять безопасностью памяти *и* неполадками многопоточной одновременности! Используя владение и проверку видов данных, многие ошибки многопоточности являются ошибками времени сборки в Ржавчине, а не ошибками времени выполнения. Поэтому вместо того, чтобы тратить много времени на попытки воспроизвести точные обстоятельства, при которых возникает ошибка многопоточности во время выполнения, неправильная рукопись будет отклонена с ошибкой. В итоге вы можете исправить свою рукопись во время работы над ней, а не после развёртывания на рабочем отдельном вычислителе. Мы назвали эту особенность Ржавчины *бесстрашной* *многопоточностью*. Бесстрашная многопоточность позволяет вам писать рукопись, которая не содержит скрытых ошибок и легко повторно согласуется без внесения новых. -> Примечание: для простоты мы будем называть многие проблемы *многопоточными*, хотя более точный термин здесь * — многопоточные и/или параллельные*. Если бы эта книга была о многопоточности и/или параллелизме, мы были бы более конкретны. В этой главе, пожалуйста, всякий раз, когда мы используем термин *«многопоточный»*, мысленно замените на понятие *«многопоточный и/или параллельный»*. +> Примечание: для простоты мы будем называть многие сбои *многопоточными*, хотя более точное понятие здесь * — многопоточные и/или одновременные*. Если бы эта книга была о многопоточности и/или одновременности, мы были бы более определены. В этой главе, пожалуйста, всякий раз, когда мы используем понятие *«многопоточный»*, мысленно замените на понятие *«многопоточный и/или одновременный»*. -Многие языки предлагают довольно консервативные решения проблем многопоточности. Например, Erlang обладает элегантной функциональностью для многопоточности при передаче сообщений, но не определяет ясных способов совместного использования состояния между потоками. Поддержка только подмножества возможных решений является разумной стратегией для языков более высокого уровня, поскольку язык более высокого уровня обещает выгоду при отказе от некоторого контроля над получением абстракций. Однако ожидается, что языки низкого уровня обеспечат решение с наилучшей производительностью в любой конкретной ситуации и будут иметь меньше абстракций по сравнению с аппаратным обеспечением. Поэтому Rust предлагает множество инструментов для моделирования проблем любым способом, который подходит для вашей ситуации и требований. +Многие языки предлагают довольно устоявшиеся решения неполадок многопоточности. Например, Erlang обладает элегантной возможностью для многопоточности при передаче сообщений, но не определяет ясных способов совместного использования состояния между потоками. Поддержка только подмножества возможных решений является разумной подходом для языков более высокого уровня, поскольку язык более высокого уровня обещает выгоду при отказе от некоторого управления над получением абстракций. Однако ожидается, что языки низкого уровня обеспечат решение с наилучшей производительностью в любом случае и будут иметь меньше абстракций по сравнению с аппаратным обеспечением. Поэтому Ржавчина предлагает множество средств для расчетов неполадок любым способом, который подходит для вашего случая и требований. -Вот темы, которые мы рассмотрим в этой главе: +Вот сути, которые мы рассмотрим в этой главе: -- Как создать потоки для одновременного запуска нескольких фрагментов кода -- Многопоточность *передачи сообщений*, где каналы передают сообщения между потоками -- Многопоточность для *совместно используемого состояния*, когда несколько потоков имеют доступ к некоторому фрагменту данных -- Типажи `Sync` и `Send`, которые расширяют гарантии многопоточности в Rust для пользовательских типов, а также типов, предоставляемых стандартной библиотекой +- Как создать потоки для одновременного запуска нескольких отрывков рукописи +- Многопоточность *передачи сообщений*, где потоки передают сообщения между потоками +- Многопоточность для *совместно используемого состояния*, когда несколько потоков имеют доступ к некоторому отрывку данных +- Сущности `Sync` и `Send`, которые расширяют заверения многопоточности в Ржавчине для пользовательских видов данных, а также видов данных, предоставляемых встроенной библиотекой diff --git a/rustbook-ru/src/ch16-01-threads.md b/rustbook-ru/src/ch16-01-threads.md index a497a5090..7477d382a 100644 --- a/rustbook-ru/src/ch16-01-threads.md +++ b/rustbook-ru/src/ch16-01-threads.md @@ -1,20 +1,20 @@ -## Использование потоков для одновременного выполнения кода +## Использование потоков для одновременного выполнения рукописи -В большинстве современных операционных систем программный код выполняется в виде *процесса*, причём операционная система способна управлять несколькими процессами сразу. Программа, в свою очередь, может состоять из нескольких независимых частей, выполняемых одновременно. Конструкция, благодаря которой эти независимые части выполняются, называется *потоком*. Например, веб-сервер может иметь несколько потоков для того, чтобы он мог обрабатывать больше одного запроса за раз. +В большинстве современных операционных систем программный рукопись выполняется в виде *этапа*, причём операционная система способна управлять несколькими этапами сразу. Программа, в свою очередь, может состоять из нескольких независимых частей, выполняемых одновременно. Устройство, благодаря которой эти независимые части выполняются, называется *потоком*. Например, сетевой-отдельный вычислитель может иметь несколько потоков для того, чтобы он мог обрабатывать больше одного запроса за раз. -Разбиение вычислений на несколько потоков может повысить производительность программы, поскольку программа выполняет несколько задач одновременно, но такое разбиение также добавляет сложности. Поскольку потоки могут работать одновременно, нет чёткой гарантии, определяющей порядок выполнения частей вашего кода в разных потоках. Это может привести к таким проблемам, как: +Разбиение вычислений на несколько потоков может повысить производительность программы, поскольку программа выполняет несколько задач одновременно, но такое разбиение также добавляет сложности. Поскольку потоки могут работать одновременно, нет чёткой заверения, определяющей порядок выполнения частей вашей рукописи в разных потоках. Это может привести к таким неполадкам, как: -- Состояния гонки, когда потоки обращаются к данным, либо ресурсам, несогласованно. -- Взаимные блокировки, когда два потока ожидают друг друга, не позволяя тем самым продолжить работу каждому из потоков. -- Ошибки, которые случаются только в определённых ситуациях, которые трудно воспроизвести и, соответственно, трудно надёжно исправить. +- Состояния гонки, когда потоки обращаются к данным, либо мощностямм, несогласованно. +- Взаимные запрета, когда два потока ожидают друг друга, не позволяя тем самым продолжить работу каждому из потоков. +- Ошибки, которые случаются только в определённых случаях, которые трудно воспроизвести и, соответственно, трудно надёжно исправить. -Rust пытается смягчить негативные последствия использования потоков, но программирование в многопоточном контексте все ещё требует тщательного обдумывания структуры кода, которая отличается от структуры кода программ, работающих в одном потоке. +Ржавчина пытается смягчить отрицательные последствия использования потоков, но программирование в многопоточном среде все ещё требует тщательного обдумывания устройства рукописи, которая отличается от устройства рукописи программ, работающих в одном потоке. -Языки программирования реализуют потоки несколькими различными способами, и многие операционные системы предоставляют API, который язык может вызывать для создания новых потоков. Стандартная библиотека Rust использует модель реализации потоков *1:1*, при которой одному потоку операционной системы соответствует ровно один "языковой" поток. Существуют крейты, в которых реализованы другие модели многопоточности, отличающиеся от модели 1:1. +Языки программирования выполняют потоки несколькими различными способами, и многие операционные системы предоставляют API, который язык может вызывать для создания новых потоков. Обычная библиотека Ржавчины использует прообраз выполнения потоков *1:1*, при которой одному потоку операционной системы соответствует ровно один "языковой" поток. Существуют ящики, в которых выполнены другие подходы многопоточности, отличающиеся от подходы 1:1. ### Создание нового потока с помощью `spawn` -Чтобы создать новый поток, мы вызываем функцию `thread::spawn` и передаём ей замыкание (мы говорили о замыканиях в главе 13), содержащее код, который мы хотим запустить в новом потоке. Пример в листинге 16-1 печатает некоторый текст из основного потока, а также другой текст из нового потока: +Чтобы создать новый поток, мы вызываем функцию `thread::spawn` и передаём ей замыкание (мы говорили о замыканиях в главе 13), содержащее рукопись, которую мы хотим запустить в новом потоке. Пример в приложении 16-1 выводит некоторый писание из основного потока, а также другой писание из нового потока: Файл: src/main.rs @@ -22,9 +22,9 @@ Rust пытается смягчить негативные последстви {{#rustdoc_include ../listings/ch16-fearless-concurrency/listing-16-01/src/main.rs}} ``` -Листинг 16-1: Создание нового потока для печати определённого текста, в то время как основной поток печатает что-то другое +Приложение 16-1: Создание нового потока для выводе определённого писания, в то время как основной поток выводит что-то другое -Обратите внимание, что когда основной поток программы на Rust завершается, все порождённые потоки закрываются, независимо от того, завершили они работу или нет. Вывод этой программы может каждый раз немного отличаться, но он будет выглядеть примерно так: +Обратите внимание, что когда основной поток программы на Ржавчине завершается, все порождённые потоки закрываются, независимо от того, завершили они работу или нет. Вывод этой программы может каждый раз немного отличаться, но он будет выглядеть примерно так: Result: 10 ``` -Мы сделали это! Мы посчитали от 0 до 10, что может показаться не очень впечатляющим, но это позволило больше узнать про `Mutex` и безопасность потоков. Вы также можете использовать структуру этой программы для выполнения более сложных операций, чем просто увеличение счётчика. Используя эту стратегию, вы можете разделить вычисления на независимые части, разделить эти части на потоки, а затем использовать `Mutex`, чтобы каждый поток обновлял конечный результат своей частью кода. +Мы сделали это! Мы посчитали от 0 до 10, что может показаться не очень впечатляющим, но это позволило больше узнать про `Mutex` и безопасность потоков. Вы также можете использовать устройство этой программы для выполнения более сложных действий, чем просто увеличение счётчика. Используя эту стратегию, вы можете разделить вычисления на независимые части, разделить эти части на потоки, а затем использовать `Mutex`, чтобы каждый поток обновлял конечный итог своей частью рукописи. -Обратите внимание, что если вы выполняете простые числовые операции, то существуют типы более простые, чем `Mutex`, которые предоставляет модуль [`std::sync::atomic` стандартной библиотеки]. Эти типы обеспечивают безопасный, параллельный, атомарный доступ к простым типам. Мы решили использовать `Mutex` с простым типом в этом примере, чтобы подробнее рассмотреть, как работает `Mutex`. +Обратите внимание, что если вы используете простые числовые действия, то существуют виды данных более простые, чем `Mutex`, которые предоставляет раздел [`std::sync::atomic` встроенной библиотеки]. Эти виды данных обеспечивают безопасный, одновременный, атомарный доступ к простым видам данных. Мы решили использовать `Mutex` с простым видом данных в этом примере, чтобы подробнее рассмотреть, как работает `Mutex`. ### Сходства `RefCell` / `Rc` и `Mutex` / `Arc` -Вы могли заметить, что `counter` сам по себе не изменяемый (immutable), но мы можем получить изменяемую ссылку на значение внутри него; это означает, что `Mutex` обеспечивает внутреннюю изменяемость, также как и семейство `Cell` типов. Мы использовали `RefCell` в главе 15, чтобы получить возможность изменять содержимое внутри `Rc`, теперь аналогичным образом мы используем `Mutex` для изменения содержимого внутри `Arc` . +Вы могли заметить, что `counter` сам по себе не изменяемый (immutable), но мы можем получить изменяемую ссылку на значение внутри него; это означает, что `Mutex` обеспечивает внутреннюю изменяемость, также как и семейство `Cell` видов. Мы использовали `RefCell` в главе 15, чтобы получить возможность изменять содержимое внутри `Rc`, теперь подобным образом мы используем `Mutex` для изменения содержимого внутри `Arc` . -Ещё одна деталь, на которую стоит обратить внимание: Rust не может защитить вас от всевозможных логических ошибок при использовании `Mutex`. Вспомните в главе 15, что использование `Rc` сопряжено с риском создания ссылочной зацикленности, где два значения `Rc` ссылаются друг на друга, что приводит к утечкам памяти. Аналогичным образом, `Mutex` сопряжён с риском создания *взаимных блокировок* (deadlocks). Это происходит, когда операции необходимо заблокировать два ресурса и каждый из двух потоков получил одну из блокировок, заставляя оба потока ждать друг друга вечно. Если вам интересна тема взаимных блокировок, попробуйте создать программу Rust, которая её содержит; затем исследуйте стратегии устранения взаимных блокировок для мьютексов на любом языке и попробуйте реализовать их в Rust. Документация стандартной библиотеки для `Mutex` и `MutexGuard` предлагает полезную информацию. +Ещё одна подробность, на которую стоит обратить внимание: Ржавчина не может защитить вас от всевозможных разумных ошибок при использовании `Mutex`. Вспомните в главе 15, что использование `Rc` сопряжено с риском создания ссылочной замкнутости, где два значения `Rc` ссылаются друг на друга, что приводит к утечкам памяти. Подобным образом, `Mutex` сопряжён с риском создания *взаимных запретов* (deadlocks). Это происходит, когда действия необходимо запретить два средства и каждый из двух потоков получил один из запретов, заставляя оба потока ждать друг друга вечно. Если вам важна направление взаимных запретов, попробуйте создать программу Ржавчина, которая её содержит; затем исследуйте стратегии устранения взаимных запретов для взаимных исключений на любом языке и попробуйте использовать их в Ржавчине. Пособие встроенной библиотеки для `Mutex` и `MutexGuard` предлагает полезные сведения. -Мы завершим эту главу, рассказав о типажах `Send` и `Sync` и о том, как мы можем использовать их с пользовательскими типами. +Мы завершим эту главу, рассказав о сущностях `Send` и `Sync` и о том, как мы можем использовать их с пользовательскими видами данных. -[`std::sync::atomic` стандартной библиотеки]: ../std/sync/atomic/index.html \ No newline at end of file +[`std::sync::atomic` встроенной библиотеки]: ../std/sync/atomic/index.html \ No newline at end of file diff --git a/rustbook-ru/src/ch16-04-extensible-concurrency-sync-and-send.md b/rustbook-ru/src/ch16-04-extensible-concurrency-sync-and-send.md index dbbd0ba49..4972dd125 100644 --- a/rustbook-ru/src/ch16-04-extensible-concurrency-sync-and-send.md +++ b/rustbook-ru/src/ch16-04-extensible-concurrency-sync-and-send.md @@ -1,38 +1,39 @@ -## Расширенная многопоточность с помощью типажей `Sync` и `Send` +## Расширенная многопоточность с помощью сущностей `Sync` и `Send` -Интересно, что сам язык Rust имеет *очень* мало возможностей для многопоточности. Почти все функции многопоточности о которых мы говорили в этой главе, были частью стандартной библиотеки, а не языка. Ваши варианты работы с многопоточностью не ограничиваются языком или стандартной библиотекой; Вы можете написать свой собственный многопоточный функционал или использовать возможности написанные другими. +Важно, что сам язык Ржавчина имеет *очень* мало возможностей для многопоточности. Почти все функции многопоточности о которых мы говорили в этой главе, были частью встроенной библиотеки, а не языка. Ваши исходы работы с многопоточностью не ограничиваются языком или встроенной библиотекой; Вы можете написать свой собственный многопоточный возможности или использовать возможности написанные другими. -Тем не менее, в язык встроены две концепции многопоточности: `std::marker` типажи `Sync` и `Send`. +Тем не менее, в язык встроены два подхода многопоточности: `std::marker` сущности `Sync` и `Send`. ### Разрешение передачи во владение между потоками с помощью `Send` -Маркерный типаж `Send` указывает, что владение типом реализующим `Send`, может передаваться между потоками. Почти каждый тип Rust является типом `Send`, но есть некоторые исключения, вроде `Rc`: он не может быть `Send`, потому что если вы клонировали значение `Rc` и попытались передать владение клоном в другой поток, оба потока могут обновить счётчик ссылок одновременно. По этой причине `Rc` реализован для использования в однопоточных ситуациях, когда вы не хотите платить за снижение производительности. +Маркерная сущность `Send` указывает, что владение видом данных выполняющим `Send`, может передаваться между потоками. Почти каждый вид данных Ржавчины является видом `Send`, но есть некоторые исключения, вроде `Rc`: он не может быть `Send`, потому что если вы удвоили значение `Rc` и попытались передать владение двойником в другой поток, оба потока могут обновить счётчик ссылок одновременно. По этой причине `Rc` выполнен для использования в однопоточных случаях, когда вы не хотите платить за снижение производительности. -Следовательно, система типов Rust и ограничений типажа гарантируют, что вы никогда не сможете случайно небезопасно отправлять значение `Rc` между потоками. Когда мы попытались сделать это в листинге 16-14, мы получили ошибку, `the trait Send is not implemented for Rc>`. Когда мы переключились на `Arc`, который является типом `Send`, то код скомпилировался. +Следовательно, перечень видов данных Ржавчине и ограничений сущности заверяют, что вы никогда не сможете случайно небезопасно отправлять значение `Rc` между потоками. Когда мы попытались сделать это в приложении 16-14, мы получили ошибку, `the trait Send is not implemented for Rc>`. Когда мы переключились на `Arc`, который является видом данных `Send`, то рукопись собралась. -Любой тип полностью состоящий из типов `Send` автоматически помечается как `Send`. Почти все примитивные типы являются `Send`, кроме сырых указателей, которые мы обсудим в главе 19. +Любой вид данных полностью состоящий из видов данных `Send` самостоятельно помечается как `Send`. Почти все простые виды данных являются `Send`, кроме сырых указателей, которые мы обсудим в главе 19. ### Разрешение доступа из нескольких потоков с `Sync` -Маркерный типаж `Sync` указывает, что на тип реализующий `Sync` можно безопасно ссылаться из нескольких потоков. Другими словами, любой тип `T` является типом `Sync`, если `&T` (ссылка на `T` ) является типом `Send`, что означает что ссылку можно безопасно отправить в другой поток. Подобно `Send`, примитивные типы являются типом `Sync`, а типы полностью скомбинированные из типов `Sync`, также являются `Sync` типом. +Маркерный сущность `Sync` указывает, что на вид данных использующий `Sync` можно безопасно ссылаться из нескольких потоков. Другими словами, любой вид данных `T` является видом данных `Sync`, если `&T` (ссылка на `T` ) является видом данных `Send`, что означает что ссылку можно безопасно отправить в другой поток. Подобно `Send`, простые виды данных являются видом `Sync`, а виды данных полностью объединенные из видов данных `Sync`, также являются `Sync` видом данных. -Умный указатель `Rc` не является `Sync` типом по тем же причинам, по которым он не является `Send`. Тип `RefCell` (о котором мы говорили в главе 15) и семейство связанных типов `Cell` не являются `Sync`. Реализация проверки заимствования, которую делает тип `RefCell` во время выполнения программы не является поточно-безопасной. Умный указатель `Mutex` является типом `Sync` и может использоваться для совместного доступа из нескольких потоков, как вы уже видели в разделе «Совместное использование `Mutex` между несколькими потоками» . +Умный указатель `Rc` не является `Sync` видом данных по тем же причинам, по которым он не является `Send`. Вид данных `RefCell` (о котором мы говорили в главе 15) и семейство связанных видов `Cell` не являются `Sync`. Выполнение проверки заимствования, которую делает вид данных `RefCell` во время выполнения программы не является поточно-безопасной. Умный указатель `Mutex` является видом `Sync` и может использоваться для совместного доступа из нескольких потоков, как вы уже видели в разделе «Совместное использование `Mutex` между несколькими потоками» . -### Реализация `Send` и `Sync` вручную небезопасна +### Использование `Send` и `Sync` вручную небезопасно -Поскольку типы созданные из типажей `Send` и `Sync` автоматически также являются типами `Send` и `Sync`, мы не должны реализовывать эти типажи вручную. Являясь маркерными типажами у них нет никаких методов для реализации. Они просто полезны для реализации инвариантов, связанных с многопоточностью. +Поскольку виды данных созданные из сущностей `Send` и `Sync` самостоятельно также являются видами данных `Send` и `Sync`, мы не должны использовать эти сущности вручную. Являясь маркерными сущностями у них нет никаких способов для выполнения. Они просто полезны для выполнения неизменных величин, связанных с многопоточностью. -Ручная реализация этих типажей включает в себя реализацию небезопасного кода Rust. Мы поговорим об использовании небезопасного кода Rust в главе 19; на данный момент важная информация заключается в том, что для создания новых многопоточных типов, не состоящих из частей `Send` и `Sync` необходимо тщательно продумать гарантии безопасности. В [Rustonomicon] есть больше информации об этих гарантиях и о том как их соблюдать. +Ручное выполнение этих сущностей включает в себя выполнение небезопасной рукописи Ржавчины. Мы поговорим об использовании небезопасной рукописи Ржавчины в главе 19; на данное мгновение важные сведения заключается в том, что для создания новых многопоточных видов данных, не состоящих из частей `Send` и `Sync` необходимо тщательно продумать заверения безопасности. В [Rustonomicon] есть больше сведений об этих заверениях и о том как их соблюдать. ## Итоги -Это не последний случай, когда вы увидите многопоточность в этой книге: проект в главе 20 будет использовать концепции этой главы для более реалистичного случая, чем небольшие примеры обсуждаемые здесь. +Это не последний случай, когда вы увидите многопоточность в этой книге: дело в главе 20 будет использовать подходы этой Главы для более существующегостичного случая, чем небольшие примеры обсуждаемые здесь. -Как упоминалось ранее, поскольку в языке Rust очень мало того, с помощью чего можно управлять многопоточностью, многие решения реализованы в виде крейтов. Они развиваются быстрее, чем стандартная библиотека, поэтому обязательно поищите в Интернете текущие современные крейты. +Как упоминалось ранее, поскольку в языке Ржавчина очень мало того, с помощью чего можно управлять многопоточностью, многие решения выполнены в виде ящиков. Они развиваются быстрее, чем обычная библиотека, поэтому обязательно поищите в Мировой сети текущие современные ящики. -Стандартная библиотека Rust предоставляет каналы для передачи сообщений и типы умных указателей, такие как `Mutex` и `Arc`, которые можно безопасно использовать в многопоточных контекстах. Система типов и анализатор заимствований гарантируют, что код использующий эти решения не будет содержать гонки данных или недействительные ссылки. Получив компилирующийся код, вы можете быть уверены, что он будет успешно работать в нескольких потоках без ошибок, которые трудно обнаружить в других языках. Многопоточное программирование больше не является концепцией, которую стоит опасаться: иди вперёд и сделай свои программы многопоточными безбоязненно! +Обычная библиотека Ржавчины предоставляет потоки для передачи сообщений и виды данных умных указателей, такие как `Mutex` и `Arc`, которые можно безопасно использовать в многопоточных средах. Перечень видов данных и оценщик заимствований заверяют, что рукопись использующий эти решения не будет содержать гонки данных или недействительные ссылки. Получив собирающийся рукопись, вы можете быть уверены, что она будет успешно работать в нескольких потоках без ошибок, которые трудно обнаружить в других языках. Многопоточное программирование больше не является подходом, которую стоит опасаться: иди вперёд и сделай свои программы многопоточными безбоязненно! -Далее мы поговорим об идиоматичных способах моделирования проблем и структурирования решений по мере усложнения ваших программ на Rust. Кроме того, мы обсудим как идиомы Rust связаны с теми, с которыми вы, возможно, знакомы по объектно-ориентированному программированию. +Далее мы поговорим об идиоматичных способах расчетов неполадок и внутреннего выстраивания + решений по мере усложнения ваших программ на Ржавчине. Кроме того, мы обсудим как устойчивого выражения Ржавчины связаны с теми, с которыми вы, возможно, знакомы по предметно-направленному программированию. [Rustonomicon]: ../nomicon/index.html \ No newline at end of file diff --git a/rustbook-ru/src/ch17-00-oop.md b/rustbook-ru/src/ch17-00-oop.md index bc71f9e0a..77677f54c 100644 --- a/rustbook-ru/src/ch17-00-oop.md +++ b/rustbook-ru/src/ch17-00-oop.md @@ -1,3 +1,3 @@ -# Возможности объектно-ориентированного программирования в Rust +# Возможности предметно-направленного программирования в Ржавчине -Объектно-ориентированное программирование (ООП) — это способ построения программ. Объекты, как программная концепция, были введены в язык программирования Simula в 1960-х годах. Эти объекты повлияли на архитектуру программирования Алана Кея, в которой объекты передают сообщения друг другу. Чтобы описать эту архитектуру, он ввёл термин *объектно-ориентированное программирование* в 1967 году. Есть много конкурирующих определений ООП, и по некоторым из этих определений Rust является объектно-ориентированным, а по другим — нет. В этой главе мы рассмотрим некоторые характеристики, которые обычно считаются объектно-ориентированными, и то, как эти характеристики транслируются в идиомы языка Rust. Затем мы покажем, как реализовать шаблон объектно-ориентированного проектирования в Rust, и обсудим компромиссы между этим вариантом и решением, использующим вместо этого некоторые сильные стороны Rust. +Предметно-направленное программирование (ООП) — это способ построения программ. Предметы, как программный подход, были введены в язык программирования Simula в 1960-х годах. Эти предметы повлияли на архитектуру программирования Алана Кея, в которой предметы передают сообщения друг другу. Чтобы описать эту архитектуру, он ввёл понятие *предметно-направленное программирование* в 1967 году. Есть много состязающихся определений ООП, и по некоторым из этих определений Ржавчины является предметно-направленным, а по другим — нет. В этой главе мы рассмотрим некоторые свойства, которые обычно считаются предметно-направленными, и то, как эти свойства переводятся в устойчивые выражения языка Ржавчина. Затем мы покажем, как использовать образец предметно-направленного разработки в Ржавчине и обсудим соглашения между этим исходом и решением, использующим вместо этого некоторые сильные стороны Ржавчины. diff --git a/rustbook-ru/src/ch17-01-what-is-oo.md b/rustbook-ru/src/ch17-01-what-is-oo.md index e8c54ec16..f2e86cc71 100644 --- a/rustbook-ru/src/ch17-01-what-is-oo.md +++ b/rustbook-ru/src/ch17-01-what-is-oo.md @@ -1,20 +1,20 @@ -## Характеристики объектно-ориентированных языков +## Свойства предметно-направленных языков -В сообществе программистов нет единого мнения о том, какими свойствами должен обладать язык, чтобы считаться объектно-ориентированным. На Rust повлияли многие парадигмы программирования, включая ООП - например, в главе 13 мы изучали особенности, пришедшие из функционального программирования. Однозначно можно утверждать, что ООП-языкам присущи следующие характерные особенности: объекты, инкапсуляция и наследование. Давайте рассмотрим, что каждая из них означает и поддерживает ли их Rust. +В сообществе программистов нет единого мнения о том, какими свойствами должен обладать язык, чтобы считаться предметно-направленным. На Ржавчине повлияли многие парадигмы программирования, включая ООП - например, в главе 13 мы изучали сущности, пришедшие из функционального программирования. Однозначно можно утверждать, что ООП-языкам присущи следующие присущие сущности: предметы, инкапсуляция и наследование. Давайте рассмотрим, что каждая из них означает и поддерживает ли их Ржавчина. -### Объекты содержат данные и поведение +### Предметы содержат данные и поведение -Книга *Приёмы объектно-ориентированного проектирования. Паттерны проектирования* Erich Gamma, Richard Helm, Ralph Johnson, и John Vlissides (Addison-Wesley Professional, 1994), в просторечии называемая *Книга банды четырёх*, представляет собой сборник примеров объектно-ориентированного проектирования. В ней даётся следующее определение ООП: +Книга *Приёмы предметно-направленной разработки. Образцы разработки* Erich Gamma, Richard Helm, Ralph Johnson, и John Vlissides (Addison-Wesley Professional, 1994), в просторечии называемая *Книга банды четырёх*, представляет собой сборник примеров предметно-направленной разработки. В ней даётся следующее определение ООП: -> Объектно-ориентированные программы состоят из объектов. *Объект* представляет собой сущность, своего рода контейнер, с данными и процедурами, которые работают с этими данными. Процедуры обычно называются *методами* или *операциями*. +> Предметно-направленные программы состоят из предметов. *Предмет* представляет собой сущность, своего рода дополнение, с данными и процедурами, которые работают с этими данными. Процедуры обычно называются *способами* или *действиеми*. -В соответствии с этим определением, Rust является объектно-ориентированным языком - в структурах и перечислениях содержатся данные, а в блоках `impl` определяются методы для них. Хотя структуры и перечисления, имеющие методы, не *называются* объектами, они обеспечивают функциональность, соответствующую определению объектов в книге банды четырёх. +В соответствии с этим определением, Ржавчина является предметно-направленным языком - в стопках и перечислениях содержатся данные, а в х `impl` определяются способы для них. Хотя стопки и перечисления, имеющие способы, не *называются* предметами, они обеспечивают возможность, соответствующую определению предметов в книге банды четырёх. -### Инкапсуляция, скрывающая детали реализации +### Инкапсуляция, скрывающая подробности выполнения -Другим аспектом, обычно связанным с объектно-ориентированным программированием, является идея *инкапсуляции*: детали реализации объекта недоступны для кода, использующего этот объект. Единственный способ взаимодействия с объектом — через его публичный интерфейс; код, использующий этот объект, не должен иметь возможности взаимодействовать с внутренними свойствами объекта и напрямую изменять его данные или поведение. Инкапсуляция позволяет изменять и реорганизовывать внутренние свойства объекта без необходимости изменять код, который использует объект. +Другой особенностью, обычно связанной с предметно-направленным программированием, является мысль *инкапсуляции*: подробности выполнения предмета недоступны для рукописи, использующей этот предмет. Единственный способ взаимодействия с предметом — через его открытую внешнюю оболочку; рукопись, использующая этот предмет, не должна иметь возможности взаимодействовать с внутренними свойствами предметами напрямую изменять его данные или поведение. Инкапсуляция позволяет изменять и ресоздавать внутренние свойства предмета без необходимости изменять саму рукопись, которая использует предмет. -В главе 7 мы уже говорили о том, как управлять инкапсуляцией: мы можем использовать ключевое слово `pub`, чтобы определить, какие модули, типы, функции и методы в нашем коде будут публичными, а всё остальное по умолчанию будет приватными. Например, мы можем определить структуру `AveragedCollection`, в которой есть поле, содержащее вектор значений `i32`. Также, структура будет иметь поле, содержащее среднее арифметическое чисел этого вектора, таким образом, среднее не нужно будет вычислять каждый раз, когда оно кому-то понадобится. Другими словами, `AveragedCollection` будет кэшировать вычисленное среднее для нас. В листинге 17-1 приведено определение структуры `AveragedCollection`: +В главе 7 мы уже говорили о том, как управлять инкапсуляцией: мы можем использовать ключевое слово `pub`, чтобы определить, какие разделы, виды данных, функции и способы в нашей рукописи будут открытыми, а всё остальное по умолчанию будет закрытыми. Например, мы можем определить стопку `AveragedCollection`, в которой есть поле, содержащее вектор значений вида данных `i32`. Также, стопка будет иметь поле, содержащее среднее арифметическое чисел этого вектора, таким образом, среднее не нужно будет вычислять каждый раз, когда оно кому-то понадобится. Другими словами, `AveragedCollection` будет кэшировать вычисленное среднее для нас. В приложении 17-1 приведено определение стопки `AveragedCollection`: Файл: src/lib.rs @@ -22,9 +22,9 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-01/src/lib.rs}} ``` -Листинг 17-1: структура AveragedCollection содержит список целых чисел и их среднее арифметическое. +Приложение 17-1: Стопка AveragedCollection содержит список целых чисел и их среднее арифметическое. -Обратите внимание, что структура помечена ключевым словом `pub`, что позволяет другому коду её использовать, однако, поля структуры остаются недоступными. Это важно, потому что мы хотим гарантировать обновление среднего значения при добавлении или удалении элемента из списка. Мы можем получить нужное поведение, определив в структуре методы `add`, `remove` и `average`, как показано в примере 17-2: +Обратите внимание, что стопка помечена ключевым словом `pub`, что позволяет другому рукописи её использовать, однако, поля стопки остаются недоступными. Это важно, потому что мы хотим обеспечить обновление среднего значения при добавлении или удалении переменной из списка. Мы можем получить нужное поведение, определив в стопке способы `add`, `remove` и `average`, как показано в примере 17-2: Файл: src/lib.rs @@ -32,34 +32,34 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-02/src/lib.rs:here}} ``` -Листинг 17-2: Реализация публичных методов add,remove, и average для AveragedCollection +Приложение 17-2: Выполнение открытых способов add,remove, и average для AveragedCollection -Публичные методы `add`, `remove` и `average` являются единственным способом получить или изменить данные в экземпляре `AveragedCollection`. Когда элемент добавляется в `list` методом `add`, или удаляется с помощью метода `remove`, код реализации каждого из этих методов вызывает приватный метод `update_average`, который позаботится об обновлении поля `average`. +Открытые способы `add`, `remove` и `average` являются единственным способом получить или изменить данные в образце `AveragedCollection`. Когда переменная добавляется в `list` способом `add`, или удаляется с помощью способа `remove`, рукопись выполнения каждого из этих способов вызывает закрытый способ `update_average`, который позаботится об обновлении поля `average`. -Мы оставляем поля `list` и `average` приватными, чтобы внешний код не мог добавлять или удалять элементы непосредственно в поле `list`; в противном случае поле `average` может оказаться не синхронизировано при подобном вмешательстве. Метод `average` возвращает значение в поле `average`, что позволяет внешнему коду читать значение `average`, но не изменять его. +Мы оставляем поля `list` и `average` закрытыми, чтобы внешняя рукопись не могла добавлять или удалять переменные непосредственно в поле `list`; в противном случае поле `average` может оказаться не согласовано при подобном вмешательстве. Способ `average` возвращает значение в поле `average`, что позволяет внешней рукописи читать значение `average`, но не изменять его. -Поскольку мы инкапсулировали детали реализации структуры `AveragedCollection`, мы можем легко изменить такие аспекты, как структура данных, в будущем. Например, мы могли бы использовать `HashSet` вместо `Vec` для поля `list`. Благодаря тому, что сигнатуры публичных методов `add`, `remove` и `average` остаются неизменными, код, использующий `AveragedCollection`, также не будет нуждаться в изменении. У нас бы не получилось этого достичь, если бы мы сделали поле `list` доступным внешнему коду: `HashSet` и`Vec` имеют разные методы для добавления и удаления элементов, поэтому внешний код, вероятно, должен измениться, если он модифицирует `list` напрямую. +Поскольку мы инкапсулировали подробности выполнения стопки `AveragedCollection`, мы можем легко изменить такие особенности, как вида данных, в будущем. Например, мы могли бы использовать `HashSet` вместо `Vec` для поля `list`. Благодаря тому, что ярлыки открытых способов `add`, `remove` и `average` остаются неизменными, рукопись, использующая `AveragedCollection`, также не будет нуждаться в изменении. У нас бы не получилось этого достичь, если бы мы сделали поле `list` доступным внешней рукописи: `HashSet` и`Vec` имеют разные способы для добавления и удаления переменных, поэтому внешняя рукопись, вероятно, должна измениться, если она изменяет `list` напрямую. -Если инкапсуляция является обязательным аспектом для определения языка как объектно-ориентированного, то Rust соответствует этому требованию. Возможность использовать или не использовать модификатор доступа `pub` для различных частей кода позволяет скрыть детали реализации. +Если инкапсуляция является обязательной особенностью для определения языка как предметно-направленного, то Ржавчина соответствует этому требованию. Возможность использовать или не использовать изменитель доступа `pub` для различных частей рукописи позволяет скрыть подробности выполнения. -### Наследование как система типов и способ совместного использования кода +### Наследование как перечень видов данных и способ совместного использования рукописи -*Наследование* — это механизм, с помощью которого объект может унаследовать элементы из определения другого объекта, то есть получить данные и поведение родительского объекта без необходимости повторно их определять. +*Наследование* — это рычаг, с помощью которого предмет может унаследовать переменные из определения другого предмета. то есть получить данные и поведение родительского предмета без необходимости повторно их определять. -Если язык должен иметь наследование, чтобы быть объектно-ориентированным, то Rust таким не является. Здесь нет способа определить структуру, наследующую поля и реализации методов родительской структуры, без использования макроса. +Если язык должен иметь наследование, чтобы быть предметно-направленным, то Ржавчина таким не является. Здесь нет способа определить вид данных, наследующий поля и выполнения способов родительского вид данных, без использования макроса. -Однако, если вы привыкли иметь наследование в своём наборе инструментов для программирования, вы можете использовать другие решения в Rust, в зависимости от того, по какой причине вы изначально хотите использовать наследование. +Однако, если вы привыкли иметь наследование в своём наборе средств для программирования, вы можете использовать другие решения в Ржавчине, в зависимости от того, по какой причине вы изначально хотите использовать наследование. -Вы могли бы выбрать наследование по двум основным причинам. Одна из них - возможность повторного использования кода: вы можете реализовать определённое поведение для одного типа, а наследование позволит вам повторно использовать эту реализацию для другого типа. В Rust для этого есть ограниченный способ, использующий реализацию метода типажа по умолчанию, который вы видели в листинге 10-14, когда мы добавили реализацию по умолчанию в методе `summarize` типажа `Summary`. Любой тип, реализующий свойство `Summary` будет иметь доступный метод `summarize` без дополнительного кода. Это похоже на то, как родительский класс имеет реализацию метода, и класс-наследник тоже имеет реализацию метода. Мы также можем переопределить реализацию по умолчанию для метода `summarize`, когда реализуем типаж `Summary`, что похоже на дочерний класс, переопределяющий реализацию метода, унаследованного от родительского класса. +Вы могли бы выбрать наследование по двум основным причинам. Одна из них - возможность повторного использования рукописи: вы можете использовать определённое поведение для одного вида данных, а наследование позволит вам повторно использовать эту выполнение для другого вида данных. В Ржавчине для этого есть ограниченный способ, использующий использование способа сущности по умолчанию, который вы видели в приложении 10-14, когда мы добавили выполнение по умолчанию в способе `summarize` сущности `Summary`. Любой вид данных, использующий свойство `Summary` будет иметь доступный способ `summarize` без дополнительного рукописи. Это похоже на то, как родительский класс имеет использование способа, и класс-наследник тоже имеет использование способа. Мы также можем переопределить выполнение по умолчанию для способа `summarize`, когда выполняем сущность `Summary`, что похоже на дочерний класс, переопределяющий использование способа, унаследованного от родительского класса. -Вторая причина использования наследования относится к системе типов: чтобы иметь возможность использовать дочерний тип в тех же места, что и родительский. Эта возможность также называется *полиморфизм* и означает возможность подменять объекты во время исполнения, если они имеют одинаковые характеристики. +Вторая причина использования наследования относится к перечню видов данных: чтобы иметь возможность использовать дочерний вид данных в тех же места, что и родительский. Эта возможность также называется *полиморфизм* и означает возможность подменять предметы во время исполнения, если они имеют одинаковые свойства. > ### Полиморфизм > -> Для многих людей полиморфизм является синонимом наследования. Но на самом деле это более общая концепция, относящаяся к коду, который может работать с данными нескольких типов. Обычно такими типами выступают подклассы при наследовании. +> Для многих людей полиморфизм является родственным наследования. Но на самом деле это более общая подход, относящаяся к рукописи, которая может работать с данными нескольких видов данных. Обычно такими видами данных выступают подклассы при наследовании. > -> Вместо этого Rust использует обобщённые типы для абстрагирования от типов, и ограничения типажей (trait bounds) для указания того, какие возможности эти типы должны предоставлять. Это иногда называют *ограниченным параметрическим полиморфизмом*. +> Вместо этого Ржавчина использует обобщённые виды данных для абстрагирования от видов данных, и ограничения сущностей (trait bounds) для указания того, какие возможности эти виды данных должны предоставлять. Это иногда называют *ограниченным свойствоическим полиморфизмом*. -Наследование, как подход к разработке, в последнее время утратило популярность во многих языках программирования, поскольку часто существует риск, что мы будем наследовать код чаще, чем это необходимо. Подклассы не всегда должны обладать всеми характеристиками родительского класса, но при использовании наследования другого варианта нет. Это может сделать дизайн программы менее гибким. Кроме этого, появляется возможность вызова у подклассов методов, которые не имеют смысла или вызывают ошибки, потому что эти методы неприменимы к подклассу. Кроме того, в некоторых языках разрешается только одиночное наследование (т.е. подкласс может наследоваться только от одного класса), что ещё больше ограничивает гибкость разработки программы. +Наследование, как подход к разработке, в последнее время утратило распространенность во многих языках программирования, поскольку часто существует риск, что мы будем наследовать рукопись чаще, чем это необходимо. Подклассы не всегда должны обладать всеми свойствами родительского класса, но при использовании наследования другого исхода нет. Это может сделать внешний вид программы менее гибким. Кроме этого, появляется возможность вызова у подклассов способов, которые не имеют смысла или вызывают ошибки, потому что эти способы неприменимы к подклассу. Кроме того, в некоторых языках разрешается только одиночное наследование (т.е. подкласс может наследоваться только от одного класса), что ещё больше ограничивает гибкость разработки программы. -По этим причинам в Rust применяется альтернативный подход, с использованием типажей-объектов вместо наследования. Давайте посмотрим как типажи-объекты реализуют полиморфизм в Rust. +По этим причинам в Ржавчине применяется иной подход, с использованием сущностей-предметов вместо наследования. Давайте посмотрим как сущности-предметы выполняют полиморфизм в Ржавчине. diff --git a/rustbook-ru/src/ch17-02-trait-objects.md b/rustbook-ru/src/ch17-02-trait-objects.md index 8ad1b623c..4495bba65 100644 --- a/rustbook-ru/src/ch17-02-trait-objects.md +++ b/rustbook-ru/src/ch17-02-trait-objects.md @@ -1,20 +1,22 @@ -## Использование типаж-объектов, допускающих значения разных типов +## Использование сущность-предметов, допускающих значения разных видов данных -В главе 8 мы упоминали, что одним из ограничений векторов является то, что они могут хранить элементы только одного типа. Мы создали обходное решение в листинге 8-9, где мы определили перечисление `SpreadsheetCell` в котором были варианты для хранения целых чисел, чисел с плавающей точкой и текста. Это означало, что мы могли хранить разные типы данных в каждой ячейке и при этом иметь вектор, представляющий строку из ячеек. Это очень хорошее решение, когда наши взаимозаменяемые элементы вектора являются типами с фиксированным набором, известным при компиляции кода. +В главе 8 мы упоминали, что одним из ограничений векторов является то, что они могут хранить переменные только одного вида данных. Мы создали обходное решение в приложении 8-9, где мы определили перечисление `SpreadsheetCell` в котором были исходы для хранения целых чисел, чисел с плавающей точкой и писания. Это означало, что мы могли хранить разные виды данных в каждой ячейке и при этом иметь вектор, представляющий строку из ячеек. Это очень хорошее решение, когда наши взаимозаменяемые переменные вектора являются видами данных с конечным набором, известными при сборке рукописи. -Однако иногда мы хотим, чтобы пользователь нашей библиотеки мог расширить набор типов, которые допустимы в конкретной ситуации. Чтобы показать как этого добиться, мы создадим пример инструмента с графическим интерфейсом пользователя (GUI), который просматривает список элементов, вызывает метод `draw` для каждого из них, чтобы нарисовать его на экране - это обычная техника для инструментов GUI. Мы создадим библиотечный крейт с именем `gui`, содержащий структуру библиотеки GUI. Этот крейт мог бы включать некоторые готовые типы для использования, такие как `Button` или `TextField`. Кроме того, пользователи такого крейта `gui` захотят создавать свои собственные типы, которые могут быть нарисованы: например, кто-то мог бы добавить тип `Image`, а кто-то другой добавить тип `SelectBox`. +Однако иногда мы хотим, чтобы пользователь нашей библиотеки мог расширить набор видов данных, которые допустимы в данном случае. Чтобы показать как этого добиться, мы создадим пример средства с внешней оболочкой пользователя (GUI), который просматривает список переменных, вызывает способ `draw` для каждого из них, чтобы нарисовать его на экране - это обычная техника для средств GUI. Мы создадим библиотечный ящик с именем `gui`, содержащий устройство библиотеки GUI. Этот ящик мог бы включать некоторые готовые виды данных для использования, такие как `Button` или `TextField`. Кроме того, пользователи такого ящика `gui` захотят создавать свои собственные виды данных, которые могут быть нарисованы: например, кто-то мог бы добавить вид данных `Image`, а кто-то другой добавить вид данных `SelectBox`. -Мы не будем реализовывать полноценную библиотеку GUI для этого примера, но покажем, как её части будут подходить друг к другу. На момент написания библиотеки мы не можем знать и определить все типы, которые могут захотеть создать другие программисты. Но мы знаем, что `gui` должен отслеживать множество значений различных типов и ему нужно вызывать метод `draw` для каждого из этих значений различного типа. Ему не нужно точно знать, что произойдёт, когда вызывается метод `draw`, просто у значения будет доступен такой метод для вызова. +Мы не будем использовать полноценную библиотеку GUI для этого примера, но покажем, как её части будут подходить друг к другу. На мгновение написания библиотеки мы не можем знать и определить все виды данных, которые могут захотеть создать другие программисты. Но мы знаем, что `gui` должен отслеживать множество значений различных видов данных и ему нужно вызывать способ `draw` для каждого из этих значений различного вида данных. Ему не нужно точно знать, что произойдёт, когда вызывается способ `draw`, просто у значения будет доступен такой способ для вызова. -Чтобы сделать это на языке с наследованием, можно определить класс с именем `Component` у которого есть метод с названием `draw`. Другие классы, такие как `Button`, `Image` и `SelectBox` наследуются от `Component` и следовательно, наследуют метод `draw`. Каждый из них может переопределить реализацию метода `draw`, чтобы определить своё пользовательское поведение, но платформа может обрабатывать все типы, как если бы они были экземплярами `Component` и вызывать `draw` у них. Но поскольку в Rust нет наследования, нам нужен другой способ структурировать `gui` библиотеку, чтобы позволить пользователям расширять её новыми типами. +Чтобы сделать это на языке с наследованием, можно определить класс с именем `Component` у которого есть способ с названием `draw`. Другие классы, такие как `Button`, `Image` и `SelectBox` наследуются от `Component` и следовательно, наследуют способ `draw`. Каждый из них может переопределить использование способа `draw`, чтобы определить своё пользовательское поведение, но площадка может обрабатывать все виды данных, как если бы они были образцами данных `Component` и вызывать `draw` у них. Но поскольку в Ржавчине нет наследования, нам нужен другой способ внутренне выстроить -### Определение типажа для общего поведения + `gui` библиотеку, чтобы позволить пользователям расширять её новыми видами данных. -Чтобы реализовать поведение, которое мы хотим иметь в `gui`, определим типаж с именем `Draw`, который будет содержать один метод с названием `draw`. Затем мы можем определить вектор, который принимает *типаж-объект*. Типаж-объект указывает как на экземпляр типа, реализующего указанный типаж, так и на внутреннюю таблицу, используемую для поиска методов типажа указанного типа во время выполнения. Мы создаём типаж-объект в таком порядке: используем какой-нибудь вид указателя, например ссылку `&` или умный указатель `Box`, затем ключевое слово `dyn`, а затем указываем соответствующий типаж. (Мы будем говорить о причине того, что типаж-объекты должны использовать указатель в разделе ["Типы динамического размера и типаж `Sized` "] главы 19). Мы можем использовать типаж-объекты вместо универсального или конкретного типа. Везде, где мы используем типаж-объект, система типов Rust проверит во время компиляции, что любое значение, используемое в этом контексте, будет реализовывать нужный типаж у типаж-объекта. Следовательно, нам не нужно знать все возможные типы во время компиляции. +### Определение сущности для общего поведения -Мы упоминали, что в Rust мы воздерживаемся называть структуры и перечисления «объектами», чтобы отличать их от объектов в других языках. В структуре или перечислении данные в полях структуры и поведение в блоках `impl` разделены, тогда как в других языках данные и поведение объединены в одну концепцию, часто обозначающуюся как объект. Тем не менее, типаж-объекты *являются* более похожими на объекты на других языках, в том смысле, что они сочетают в себе данные и поведение. Но типаж-объекты отличаются от традиционных объектов тем, что не позволяют добавлять данные к типаж-объекту. Типаж-объекты обычно не настолько полезны, как объекты в других языках: их конкретная цель - обеспечить абстракцию через общее поведение. +Чтобы использовать поведение, которое мы хотим иметь в `gui`, определим сущность с именем `Draw`, который будет содержать один способ с названием `draw`. Затем мы можем определить вектор, который принимает *сущность-предмет*. Сущность-предмет указывает как на образец вида данных, выполняющего указанную сущность, так и на внутреннюю таблицу, используемую для поиска способов сущности указанного вида данных во время выполнения. Мы создаём сущность-предмет в таком порядке: используем какой-нибудь вид указателя, например ссылку `&` или умный указатель `Box`, затем ключевое слово `dyn`, а затем указываем соответствующую сущность. (Мы будем говорить о причине того, что сущность-предметы должны использовать указатель в разделе ["Виды данных изменяемого размера и сущность `Sized` "] Главы 19). Мы можем использовать сущность-предметы вместо гибкого или определенного вида данных. Везде, где мы используем сущность-предмет, перечень видов данных Ржавчины проверит во время сборки, что любое значение, используемое в этой среде, будет выполнять нужную сущность у сущность-предмета. Следовательно, нам не нужно знать все возможные виды данных во время сборки. -В листинге 17.3 показано, как определить типаж с именем `Draw` с помощью одного метода с именем `draw`: +Мы упоминали, что в Ржавчине мы воздерживаемся называть стопки и перечисления «предметами», чтобы отличать их от предметов в других языках. В стопке или перечислении данные в полях стопки и поведение в разделах `impl` разделены, тогда как в других языках данные и поведение объединены в одну подход, часто обозначающуюся как предмет. Тем не менее, сущность-предметы *являются* более похожими на предметы на других языках, в том смысле, что они сочетают в себе данные и поведение. Но сущность-предметы отличаются от привычных предметов тем, что не позволяют добавлять данные к сущность-предмету. Сущность-предметы обычно не настолько полезны, как предметы в других языках: их определенная цель - обеспечить абстракцию через общее поведение. + +В приложении 17.3 показано, как определить сущность с именем `Draw` с помощью одного способа с именем `draw`: Файл: src/lib.rs @@ -22,9 +24,9 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-03/src/lib.rs}} ``` -Листинг 17-3: Определение типажа Draw +Приложение 17-3: Определение сущности Draw -Этот синтаксис должен выглядеть знакомым из наших дискуссий о том, как определять типажи в главе 10. Далее следует новый синтаксис: в листинге 17.4 определена структура с именем `Screen`, которая содержит вектор с именем `components`. Этот вектор имеет тип `Box`, который и является типаж-объектом; это замена для любого типа внутри `Box` который реализует типаж `Draw`. +Эти правила написания должны выглядеть знакомым из наших споров о том, как определять сущности в главе 10. Далее следуют новые правила написания: в приложении 17.4 определена стопка с именем `Screen`, которая содержит вектор с именем `components`. Этот вектор имеет вид данных `Box`, который и является сущность-предметом; это замена для любого вида данных внутри `Box` который использует сущность `Draw`. Файл: src/lib.rs @@ -32,9 +34,9 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-04/src/lib.rs:here}} ``` -Листинг 17-4: Определение структуры Screen с полем components, которое является вектором типаж-объектов, которые реализуют типаж Draw +Приложение 17-4: Определение стопки Screen с полем components, которая является вектором сущность-предметов, которые используют сущность Draw -В структуре `Screen`, мы определим метод `run`, который будет вызывать метод `draw` каждого элемента вектора `components`, как показано в листинге 17-5: +В стопке `Screen`, мы определим способ `run`, который будет вызывать способ `draw` каждой переменной вектора `components`, как показано в приложении 17-5: Файл: src/lib.rs @@ -42,9 +44,9 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-05/src/lib.rs:here}} ``` -Листинг 17-5: Реализация метода run у структуры Screen, который вызывает метод draw каждого компонента из вектора +Приложение 17-5: Использование способа run у стопки Screen, который вызывает способ draw каждого составляющих из вектора -Это работает иначе, чем определение структуры, которая использует параметр общего типа с ограничениями типажа. Обобщённый параметр типа может быть заменён только одним конкретным типом, тогда как типаж-объекты позволяют нескольким конкретным типам замещать типаж-объект во время выполнения. Например, мы могли бы определить структуру `Screen` используя общий тип и ограничение типажа, как показано в листинге 17-6: +Это работает иначе, чем определение стопки, которая использует свойство общего вида данных с ограничениями сущности. Обобщённое свойство вида данных может быть заменён только одним определенным видом данных, тогда как сущность-предметы позволяют нескольким определенным видам данных замещать сущность-предмет во время выполнения. Например, мы могли бы определить стопку `Screen` используя общий вид данных и ограничение сущности, как показано в приложении 17-6: Файл: src/lib.rs @@ -52,15 +54,15 @@ {{#rustdoc_include ../listings/ch17-oop/listing-17-06/src/lib.rs:here}} ``` -Листинг 17-6: Альтернативная реализация структуры Screen и метода run, используя обобщённый тип и ограничения типажа +Приложение 17-6: Иное выполнение стопки Screen и способа run, используя обобщённый вид данных и ограничения сущности -Это вариант ограничивает нас экземпляром `Screen`, который имеет список компонентов всех типов `Button` или всех типов `TextField`. Если у вас когда-либо будут только однородные коллекции, использование обобщений и ограничений типажа является предпочтительным, поскольку определения будут мономорфизированы во время компиляции для использования с конкретными типами. +Это исход ограничивает нас образцом `Screen`, который имеет список составляющих всех видов данных `Button` или всех видов данных `TextField`. Если у вас когда-либо будут только однородные собрания, использование обобщений и ограничений сущности является предпочтительным, поскольку определения будут мономорфизированы во время сборки для использования с определенными видами данных. -С другой стороны, с помощью метода, использующего типаж-объекты, один экземпляр `Screen` может содержать `Vec` который содержит `Box