diff --git a/po/uk.po b/po/uk.po index 9471f5e9..e0212fba 100644 --- a/po/uk.po +++ b/po/uk.po @@ -52,8 +52,8 @@ msgstr "Локальний запуск Cargo" msgid "Day 1: Morning" msgstr "" -#: src/SUMMARY.md:19 src/SUMMARY.md:79 src/SUMMARY.md:137 src/SUMMARY.md:195 -#: src/SUMMARY.md:221 src/SUMMARY.md:271 +#: src/SUMMARY.md:19 src/SUMMARY.md:79 src/SUMMARY.md:134 src/SUMMARY.md:192 +#: src/SUMMARY.md:218 src/SUMMARY.md:268 msgid "Welcome" msgstr "" @@ -121,7 +121,7 @@ msgstr "" msgid "Rustdoc" msgstr "" -#: src/SUMMARY.md:36 src/SUMMARY.md:107 src/basic-syntax/methods.md:1 +#: src/SUMMARY.md:36 src/SUMMARY.md:102 src/basic-syntax/methods.md:1 #: src/methods.md:1 msgid "Methods" msgstr "" @@ -130,9 +130,9 @@ msgstr "" msgid "Overloading" msgstr "" -#: src/SUMMARY.md:38 src/SUMMARY.md:71 src/SUMMARY.md:100 src/SUMMARY.md:110 -#: src/SUMMARY.md:129 src/SUMMARY.md:157 src/SUMMARY.md:187 src/SUMMARY.md:214 -#: src/SUMMARY.md:235 src/SUMMARY.md:263 src/SUMMARY.md:285 src/SUMMARY.md:306 +#: src/SUMMARY.md:38 src/SUMMARY.md:71 src/SUMMARY.md:105 src/SUMMARY.md:125 +#: src/SUMMARY.md:154 src/SUMMARY.md:184 src/SUMMARY.md:211 src/SUMMARY.md:232 +#: src/SUMMARY.md:260 src/SUMMARY.md:282 src/SUMMARY.md:303 #: src/exercises/android/morning.md:1 src/exercises/bare-metal/morning.md:1 #: src/exercises/bare-metal/afternoon.md:1 #: src/exercises/concurrency/morning.md:1 @@ -152,7 +152,7 @@ msgstr "" msgid "Day 1: Afternoon" msgstr "" -#: src/SUMMARY.md:44 src/SUMMARY.md:298 src/control-flow.md:1 +#: src/SUMMARY.md:44 src/SUMMARY.md:295 src/control-flow.md:1 msgid "Control Flow" msgstr "" @@ -285,751 +285,747 @@ msgstr "" msgid "Rust Memory Management" msgstr "" -#: src/SUMMARY.md:88 src/memory-management/comparison.md:1 -msgid "Comparison" -msgstr "" - -#: src/SUMMARY.md:89 src/ownership.md:1 +#: src/SUMMARY.md:88 src/ownership.md:1 msgid "Ownership" msgstr "" -#: src/SUMMARY.md:90 src/ownership/move-semantics.md:1 +#: src/SUMMARY.md:89 src/ownership/move-semantics.md:1 msgid "Move Semantics" msgstr "" -#: src/SUMMARY.md:91 src/ownership/moved-strings-rust.md:1 +#: src/SUMMARY.md:90 src/ownership/moved-strings-rust.md:1 msgid "Moved Strings in Rust" msgstr "" -#: src/SUMMARY.md:92 +#: src/SUMMARY.md:91 msgid "Double Frees in Modern C++" msgstr "" -#: src/SUMMARY.md:93 src/ownership/moves-function-calls.md:1 +#: src/SUMMARY.md:92 src/ownership/moves-function-calls.md:1 msgid "Moves in Function Calls" msgstr "" -#: src/SUMMARY.md:94 src/ownership/copy-clone.md:1 +#: src/SUMMARY.md:93 src/ownership/copy-clone.md:1 msgid "Copying and Cloning" msgstr "" -#: src/SUMMARY.md:95 src/ownership/borrowing.md:1 +#: src/SUMMARY.md:94 src/ownership/borrowing.md:1 msgid "Borrowing" msgstr "" -#: src/SUMMARY.md:96 src/ownership/shared-unique-borrows.md:1 +#: src/SUMMARY.md:95 src/ownership/shared-unique-borrows.md:1 msgid "Shared and Unique Borrows" msgstr "" -#: src/SUMMARY.md:97 src/ownership/lifetimes.md:1 +#: src/SUMMARY.md:96 src/ownership/lifetimes.md:1 msgid "Lifetimes" msgstr "" -#: src/SUMMARY.md:98 src/ownership/lifetimes-function-calls.md:1 +#: src/SUMMARY.md:97 src/ownership/lifetimes-function-calls.md:1 msgid "Lifetimes in Function Calls" msgstr "" -#: src/SUMMARY.md:99 src/ownership/lifetimes-data-structures.md:1 +#: src/SUMMARY.md:98 src/ownership/lifetimes-data-structures.md:1 msgid "Lifetimes in Data Structures" msgstr "" -#: src/SUMMARY.md:101 src/exercises/day-2/book-library.md:1 -msgid "Storing Books" -msgstr "" - -#: src/SUMMARY.md:102 src/exercises/day-2/iterators-and-ownership.md:1 -msgid "Iterators and Ownership" -msgstr "" - -#: src/SUMMARY.md:104 src/structs.md:1 +#: src/SUMMARY.md:99 src/structs.md:1 msgid "Structs" msgstr "" -#: src/SUMMARY.md:105 src/structs/tuple-structs.md:1 +#: src/SUMMARY.md:100 src/structs/tuple-structs.md:1 msgid "Tuple Structs" msgstr "" -#: src/SUMMARY.md:106 src/structs/field-shorthand.md:1 +#: src/SUMMARY.md:101 src/structs/field-shorthand.md:1 msgid "Field Shorthand Syntax" msgstr "" -#: src/SUMMARY.md:108 src/methods/receiver.md:1 +#: src/SUMMARY.md:103 src/methods/receiver.md:1 msgid "Method Receiver" msgstr "" -#: src/SUMMARY.md:109 src/SUMMARY.md:169 src/SUMMARY.md:284 +#: src/SUMMARY.md:104 src/SUMMARY.md:166 src/SUMMARY.md:281 #: src/methods/example.md:1 src/concurrency/shared_state/example.md:1 msgid "Example" msgstr "" -#: src/SUMMARY.md:111 src/exercises/day-2/health-statistics.md:1 +#: src/SUMMARY.md:106 src/exercises/day-2/book-library.md:1 +msgid "Storing Books" +msgstr "" + +#: src/SUMMARY.md:107 src/exercises/day-2/health-statistics.md:1 msgid "Health Statistics" msgstr "" -#: src/SUMMARY.md:113 +#: src/SUMMARY.md:109 msgid "Day 2: Afternoon" msgstr "" -#: src/SUMMARY.md:115 src/std.md:1 +#: src/SUMMARY.md:111 src/std.md:1 msgid "Standard Library" msgstr "" -#: src/SUMMARY.md:116 +#: src/SUMMARY.md:112 msgid "Option and Result" msgstr "" -#: src/SUMMARY.md:117 src/std/string.md:1 +#: src/SUMMARY.md:113 src/std/string.md:1 msgid "String" msgstr "" -#: src/SUMMARY.md:118 +#: src/SUMMARY.md:114 msgid "Vec" msgstr "" -#: src/SUMMARY.md:119 +#: src/SUMMARY.md:115 msgid "HashMap" msgstr "" -#: src/SUMMARY.md:120 +#: src/SUMMARY.md:116 msgid "Box" msgstr "" -#: src/SUMMARY.md:121 +#: src/SUMMARY.md:117 msgid "Recursive Data Types" msgstr "" -#: src/SUMMARY.md:122 src/std/box-niche.md:1 +#: src/SUMMARY.md:118 src/std/box-niche.md:1 msgid "Niche Optimization" msgstr "" -#: src/SUMMARY.md:123 +#: src/SUMMARY.md:119 msgid "Rc" msgstr "" -#: src/SUMMARY.md:124 +#: src/SUMMARY.md:120 msgid "Cell/RefCell" msgstr "" -#: src/SUMMARY.md:125 src/modules.md:1 +#: src/SUMMARY.md:121 src/modules.md:1 msgid "Modules" msgstr "" -#: src/SUMMARY.md:126 src/modules/visibility.md:1 +#: src/SUMMARY.md:122 src/modules/visibility.md:1 msgid "Visibility" msgstr "" -#: src/SUMMARY.md:127 src/modules/paths.md:1 +#: src/SUMMARY.md:123 src/modules/paths.md:1 msgid "Paths" msgstr "" -#: src/SUMMARY.md:128 src/modules/filesystem.md:1 +#: src/SUMMARY.md:124 src/modules/filesystem.md:1 msgid "Filesystem Hierarchy" msgstr "" -#: src/SUMMARY.md:130 src/exercises/day-2/strings-iterators.md:1 +#: src/SUMMARY.md:126 src/exercises/day-2/iterators-and-ownership.md:1 +msgid "Iterators and Ownership" +msgstr "" + +#: src/SUMMARY.md:127 src/exercises/day-2/strings-iterators.md:1 #: src/exercises/day-2/solutions-afternoon.md:3 msgid "Strings and Iterators" msgstr "" -#: src/SUMMARY.md:133 +#: src/SUMMARY.md:130 msgid "Day 3: Morning" msgstr "" -#: src/SUMMARY.md:138 src/generics.md:1 +#: src/SUMMARY.md:135 src/generics.md:1 msgid "Generics" msgstr "" -#: src/SUMMARY.md:139 src/generics/data-types.md:1 +#: src/SUMMARY.md:136 src/generics/data-types.md:1 msgid "Generic Data Types" msgstr "" -#: src/SUMMARY.md:140 src/generics/methods.md:1 +#: src/SUMMARY.md:137 src/generics/methods.md:1 msgid "Generic Methods" msgstr "" -#: src/SUMMARY.md:141 src/generics/monomorphization.md:1 +#: src/SUMMARY.md:138 src/generics/monomorphization.md:1 msgid "Monomorphization" msgstr "" -#: src/SUMMARY.md:142 src/traits.md:1 +#: src/SUMMARY.md:139 src/traits.md:1 msgid "Traits" msgstr "" -#: src/SUMMARY.md:143 src/traits/trait-objects.md:1 +#: src/SUMMARY.md:140 src/traits/trait-objects.md:1 msgid "Trait Objects" msgstr "" -#: src/SUMMARY.md:144 src/traits/deriving-traits.md:1 +#: src/SUMMARY.md:141 src/traits/deriving-traits.md:1 msgid "Deriving Traits" msgstr "" -#: src/SUMMARY.md:145 src/traits/default-methods.md:1 +#: src/SUMMARY.md:142 src/traits/default-methods.md:1 msgid "Default Methods" msgstr "" -#: src/SUMMARY.md:146 src/traits/trait-bounds.md:1 +#: src/SUMMARY.md:143 src/traits/trait-bounds.md:1 msgid "Trait Bounds" msgstr "" -#: src/SUMMARY.md:147 +#: src/SUMMARY.md:144 msgid "impl Trait" msgstr "" -#: src/SUMMARY.md:148 src/traits/important-traits.md:1 +#: src/SUMMARY.md:145 src/traits/important-traits.md:1 msgid "Important Traits" msgstr "" -#: src/SUMMARY.md:149 +#: src/SUMMARY.md:146 msgid "Iterator" msgstr "" -#: src/SUMMARY.md:150 src/traits/from-iterator.md:1 +#: src/SUMMARY.md:147 src/traits/from-iterator.md:1 msgid "FromIterator" msgstr "" -#: src/SUMMARY.md:151 +#: src/SUMMARY.md:148 msgid "From and Into" msgstr "" -#: src/SUMMARY.md:152 +#: src/SUMMARY.md:149 msgid "Read and Write" msgstr "" -#: src/SUMMARY.md:153 +#: src/SUMMARY.md:150 msgid "Drop" msgstr "" -#: src/SUMMARY.md:154 +#: src/SUMMARY.md:151 msgid "Default" msgstr "" -#: src/SUMMARY.md:155 +#: src/SUMMARY.md:152 msgid "Operators: Add, Mul, ..." msgstr "" -#: src/SUMMARY.md:156 +#: src/SUMMARY.md:153 msgid "Closures: Fn, FnMut, FnOnce" msgstr "" -#: src/SUMMARY.md:158 src/exercises/day-3/simple-gui.md:1 +#: src/SUMMARY.md:155 src/exercises/day-3/simple-gui.md:1 #: src/exercises/day-3/solutions-morning.md:3 msgid "A Simple GUI Library" msgstr "" -#: src/SUMMARY.md:159 src/exercises/day-3/solutions-morning.md:175 +#: src/SUMMARY.md:156 src/exercises/day-3/solutions-morning.md:175 msgid "Points and Polygons" msgstr "" -#: src/SUMMARY.md:161 +#: src/SUMMARY.md:158 msgid "Day 3: Afternoon" msgstr "" -#: src/SUMMARY.md:163 src/error-handling.md:1 +#: src/SUMMARY.md:160 src/error-handling.md:1 msgid "Error Handling" msgstr "" -#: src/SUMMARY.md:164 src/error-handling/panics.md:1 +#: src/SUMMARY.md:161 src/error-handling/panics.md:1 msgid "Panics" msgstr "" -#: src/SUMMARY.md:165 +#: src/SUMMARY.md:162 msgid "Catching Stack Unwinding" msgstr "" -#: src/SUMMARY.md:166 +#: src/SUMMARY.md:163 msgid "Structured Error Handling" msgstr "" -#: src/SUMMARY.md:167 +#: src/SUMMARY.md:164 msgid "Propagating Errors with ?" msgstr "" -#: src/SUMMARY.md:168 src/error-handling/converting-error-types.md:1 +#: src/SUMMARY.md:165 src/error-handling/converting-error-types.md:1 #: src/error-handling/converting-error-types-example.md:1 msgid "Converting Error Types" msgstr "" -#: src/SUMMARY.md:170 src/error-handling/deriving-error-enums.md:1 +#: src/SUMMARY.md:167 src/error-handling/deriving-error-enums.md:1 msgid "Deriving Error Enums" msgstr "" -#: src/SUMMARY.md:171 src/error-handling/dynamic-errors.md:1 +#: src/SUMMARY.md:168 src/error-handling/dynamic-errors.md:1 msgid "Dynamic Error Types" msgstr "" -#: src/SUMMARY.md:172 src/error-handling/error-contexts.md:1 +#: src/SUMMARY.md:169 src/error-handling/error-contexts.md:1 msgid "Adding Context to Errors" msgstr "" -#: src/SUMMARY.md:173 src/testing.md:1 +#: src/SUMMARY.md:170 src/testing.md:1 msgid "Testing" msgstr "" -#: src/SUMMARY.md:174 src/testing/unit-tests.md:1 +#: src/SUMMARY.md:171 src/testing/unit-tests.md:1 msgid "Unit Tests" msgstr "" -#: src/SUMMARY.md:175 src/testing/test-modules.md:1 +#: src/SUMMARY.md:172 src/testing/test-modules.md:1 msgid "Test Modules" msgstr "" -#: src/SUMMARY.md:176 src/testing/doc-tests.md:1 +#: src/SUMMARY.md:173 src/testing/doc-tests.md:1 msgid "Documentation Tests" msgstr "" -#: src/SUMMARY.md:177 src/testing/integration-tests.md:1 +#: src/SUMMARY.md:174 src/testing/integration-tests.md:1 msgid "Integration Tests" msgstr "" -#: src/SUMMARY.md:178 src/bare-metal/useful-crates.md:1 +#: src/SUMMARY.md:175 src/bare-metal/useful-crates.md:1 msgid "Useful crates" msgstr "" -#: src/SUMMARY.md:179 src/unsafe.md:1 +#: src/SUMMARY.md:176 src/unsafe.md:1 msgid "Unsafe Rust" msgstr "" -#: src/SUMMARY.md:180 src/unsafe/raw-pointers.md:1 +#: src/SUMMARY.md:177 src/unsafe/raw-pointers.md:1 msgid "Dereferencing Raw Pointers" msgstr "" -#: src/SUMMARY.md:181 src/unsafe/mutable-static-variables.md:1 +#: src/SUMMARY.md:178 src/unsafe/mutable-static-variables.md:1 msgid "Mutable Static Variables" msgstr "" -#: src/SUMMARY.md:182 src/unsafe/unions.md:1 +#: src/SUMMARY.md:179 src/unsafe/unions.md:1 msgid "Unions" msgstr "" -#: src/SUMMARY.md:183 src/unsafe/calling-unsafe-functions.md:1 +#: src/SUMMARY.md:180 src/unsafe/calling-unsafe-functions.md:1 msgid "Calling Unsafe Functions" msgstr "" -#: src/SUMMARY.md:184 src/unsafe/writing-unsafe-functions.md:1 +#: src/SUMMARY.md:181 src/unsafe/writing-unsafe-functions.md:1 msgid "Writing Unsafe Functions" msgstr "" -#: src/SUMMARY.md:185 +#: src/SUMMARY.md:182 msgid "Extern Functions" msgstr "" -#: src/SUMMARY.md:186 src/unsafe/unsafe-traits.md:1 +#: src/SUMMARY.md:183 src/unsafe/unsafe-traits.md:1 msgid "Implementing Unsafe Traits" msgstr "" -#: src/SUMMARY.md:188 src/exercises/day-3/safe-ffi-wrapper.md:1 +#: src/SUMMARY.md:185 src/exercises/day-3/safe-ffi-wrapper.md:1 #: src/exercises/day-3/solutions-afternoon.md:3 msgid "Safe FFI Wrapper" msgstr "" -#: src/SUMMARY.md:191 src/SUMMARY.md:261 src/bare-metal/android.md:1 +#: src/SUMMARY.md:188 src/SUMMARY.md:258 src/bare-metal/android.md:1 msgid "Android" msgstr "" -#: src/SUMMARY.md:196 src/android/setup.md:1 +#: src/SUMMARY.md:193 src/android/setup.md:1 msgid "Setup" msgstr "" -#: src/SUMMARY.md:197 src/android/build-rules.md:1 +#: src/SUMMARY.md:194 src/android/build-rules.md:1 msgid "Build Rules" msgstr "" -#: src/SUMMARY.md:198 +#: src/SUMMARY.md:195 msgid "Binary" msgstr "" -#: src/SUMMARY.md:199 +#: src/SUMMARY.md:196 msgid "Library" msgstr "" -#: src/SUMMARY.md:200 src/android/aidl.md:1 +#: src/SUMMARY.md:197 src/android/aidl.md:1 msgid "AIDL" msgstr "" -#: src/SUMMARY.md:201 +#: src/SUMMARY.md:198 msgid "Interface" msgstr "" -#: src/SUMMARY.md:202 +#: src/SUMMARY.md:199 msgid "Implementation" msgstr "" -#: src/SUMMARY.md:203 +#: src/SUMMARY.md:200 msgid "Server" msgstr "" -#: src/SUMMARY.md:204 src/android/aidl/deploy.md:1 +#: src/SUMMARY.md:201 src/android/aidl/deploy.md:1 msgid "Deploy" msgstr "" -#: src/SUMMARY.md:205 +#: src/SUMMARY.md:202 msgid "Client" msgstr "" -#: src/SUMMARY.md:206 src/android/aidl/changing.md:1 +#: src/SUMMARY.md:203 src/android/aidl/changing.md:1 msgid "Changing API" msgstr "" -#: src/SUMMARY.md:207 src/SUMMARY.md:251 src/android/logging.md:1 +#: src/SUMMARY.md:204 src/SUMMARY.md:248 src/android/logging.md:1 #: src/bare-metal/aps/logging.md:1 msgid "Logging" msgstr "" -#: src/SUMMARY.md:208 src/android/interoperability.md:1 +#: src/SUMMARY.md:205 src/android/interoperability.md:1 msgid "Interoperability" msgstr "" -#: src/SUMMARY.md:209 +#: src/SUMMARY.md:206 msgid "With C" msgstr "" -#: src/SUMMARY.md:210 +#: src/SUMMARY.md:207 msgid "Calling C with Bindgen" msgstr "" -#: src/SUMMARY.md:211 +#: src/SUMMARY.md:208 msgid "Calling Rust from C" msgstr "" -#: src/SUMMARY.md:212 src/android/interoperability/cpp.md:1 +#: src/SUMMARY.md:209 src/android/interoperability/cpp.md:1 msgid "With C++" msgstr "" -#: src/SUMMARY.md:213 +#: src/SUMMARY.md:210 msgid "With Java" msgstr "" -#: src/SUMMARY.md:217 +#: src/SUMMARY.md:214 msgid "Bare Metal: Morning" msgstr "" -#: src/SUMMARY.md:222 +#: src/SUMMARY.md:219 msgid "no_std" msgstr "" -#: src/SUMMARY.md:223 +#: src/SUMMARY.md:220 msgid "A Minimal Example" msgstr "" -#: src/SUMMARY.md:224 +#: src/SUMMARY.md:221 msgid "alloc" msgstr "" -#: src/SUMMARY.md:225 src/bare-metal/microcontrollers.md:1 +#: src/SUMMARY.md:222 src/bare-metal/microcontrollers.md:1 msgid "Microcontrollers" msgstr "" -#: src/SUMMARY.md:226 src/bare-metal/microcontrollers/mmio.md:1 +#: src/SUMMARY.md:223 src/bare-metal/microcontrollers/mmio.md:1 msgid "Raw MMIO" msgstr "" -#: src/SUMMARY.md:227 +#: src/SUMMARY.md:224 msgid "PACs" msgstr "" -#: src/SUMMARY.md:228 +#: src/SUMMARY.md:225 msgid "HAL Crates" msgstr "" -#: src/SUMMARY.md:229 +#: src/SUMMARY.md:226 msgid "Board Support Crates" msgstr "" -#: src/SUMMARY.md:230 +#: src/SUMMARY.md:227 msgid "The Type State Pattern" msgstr "" -#: src/SUMMARY.md:231 +#: src/SUMMARY.md:228 msgid "embedded-hal" msgstr "" -#: src/SUMMARY.md:232 +#: src/SUMMARY.md:229 msgid "probe-rs, cargo-embed" msgstr "" -#: src/SUMMARY.md:233 src/bare-metal/microcontrollers/debugging.md:1 +#: src/SUMMARY.md:230 src/bare-metal/microcontrollers/debugging.md:1 msgid "Debugging" msgstr "" -#: src/SUMMARY.md:234 src/SUMMARY.md:254 +#: src/SUMMARY.md:231 src/SUMMARY.md:251 msgid "Other Projects" msgstr "" -#: src/SUMMARY.md:236 src/exercises/bare-metal/compass.md:1 +#: src/SUMMARY.md:233 src/exercises/bare-metal/compass.md:1 #: src/exercises/bare-metal/solutions-morning.md:3 msgid "Compass" msgstr "" -#: src/SUMMARY.md:238 +#: src/SUMMARY.md:235 msgid "Bare Metal: Afternoon" msgstr "" -#: src/SUMMARY.md:240 +#: src/SUMMARY.md:237 msgid "Application Processors" msgstr "" -#: src/SUMMARY.md:241 src/bare-metal/aps/entry-point.md:1 +#: src/SUMMARY.md:238 src/bare-metal/aps/entry-point.md:1 msgid "Getting Ready to Rust" msgstr "" -#: src/SUMMARY.md:242 +#: src/SUMMARY.md:239 msgid "Inline Assembly" msgstr "" -#: src/SUMMARY.md:243 +#: src/SUMMARY.md:240 msgid "MMIO" msgstr "" -#: src/SUMMARY.md:244 +#: src/SUMMARY.md:241 msgid "Let's Write a UART Driver" msgstr "" -#: src/SUMMARY.md:245 +#: src/SUMMARY.md:242 msgid "More Traits" msgstr "" -#: src/SUMMARY.md:246 +#: src/SUMMARY.md:243 msgid "A Better UART Driver" msgstr "" -#: src/SUMMARY.md:247 src/bare-metal/aps/better-uart/bitflags.md:1 +#: src/SUMMARY.md:244 src/bare-metal/aps/better-uart/bitflags.md:1 msgid "Bitflags" msgstr "" -#: src/SUMMARY.md:248 +#: src/SUMMARY.md:245 msgid "Multiple Registers" msgstr "" -#: src/SUMMARY.md:249 src/bare-metal/aps/better-uart/driver.md:1 +#: src/SUMMARY.md:246 src/bare-metal/aps/better-uart/driver.md:1 msgid "Driver" msgstr "" -#: src/SUMMARY.md:250 src/SUMMARY.md:252 +#: src/SUMMARY.md:247 src/SUMMARY.md:249 msgid "Using It" msgstr "" -#: src/SUMMARY.md:253 src/bare-metal/aps/exceptions.md:1 +#: src/SUMMARY.md:250 src/bare-metal/aps/exceptions.md:1 msgid "Exceptions" msgstr "" -#: src/SUMMARY.md:255 +#: src/SUMMARY.md:252 msgid "Useful Crates" msgstr "" -#: src/SUMMARY.md:256 +#: src/SUMMARY.md:253 msgid "zerocopy" msgstr "" -#: src/SUMMARY.md:257 +#: src/SUMMARY.md:254 msgid "aarch64-paging" msgstr "" -#: src/SUMMARY.md:258 +#: src/SUMMARY.md:255 msgid "buddy_system_allocator" msgstr "" -#: src/SUMMARY.md:259 +#: src/SUMMARY.md:256 msgid "tinyvec" msgstr "" -#: src/SUMMARY.md:260 +#: src/SUMMARY.md:257 msgid "spin" msgstr "" -#: src/SUMMARY.md:262 src/bare-metal/android/vmbase.md:1 +#: src/SUMMARY.md:259 src/bare-metal/android/vmbase.md:1 msgid "vmbase" msgstr "" -#: src/SUMMARY.md:264 +#: src/SUMMARY.md:261 msgid "RTC Driver" msgstr "" -#: src/SUMMARY.md:267 +#: src/SUMMARY.md:264 msgid "Concurrency: Morning" msgstr "" -#: src/SUMMARY.md:272 src/concurrency/threads.md:1 +#: src/SUMMARY.md:269 src/concurrency/threads.md:1 msgid "Threads" msgstr "" -#: src/SUMMARY.md:273 src/concurrency/scoped-threads.md:1 +#: src/SUMMARY.md:270 src/concurrency/scoped-threads.md:1 msgid "Scoped Threads" msgstr "" -#: src/SUMMARY.md:274 src/concurrency/channels.md:1 +#: src/SUMMARY.md:271 src/concurrency/channels.md:1 msgid "Channels" msgstr "" -#: src/SUMMARY.md:275 src/concurrency/channels/unbounded.md:1 +#: src/SUMMARY.md:272 src/concurrency/channels/unbounded.md:1 msgid "Unbounded Channels" msgstr "" -#: src/SUMMARY.md:276 src/concurrency/channels/bounded.md:1 +#: src/SUMMARY.md:273 src/concurrency/channels/bounded.md:1 msgid "Bounded Channels" msgstr "" -#: src/SUMMARY.md:277 +#: src/SUMMARY.md:274 msgid "Send and Sync" msgstr "" -#: src/SUMMARY.md:277 +#: src/SUMMARY.md:274 msgid "Send" msgstr "" -#: src/SUMMARY.md:277 +#: src/SUMMARY.md:274 msgid "Sync" msgstr "" -#: src/SUMMARY.md:280 src/concurrency/send-sync/examples.md:1 +#: src/SUMMARY.md:277 src/concurrency/send-sync/examples.md:1 msgid "Examples" msgstr "" -#: src/SUMMARY.md:281 src/concurrency/shared_state.md:1 +#: src/SUMMARY.md:278 src/concurrency/shared_state.md:1 msgid "Shared State" msgstr "" -#: src/SUMMARY.md:282 +#: src/SUMMARY.md:279 msgid "Arc" msgstr "" -#: src/SUMMARY.md:283 +#: src/SUMMARY.md:280 msgid "Mutex" msgstr "" -#: src/SUMMARY.md:286 src/SUMMARY.md:307 +#: src/SUMMARY.md:283 src/SUMMARY.md:304 #: src/exercises/concurrency/dining-philosophers.md:1 #: src/exercises/concurrency/solutions-morning.md:3 msgid "Dining Philosophers" msgstr "" -#: src/SUMMARY.md:287 src/exercises/concurrency/link-checker.md:1 +#: src/SUMMARY.md:284 src/exercises/concurrency/link-checker.md:1 msgid "Multi-threaded Link Checker" msgstr "" -#: src/SUMMARY.md:289 +#: src/SUMMARY.md:286 msgid "Concurrency: Afternoon" msgstr "" -#: src/SUMMARY.md:291 +#: src/SUMMARY.md:288 msgid "Async Basics" msgstr "" -#: src/SUMMARY.md:292 +#: src/SUMMARY.md:289 msgid "async/await" msgstr "" -#: src/SUMMARY.md:293 src/async/futures.md:1 +#: src/SUMMARY.md:290 src/async/futures.md:1 msgid "Futures" msgstr "" -#: src/SUMMARY.md:294 src/async/runtimes.md:1 +#: src/SUMMARY.md:291 src/async/runtimes.md:1 msgid "Runtimes" msgstr "" -#: src/SUMMARY.md:295 src/async/runtimes/tokio.md:1 +#: src/SUMMARY.md:292 src/async/runtimes/tokio.md:1 msgid "Tokio" msgstr "" -#: src/SUMMARY.md:296 src/exercises/concurrency/link-checker.md:126 -#: src/async/tasks.md:1 src/exercises/concurrency/chat-app.md:140 +#: src/SUMMARY.md:293 src/exercises/concurrency/link-checker.md:126 +#: src/async/tasks.md:1 src/exercises/concurrency/chat-app.md:143 msgid "Tasks" msgstr "" -#: src/SUMMARY.md:297 src/async/channels.md:1 +#: src/SUMMARY.md:294 src/async/channels.md:1 msgid "Async Channels" msgstr "" -#: src/SUMMARY.md:299 src/async/control-flow/join.md:1 +#: src/SUMMARY.md:296 src/async/control-flow/join.md:1 msgid "Join" msgstr "" -#: src/SUMMARY.md:300 src/async/control-flow/select.md:1 +#: src/SUMMARY.md:297 src/async/control-flow/select.md:1 msgid "Select" msgstr "" -#: src/SUMMARY.md:301 +#: src/SUMMARY.md:298 msgid "Pitfalls" msgstr "" -#: src/SUMMARY.md:302 +#: src/SUMMARY.md:299 msgid "Blocking the Executor" msgstr "" -#: src/SUMMARY.md:303 src/async/pitfalls/pin.md:1 +#: src/SUMMARY.md:300 src/async/pitfalls/pin.md:1 msgid "Pin" msgstr "" -#: src/SUMMARY.md:304 src/async/pitfalls/async-traits.md:1 +#: src/SUMMARY.md:301 src/async/pitfalls/async-traits.md:1 msgid "Async Traits" msgstr "" -#: src/SUMMARY.md:305 src/async/pitfalls/cancellation.md:1 +#: src/SUMMARY.md:302 src/async/pitfalls/cancellation.md:1 #, fuzzy msgid "Cancellation" msgstr "Встановлення" -#: src/SUMMARY.md:308 src/exercises/concurrency/chat-app.md:1 +#: src/SUMMARY.md:305 src/exercises/concurrency/chat-app.md:1 #: src/exercises/concurrency/solutions-afternoon.md:119 msgid "Broadcast Chat Application" msgstr "" -#: src/SUMMARY.md:311 +#: src/SUMMARY.md:308 msgid "Final Words" msgstr "" -#: src/SUMMARY.md:315 src/thanks.md:1 +#: src/SUMMARY.md:312 src/thanks.md:1 msgid "Thanks!" msgstr "" -#: src/SUMMARY.md:316 +#: src/SUMMARY.md:313 msgid "Other Resources" msgstr "" -#: src/SUMMARY.md:317 src/credits.md:1 +#: src/SUMMARY.md:314 src/credits.md:1 msgid "Credits" msgstr "" -#: src/SUMMARY.md:320 src/exercises/solutions.md:1 +#: src/SUMMARY.md:317 src/exercises/solutions.md:1 msgid "Solutions" msgstr "" -#: src/SUMMARY.md:325 +#: src/SUMMARY.md:322 msgid "Day 1 Morning" msgstr "" -#: src/SUMMARY.md:326 +#: src/SUMMARY.md:323 msgid "Day 1 Afternoon" msgstr "" -#: src/SUMMARY.md:327 +#: src/SUMMARY.md:324 msgid "Day 2 Morning" msgstr "" -#: src/SUMMARY.md:328 +#: src/SUMMARY.md:325 msgid "Day 2 Afternoon" msgstr "" -#: src/SUMMARY.md:329 +#: src/SUMMARY.md:326 msgid "Day 3 Morning" msgstr "" -#: src/SUMMARY.md:330 +#: src/SUMMARY.md:327 msgid "Day 3 Afternoon" msgstr "" -#: src/SUMMARY.md:331 +#: src/SUMMARY.md:328 msgid "Bare Metal Rust Morning" msgstr "" -#: src/SUMMARY.md:332 src/exercises/bare-metal/solutions-afternoon.md:1 +#: src/SUMMARY.md:329 src/exercises/bare-metal/solutions-afternoon.md:1 msgid "Bare Metal Rust Afternoon" msgstr "" -#: src/SUMMARY.md:333 +#: src/SUMMARY.md:330 msgid "Concurrency Morning" msgstr "" -#: src/SUMMARY.md:334 +#: src/SUMMARY.md:331 msgid "Concurrency Afternoon" msgstr "" @@ -1059,29 +1055,36 @@ msgstr "" #: src/index.md:11 msgid "" +"The latest version of the course can be found at . If you are reading somewhere else, please check there " +"for updates." +msgstr "" + +#: src/index.md:15 +msgid "" "The goal of the course is to teach you Rust. We assume you don't know " "anything about Rust and hope to:" msgstr "" "Ціль курсу --- навчити вас мові Rust. Ми припускаємо, що ви нічого не знаєте " "про Rust и надіємося:" -#: src/index.md:14 +#: src/index.md:18 msgid "Give you a comprehensive understanding of the Rust syntax and language." msgstr "Дати повне уявлення про синтаксис та семантику Rust." -#: src/index.md:15 +#: src/index.md:19 msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "Навчити працювати з існуючим кодом та писати нові програми на Rust." -#: src/index.md:16 +#: src/index.md:20 msgid "Show you common Rust idioms." msgstr "Показати розповсюджені ідіоми мови Rust." -#: src/index.md:18 +#: src/index.md:22 msgid "We call the first three course days Rust Fundamentals." msgstr "" -#: src/index.md:20 +#: src/index.md:24 #, fuzzy msgid "" "Building on this, you're invited to dive into one or more specialized topics:" @@ -1089,7 +1092,7 @@ msgstr "" "Перші три дні познайомлять вас із основами Rust. Після цього вам " "пропонується заглибитися в одну або кілька спеціалізованих тем:" -#: src/index.md:22 +#: src/index.md:26 msgid "" "[Android](android.md): a half-day course on using Rust for Android platform " "development (AOSP). This includes interoperability with C, C++, and Java." @@ -1098,7 +1101,7 @@ msgstr "" "для розробки на платформі Android (AOSP). Сюди входить взаємодія з C, C++ та " "Java." -#: src/index.md:24 +#: src/index.md:28 #, fuzzy msgid "" "[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal " @@ -1109,7 +1112,7 @@ msgstr "" "низькорівневої (embedded) розробки, що охоплює як мікроконтролери, так і " "звичайні процесори." -#: src/index.md:27 +#: src/index.md:31 #, fuzzy msgid "" "[Concurrency](concurrency.md): a whole-day class on concurrency in Rust. We " @@ -1122,11 +1125,11 @@ msgstr "" "багатозадачність з використанням потоків і м'ютексів), так і async/await " "конкурентність (кооперативна багатозадачність з використанням футур)." -#: src/index.md:33 +#: src/index.md:37 msgid "Non-Goals" msgstr "За рамками курсу" -#: src/index.md:35 +#: src/index.md:39 msgid "" "Rust is a large language and we won't be able to cover all of it in a few " "days. Some non-goals of this course are:" @@ -1134,7 +1137,7 @@ msgstr "" "Rust --- це об'ємна мова, і ми не зможемо охопити її за кілька днів. Теми, " "що виходять за межі курсу:" -#: src/index.md:38 +#: src/index.md:42 #, fuzzy msgid "" "Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" @@ -1145,11 +1148,11 @@ msgstr "" "org/book/ch19-06-macros.html) и [Rust by Example](https://doc.rust-lang.org/" "rust-by-example/macros.html)." -#: src/index.md:42 +#: src/index.md:46 msgid "Assumptions" msgstr "Пропозиції" -#: src/index.md:44 +#: src/index.md:48 #, fuzzy msgid "" "The course assumes that you already know how to program. Rust is a " @@ -1161,7 +1164,7 @@ msgstr "" "щоб краще пояснити чи підкреслити різницю у підходах до написання коду на " "Rust." -#: src/index.md:48 +#: src/index.md:52 #, fuzzy msgid "" "If you know how to program in a dynamically-typed language such as Python or " @@ -1170,7 +1173,7 @@ msgstr "" "Якщо ви знаєте, як програмувати мовою з динамічною типізацією, наприклад " "Python або JavaScript, ви зможете успішно пройти цей курс." -#: src/index.md:53 +#: src/index.md:57 msgid "" "This is an example of a _speaker note_. We will use these to add additional " "information to the slides. This could be key points which the instructor " @@ -1194,10 +1197,20 @@ msgstr "" "Google.." #: src/running-the-course.md:8 +msgid "" +"We typically run classes from 10:00 am to 4:00 pm, with a 1 hour lunch break " +"in the middle. This leaves 2.5 hours for the morning class and 2.5 hours for " +"the afternoon class. Note that this is just a recommendation: you can also " +"spend 3 hour on the morning session to give people more time for exercises. " +"The downside of longer session is that people can become very tired after 6 " +"full hours of class in the afternoon." +msgstr "" + +#: src/running-the-course.md:16 msgid "Before you run the course, you will want to:" msgstr "Перед проведенням курсу бажано:" -#: src/running-the-course.md:10 +#: src/running-the-course.md:18 msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " @@ -1213,7 +1226,7 @@ msgstr "" "замітками для викладача, в той час, як основне вікно ви можете демонструвати " "класу." -#: src/running-the-course.md:16 +#: src/running-the-course.md:24 msgid "" "Decide on the dates. Since the course takes at least three full days, we " "recommend that you schedule the days over two weeks. Course participants " @@ -1225,7 +1238,7 @@ msgstr "" "учасники курсу вважають корисною наявність перерв, оскільки це допомагає їм " "краще осмислити інформацію." -#: src/running-the-course.md:21 +#: src/running-the-course.md:29 msgid "" "Find a room large enough for your in-person participants. We recommend a " "class size of 15-25 people. That's small enough that people are comfortable " @@ -1240,7 +1253,7 @@ msgstr "" "комфортно ставити запитання, а у викладача залишився час на те, щоб на них " "відповідати." -#: src/running-the-course.md:29 +#: src/running-the-course.md:37 msgid "" "On the day of your course, show up to the room a little early to set things " "up. We recommend presenting directly using `mdbook serve` running on your " @@ -1256,7 +1269,7 @@ msgstr "" "затримок під час зміни сторінок. Використання ноутбука також дозволить вам " "виправляти друкарські помилки в міру їх виявлення вами або учасниками курсу." -#: src/running-the-course.md:35 +#: src/running-the-course.md:43 msgid "" "Let people solve the exercises by themselves or in small groups. We " "typically spend 30-45 minutes on exercises in the morning and in the " @@ -1274,7 +1287,7 @@ msgstr "" "рішення, наприклад, показавши, де знайти відповідну інформацію у стандартній " "бібліотеці." -#: src/running-the-course.md:43 +#: src/running-the-course.md:51 msgid "" "That is all, good luck running the course! We hope it will be as much fun " "for you as it has been for us!" @@ -1282,7 +1295,7 @@ msgstr "" "На цьому все, удачі у проходженні курсу! Ми сподіваємося, що вам буде так " "само весело, як і нам!" -#: src/running-the-course.md:46 +#: src/running-the-course.md:54 msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" "discussions/86) afterwards so that we can keep improving the course. We " @@ -1297,14 +1310,20 @@ msgstr "" "discussions/100)!" #: src/running-the-course/course-structure.md:5 -msgid "The course is fast paced and covers a lot of ground:" -msgstr "Курс проходить у швидкому темпі та охоплює багато питань:" +msgid "Rust Fundamentals" +msgstr "" #: src/running-the-course/course-structure.md:7 +msgid "" +"The first three days make up [Rust Fundaments](../welcome-day-1.md). The " +"days are fast paced and we cover a lot of ground:" +msgstr "" + +#: src/running-the-course/course-structure.md:10 msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." msgstr "" -#: src/running-the-course/course-structure.md:8 +#: src/running-the-course/course-structure.md:11 #, fuzzy msgid "" "Day 2: Memory management, ownership, compound data types, and the standard " @@ -1312,18 +1331,18 @@ msgid "" msgstr "" "День 2: Складові типи даних, зіставлення із зразком, стандартна бібліотека." -#: src/running-the-course/course-structure.md:9 +#: src/running-the-course/course-structure.md:12 #, fuzzy msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." msgstr "" "День 3: Трейти та узагальнення, обробка помилок, тестування, небезпечний " "Rust." -#: src/running-the-course/course-structure.md:11 +#: src/running-the-course/course-structure.md:14 msgid "Deep Dives" msgstr "Глибоке занурення" -#: src/running-the-course/course-structure.md:13 +#: src/running-the-course/course-structure.md:16 msgid "" "In addition to the 3-day class on Rust Fundamentals, we cover some more " "specialized topics:" @@ -1331,11 +1350,11 @@ msgstr "" "На додаток до 3-денного курсу з основ Rust, ми розглянемо ще кілька " "спеціалізованих тем:" -#: src/running-the-course/course-structure.md:16 +#: src/running-the-course/course-structure.md:19 msgid "Rust in Android" msgstr "" -#: src/running-the-course/course-structure.md:18 +#: src/running-the-course/course-structure.md:21 #, fuzzy msgid "" "The [Rust in Android](../android.md) deep dive is a half-day course on using " @@ -1346,7 +1365,7 @@ msgstr "" "Rust для розробки на Android платформі. Сюди входить взаємодія з C, C++ та " "Java." -#: src/running-the-course/course-structure.md:22 +#: src/running-the-course/course-structure.md:25 msgid "" "You will need an [AOSP checkout](https://source.android.com/docs/setup/" "download/downloading). Make a checkout of the [course repository](https://" @@ -1360,7 +1379,7 @@ msgstr "" "`src/android/` в кореневий каталог вашого AOSP. Це гарантує, що система " "збирання Android побачить файли `Android.bp` в `src/android/`." -#: src/running-the-course/course-structure.md:27 +#: src/running-the-course/course-structure.md:30 msgid "" "Ensure that `adb sync` works with your emulator or real device and pre-build " "all Android examples using `src/android/build_all.sh`. Read the script to " @@ -1371,11 +1390,11 @@ msgstr "" "android/build_all.sh`. Прочитайте скрипт, щоб побачити команди, які він " "запускає, і переконайтеся, що вони працюють, коли ви запускаєте їх вручну." -#: src/running-the-course/course-structure.md:34 +#: src/running-the-course/course-structure.md:37 msgid "Bare-Metal Rust" msgstr "" -#: src/running-the-course/course-structure.md:36 +#: src/running-the-course/course-structure.md:39 #, fuzzy msgid "" "The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " @@ -1386,7 +1405,7 @@ msgstr "" "використання Rust для низькорівневої (embedded) розробки. Розглядаються як " "мікроконтролери, так і прикладні процесори." -#: src/running-the-course/course-structure.md:40 +#: src/running-the-course/course-structure.md:43 msgid "" "For the microcontroller part, you will need to buy the [BBC micro:bit]" "(https://microbit.org/) v2 development board ahead of time. Everybody will " @@ -1398,12 +1417,12 @@ msgstr "" "встановити кілька пакетів, як описано на [сторінці привітання](../bare-metal." "md)." -#: src/running-the-course/course-structure.md:45 +#: src/running-the-course/course-structure.md:48 #, fuzzy msgid "Concurrency in Rust" msgstr "Конкурентність" -#: src/running-the-course/course-structure.md:47 +#: src/running-the-course/course-structure.md:50 #, fuzzy msgid "" "The [Concurrency in Rust](../concurrency.md) deep dive is a full day class " @@ -1412,7 +1431,7 @@ msgstr "" "[Concurrency Deep Dive](../concurrency.md) це цілий день занять з класичної, " "а теж `async`/`await` конкурентності." -#: src/running-the-course/course-structure.md:50 +#: src/running-the-course/course-structure.md:53 msgid "" "You will need a fresh crate set up and the dependencies downloaded and ready " "to go. You can then copy/paste the examples into `src/main.rs` to experiment " @@ -1422,7 +1441,7 @@ msgstr "" "готові до роботи. Потім ви можете скопіювати приклади в `src/main.rs`, щоб " "поекспериментувати з ними:" -#: src/running-the-course/course-structure.md:54 +#: src/running-the-course/course-structure.md:57 msgid "" "```shell\n" "cargo init concurrency\n" @@ -1432,11 +1451,11 @@ msgid "" "```" msgstr "" -#: src/running-the-course/course-structure.md:61 +#: src/running-the-course/course-structure.md:64 msgid "Format" msgstr "Формат" -#: src/running-the-course/course-structure.md:63 +#: src/running-the-course/course-structure.md:66 msgid "" "The course is meant to be very interactive and we recommend letting the " "questions drive the exploration of Rust!" @@ -1709,6 +1728,7 @@ msgstr "" #: src/why-rust/modern.md:21 src/basic-syntax/compound-types.md:30 #: src/basic-syntax/references.md:23 #: src/pattern-matching/destructuring-enums.md:35 +#: src/ownership/double-free-modern-cpp.md:55 #: src/error-handling/try-operator.md:48 #: src/error-handling/converting-error-types-example.md:50 #: src/concurrency/threads.md:30 src/async/async-await.md:25 @@ -3669,8 +3689,8 @@ msgstr "" #: src/exercises/day-1/for-loops.md:102 msgid "" -"An implicit array copy would have occurred. Since `i32` is a copy type, then " -"`[i32; 3]` is also a copy type." +"An implicit array copy would have occurred. Since `i32` is a copy type, " +"then `[i32; 3]` is also a copy type." msgstr "" #: src/control-flow.md:3 @@ -5188,8 +5208,8 @@ msgstr "" #: src/exercises/day-1/luhn.md:12 msgid "" -"After doubling a digit, sum the digits. So doubling `7` becomes `14` which " -"becomes `5`." +"After doubling a digit, sum the digits if the result is greater than 9. So " +"doubling `7` becomes `14` which becomes `1 + 4 = 5`." msgstr "" #: src/exercises/day-1/luhn.md:15 @@ -5225,6 +5245,7 @@ msgid "" "#[test]\n" "fn test_non_digit_cc_number() {\n" " assert!(!luhn(\"foo\"));\n" +" assert!(!luhn(\"foo 0 0\"));\n" "}\n" "\n" "#[test]\n" @@ -5592,27 +5613,20 @@ msgid "Safe and correct like Java, but without a garbage collector." msgstr "" #: src/memory-management/rust.md:6 -msgid "" -"Depending on which abstraction (or combination of abstractions) you choose, " -"can be a single unique pointer, reference counted, or atomically reference " -"counted." -msgstr "" - -#: src/memory-management/rust.md:7 msgid "Scope-based like C++, but the compiler enforces full adherence." msgstr "" -#: src/memory-management/rust.md:8 +#: src/memory-management/rust.md:7 msgid "" "A Rust user can choose the right abstraction for the situation, some even " "have no cost at runtime like C." msgstr "" -#: src/memory-management/rust.md:10 +#: src/memory-management/rust.md:9 msgid "Rust achieves this by modeling _ownership_ explicitly." msgstr "" -#: src/memory-management/rust.md:14 +#: src/memory-management/rust.md:13 msgid "" "If asked how at this point, you can mention that in Rust this is usually " "handled by RAII wrapper types such as [Box](https://doc.rust-lang.org/std/" @@ -5623,107 +5637,12 @@ msgid "" "errors in C." msgstr "" -#: src/memory-management/rust.md:16 +#: src/memory-management/rust.md:15 msgid "" "You may be asked about destructors here, the [Drop](https://doc.rust-lang." "org/std/ops/trait.Drop.html) trait is the Rust equivalent." msgstr "" -#: src/memory-management/comparison.md:3 -msgid "Here is a rough comparison of the memory management techniques." -msgstr "" - -#: src/memory-management/comparison.md:5 -msgid "Pros of Different Memory Management Techniques" -msgstr "" - -#: src/memory-management/comparison.md:7 src/memory-management/comparison.md:22 -msgid "Manual like C:" -msgstr "" - -#: src/memory-management/comparison.md:8 src/memory-management/comparison.md:14 -#: src/memory-management/comparison.md:17 -msgid "No runtime overhead." -msgstr "" - -#: src/memory-management/comparison.md:9 src/memory-management/comparison.md:26 -msgid "Automatic like Java:" -msgstr "" - -#: src/memory-management/comparison.md:10 -msgid "Fully automatic." -msgstr "" - -#: src/memory-management/comparison.md:11 -#: src/memory-management/comparison.md:18 -msgid "Safe and correct." -msgstr "" - -#: src/memory-management/comparison.md:12 -#: src/memory-management/comparison.md:29 -msgid "Scope-based like C++:" -msgstr "" - -#: src/memory-management/comparison.md:13 -msgid "Partially automatic." -msgstr "" - -#: src/memory-management/comparison.md:15 -msgid "Compiler-enforced scope-based like Rust:" -msgstr "" - -#: src/memory-management/comparison.md:16 -msgid "Enforced by compiler." -msgstr "" - -#: src/memory-management/comparison.md:20 -msgid "Cons of Different Memory Management Techniques" -msgstr "" - -#: src/memory-management/comparison.md:23 -msgid "Use-after-free." -msgstr "" - -#: src/memory-management/comparison.md:24 -msgid "Double-frees." -msgstr "" - -#: src/memory-management/comparison.md:25 -msgid "Memory leaks." -msgstr "" - -#: src/memory-management/comparison.md:27 -msgid "Garbage collection pauses." -msgstr "" - -#: src/memory-management/comparison.md:28 -msgid "Destructor delays." -msgstr "" - -#: src/memory-management/comparison.md:30 -msgid "Complex, opt-in by programmer (on C++)." -msgstr "" - -#: src/memory-management/comparison.md:31 -msgid "Circular references can lead to memory leaks" -msgstr "" - -#: src/memory-management/comparison.md:32 -msgid "Potential runtime overhead" -msgstr "" - -#: src/memory-management/comparison.md:33 -msgid "Compiler-enforced and scope-based like Rust:" -msgstr "" - -#: src/memory-management/comparison.md:34 -msgid "Some upfront complexity." -msgstr "" - -#: src/memory-management/comparison.md:35 -msgid "Can reject valid programs." -msgstr "" - #: src/ownership.md:3 msgid "" "All variable bindings have a _scope_ where they are valid and it is an error " @@ -5881,7 +5800,7 @@ msgid "" msgstr "" #: src/ownership/double-free-modern-cpp.md:1 -msgid "Extra Work in Modern C++" +msgid "Defensive Copies in Modern C++" msgstr "" #: src/ownership/double-free-modern-cpp.md:3 @@ -5954,6 +5873,28 @@ msgid "" "```" msgstr "" +#: src/ownership/double-free-modern-cpp.md:57 +msgid "" +"C++ has made a slightly different choice than Rust. Because `=` copies data, " +"the string data has to be cloned. Otherwise we would get a double-free when " +"either string goes out of scope." +msgstr "" + +#: src/ownership/double-free-modern-cpp.md:61 +msgid "" +"C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " +"which is used to indicate when a value may be moved from. If the example had " +"been `s2 = std::move(s1)`, no heap allocation would take place. After the " +"move, `s1` would be in a valid but unspecified state. Unlike Rust, the " +"programmer is allowed to keep using `s1`." +msgstr "" + +#: src/ownership/double-free-modern-cpp.md:66 +msgid "" +"Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " +"which is being copied or moved." +msgstr "" + #: src/ownership/moves-function-calls.md:3 msgid "" "When you pass a value to a function, the value is assigned to the function " @@ -6430,311 +6371,6 @@ msgid "" "of the struct itself. Those are very advanced use cases." msgstr "" -#: src/exercises/day-2/morning.md:1 -msgid "Day 2: Morning Exercises" -msgstr "" - -#: src/exercises/day-2/morning.md:3 -msgid "We will look at implementing methods in two contexts:" -msgstr "" - -#: src/exercises/day-2/morning.md:5 -msgid "Simple struct which tracks health statistics." -msgstr "" - -#: src/exercises/day-2/morning.md:7 -msgid "Multiple structs and enums for a drawing library." -msgstr "" - -#: src/exercises/day-2/book-library.md:3 -msgid "" -"We will learn much more about structs and the `Vec` type tomorrow. For " -"now, you just need to know part of its API:" -msgstr "" - -#: src/exercises/day-2/book-library.md:6 -msgid "" -"```rust,editable\n" -"fn main() {\n" -" let mut vec = vec![10, 20];\n" -" vec.push(30);\n" -" let midpoint = vec.len() / 2;\n" -" println!(\"middle value: {}\", vec[midpoint]);\n" -" for item in &vec {\n" -" println!(\"item: {item}\");\n" -" }\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/book-library.md:18 -msgid "" -"Use this to model a library's book collection. Copy the code below to " -" and update the types to make it compile:" -msgstr "" - -#: src/exercises/day-2/book-library.md:21 -msgid "" -"```rust,should_panic\n" -"struct Library {\n" -" books: Vec,\n" -"}\n" -"\n" -"struct Book {\n" -" title: String,\n" -" year: u16,\n" -"}\n" -"\n" -"impl Book {\n" -" // This is a constructor, used below.\n" -" fn new(title: &str, year: u16) -> Book {\n" -" Book {\n" -" title: String::from(title),\n" -" year,\n" -" }\n" -" }\n" -"}\n" -"\n" -"// Implement the methods below. Update the `self` parameter to\n" -"// indicate the method's required level of ownership over the object:\n" -"//\n" -"// - `&self` for shared read-only access,\n" -"// - `&mut self` for unique and mutable access,\n" -"// - `self` for unique access by value.\n" -"impl Library {\n" -" fn new() -> Library {\n" -" todo!(\"Initialize and return a `Library` value\")\n" -" }\n" -"\n" -" //fn len(self) -> usize {\n" -" // todo!(\"Return the length of `self.books`\")\n" -" //}\n" -"\n" -" //fn is_empty(self) -> bool {\n" -" // todo!(\"Return `true` if `self.books` is empty\")\n" -" //}\n" -"\n" -" //fn add_book(self, book: Book) {\n" -" // todo!(\"Add a new book to `self.books`\")\n" -" //}\n" -"\n" -" //fn print_books(self) {\n" -" // todo!(\"Iterate over `self.books` and each book's title and " -"year\")\n" -" //}\n" -"\n" -" //fn oldest_book(self) -> Option<&Book> {\n" -" // todo!(\"Return a reference to the oldest book (if any)\")\n" -" //}\n" -"}\n" -"\n" -"// This shows the desired behavior. Uncomment the code below and\n" -"// implement the missing methods. You will need to update the\n" -"// method signatures, including the \"self\" parameter! You may\n" -"// also need to update the variable bindings within main.\n" -"fn main() {\n" -" let library = Library::new();\n" -"\n" -" //println!(\"The library is empty: library.is_empty() -> {}\", library." -"is_empty());\n" -" //\n" -" //library.add_book(Book::new(\"Lord of the Rings\", 1954));\n" -" //library.add_book(Book::new(\"Alice's Adventures in Wonderland\", " -"1865));\n" -" //\n" -" //println!(\"The library is no longer empty: library.is_empty() -> {}\", " -"library.is_empty());\n" -" //\n" -" //\n" -" //library.print_books();\n" -" //\n" -" //match library.oldest_book() {\n" -" // Some(book) => println!(\"The oldest book is {}\", book.title),\n" -" // None => println!(\"The library is empty!\"),\n" -" //}\n" -" //\n" -" //println!(\"The library has {} books\", library.len());\n" -" //library.print_books();\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/book-library.md:102 -msgid "[Solution](solutions-afternoon.md#designing-a-library)" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:3 -msgid "" -"The ownership model of Rust affects many APIs. An example of this is the " -"[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) and " -"[`IntoIterator`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html) " -"traits." -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:8 src/bare-metal/no_std.md:28 -msgid "`Iterator`" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:10 -msgid "" -"Traits are like interfaces: they describe behavior (methods) for a type. The " -"`Iterator` trait simply says that you can call `next` until you get `None` " -"back:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:13 -msgid "" -"```rust\n" -"pub trait Iterator {\n" -" type Item;\n" -" fn next(&mut self) -> Option;\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:20 -msgid "You use this trait like this:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:22 -msgid "" -"```rust,editable\n" -"fn main() {\n" -" let v: Vec = vec![10, 20, 30];\n" -" let mut iter = v.iter();\n" -"\n" -" println!(\"v[0]: {:?}\", iter.next());\n" -" println!(\"v[1]: {:?}\", iter.next());\n" -" println!(\"v[2]: {:?}\", iter.next());\n" -" println!(\"No more items: {:?}\", iter.next());\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:34 -msgid "What is the type returned by the iterator? Test your answer here:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:36 -msgid "" -"```rust,editable,compile_fail\n" -"fn main() {\n" -" let v: Vec = vec![10, 20, 30];\n" -" let mut iter = v.iter();\n" -"\n" -" let v0: Option<..> = iter.next();\n" -" println!(\"v0: {v0:?}\");\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:46 -msgid "Why is this type used?" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:48 -msgid "`IntoIterator`" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:50 -msgid "" -"The `Iterator` trait tells you how to _iterate_ once you have created an " -"iterator. The related trait `IntoIterator` tells you how to create the " -"iterator:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:53 -msgid "" -"```rust\n" -"pub trait IntoIterator {\n" -" type Item;\n" -" type IntoIter: Iterator;\n" -"\n" -" fn into_iter(self) -> Self::IntoIter;\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:62 -msgid "" -"The syntax here means that every implementation of `IntoIterator` must " -"declare two types:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:65 -msgid "`Item`: the type we iterate over, such as `i8`," -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:66 -msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:68 -msgid "" -"Note that `IntoIter` and `Item` are linked: the iterator must have the same " -"`Item` type, which means that it returns `Option`" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:71 -msgid "Like before, what is the type returned by the iterator?" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:73 -msgid "" -"```rust,editable,compile_fail\n" -"fn main() {\n" -" let v: Vec = vec![String::from(\"foo\"), String::" -"from(\"bar\")];\n" -" let mut iter = v.into_iter();\n" -"\n" -" let v0: Option<..> = iter.next();\n" -" println!(\"v0: {v0:?}\");\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:83 -msgid "`for` Loops" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:85 -msgid "" -"Now that we know both `Iterator` and `IntoIterator`, we can build `for` " -"loops. They call `into_iter()` on an expression and iterates over the " -"resulting iterator:" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:89 -msgid "" -"```rust,editable\n" -"fn main() {\n" -" let v: Vec = vec![String::from(\"foo\"), String::" -"from(\"bar\")];\n" -"\n" -" for word in &v {\n" -" println!(\"word: {word}\");\n" -" }\n" -"\n" -" for word in v {\n" -" println!(\"word: {word}\");\n" -" }\n" -"}\n" -"```" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:103 -msgid "What is the type of `word` in each loop?" -msgstr "" - -#: src/exercises/day-2/iterators-and-ownership.md:105 -msgid "" -"Experiment with the code above and then consult the documentation for [`impl " -"IntoIterator for &Vec`](https://doc.rust-lang.org/std/vec/struct.Vec." -"html#impl-IntoIterator-for-%26'a+Vec%3CT,+A%3E) and [`impl IntoIterator for " -"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-" -"for-Vec%3CT,+A%3E) to check your answers." -msgstr "" - #: src/structs.md:3 msgid "Like C and C++, Rust has support for custom structs:" msgstr "" @@ -7195,12 +6831,137 @@ msgid "" "over. We describe vectors in more detail in the afternoon. " msgstr "" -#: src/exercises/day-2/afternoon.md:1 -msgid "Day 2: Afternoon Exercises" +#: src/exercises/day-2/morning.md:1 +msgid "Day 2: Morning Exercises" msgstr "" -#: src/exercises/day-2/afternoon.md:3 -msgid "The exercises for this afternoon will focus on strings and iterators." +#: src/exercises/day-2/morning.md:3 +msgid "We will look at implementing methods in two contexts:" +msgstr "" + +#: src/exercises/day-2/morning.md:5 +msgid "Storing books and querying the collection" +msgstr "" + +#: src/exercises/day-2/morning.md:7 +msgid "Keeping track of health statistics for patients" +msgstr "" + +#: src/exercises/day-2/book-library.md:3 +msgid "" +"We will learn much more about structs and the `Vec` type tomorrow. For " +"now, you just need to know part of its API:" +msgstr "" + +#: src/exercises/day-2/book-library.md:6 +msgid "" +"```rust,editable\n" +"fn main() {\n" +" let mut vec = vec![10, 20];\n" +" vec.push(30);\n" +" let midpoint = vec.len() / 2;\n" +" println!(\"middle value: {}\", vec[midpoint]);\n" +" for item in &vec {\n" +" println!(\"item: {item}\");\n" +" }\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/book-library.md:18 +msgid "" +"Use this to model a library's book collection. Copy the code below to " +" and update the types to make it compile:" +msgstr "" + +#: src/exercises/day-2/book-library.md:21 +msgid "" +"```rust,should_panic\n" +"struct Library {\n" +" books: Vec,\n" +"}\n" +"\n" +"struct Book {\n" +" title: String,\n" +" year: u16,\n" +"}\n" +"\n" +"impl Book {\n" +" // This is a constructor, used below.\n" +" fn new(title: &str, year: u16) -> Book {\n" +" Book {\n" +" title: String::from(title),\n" +" year,\n" +" }\n" +" }\n" +"}\n" +"\n" +"// Implement the methods below. Update the `self` parameter to\n" +"// indicate the method's required level of ownership over the object:\n" +"//\n" +"// - `&self` for shared read-only access,\n" +"// - `&mut self` for unique and mutable access,\n" +"// - `self` for unique access by value.\n" +"impl Library {\n" +" fn new() -> Library {\n" +" todo!(\"Initialize and return a `Library` value\")\n" +" }\n" +"\n" +" //fn len(self) -> usize {\n" +" // todo!(\"Return the length of `self.books`\")\n" +" //}\n" +"\n" +" //fn is_empty(self) -> bool {\n" +" // todo!(\"Return `true` if `self.books` is empty\")\n" +" //}\n" +"\n" +" //fn add_book(self, book: Book) {\n" +" // todo!(\"Add a new book to `self.books`\")\n" +" //}\n" +"\n" +" //fn print_books(self) {\n" +" // todo!(\"Iterate over `self.books` and print each book's title and " +"year\")\n" +" //}\n" +"\n" +" //fn oldest_book(self) -> Option<&Book> {\n" +" // todo!(\"Return a reference to the oldest book (if any)\")\n" +" //}\n" +"}\n" +"\n" +"// This shows the desired behavior. Uncomment the code below and\n" +"// implement the missing methods. You will need to update the\n" +"// method signatures, including the \"self\" parameter! You may\n" +"// also need to update the variable bindings within main.\n" +"fn main() {\n" +" let library = Library::new();\n" +"\n" +" //println!(\"The library is empty: library.is_empty() -> {}\", library." +"is_empty());\n" +" //\n" +" //library.add_book(Book::new(\"Lord of the Rings\", 1954));\n" +" //library.add_book(Book::new(\"Alice's Adventures in Wonderland\", " +"1865));\n" +" //\n" +" //println!(\"The library is no longer empty: library.is_empty() -> {}\", " +"library.is_empty());\n" +" //\n" +" //\n" +" //library.print_books();\n" +" //\n" +" //match library.oldest_book() {\n" +" // Some(book) => println!(\"The oldest book is {}\", book.title),\n" +" // None => println!(\"The library is empty!\"),\n" +" //}\n" +" //\n" +" //println!(\"The library has {} books\", library.len());\n" +" //library.print_books();\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/book-library.md:102 +msgid "[Solution](solutions-afternoon.md#designing-a-library)" msgstr "" #: src/exercises/day-2/health-statistics.md:3 @@ -8327,6 +8088,186 @@ msgid "" "in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" +#: src/exercises/day-2/afternoon.md:1 +msgid "Day 2: Afternoon Exercises" +msgstr "" + +#: src/exercises/day-2/afternoon.md:3 +msgid "The exercises for this afternoon will focus on strings and iterators." +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:3 +msgid "" +"The ownership model of Rust affects many APIs. An example of this is the " +"[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) and " +"[`IntoIterator`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html) " +"traits." +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:8 src/bare-metal/no_std.md:28 +msgid "`Iterator`" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:10 +msgid "" +"Traits are like interfaces: they describe behavior (methods) for a type. The " +"`Iterator` trait simply says that you can call `next` until you get `None` " +"back:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:13 +msgid "" +"```rust\n" +"pub trait Iterator {\n" +" type Item;\n" +" fn next(&mut self) -> Option;\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:20 +msgid "You use this trait like this:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:22 +msgid "" +"```rust,editable\n" +"fn main() {\n" +" let v: Vec = vec![10, 20, 30];\n" +" let mut iter = v.iter();\n" +"\n" +" println!(\"v[0]: {:?}\", iter.next());\n" +" println!(\"v[1]: {:?}\", iter.next());\n" +" println!(\"v[2]: {:?}\", iter.next());\n" +" println!(\"No more items: {:?}\", iter.next());\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:34 +msgid "What is the type returned by the iterator? Test your answer here:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:36 +msgid "" +"```rust,editable,compile_fail\n" +"fn main() {\n" +" let v: Vec = vec![10, 20, 30];\n" +" let mut iter = v.iter();\n" +"\n" +" let v0: Option<..> = iter.next();\n" +" println!(\"v0: {v0:?}\");\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:46 +msgid "Why is this type used?" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:48 +msgid "`IntoIterator`" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:50 +msgid "" +"The `Iterator` trait tells you how to _iterate_ once you have created an " +"iterator. The related trait `IntoIterator` tells you how to create the " +"iterator:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:53 +msgid "" +"```rust\n" +"pub trait IntoIterator {\n" +" type Item;\n" +" type IntoIter: Iterator;\n" +"\n" +" fn into_iter(self) -> Self::IntoIter;\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:62 +msgid "" +"The syntax here means that every implementation of `IntoIterator` must " +"declare two types:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:65 +msgid "`Item`: the type we iterate over, such as `i8`," +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:66 +msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:68 +msgid "" +"Note that `IntoIter` and `Item` are linked: the iterator must have the same " +"`Item` type, which means that it returns `Option`" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:71 +msgid "Like before, what is the type returned by the iterator?" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:73 +msgid "" +"```rust,editable,compile_fail\n" +"fn main() {\n" +" let v: Vec = vec![String::from(\"foo\"), String::" +"from(\"bar\")];\n" +" let mut iter = v.into_iter();\n" +"\n" +" let v0: Option<..> = iter.next();\n" +" println!(\"v0: {v0:?}\");\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:83 +msgid "`for` Loops" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:85 +msgid "" +"Now that we know both `Iterator` and `IntoIterator`, we can build `for` " +"loops. They call `into_iter()` on an expression and iterates over the " +"resulting iterator:" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:89 +msgid "" +"```rust,editable\n" +"fn main() {\n" +" let v: Vec = vec![String::from(\"foo\"), String::" +"from(\"bar\")];\n" +"\n" +" for word in &v {\n" +" println!(\"word: {word}\");\n" +" }\n" +"\n" +" for word in v {\n" +" println!(\"word: {word}\");\n" +" }\n" +"}\n" +"```" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:103 +msgid "What is the type of `word` in each loop?" +msgstr "" + +#: src/exercises/day-2/iterators-and-ownership.md:105 +msgid "" +"Experiment with the code above and then consult the documentation for [`impl " +"IntoIterator for &Vec`](https://doc.rust-lang.org/std/vec/struct.Vec." +"html#impl-IntoIterator-for-%26'a+Vec%3CT,+A%3E) and [`impl IntoIterator for " +"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-" +"for-Vec%3CT,+A%3E) to check your answers." +msgstr "" + #: src/exercises/day-2/strings-iterators.md:3 msgid "" "In this exercise, you are implementing a routing component of a web server. " @@ -17813,7 +17754,7 @@ msgid "" "In this example, we have a race between a cat and a dog. " "`first_animal_to_finish_race` listens to both channels and will pick " "whichever arrives first. Since the dog takes 50ms, it wins against the cat " -"that take 500ms seconds." +"that take 500ms." msgstr "" #: src/async/control-flow/select.md:67 @@ -18272,7 +18213,7 @@ msgstr "" #: src/async/pitfalls/cancellation.md:82 msgid "" -"`LinesReader` can be made cancellation-safe by makeing `buf` part of the " +"`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "" @@ -18447,7 +18388,7 @@ msgstr "" msgid "" "For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" "sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" -"(https://docs.rs/tokio-websockets/0.3.2/tokio_websockets/) for the " +"(https://docs.rs/tokio-websockets/0.4.0/tokio_websockets/) for the " "communication between the client and the server." msgstr "" @@ -18468,10 +18409,11 @@ msgid "" "edition = \"2021\"\n" "\n" "[dependencies]\n" -"futures-util = \"0.3.28\"\n" +"futures-util = { version = \"0.3.28\", features = [\"sink\"] }\n" "http = \"0.2.9\"\n" "tokio = { version = \"1.28.1\", features = [\"full\"] }\n" -"tokio-websockets = \"0.3.2\"\n" +"tokio-websockets = { version = \"0.4.0\", features = [\"client\", " +"\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -18482,15 +18424,15 @@ msgstr "" #: src/exercises/concurrency/chat-app.md:33 msgid "" "You are going to need the following functions from `tokio` and " -"[`tokio_websockets`](https://docs.rs/tokio-websockets/0.3.2/" +"[`tokio_websockets`](https://docs.rs/tokio-websockets/0.4.0/" "tokio_websockets/). Spend a few minutes to familiarize yourself with the " "API. " msgstr "" #: src/exercises/concurrency/chat-app.md:37 msgid "" -"[WebsocketStream::next()](https://docs.rs/tokio-websockets/0.3.2/" -"tokio_websockets/proto/struct.WebsocketStream.html#method.next): for " +"[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" +"trait.StreamExt.html#method.next) implemented by `WebsocketStream`: for " "asynchronously reading messages from a Websocket Stream." msgstr "" @@ -18545,6 +18487,7 @@ msgstr "" msgid "" "```rust,compile_fail\n" "use futures_util::sink::SinkExt;\n" +"use futures_util::stream::StreamExt;\n" "use std::error::Error;\n" "use std::net::SocketAddr;\n" "use tokio::net::{TcpListener, TcpStream};\n" @@ -18583,14 +18526,15 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md:102 -#: src/exercises/concurrency/solutions-afternoon.md:208 +#: src/exercises/concurrency/chat-app.md:103 +#: src/exercises/concurrency/solutions-afternoon.md:210 msgid "`src/bin/client.rs`:" msgstr "" -#: src/exercises/concurrency/chat-app.md:106 +#: src/exercises/concurrency/chat-app.md:107 msgid "" "```rust,compile_fail\n" +"use futures_util::stream::StreamExt;\n" "use futures_util::SinkExt;\n" "use http::Uri;\n" "use tokio::io::{AsyncBufReadExt, BufReader};\n" @@ -18598,10 +18542,10 @@ msgid "" "\n" "#[tokio::main]\n" "async fn main() -> Result<(), tokio_websockets::Error> {\n" -" let mut ws_stream = ClientBuilder::from_uri(Uri::" -"from_static(\"ws://127.0.0.1:2000\"))\n" -" .connect()\n" -" .await?;\n" +" let (mut ws_stream, _) =\n" +" ClientBuilder::from_uri(Uri::from_static(\"ws://127.0.0.1:2000\"))\n" +" .connect()\n" +" .await?;\n" "\n" " let stdin = tokio::io::stdin();\n" " let mut stdin = BufReader::new(stdin).lines();\n" @@ -18613,48 +18557,48 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md:127 +#: src/exercises/concurrency/chat-app.md:130 msgid "Running the binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md:128 +#: src/exercises/concurrency/chat-app.md:131 msgid "Run the server with:" msgstr "" -#: src/exercises/concurrency/chat-app.md:130 +#: src/exercises/concurrency/chat-app.md:133 msgid "" "```shell\n" "cargo run --bin server\n" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md:134 +#: src/exercises/concurrency/chat-app.md:137 msgid "and the client with:" msgstr "" -#: src/exercises/concurrency/chat-app.md:136 +#: src/exercises/concurrency/chat-app.md:139 msgid "" "```shell\n" "cargo run --bin client\n" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md:142 +#: src/exercises/concurrency/chat-app.md:145 msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md:143 +#: src/exercises/concurrency/chat-app.md:146 msgid "" "Hint: Use `tokio::select!` for concurrently performing two tasks in a " "continuous loop. One task receives messages from the client and broadcasts " "them. The other sends messages received by the server to the client." msgstr "" -#: src/exercises/concurrency/chat-app.md:146 +#: src/exercises/concurrency/chat-app.md:149 msgid "Complete the main function in `src/bin/client.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md:147 +#: src/exercises/concurrency/chat-app.md:150 msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " "performing two tasks: (1) reading user messages from standard input and " @@ -18662,7 +18606,7 @@ msgid "" "displaying them for the user." msgstr "" -#: src/exercises/concurrency/chat-app.md:151 +#: src/exercises/concurrency/chat-app.md:154 msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." @@ -19092,6 +19036,7 @@ msgid "" "#[test]\n" "fn test_non_digit_cc_number() {\n" " assert!(!luhn(\"foo\"));\n" +" assert!(!luhn(\"foo 0 0\"));\n" "}\n" "\n" "#[test]\n" @@ -19129,11 +19074,11 @@ msgid "" "```" msgstr "" -#: src/exercises/day-1/solutions-afternoon.md:97 +#: src/exercises/day-1/solutions-afternoon.md:98 msgid "Pattern matching" msgstr "" -#: src/exercises/day-1/solutions-afternoon.md:99 +#: src/exercises/day-1/solutions-afternoon.md:100 msgid "TBD." msgstr "" @@ -19230,7 +19175,7 @@ msgid "" "\n" " // ANCHOR: Library_print_books\n" " //fn print_books(self) {\n" -" // todo!(\"Iterate over `self.books` and each book's title and " +" // todo!(\"Iterate over `self.books` and print each book's title and " "year\")\n" " //}\n" " // ANCHOR_END: Library_print_books\n" @@ -20999,6 +20944,7 @@ msgid "" "\n" "// ANCHOR: setup\n" "use futures_util::sink::SinkExt;\n" +"use futures_util::stream::StreamExt;\n" "use std::error::Error;\n" "use std::net::SocketAddr;\n" "use tokio::net::{TcpListener, TcpStream};\n" @@ -21028,9 +20974,10 @@ msgid "" " incoming = ws_stream.next() => {\n" " match incoming {\n" " Some(Ok(msg)) => {\n" -" let msg = msg.as_text()?;\n" -" println!(\"From client {addr:?} {msg:?}\");\n" -" bcast_tx.send(msg.into())?;\n" +" if let Some(text) = msg.as_text() {\n" +" println!(\"From client {addr:?} {text:?}\");\n" +" bcast_tx.send(text.into())?;\n" +" }\n" " }\n" " Some(Err(err)) => return Err(err.into()),\n" " None => return Ok(()),\n" @@ -21067,7 +21014,7 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md:210 +#: src/exercises/concurrency/solutions-afternoon.md:212 msgid "" "```rust,compile_fail\n" "// Copyright 2023 Google LLC\n" @@ -21085,6 +21032,7 @@ msgid "" "// limitations under the License.\n" "\n" "// ANCHOR: setup\n" +"use futures_util::stream::StreamExt;\n" "use futures_util::SinkExt;\n" "use http::Uri;\n" "use tokio::io::{AsyncBufReadExt, BufReader};\n" @@ -21092,10 +21040,10 @@ msgid "" "\n" "#[tokio::main]\n" "async fn main() -> Result<(), tokio_websockets::Error> {\n" -" let mut ws_stream = ClientBuilder::from_uri(Uri::" -"from_static(\"ws://127.0.0.1:2000\"))\n" -" .connect()\n" -" .await?;\n" +" let (mut ws_stream, _) =\n" +" ClientBuilder::from_uri(Uri::from_static(\"ws://127.0.0.1:2000\"))\n" +" .connect()\n" +" .await?;\n" "\n" " let stdin = tokio::io::stdin();\n" " let mut stdin = BufReader::new(stdin).lines();\n" @@ -21106,8 +21054,11 @@ msgid "" " tokio::select! {\n" " incoming = ws_stream.next() => {\n" " match incoming {\n" -" Some(Ok(msg)) => println!(\"From server: {}\", msg." -"as_text()?),\n" +" Some(Ok(msg)) => {\n" +" if let Some(text) = msg.as_text() {\n" +" println!(\"From server: {}\", text);\n" +" }\n" +" },\n" " Some(Err(err)) => return Err(err.into()),\n" " None => return Ok(()),\n" " }\n" @@ -21127,6 +21078,9 @@ msgid "" "```" msgstr "" +#~ msgid "The course is fast paced and covers a lot of ground:" +#~ msgstr "Курс проходить у швидкому темпі та охоплює багато питань:" + #~ msgid "Day 1: Basic Rust, ownership and the borrow checker." #~ msgstr "День 1: Базовий Rust, володіння та аналізатор запозичень"