From 0a485b5a4cdc7742e34da7cfd55b58b59dc11634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Wed, 16 Jul 2025 19:31:04 +0300 Subject: [PATCH 001/103] Update destructuring-structs.md (#2807) In the #2749 , the match arm order has changed. Therefore, the word "second" should be changed to "first" in the notes. --- src/pattern-matching/destructuring-structs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pattern-matching/destructuring-structs.md b/src/pattern-matching/destructuring-structs.md index 9ca9811e..f0071686 100644 --- a/src/pattern-matching/destructuring-structs.md +++ b/src/pattern-matching/destructuring-structs.md @@ -24,7 +24,7 @@ Like tuples, Struct can also be destructured by matching: - The same effect occurs with `match &mut foo`: the captures become exclusive references. - The distinction between a capture and a constant expression can be hard to - spot. Try changing the `2` in the second arm to a variable, and see that it + spot. Try changing the `2` in the first arm to a variable, and see that it subtly doesn't work. Change it to a `const` and see it working again. From 22d6af4abd567d413c3e37a5094ae204f2fb020a Mon Sep 17 00:00:00 2001 From: Tim McNamara Date: Thu, 17 Jul 2025 14:03:31 +1200 Subject: [PATCH 002/103] Add Unsafe Rust Deep Dive (#2806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the start of an unsafe deep dive to Comprehensive Rust. The `unsafe` keyword is easy to type, but hard to master. When used appropriately, it forms a useful and indeed essential part of the Rust programming language. By the end of this deep dive, you'll know how to work with `unsafe` code, review others' changes that include the `unsafe` keyword, and produce your own. What you'll learn: - What the terms undefined behavior, soundness, and safety mean - Why the `unsafe` keyword exists in the Rust language - How to write your own code using `unsafe` safely - How to review `unsafe` code Here is a tentative outline of a 10h (2 day) treatment: Day 1: Using and Reviewing Unsafe - Welcome - Motivations: explain why the `unsafe` keyword exists - Foundations: provide background knowledge; what is soundness? what is undefined behavior? what is validity in respect to pointers? - Mechanics: what a safe `unsafe` block should look like - Representations and Interoperability: explore how data is laid out in memory and how that can be sent across the wire and/or stored on disk. - Reviewing unsafe - Patterns for safer unsafe: Encapsulating unsafe code in safe-to-use abstractions, such as marking a type's constructor as `unsafe` so that invariants only need to be enforced once by the programmer. Day 2: Deploying Unsafe to Build Abstractions - Welcome - Validity in detail: A refresher. Emphasis on the details of the invariants that are being upheld by a “typical” unsafe block, such as aliasing, alignment, data validity, padding. - Concurrency and thread safety: understanding `Send` and `Sync`, knowing how to implement them on a user-defined type - Case study: Small string optimization - Case study: Zero-copy parsing - Review --------- Co-authored-by: Dmitri Gribenko --- src/SUMMARY.md | 17 ++ src/running-the-course/course-structure.md | 9 + src/unsafe-deep-dive/Cargo.toml | 0 src/unsafe-deep-dive/foundations.md | 5 + .../foundations/actions-might-not-be.md | 19 ++ .../foundations/data-structures-are-safe.md | 25 ++ .../foundations/less-powerful.md | 52 ++++ .../foundations/what-is-unsafe.md | 98 +++++++ .../foundations/when-is-unsafe-used.md | 48 ++++ src/unsafe-deep-dive/motivations.md | 24 ++ .../motivations/data-structures.md | 30 +++ src/unsafe-deep-dive/motivations/interop.md | 245 ++++++++++++++++++ .../motivations/performance.md | 10 + src/unsafe-deep-dive/setup.md | 46 ++++ src/unsafe-deep-dive/welcome.md | 46 ++++ 15 files changed, 674 insertions(+) create mode 100644 src/unsafe-deep-dive/Cargo.toml create mode 100644 src/unsafe-deep-dive/foundations.md create mode 100644 src/unsafe-deep-dive/foundations/actions-might-not-be.md create mode 100644 src/unsafe-deep-dive/foundations/data-structures-are-safe.md create mode 100644 src/unsafe-deep-dive/foundations/less-powerful.md create mode 100644 src/unsafe-deep-dive/foundations/what-is-unsafe.md create mode 100644 src/unsafe-deep-dive/foundations/when-is-unsafe-used.md create mode 100644 src/unsafe-deep-dive/motivations.md create mode 100644 src/unsafe-deep-dive/motivations/data-structures.md create mode 100644 src/unsafe-deep-dive/motivations/interop.md create mode 100644 src/unsafe-deep-dive/motivations/performance.md create mode 100644 src/unsafe-deep-dive/setup.md create mode 100644 src/unsafe-deep-dive/welcome.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 1950476a..1dca1f14 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -440,6 +440,23 @@ --- +# Unsafe + +- [Welcome](unsafe-deep-dive/welcome.md) +- [Setup](unsafe-deep-dive/setup.md) +- [Motivations](unsafe-deep-dive/motivations.md) + - [Interoperability](unsafe-deep-dive/motivations/interop.md) + - [Data Structures](unsafe-deep-dive/motivations/data-structures.md) + - [Performance](unsafe-deep-dive/motivations/performance.md) +- [Foundations](unsafe-deep-dive/foundations.md) + - [What is unsafe?](unsafe-deep-dive/foundations/what-is-unsafe.md) + - [When is unsafe used?](unsafe-deep-dive/foundations/when-is-unsafe-used.md) + - [Data structures are safe](unsafe-deep-dive/foundations/data-structures-are-safe.md) + - [Actions might not be](unsafe-deep-dive/foundations/actions-might-not-be.md) + - [Less powerful than it seems](unsafe-deep-dive/foundations/less-powerful.md) + +--- + # Final Words - [Thanks!](thanks.md) diff --git a/src/running-the-course/course-structure.md b/src/running-the-course/course-structure.md index cc8067e1..cb2a63aa 100644 --- a/src/running-the-course/course-structure.md +++ b/src/running-the-course/course-structure.md @@ -82,6 +82,15 @@ You should be familiar with the material in {{%course outline Idiomatic Rust}} +### Unsafe (Work in Progress) + +The [Unsafe](../unsafe-deep-dive/welcome.md) deep dive is a two-day class on the +_unsafe_ Rust language. It covers the fundamentals of Rust's safety guarantees, +the motivation for `unsafe`, review process for `unsafe` code, FFI basics, and +building data structures that the borrow checker would normally reject. + +{{%course outline Unsafe}} + ## Format The course is meant to be very interactive and we recommend letting the diff --git a/src/unsafe-deep-dive/Cargo.toml b/src/unsafe-deep-dive/Cargo.toml new file mode 100644 index 00000000..e69de29b diff --git a/src/unsafe-deep-dive/foundations.md b/src/unsafe-deep-dive/foundations.md new file mode 100644 index 00000000..b81d9de1 --- /dev/null +++ b/src/unsafe-deep-dive/foundations.md @@ -0,0 +1,5 @@ +# Foundations + +Some fundamental concepts and terms. + +{{%segment outline}} diff --git a/src/unsafe-deep-dive/foundations/actions-might-not-be.md b/src/unsafe-deep-dive/foundations/actions-might-not-be.md new file mode 100644 index 00000000..fd9f60d7 --- /dev/null +++ b/src/unsafe-deep-dive/foundations/actions-might-not-be.md @@ -0,0 +1,19 @@ +--- +minutes: 2 +--- + +# ... but actions on them might not be + +```rust +fn main() { + let n: i64 = 12345; + let safe = &n as *const _; + println!("{safe:p}"); +} +``` + +
+ +Modify the example to de-reference `safe` without an `unsafe` block. + +
diff --git a/src/unsafe-deep-dive/foundations/data-structures-are-safe.md b/src/unsafe-deep-dive/foundations/data-structures-are-safe.md new file mode 100644 index 00000000..e298edaa --- /dev/null +++ b/src/unsafe-deep-dive/foundations/data-structures-are-safe.md @@ -0,0 +1,25 @@ +--- +minutes: 2 +--- + +# Data structures are safe ... + +Data structures are inert. They cannot do any harm by themselves. + +Safe Rust code can create raw pointers: + +```rust +fn main() { + let n: i64 = 12345; + let safe = &raw const n; + println!("{safe:p}"); +} +``` + +
+ +Consider a raw pointer to an integer, i.e., the value `safe` is the raw pointer +type `*const i64`. Raw pointers can be out-of-bounds, misaligned, or be null. +But the unsafe keyword is not required when creating them. + +
diff --git a/src/unsafe-deep-dive/foundations/less-powerful.md b/src/unsafe-deep-dive/foundations/less-powerful.md new file mode 100644 index 00000000..cc2d795b --- /dev/null +++ b/src/unsafe-deep-dive/foundations/less-powerful.md @@ -0,0 +1,52 @@ +--- +minutes: 10 +--- + +# Less powerful than it seems + +The `unsafe` keyword does not allow you to break Rust. + +```rust,ignore +use std::mem::transmute; + +let orig = b"RUST"; +let n: i32 = unsafe { transmute(orig) }; + +println!("{n}") +``` + +
+ +## Suggested outline + +- Request that someone explains what `std::mem::transmute` does +- Discuss why it doesn't compile +- Fix the code + +## Expected compiler output + +```ignore + Compiling playground v0.0.1 (/playground) +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> src/main.rs:5:27 + | +5 | let n: i32 = unsafe { transmute(orig) }; + | ^^^^^^^^^ + | + = note: source type: `&[u8; 4]` (64 bits) + = note: target type: `i32` (32 bits) +``` + +## Suggested change + +```diff +- let n: i32 = unsafe { transmute(orig) }; ++ let n: i64 = unsafe { transmute(orig) }; +``` + +## Notes on less familiar Rust + +- the `b` prefix on a string literal marks it as byte slice (`&[u8]`) rather + than a string slice (`&str`) + +
diff --git a/src/unsafe-deep-dive/foundations/what-is-unsafe.md b/src/unsafe-deep-dive/foundations/what-is-unsafe.md new file mode 100644 index 00000000..8af083ac --- /dev/null +++ b/src/unsafe-deep-dive/foundations/what-is-unsafe.md @@ -0,0 +1,98 @@ +--- +minutes: 6 +--- + +# What is “unsafety”? + +Unsafe Rust is a superset of Safe Rust. + +Let's create a list of things that are enabled by the `unsafe` keyword. + +
+ +## Definitions from authoritative docs: + +From the [unsafe keyword's documentation](): + +> Code or interfaces whose memory safety cannot be verified by the type system. +> +> ... +> +> Here are the abilities Unsafe Rust has in addition to Safe Rust: +> +> - Dereference raw pointers +> - Implement unsafe traits +> - Call unsafe functions +> - Mutate statics (including external ones) +> - Access fields of unions + +From the [reference](https://doc.rust-lang.org/reference/unsafety.html) + +> The following language level features cannot be used in the safe subset of +> Rust: +> +> - Dereferencing a raw pointer. +> - Reading or writing a mutable or external static variable. +> - Accessing a field of a union, other than to assign to it. +> - Calling an unsafe function (including an intrinsic or foreign function). +> - Calling a safe function marked with a target_feature from a function that +> does not have a target_feature attribute enabling the same features (see +> attributes.codegen.target_feature.safety-restrictions). +> - Implementing an unsafe trait. +> - Declaring an extern block. +> - Applying an unsafe attribute to an item. + +## Group exercise + +> You may have a group of learners who are not familiar with each other yet. +> This is a way for you to gather some data about their confidence levels and +> the psychological safety that they're feeling. + +### Part 1: Informal definition + +> Use this to gauge the confidence level of the group. If they are uncertain, +> then tailor the next section to be more directed. + +Ask the class: **By raising your hand, indicate if you would feel comfortable +defining unsafe?** + +If anyone's feeling confident, allow them to try to explain. + +### Part 2: Evidence gathering + +Ask the class to spend 3-5 minutes. + +- Find a use of the unsafe keyword. What contract/invariant/pre-condition is + being established or satisfied? +- Write down terms that need to be defined (unsafe, memory safety, soundness, + undefined behavior) + +### Part 3: Write a working definition + +### Part 4: Remarks + +Mention that we'll be reviewing our definition at the end of the day. + +## Note: Avoid detailed discussion about precise semantics of memory safety + +It's possible that the group will slide into a discussion about the precise +semantics of what memory safety actually is and how define pointer validity. +This isn't a productive line of discussion. It can undermine confidence in less +experienced learners. + +Perhaps refer people who wish to discuss this to the discussion within the +official [documentation for pointer types] (excerpt below) as a place for +further research. + +> Many functions in [this module] take raw pointers as arguments and read from +> or write to them. For this to be safe, these pointers must be _valid_ for the +> given access. +> +> ... +> +> The precise rules for validity are not determined yet. + +[this module]: https://doc.rust-lang.org/std/ptr/index.html +[documentation for pointer types]: https://doc.rust-lang.org/std/ptr/index.html#safety + +
diff --git a/src/unsafe-deep-dive/foundations/when-is-unsafe-used.md b/src/unsafe-deep-dive/foundations/when-is-unsafe-used.md new file mode 100644 index 00000000..955c17be --- /dev/null +++ b/src/unsafe-deep-dive/foundations/when-is-unsafe-used.md @@ -0,0 +1,48 @@ +--- +minutes: 2 +--- + +# When is unsafe used? + +The unsafe keyword indicates that the programmer is responsible for upholding +Rust's safety guarantees. + +The keyword has two roles: + +- define pre-conditions that must be satisfied +- assert to the compiler (= promise) that those defined pre-conditions are + satisfied + +## Further references + +- [The unsafe keyword chapter of the Rust Reference](https://doc.rust-lang.org/reference/unsafe-keyword.html) + +
+ +Places where pre-conditions can be defined (Role 1) + +- [unsafe functions] (`unsafe fn foo() { ... }`). Example: `get_unchecked` + method on slices, which requires callers to verify that the index is + in-bounds. +- unsafe traits (`unsafe trait`). Examples: [`Send`] and [`Sync`] marker traits + in the standard library. + +Places where pre-conditions must be satisfied (Role 2) + +- unsafe blocks (`unafe { ... }`) +- implementing unsafe traits (`unsafe impl`) +- access external items (`unsafe extern`) +- adding + [unsafe attributes](https://doc.rust-lang.org/reference/attributes.html) o an + item. Examples: [`export_name`], [`link_section`] and [`no_mangle`]. Usage: + `#[unsafe(no_mangle)]` + +[unsafe functions]: https://doc.rust-lang.org/reference/unsafe-keyword.html#unsafe-functions-unsafe-fn +[unsafe traits]: https://doc.rust-lang.org/reference/unsafe-keyword.html#unsafe-traits-unsafe-trait +[`export_name`]: https://doc.rust-lang.org/reference/abi.html#the-export_name-attribute +[`link_section`]: https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute +[`no_mangle`]: https://doc.rust-lang.org/reference/abi.html#the-no_mangle-attribute +[`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html +[`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html + +
diff --git a/src/unsafe-deep-dive/motivations.md b/src/unsafe-deep-dive/motivations.md new file mode 100644 index 00000000..c4acb819 --- /dev/null +++ b/src/unsafe-deep-dive/motivations.md @@ -0,0 +1,24 @@ +--- +minutes: 1 +--- + +# Motivations + +We know that writing code without the guarantees that Rust provides ... + +> “Use-after-free (UAF), integer overflows, and out of bounds (OOB) reads/writes +> comprise 90% of vulnerabilities with OOB being the most common.” +> +> --— **Jeff Vander Stoep and Chong Zang**, Google. +> "[Queue the Hardening Enhancements](https://security.googleblog.com/2019/05/queue-hardening-enhancements.html)" + +... so why is `unsafe` part of the language? + +{{%segment outline}} + +
+ +The `unsafe` keyword exists because there is no compiler technology available +today that makes it obsolete. Compilers cannot verify everything. + +
diff --git a/src/unsafe-deep-dive/motivations/data-structures.md b/src/unsafe-deep-dive/motivations/data-structures.md new file mode 100644 index 00000000..0e1b3a84 --- /dev/null +++ b/src/unsafe-deep-dive/motivations/data-structures.md @@ -0,0 +1,30 @@ +--- +minutes: 5 +--- + +# Data Structures + +Some families of data structures are impossible to create in safe Rust. + +- graphs +- bit twiddling +- self-referential types +- intrusive data structures + +
+ +Graphs: General-purpose graphs cannot be created as they may need to represent +cycles. Cycles are impossible for the type system to reason about. + +Bit twiddling: Overloading bits with multiple meanings. Examples include using +the NaN bits in `f64` for some other purpose or the higher-order bits of +pointers on `x86_64` platforms. This is somewhat common when writing language +interpreters to keep representations within the word size the target platform. + +Self-referential types are too hard for the borrow checker to verify. + +Intrusive data structures: store structural metadata (like pointers to other +elements) inside the elements themselves, which requires careful handling of +aliasing. + +
diff --git a/src/unsafe-deep-dive/motivations/interop.md b/src/unsafe-deep-dive/motivations/interop.md new file mode 100644 index 00000000..6a9aa632 --- /dev/null +++ b/src/unsafe-deep-dive/motivations/interop.md @@ -0,0 +1,245 @@ +--- +minutes: 5 +--- + +> TODO: Refactor this content into multiple slides as this slide is intended as +> an introduction to the motivations only, rather than to be an elaborate +> discussion of the whole problem. + +# Interoperability + +Language interoperability allows you to: + +- Call functions written in other languages from Rust +- Write functions in Rust that are callable from other languages + +However, this requires unsafe. + +```rust,editable,ignore +unsafe extern "C" { + safe fn random() -> libc::c_long; +} + +fn main() { + let a = random() as i64; + println!("{a:?}"); +} +``` + +
+ +The Rust compiler can't enforce any safety guarantees for programs that it +hasn't compiled, so it delegates that responsibility to you through the unsafe +keyword. + +The code example we're seeing shows how to call the random function provided by +libc within Rust. libc is available to scripts in the Rust Playground. + +This uses Rust's _foreign function interface_. + +This isn't the only style of interoperability, however it is the method that's +needed if you want to work between Rust and some other language in a zero cost +way. Another important strategy is message passing. + +Message passing avoids unsafe, but serialization, allocation, data transfer and +parsing all take energy and time. + +## Answers to questions + +- _Where does "random" come from?_\ + libc is dynamically linked to Rust programs by default, allowing our code to + rely on its symbols, including `random`, being available to our program. +- _What is the "safe" keyword?_\ + It allows callers to call the function without needing to wrap that call in + `unsafe`. The [`safe` function qualifier] was introduced in the 2024 edition + of Rust and can only be used within `extern` blocks. It was introduced because + `unsafe` became a mandatory qualifier for `extern` blocks in that edition. +- _What is the [`std::ffi::c_long`] type?_\ + According to the C standard, an integer that's at least 32 bits wide. On + today's systems, It's an `i32` on Windows and an `i64` on Linux. + +[`safe` keyword]: https://doc.rust-lang.org/reference/safe-keyword.html +[`std::ffi::c_long`]: https://doc.rust-lang.org/std/ffi/type.c_long.html + +## Consideration: type safety + +Modify the code example to remove the need for type casting later. Discuss the +potential UB - long's width is defined by the target. + +```rust +unsafe extern "C" { + safe fn random() -> i64; +} + +fn main() { + let a = random(); + println!("{a:?}"); +} +``` + +> Changes from the original: +> +> ```diff +> unsafe extern "C" { +> - safe fn random() -> libc::c_long; +> + safe fn random() -> i64; +> } +> +> fn main() { +> - let a = random() as i64; +> + let a = random(); +> println!("{a:?}"); +> } +> ``` + +It's also possible to completely ignore the intended type and create undefined +behavior in multiple ways. The code below produces output most of the time, but +generally results in a stack overflow. It may also produce illegal `char` +values. Although `char` is represented in 4 bytes (32 bits), +[not all bit patterns are permitted as a `char`][char]. + +Stress that the Rust compiler will trust that the wrapper is telling the truth. + +[char]: https://doc.rust-lang.org/std/primitive.char.html#validity-and-layout + + + +```rust,ignore +unsafe extern "C" { + safe fn random() -> [char; 2]; +} + +fn main() { + let a = random(); + println!("{a:?}"); +} +``` + +> Changes from the original: +> +> ```diff +> unsafe extern "C" { +> - safe fn random() -> libc::c_long; +> + safe fn random() -> [char; 2]; +> } +> +> fn main() { +> - let a = random() as i64; +> - println!("{a}"); +> + let a = random(); +> + println!("{a:?}"); +> } +> ``` + +> Attempting to print a `[char; 2]` from randomly generated input will often +> produce strange output, including: +> +> ```ignore +> thread 'main' panicked at library/std/src/io/stdio.rs:1165:9: +> failed printing to stdout: Bad address (os error 14) +> ``` +> +> ```ignore +> thread 'main' has overflowed its stack +> fatal runtime error: stack overflow, aborting +> ``` + +Mention that type safety is generally not a large concern in practice. Tools +that produce wrappers automatically, i.e. bindgen, are excellent at reading +header files and producing values of the correct type. + +## Consideration: Ownership and lifetime management + +While libc's `random` function doesn't use pointers, many do. This creates many +more possibilities for unsoundness. + +- both sides might attempt to free the memory (double free) +- both sides can attempt to write to the data + +For example, some C libraries expose functions that write to static buffers that +are re-used between calls. + + + + + +```rust,ignore +use std::ffi::{CStr, c_char}; +use std::time::{SystemTime, UNIX_EPOCH}; + +unsafe extern "C" { + /// Create a formatted time based on time `t`, including trailing newline. + /// Read `man 3 ctime` details. + fn ctime(t: *const libc::time_t) -> *const c_char; +} + +unsafe fn format_timestamp<'a>(t: u64) -> &'a str { + let t = t as libc::time_t; + + unsafe { + let fmt_ptr = ctime(&t); + CStr::from_ptr(fmt_ptr).to_str().unwrap() + } +} + +fn main() { + let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); + + let now = now.as_secs(); + let now_fmt = unsafe { format_timestamp(now) }; + print!("now (1): {}", now_fmt); + + let future = now + 60; + let future_fmt = unsafe { format_timestamp(future) }; + print!("future: {}", future_fmt); + + print!("now (2): {}", now_fmt); +} +``` + +> Aside: Lifetimes in the `format_timestamp()` function +> +> Neither `'a`, nor `'static` correctly describe the lifetime of the string +> that's returned. Rust treats it as an immutable reference, but subsequent +> calls to `ctime` will overwrite the static buffer that the string occupies. + +Bonus points: can anyone spot the lifetime bug? `format_timestamp()` should +return a `&'static str`. + +## Consideration: Representation mismatch + +Different programming languages have made different design decisions and this +can create impedance mismatches between different domains. + +Consider string handling. C++ defines `std::string`, which has an incompatible +memory layout with Rust's `String` type. `String` also requires text to be +encoded as UTF-8, whereas `std::string` does not. In C, text is represented by a +null-terminated sequence of bytes (`char*`). + +```rust +fn main() { + let c_repr = b"Hello, C\0"; + let rust_repr = (b"Hello, Rust", 11); + + let c: &str = unsafe { + let ptr = c_repr.as_ptr() as *const i8; + std::ffi::CStr::from_ptr(ptr).to_str().unwrap() + }; + println!("{c}"); + + let rust: &str = unsafe { + let ptr = rust_repr.0.as_ptr(); + let bytes = std::slice::from_raw_parts(ptr, rust_repr.1); + std::str::from_utf8_unchecked(bytes) + }; + println!("{rust}"); +} +``` + +
diff --git a/src/unsafe-deep-dive/motivations/performance.md b/src/unsafe-deep-dive/motivations/performance.md new file mode 100644 index 00000000..0b32e860 --- /dev/null +++ b/src/unsafe-deep-dive/motivations/performance.md @@ -0,0 +1,10 @@ +--- +minutes: 5 +--- + +# Performance + +> TODO: Stub for now + +It's easy to think of performance as the main reason for unsafe, but high +performance code makes up the minority of unsafe blocks. diff --git a/src/unsafe-deep-dive/setup.md b/src/unsafe-deep-dive/setup.md new file mode 100644 index 00000000..12bb1983 --- /dev/null +++ b/src/unsafe-deep-dive/setup.md @@ -0,0 +1,46 @@ +--- +minutes: 2 +--- + +# Setting Up + +## Local Rust installation + +You should have a Rust compiler installed that supports the 2024 edition of the +language, which is any version of rustc higher than 1.84. + +```console +$ rustc --version +rustc 1.87 +``` + + + +## (Optional) Create a local instance of the course + +```console +$ git clone --depth=1 https://github.com/google/comprehensive-rust.git +Cloning into 'comprehensive-rust'... +... +$ cd comprehensive-rust +$ cargo install-tools +... +$ cargo serve # then open http://127.0.0.1:3000/ in a browser +``` + +
+ +Ask everyone to confirm that everyone is able to execute `rustc` with a version +older that 1.87. + +For those people who do not, tell them that we'll resolve that in the break. + +
diff --git a/src/unsafe-deep-dive/welcome.md b/src/unsafe-deep-dive/welcome.md new file mode 100644 index 00000000..2291281c --- /dev/null +++ b/src/unsafe-deep-dive/welcome.md @@ -0,0 +1,46 @@ +--- +course: Unsafe +session: Day 1 Morning +target_minutes: 300 +--- + +# Welcome to Unsafe Rust + +> IMPORTANT: THIS MODULE IS IN AN EARLY STAGE OF DEVELOPMENT +> +> Please do not consider this module of Comprehensive Rust to be complete. With +> that in mind, your feedback, comments, and especially your concerns, are very +> welcome. +> +> To comment on this module's development, please use the +> [GitHub issue tracker]. + +[GitHub issue tracker]: https://github.com/google/comprehensive-rust/issues + +The `unsafe` keyword is easy to type, but hard to master. When used +appropriately, it forms a useful and indeed essential part of the Rust +programming language. + +By the end of this deep dive, you'll know how to work with `unsafe` code, review +others' changes that include the `unsafe` keyword, and produce your own. + +What you'll learn: + +- What the terms undefined behavior, soundness, and safety mean +- Why the `unsafe` keyword exists in the Rust language +- How to write your own code using `unsafe` safely +- How to review `unsafe` code + +## Links to other sections of the course + +The `unsafe` keyword has treatment in: + +- _Rust Fundamentals_, the main module of Comprehensive Rust, includes a session + on [Unsafe Rust] in its last day. +- _Rust in Chromium_ discusses how to [interoperate with C++]. Consult that + material if you are looking into FFI. +- _Bare Metal Rust_ uses unsafe heavily to interact with the underlying host, + among other things. + +[interoperate with C++]: ../chromium/interoperability-with-cpp.md +[Unsafe Rust]: ../unsafe-rust.html From c15f398c3d33ceae6c37cd83010ca03afb9acf57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 11:48:24 +0200 Subject: [PATCH 003/103] Bump the npm_and_yarn group across 1 directory with 2 updates (#2824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the npm_and_yarn group with 2 updates in the /tests directory: [on-headers](https://github.com/jshttp/on-headers) and [morgan](https://github.com/expressjs/morgan). Updates `on-headers` from 1.0.2 to 1.1.0
Release notes

Sourced from on-headers's releases.

1.1.0

Important

What's Changed

New Contributors

Full Changelog: https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0

Changelog

Sourced from on-headers's changelog.

1.1.0 / 2025-07-17

Commits
  • 4b017af 1.1.0
  • b636f2d ♻️ refactor header array code
  • 3e2c2d4 ✨ ignore falsy header keys, matching node behavior
  • 172eb41 ✨ support duplicate headers
  • c6e3849 🔒️ fix array handling
  • 6893518 💚 update CI - add newer node versions
  • 56a345d ✨ add script to update known hashes
  • 175ab21 👷 add upstream change detection (#31)
  • ce0b2c8 ci: apply OSSF Scorecard security best practices (#20)
  • 1a38c54 fix: use ubuntu-latest as ci runner (#19)
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by ulisesgascon, a new releaser for on-headers since your current version.


Updates `morgan` from 1.10.0 to 1.10.1
Release notes

Sourced from morgan's releases.

1.10.1

What's Changed

New Contributors

Full Changelog: https://github.com/expressjs/morgan/compare/1.10.0...1.10.1

Changelog

Sourced from morgan's changelog.

1.10.1 / 2025-07-17

Commits
Maintainer changes

This version was pushed to npm by ulisesgascon, a new releaser for morgan since your current version.


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/comprehensive-rust/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/package-lock.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/package-lock.json b/tests/package-lock.json index 9fe8d4fc..d88b3c3b 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -4625,16 +4625,17 @@ } }, "node_modules/morgan": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", - "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.1.tgz", + "integrity": "sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==", "dev": true, + "license": "MIT", "dependencies": { "basic-auth": "~2.0.1", "debug": "2.6.9", "depd": "~2.0.0", "on-finished": "~2.3.0", - "on-headers": "~1.0.2" + "on-headers": "~1.1.0" }, "engines": { "node": ">= 0.8.0" @@ -4825,10 +4826,11 @@ } }, "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } From 8994e390affb487b4dfb6236190406b3db9e7ed3 Mon Sep 17 00:00:00 2001 From: Tim McNamara Date: Fri, 18 Jul 2025 21:48:46 +1200 Subject: [PATCH 004/103] Fix missing link (fixes #2822) (#2823) This change fixes a broken link when markdown source is rendered as HTML by mdbook. --- src/unsafe-deep-dive/motivations/interop.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/unsafe-deep-dive/motivations/interop.md b/src/unsafe-deep-dive/motivations/interop.md index 6a9aa632..85505b21 100644 --- a/src/unsafe-deep-dive/motivations/interop.md +++ b/src/unsafe-deep-dive/motivations/interop.md @@ -51,15 +51,16 @@ parsing all take energy and time. rely on its symbols, including `random`, being available to our program. - _What is the "safe" keyword?_\ It allows callers to call the function without needing to wrap that call in - `unsafe`. The [`safe` function qualifier] was introduced in the 2024 edition - of Rust and can only be used within `extern` blocks. It was introduced because - `unsafe` became a mandatory qualifier for `extern` blocks in that edition. + `unsafe`. The [`safe` function qualifier][safe] was introduced in the 2024 + edition of Rust and can only be used within `extern` blocks. It was introduced + because `unsafe` became a mandatory qualifier for `extern` blocks in that + edition. - _What is the [`std::ffi::c_long`] type?_\ According to the C standard, an integer that's at least 32 bits wide. On today's systems, It's an `i32` on Windows and an `i64` on Linux. -[`safe` keyword]: https://doc.rust-lang.org/reference/safe-keyword.html [`std::ffi::c_long`]: https://doc.rust-lang.org/std/ffi/type.c_long.html +[safe]: https://doc.rust-lang.org/stable/edition-guide/rust-2024/unsafe-extern.html ## Consideration: type safety @@ -203,15 +204,12 @@ fn main() { } ``` -> Aside: Lifetimes in the `format_timestamp()` function +> _Aside:_ Lifetimes in the `format_timestamp()` function > -> Neither `'a`, nor `'static` correctly describe the lifetime of the string +> Neither `'a`, nor `'static`, correctly describe the lifetime of the string > that's returned. Rust treats it as an immutable reference, but subsequent > calls to `ctime` will overwrite the static buffer that the string occupies. -Bonus points: can anyone spot the lifetime bug? `format_timestamp()` should -return a `&'static str`. - ## Consideration: Representation mismatch Different programming languages have made different design decisions and this From 4dbbcce4b8705d11f0f801f07f850399aaf6254d Mon Sep 17 00:00:00 2001 From: Michalina Sidor Date: Tue, 22 Jul 2025 18:39:59 +0200 Subject: [PATCH 005/103] Fix typo in embedded-hal.md (#2828) --- src/bare-metal/microcontrollers/embedded-hal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bare-metal/microcontrollers/embedded-hal.md b/src/bare-metal/microcontrollers/embedded-hal.md index 5a6cf581..70a2fe85 100644 --- a/src/bare-metal/microcontrollers/embedded-hal.md +++ b/src/bare-metal/microcontrollers/embedded-hal.md @@ -8,7 +8,7 @@ microcontroller peripherals: - Delay timers - I2C and SPI buses and devices -Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken out +Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs are broken out into [`embedded-io`], [`embedded-can`] and [`rand_core`] respectively. Other crates then implement [drivers] in terms of these traits, e.g. an From 1a3c11b03e521df0c5f82977534499a43e82098a Mon Sep 17 00:00:00 2001 From: Nicole L Date: Wed, 23 Jul 2025 10:37:19 -0700 Subject: [PATCH 006/103] Add speaker note that arrays go on the stack (#2826) --- src/tuples-and-arrays/arrays.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tuples-and-arrays/arrays.md b/src/tuples-and-arrays/arrays.md index f3c982e7..7ed57288 100644 --- a/src/tuples-and-arrays/arrays.md +++ b/src/tuples-and-arrays/arrays.md @@ -65,4 +65,9 @@ fn main() { - Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be easier to read. +- Arrays are not heap-allocated. They are regular values with a fixed size known + at compile time, meaning they go on the stack. This can be different from what + students expect if they come from a garbage collected language, where arrays + may be heap allocated by default. + From c4985cbf274341e60cb4b62cdf4c9032317292e3 Mon Sep 17 00:00:00 2001 From: Dayo Date: Fri, 25 Jul 2025 17:52:53 +0900 Subject: [PATCH 007/103] Fix major Korean translation issues on title (#2825) This fixes the titles of Korean translation which has been mixed or has major issues that may reader harden to understand --- po/ko.po | 70 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/po/ko.po b/po/ko.po index 490503a6..678a37f8 100644 --- a/po/ko.po +++ b/po/ko.po @@ -188,7 +188,7 @@ msgstr "튜플" #: src/SUMMARY.md src/tuples-and-arrays/iteration.md #, fuzzy msgid "Array Iteration" -msgstr "배열 반복" +msgstr "배열 순회" #: src/SUMMARY.md src/tuples-and-arrays/destructuring.md #, fuzzy @@ -216,7 +216,7 @@ msgstr "허상(dangling) 참조" #: src/SUMMARY.md src/references/exercise.md #, fuzzy msgid "Exercise: Geometry" -msgstr "연습문제: 도형" +msgstr "연습문제: 기하" #: src/SUMMARY.md src/user-defined-types.md #, fuzzy @@ -275,7 +275,7 @@ msgstr "흐름 제어" #: src/SUMMARY.md src/pattern-matching/exercise.md msgid "Exercise: Expression Evaluation" -msgstr "연습문제: 표현식 평가" +msgstr "연습문제: 수식 계산" #: src/SUMMARY.md src/methods-and-traits.md msgid "Methods and Traits" @@ -312,7 +312,7 @@ msgstr "트레잇 상속하기" #: src/SUMMARY.md #, fuzzy msgid "Exercise: Generic Logger" -msgstr "연습문제: 일반 `min`" +msgstr "연습문제: 범용 로거" #: src/SUMMARY.md src/generics.md msgid "Generics" @@ -343,7 +343,7 @@ msgstr "트레잇 구현하기(`impl Trait`)" #: src/SUMMARY.md src/generics/exercise.md #, fuzzy msgid "Exercise: Generic `min`" -msgstr "연습문제: 일반 `min`" +msgstr "연습문제: 범용 `min`" #: src/SUMMARY.md msgid "Day 2: Afternoon" @@ -352,7 +352,7 @@ msgstr "2일차 오후" #: src/SUMMARY.md src/std-types.md #, fuzzy msgid "Standard Library Types" -msgstr "표준 라이브러리" +msgstr "표준 라이브러리 타입" #: src/SUMMARY.md src/std-types/std.md msgid "Standard Library" @@ -394,7 +394,7 @@ msgstr "연습문제: 카운터" #: src/SUMMARY.md src/std-traits.md #, fuzzy msgid "Standard Library Traits" -msgstr "표준 라이브러리" +msgstr "표준 라이브러리 트레잇" #: src/SUMMARY.md src/std-traits/comparisons.md src/async.md #, fuzzy @@ -430,7 +430,7 @@ msgstr "클로저(Closure)" #: src/SUMMARY.md src/std-traits/exercise.md #, fuzzy msgid "Exercise: ROT13" -msgstr "연습문제: 바이너리 트리" +msgstr "연습문제: ROT13" #: src/SUMMARY.md msgid "Day 3: Morning" @@ -474,7 +474,7 @@ msgstr "Drop" #: src/SUMMARY.md src/memory-management/exercise.md #, fuzzy msgid "Exercise: Builder Type" -msgstr "연습문제: 빌드 타입" +msgstr "연습문제: Builder 타입" #: src/SUMMARY.md src/smart-pointers.md msgid "Smart Pointers" @@ -505,17 +505,17 @@ msgstr "3일차 오후" #: src/SUMMARY.md src/borrowing.md msgid "Borrowing" -msgstr "빌림" +msgstr "대여" #: src/SUMMARY.md src/borrowing/shared.md #, fuzzy msgid "Borrowing a Value" -msgstr "빌림" +msgstr "값 대여" #: src/SUMMARY.md src/borrowing/borrowck.md #, fuzzy msgid "Borrow Checking" -msgstr "빌림" +msgstr "대여 검증" #: src/SUMMARY.md src/borrowing/interior-mutability.md #, fuzzy @@ -525,12 +525,12 @@ msgstr "상호운용성" #: src/SUMMARY.md src/borrowing/exercise.md #, fuzzy msgid "Exercise: Health Statistics" -msgstr "연습문제: 엘리베이터 이벤트" +msgstr "연습문제: 건강검진" #: src/SUMMARY.md src/slices-and-lifetimes.md #, fuzzy msgid "Slices and Lifetimes" -msgstr "수명" +msgstr "슬라이스와 수명" #: src/SUMMARY.md #, fuzzy @@ -540,7 +540,7 @@ msgstr "슬라이스" #: src/SUMMARY.md src/slices-and-lifetimes/str.md #, fuzzy msgid "String References" -msgstr "허상(dangling) 참조" +msgstr "문자열 레퍼런스" #: src/SUMMARY.md src/slices-and-lifetimes/lifetime-annotations.md #, fuzzy @@ -550,12 +550,12 @@ msgstr "함수 호출에서의 수명" #: src/SUMMARY.md #, fuzzy msgid "Lifetime Elision" -msgstr "수명" +msgstr "수명 표기의 생략" #: src/SUMMARY.md #, fuzzy msgid "Struct Lifetimes" -msgstr "수명" +msgstr "구조체의 수명" #: src/SUMMARY.md src/slices-and-lifetimes/exercise.md #, fuzzy @@ -587,7 +587,7 @@ msgstr "FromIterator" #: src/SUMMARY.md src/iterators/exercise.md #, fuzzy msgid "Exercise: Iterator Method Chaining" -msgstr "연습문제: 반복자 메서드 체이닝" +msgstr "연습문제: Iterator 메서드 체이닝" #: src/SUMMARY.md src/modules.md src/modules/modules.md msgid "Modules" @@ -608,7 +608,7 @@ msgstr "`use`, `super`, `self`" #: src/SUMMARY.md src/modules/exercise.md #, fuzzy msgid "Exercise: Modules for a GUI Library" -msgstr "연습문제: GUI 라이브러리 모듈" +msgstr "연습문제: GUI 라이브러리 모듈 만들기" #: src/SUMMARY.md src/testing.md src/chromium/testing.md msgid "Testing" @@ -621,7 +621,7 @@ msgstr "테스트 모듈" #: src/SUMMARY.md src/testing/other.md #, fuzzy msgid "Other Types of Tests" -msgstr "다른 프로젝트" +msgstr "다른 테스트 프로젝트 타입" #: src/SUMMARY.md src/testing/lints.md #, fuzzy @@ -659,7 +659,7 @@ msgstr "묵시적 형변환" #: src/SUMMARY.md #, fuzzy msgid "`Error` Trait" -msgstr "`Error`" +msgstr "`Error` 트레잇" #: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md #, fuzzy @@ -741,12 +741,12 @@ msgstr "AIDL 인터페이스" #: src/SUMMARY.md msgid "Service API" -msgstr "" +msgstr "서비스 API" #: src/SUMMARY.md #, fuzzy msgid "Service" -msgstr "AIDL 서버" +msgstr "AIDL 서비스" #: src/SUMMARY.md msgid "Server" @@ -767,16 +767,16 @@ msgstr "API 수정" #: src/SUMMARY.md #, fuzzy msgid "Updating Implementations" -msgstr "서비스 구현" +msgstr "구헌체 업데이트" #: src/SUMMARY.md #, fuzzy msgid "AIDL Types" -msgstr "타입" +msgstr "AIDL 타입" #: src/SUMMARY.md src/android/aidl/types/primitives.md msgid "Primitive Types" -msgstr "" +msgstr "원시 타입" #: src/SUMMARY.md src/android/aidl/types/arrays.md #, fuzzy @@ -832,7 +832,7 @@ msgstr "C++와의 상호운용성" #: src/SUMMARY.md src/android/interoperability/cpp/bridge.md #, fuzzy msgid "The Bridge Module" -msgstr "테스트 모듈" +msgstr "브리지 모듈" #: src/SUMMARY.md msgid "Rust Bridge" @@ -859,12 +859,12 @@ msgstr "공유 Enum" #: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md #, fuzzy msgid "Rust Error Handling" -msgstr "오류처리" +msgstr "Rust 오류처리" #: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "C++ Error Handling" -msgstr "오류처리" +msgstr "C++ 오류처리" #: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" @@ -909,12 +909,12 @@ msgstr "정책" #: src/SUMMARY.md #, fuzzy msgid "Unsafe Code" -msgstr "안전하지 않은 러스트" +msgstr "안전하지 않은 코드" #: src/SUMMARY.md src/chromium/build-rules/depending.md #, fuzzy msgid "Depending on Rust Code from Chromium C++" -msgstr "Chromium C++의 Rust 코드에 의존" +msgstr "Chromium C++에 의존하는 Rust 코드" #: src/SUMMARY.md src/chromium/build-rules/vscode.md #, fuzzy @@ -941,7 +941,7 @@ msgstr "" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md #, fuzzy msgid "Interoperability with C++" -msgstr "C와의 상호운용성" +msgstr "C++와의 상호운용성" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy @@ -955,17 +955,17 @@ msgstr "CXX 제한사항" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "CXX Error Handling" -msgstr "오류처리" +msgstr "CXX에서의 오류처리" #: src/SUMMARY.md #, fuzzy msgid "Error Handling: QR Example" -msgstr "오류처리" +msgstr "오류처리 예제: QR" #: src/SUMMARY.md #, fuzzy msgid "Error Handling: PNG Example" -msgstr "오류처리" +msgstr "오류처리 예제: PNG" #: src/SUMMARY.md #, fuzzy From f37402066dfb054af6f38cef1db84abb25488a8c Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 25 Jul 2025 02:10:31 -0700 Subject: [PATCH 008/103] Remove unnecessary type cast in C ffi example (#2783) A `&T` can automatically coerce to a `*const T`, so the manual cast isn't necessary here. --- src/android/interoperability/with-c/bindgen/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/interoperability/with-c/bindgen/main.rs b/src/android/interoperability/with-c/bindgen/main.rs index d73dc21d..67877948 100644 --- a/src/android/interoperability/with-c/bindgen/main.rs +++ b/src/android/interoperability/with-c/bindgen/main.rs @@ -25,6 +25,6 @@ fn main() { // remains valid. `print_card` doesn't store either pointer to use later // after it returns. unsafe { - print_card(&card as *const card); + print_card(&card); } } From 047b2b2255cb3e41832f4e490f2ac4f0bed9ee3b Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 25 Jul 2025 02:11:17 -0700 Subject: [PATCH 009/103] Add note to binary-tree exercise about duplicate values (#2790) Just a small note to clarify a minor point of confusion with the exercise. --- src/smart-pointers/exercise.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smart-pointers/exercise.md b/src/smart-pointers/exercise.md index 37b33725..bb253259 100644 --- a/src/smart-pointers/exercise.md +++ b/src/smart-pointers/exercise.md @@ -7,7 +7,8 @@ minutes: 30 A binary tree is a tree-type data structure where every node has two children (left and right). We will create a tree where each node stores a value. For a given node N, all nodes in a N's left subtree contain smaller values, and all -nodes in N's right subtree will contain larger values. +nodes in N's right subtree will contain larger values. A given value should only +be stored in the tree once, i.e. no duplicate nodes. Implement the following types, so that the given tests pass. From a76b50a0df7b804db6de60f9a3643a221ee6a90a Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 25 Jul 2025 02:11:56 -0700 Subject: [PATCH 010/103] Remove unnecessary dependencies on libbinder_rs (#2782) These dependencies turned out not to be necessary, since depending on the generated `com.example.birthdayservice-rust` also exports the common binder functionality. --- src/android/aidl/birthday_service/Android.bp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/android/aidl/birthday_service/Android.bp b/src/android/aidl/birthday_service/Android.bp index e4f6d8e2..849c7fa9 100644 --- a/src/android/aidl/birthday_service/Android.bp +++ b/src/android/aidl/birthday_service/Android.bp @@ -1,11 +1,10 @@ // ANCHOR: libbirthdayservice rust_library { name: "libbirthdayservice", - srcs: ["src/lib.rs"], crate_name: "birthdayservice", + srcs: ["src/lib.rs"], rustlibs: [ "com.example.birthdayservice-rust", - "libbinder_rs", ], } // ANCHOR_END: libbirthdayservice @@ -17,7 +16,6 @@ rust_binary { srcs: ["src/server.rs"], rustlibs: [ "com.example.birthdayservice-rust", - "libbinder_rs", "libbirthdayservice", ], prefer_rlib: true, // To avoid dynamic link error. @@ -31,7 +29,6 @@ rust_binary { srcs: ["src/client.rs"], rustlibs: [ "com.example.birthdayservice-rust", - "libbinder_rs", ], prefer_rlib: true, // To avoid dynamic link error. } From 0105fac0654deb791c48e6f0ec68a2a78ca1ef37 Mon Sep 17 00:00:00 2001 From: Outer Heaven Legacy Date: Sun, 27 Jul 2025 20:04:47 +0330 Subject: [PATCH 011/103] Fix typo in fa.po (#2829) Fix typo in fa.po --- po/fa.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/fa.po b/po/fa.po index 536f8d68..0a03244a 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1712,7 +1712,7 @@ msgstr "۴۰ دقیقه" #: src/running-the-course/course-structure.md msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" -msgstr "روز ۱ بعد از ظهر (۲ ساعت و ۳۵ دقیقه،شامل وقت استراحت)" +msgstr "روز ۱ بعد از ظهر (۲ ساعت و ۳۵ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md msgid "35 minutes" @@ -1818,7 +1818,7 @@ msgstr "" "شما نیاز دارید که یک نسخه از [مخزن ASOP](https://source.android.com/docs/" "setup/download/downloading) بگیرید, همچنین یک نسخه از [مخزن دوره](https://" "github.com/google/comprehensive-rust) بگیرید و روی همون ماشین در مسیر `src/" -"android/`مخزن ASOP قرار دهید. با این کار طمینان حاصل می‌کنید که سیستم build " +"android/`مخزن ASOP قرار دهید. با این کار اطمینان حاصل می‌کنید که سیستم build " "اندروید فایل های `Android.bp` را در `src/android/` می‌بینید." #: src/running-the-course/course-structure.md @@ -1909,7 +1909,7 @@ msgstr "" #: src/running-the-course/course-structure.md msgid "Morning (3 hours and 20 minutes, including breaks)" -msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت اسراحت)" +msgstr "صبح (۳ ساعت و ۲۰ دقیقه، شامل وقت استراحت)" #: src/running-the-course/course-structure.md src/pattern-matching.md #: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md From 697054c301c27627868f90cf10468e7a0ceeef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20Rahim=20Kuru?= <61504310+rexoplans1@users.noreply.github.com> Date: Sun, 27 Jul 2025 19:44:51 +0300 Subject: [PATCH 012/103] Added new reviewer for Turkish translation (#2831) Hello, I would like to support the translation of Rust into Turkish in order to promote it in Turkey. As I saw in the previous PRs, we need to add our own name here, so I am opening a PR in this regard. I hope it will have a positive outcome (I know I opened the PR with the wrong name, I'm sorry). --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b244f618..0e4aa0b7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,7 +14,7 @@ po/pl.po @jkotur @dyeroshenko po/pt-BR.po @rastringer @hugojacob @henrif75 @joaovicmendes @azevedoalice po/ro.po @AlexandraImbrisca @razvanm po/ru.po @istolga @baltuky @zvonden @dyeroshenko -po/tr.po @alerque @Enes1313 +po/tr.po @alerque @Enes1313 @rexoplans1 po/uk.po @dyeroshenko po/vi.po @daivinhtran @qu-ngx po/zh-CN.po @wnghl @anlunx @kongy @noahdragon @superwhd @emmali01 @candysonya @AgainstEntropy From e157487e6ebb3cd48a0924d0cd1650e337e0fd04 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Sun, 27 Jul 2025 12:52:11 -0400 Subject: [PATCH 013/103] Fix typo in Matching Values section (#2832) Given ``` #[rustfmt::skip] fn main() { let input = '1'; match input { key if key.is_lowercase() => println!("Lowercase: {key}"), 'q' => println!("Quitting"), 'a' | 's' | 'w' | 'd' => println!("Moving around"), '0'..='9' => println!("Number input"), _ => println!("Something else"), } } ``` the output will be ``` Number input ``` So in practice, failing the condition does result to the other arms if the other arms are after that (if I'm reading this correctly). --- src/pattern-matching/match.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pattern-matching/match.md b/src/pattern-matching/match.md index 916950e9..c607b84c 100644 --- a/src/pattern-matching/match.md +++ b/src/pattern-matching/match.md @@ -43,7 +43,7 @@ Key Points: wish to concisely express more complex ideas than patterns alone would allow. - They are not the same as separate `if` expression inside of the match arm. An `if` expression inside of the branch block (after `=>`) happens after the - match arm is selected. Failing the `if` condition inside of that block won't + match arm is selected. Failing the `if` condition inside of that block will result in other arms of the original `match` expression being considered. - The condition defined in the guard applies to every expression in a pattern with an `|`. From a0edd51120deddf56167134438c3295c6fc51a19 Mon Sep 17 00:00:00 2001 From: Jason Lin Date: Mon, 28 Jul 2025 12:29:32 +1000 Subject: [PATCH 014/103] Add a note about using rust-bindgen (#2818) Co-authored-by: Dmitri Gribenko --- src/unsafe-rust/exercise.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/unsafe-rust/exercise.md b/src/unsafe-rust/exercise.md index 208ec97f..14da5368 100644 --- a/src/unsafe-rust/exercise.md +++ b/src/unsafe-rust/exercise.md @@ -74,3 +74,13 @@ functions and methods: {{#include exercise.rs:main}} ``` + +
+ +FFI binding code is typically generated by tools like [bindgen], rather than +being written manually as we are doing here. However, bindgen can't run in an +online playground. + +
+ +[bindgen]: https://github.com/rust-lang/rust-bindgen From 16d25dbed720298cb6a99d61160fa94b846cf1e0 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Tue, 29 Jul 2025 22:09:51 -0400 Subject: [PATCH 015/103] Clarify Matching Values section (#2833) --- src/pattern-matching/match.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/pattern-matching/match.md b/src/pattern-matching/match.md index c607b84c..01f24824 100644 --- a/src/pattern-matching/match.md +++ b/src/pattern-matching/match.md @@ -41,10 +41,24 @@ Key Points: - Match guards as a separate syntax feature are important and necessary when we wish to concisely express more complex ideas than patterns alone would allow. -- They are not the same as separate `if` expression inside of the match arm. An - `if` expression inside of the branch block (after `=>`) happens after the - match arm is selected. Failing the `if` condition inside of that block will - result in other arms of the original `match` expression being considered. +- Match guards are different from `if` expressions after the `=>`. An `if` + expression is evaluated after the match arm is selected. Failing the `if` + condition inside of that block won't result in other arms of the original + `match` expression being considered. In the following example, the wildcard + pattern `_ =>` is never even attempted. + +```rust,editable +#[rustfmt::skip] +fn main() { + let input = 'a'; + match input { + key if key.is_uppercase() => println!("Uppercase"), + key => if input == 'q' { println!("Quitting") }, + _ => println!("Bug: this is never printed"), + } +} +``` + - The condition defined in the guard applies to every expression in a pattern with an `|`. - Note that you can't use an existing variable as the condition in a match arm, From 5fc5893fbf6170ba668b102c4a10acac464ae3c6 Mon Sep 17 00:00:00 2001 From: Eric Githinji <51313777+egithinji@users.noreply.github.com> Date: Thu, 31 Jul 2025 12:54:26 +0300 Subject: [PATCH 016/103] Support setting language and output directory in cargo xtask (#2776) In addition to simplifying building locally (no need to set an environment variable), this makes it possible to use the `cargo xtask build` command in the CI and specify any output location, rather than relying on the build.sh script. --------- Co-authored-by: Eric Githinji --- README.md | 14 ++++---- xtask/src/main.rs | 89 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 73 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index a41b45d2..9345895c 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,13 @@ cargo xtask install-tools Here is a summary of the various commands you can run in the project. -| Command | Description | -| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cargo install-tools` | Install all the tools the project depends on. | -| `cargo serve` | Start a web server with the course. You'll find the content on http://localhost:3000. | -| `cargo rust-tests` | Test the included Rust snippets. | -| `cargo web-tests` | Run the web driver tests in the tests directory. | -| `cargo build-book` | Create a static version of the course in the `book/` directory. Note that you have to separately build and zip exercises and add them to book/html. To build any of the translated versions of the course, run MDBOOK_BOOK__LANGUAGE=xx mdbook build -d book/xx where xx is the ISO 639 language code (e.g. da for the Danish translation). [TRANSLATIONS.md](TRANSLATIONS.md) contains further instructions. | +| Command | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cargo install-tools` | Install all the tools the project depends on. | +| `cargo serve` | Start a web server with the course. You'll find the content on http://localhost:3000. To serve any of the translated versions of the course, add the language flag (`--language` or `-l`) followed by xx, where xx is the ISO 639 language code (e.g. `cargo xtask serve -l da` for the Danish translation). | +| `cargo rust-tests` | Test the included Rust snippets. | +| `cargo web-tests` | Run the web driver tests in the tests directory. | +| `cargo build-book` | Create a static version of the course in the `book/` directory. Note that you have to separately build and zip exercises and add them to book/html. To build any of the translated versions of the course, add the language flag (`--language` or `-l`) followed by xx, where xx is the ISO 639 language code (e.g. `cargo xtask build -l da` for the Danish translation). [TRANSLATIONS.md](TRANSLATIONS.md) contains further instructions. | > **Note** On Windows, you need to enable symlinks > (`git config --global core.symlinks true`) and Developer Mode. diff --git a/xtask/src/main.rs b/xtask/src/main.rs index b8a64894..f5d9f5cc 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -20,8 +20,8 @@ //! the tools. use anyhow::{Ok, Result, anyhow}; -use clap::{Parser, ValueEnum}; -use std::path::Path; +use clap::{Parser, Subcommand}; +use std::path::{Path, PathBuf}; use std::{env, process::Command}; fn main() -> Result<()> { @@ -38,11 +38,11 @@ fn main() -> Result<()> { )] struct Cli { /// The task to execute - #[arg(value_enum)] + #[command(subcommand)] task: Task, } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] +#[derive(Subcommand)] enum Task { /// Installs the tools the project depends on. InstallTools, @@ -51,9 +51,25 @@ enum Task { /// Tests all included Rust snippets. RustTests, /// Starts a web server with the course. - Serve, - /// Create a static version of the course in the `book/` directory. - Build, + Serve { + /// ISO 639 language code (e.g. da for the Danish translation). + #[arg(short, long)] + language: Option, + + /// Directory to place the build. If not provided, defaults to the book/ directory (or the book/xx directory if a language is provided). + #[arg(short, long)] + output: Option, + }, + /// Create a static version of the course. + Build { + /// ISO 639 language code (e.g. da for the Danish translation). + #[arg(short, long)] + language: Option, + + /// Directory to place the build. If not provided, defaults to the book/ directory (or the book/xx directory if a language is provided). + #[arg(short, long)] + output: Option, + }, } fn execute_task() -> Result<()> { @@ -62,15 +78,14 @@ fn execute_task() -> Result<()> { Task::InstallTools => install_tools()?, Task::WebTests => run_web_tests()?, Task::RustTests => run_rust_tests()?, - Task::Serve => start_web_server()?, - Task::Build => build()?, + Task::Serve { language, output } => start_web_server(language, output)?, + Task::Build { language, output } => build(language, output)?, } Ok(()) } fn install_tools() -> Result<()> { println!("Installing project tools..."); - let path_to_mdbook_exerciser = Path::new(env!("CARGO_WORKSPACE_DIR")).join("mdbook-exerciser"); let path_to_mdbook_course = @@ -136,7 +151,6 @@ fn run_web_tests() -> Result<()> { fn run_rust_tests() -> Result<()> { println!("Running rust tests..."); - let path_to_workspace_root = Path::new(env!("CARGO_WORKSPACE_DIR")); let status = Command::new("mdbook") @@ -156,15 +170,26 @@ fn run_rust_tests() -> Result<()> { Ok(()) } -fn start_web_server() -> Result<()> { +fn start_web_server( + language: Option, + output_arg: Option, +) -> Result<()> { println!("Starting web server ..."); let path_to_workspace_root = Path::new(env!("CARGO_WORKSPACE_DIR")); - let status = Command::new("mdbook") - .current_dir(path_to_workspace_root.to_str().unwrap()) - .arg("serve") - .status() - .expect("Failed to execute mdbook serve"); + let mut command = Command::new("mdbook"); + command.current_dir(path_to_workspace_root.to_str().unwrap()); + command.arg("serve"); + + if let Some(language) = &language { + println!("Language: {}", &language); + command.env("MDBOOK_BOOK__LANGUAGE", &language); + } + + command.arg("-d"); + command.arg(get_output_dir(language, output_arg)); + + let status = command.status().expect("Failed to execute mdbook serve"); if !status.success() { let error_message = format!( @@ -176,15 +201,23 @@ fn start_web_server() -> Result<()> { Ok(()) } -fn build() -> Result<()> { +fn build(language: Option, output_arg: Option) -> Result<()> { println!("Building course..."); let path_to_workspace_root = Path::new(env!("CARGO_WORKSPACE_DIR")); - let status = Command::new("mdbook") - .current_dir(path_to_workspace_root.to_str().unwrap()) - .arg("build") - .status() - .expect("Failed to execute mdbook build"); + let mut command = Command::new("mdbook"); + command.current_dir(path_to_workspace_root.to_str().unwrap()); + command.arg("build"); + + if let Some(language) = &language { + println!("Language: {}", &language); + command.env("MDBOOK_BOOK__LANGUAGE", language); + } + + command.arg("-d"); + command.arg(get_output_dir(language, output_arg)); + + let status = command.status().expect("Failed to execute mdbook build"); if !status.success() { let error_message = format!( @@ -195,3 +228,13 @@ fn build() -> Result<()> { } Ok(()) } + +fn get_output_dir(language: Option, output_arg: Option) -> PathBuf { + // If the 'output' arg is specified by the caller, use that, otherwise output to the 'book/' directory + // (or the 'book/xx' directory if a language was specified). + if let Some(d) = output_arg { + d + } else { + Path::new("book").join(language.unwrap_or("".to_string())) + } +} From 570a726cb541c15d4ae5eb86017f9d280fb99120 Mon Sep 17 00:00:00 2001 From: Eric Githinji <51313777+egithinji@users.noreply.github.com> Date: Fri, 1 Aug 2025 11:07:19 +0300 Subject: [PATCH 017/103] Add xtask support for refresh slide list. (#2774) Adds support for a `refresh-slide-list` argument when running the command `cargo xtask web-tests`. Allows one to also specify an optional book html directory **if** one uses the `refresh-slide-list` argument. Fixes #2744 . --- xtask/src/main.rs | 49 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f5d9f5cc..6a469b46 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -47,7 +47,11 @@ enum Task { /// Installs the tools the project depends on. InstallTools, /// Runs the web driver tests in the tests directory. - WebTests, + WebTests { + /// Optional 'book html' directory - if set, will also refresh the list of slides used by slide size test. + #[arg(short, long)] + dir: Option, + }, /// Tests all included Rust snippets. RustTests, /// Starts a web server with the course. @@ -76,7 +80,7 @@ fn execute_task() -> Result<()> { let cli = Cli::parse(); match cli.task { Task::InstallTools => install_tools()?, - Task::WebTests => run_web_tests()?, + Task::WebTests { dir } => run_web_tests(dir)?, Task::RustTests => run_rust_tests()?, Task::Serve { language, output } => start_web_server(language, output)?, Task::Build { language, output } => build(language, output)?, @@ -94,7 +98,7 @@ fn install_tools() -> Result<()> { let install_args = vec![ // The --locked flag is important for reproducible builds. It also // avoids breakage due to skews between mdbook and mdbook-svgbob. - vec!["mdbook", "--locked", "--version", "0.4.48"], + vec!["mdbook", "--locked", "--version", "0.4.51"], vec!["mdbook-svgbob", "--locked", "--version", "0.2.2"], vec!["mdbook-pandoc", "--locked", "--version", "0.10.4"], vec!["mdbook-i18n-helpers", "--locked", "--version", "0.3.6"], @@ -127,16 +131,41 @@ fn install_tools() -> Result<()> { Ok(()) } -fn run_web_tests() -> Result<()> { +fn run_web_tests(dir: Option) -> Result<()> { println!("Running web tests..."); - let path_to_tests_dir = Path::new(env!("CARGO_WORKSPACE_DIR")).join("tests"); + let absolute_dir = dir.map(|d| d.canonicalize()).transpose()?; - let status = Command::new("npm") - .current_dir(path_to_tests_dir.to_str().unwrap()) - .arg("test") - .status() - .expect("Failed to execute npm test"); + if let Some(d) = &absolute_dir { + println!("Refreshing slide lists..."); + let path_to_refresh_slides_script = Path::new("tests") + .join("src") + .join("slides") + .join("create-slide.list.sh"); + let status = Command::new(path_to_refresh_slides_script) + .current_dir(Path::new(env!("CARGO_WORKSPACE_DIR"))) + .arg(d) + .status() + .expect("Failed to execute create-slide.list.sh"); + + if !status.success() { + let error_message = format!( + "Command 'cargo xtask web-tests' exited with status code: {}", + status.code().unwrap() + ); + return Err(anyhow!(error_message)); + } + } + + let path_to_tests_dir = Path::new(env!("CARGO_WORKSPACE_DIR")).join("tests"); + let mut command = Command::new("npm"); + command.current_dir(path_to_tests_dir.to_str().unwrap()); + command.arg("test"); + + if let Some(d) = absolute_dir { + command.env("TEST_BOOK_DIR", d); + } + let status = command.status().expect("Failed to execute npm test"); if !status.success() { let error_message = format!( From 426f3f783aed8b19794fe94ce36431633600e0a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Aug 2025 12:17:06 -0400 Subject: [PATCH 018/103] cargo: bump the patch group with 3 updates (#2837) Bumps the patch group with 3 updates: [clap](https://github.com/clap-rs/clap), [serde_json](https://github.com/serde-rs/json) and [reqwest](https://github.com/seanmonstar/reqwest). --- Cargo.lock | 20 ++++++++++---------- mdbook-course/Cargo.toml | 4 ++-- src/concurrency/sync-exercises/Cargo.toml | 2 +- xtask/Cargo.toml | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ea1b43e..de6fb398 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.40" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" dependencies = [ "clap_builder", "clap_derive", @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" dependencies = [ "anstream", "anstyle", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck", "proc-macro2", @@ -2259,9 +2259,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.21" +version = "0.12.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8cea6b35bcceb099f30173754403d2eba0a5dc18cea3630fccd88251909288" +checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" dependencies = [ "base64 0.22.0", "bytes", @@ -2514,9 +2514,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ "itoa", "memchr", diff --git a/mdbook-course/Cargo.toml b/mdbook-course/Cargo.toml index 960d5eaa..471c7057 100644 --- a/mdbook-course/Cargo.toml +++ b/mdbook-course/Cargo.toml @@ -10,7 +10,7 @@ description = "An mdbook preprocessor for comprehensive-rust." [dependencies] anyhow = "1.0.98" -clap = "4.5.40" +clap = "4.5.42" lazy_static = "1.5" log = "0.4.27" matter = "0.1.0-alpha4" @@ -18,5 +18,5 @@ mdbook = "0.4.51" pretty_env_logger = "0.5.0" regex = "1.11" serde = "1.0.219" -serde_json = "1.0.140" +serde_json = "1.0.142" serde_yaml = "0.9" diff --git a/src/concurrency/sync-exercises/Cargo.toml b/src/concurrency/sync-exercises/Cargo.toml index 70f6d183..570ec763 100644 --- a/src/concurrency/sync-exercises/Cargo.toml +++ b/src/concurrency/sync-exercises/Cargo.toml @@ -13,7 +13,7 @@ name = "link-checker" path = "link-checker.rs" [dependencies] -reqwest = { version = "0.12.21", features = ["blocking"] } +reqwest = { version = "0.12.22", features = ["blocking"] } scraper = "0.23.1" thiserror = "2.0.12" diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 97c6b7fb..57dd6f48 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -6,4 +6,4 @@ publish = false [dependencies] anyhow = "1.0.98" -clap = { version = "4.5.40", features = ["derive"] } +clap = { version = "4.5.42", features = ["derive"] } From 196dafc7e80fd0f4180e7856822bfb8ea66f97c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Aug 2025 12:17:56 -0400 Subject: [PATCH 019/103] cargo: bump the minor group with 2 updates (#2838) Bumps the minor group with 2 updates: [tokio](https://github.com/tokio-rs/tokio) and [tokio-websockets](https://github.com/Gelbpunkt/tokio-websockets). --- Cargo.lock | 39 +++++++++++++++---- .../async-exercises/chat-async/Cargo.toml | 4 +- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index de6fb398..27851417 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1094,7 +1094,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.10", "tokio", "tower-service", "tracing", @@ -1172,7 +1172,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -1388,6 +1388,17 @@ dependencies = [ "libc", ] +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags 2.8.0", + "cfg-if", + "libc", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -2642,6 +2653,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "spin" version = "0.9.8" @@ -2881,20 +2902,22 @@ dependencies = [ [[package]] name = "tokio" -version = "1.45.1" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "slab", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2967,9 +2990,9 @@ dependencies = [ [[package]] name = "tokio-websockets" -version = "0.11.4" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fcaf159b4e7a376b05b5bfd77bfd38f3324f5fce751b4213bfc7eaa47affb4e" +checksum = "3f29ba084eb43becc9864ba514b4a64f5f65b82f9a6ffbafa5436c1c80605f03" dependencies = [ "base64 0.22.0", "bytes", diff --git a/src/concurrency/async-exercises/chat-async/Cargo.toml b/src/concurrency/async-exercises/chat-async/Cargo.toml index a6e28b63..edf6b49f 100644 --- a/src/concurrency/async-exercises/chat-async/Cargo.toml +++ b/src/concurrency/async-exercises/chat-async/Cargo.toml @@ -6,5 +6,5 @@ edition = "2024" [dependencies] futures-util = { version = "0.3.31", features = ["sink"] } http = "1.3.1" -tokio = { version = "1.45.1", features = ["full"] } -tokio-websockets = { version = "0.11.4", features = ["client", "fastrand", "server", "sha1_smol"] } +tokio = { version = "1.47.0", features = ["full"] } +tokio-websockets = { version = "0.12.0", features = ["client", "fastrand", "server", "sha1_smol"] } From 6e2c393364d11d8a11c173d3b042d1ada9ed99c6 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Wed, 6 Aug 2025 03:50:19 -0400 Subject: [PATCH 020/103] Fix typo (#2842) Fixes #2840 --- src/concurrency/async/state-machine.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/concurrency/async/state-machine.md b/src/concurrency/async/state-machine.md index 4531739b..5c387b5e 100644 --- a/src/concurrency/async/state-machine.md +++ b/src/concurrency/async/state-machine.md @@ -33,9 +33,9 @@ fn two_d10(modifier: u32) -> TwoD10 { enum TwoD10 { // Function has not begun yet. Init { modifier: u32 }, - // Waitig for first `.await` to complete. + // Waiting for first `.await` to complete. FirstRoll { modifier: u32, fut: RollD10Future }, - // Waitig for second `.await` to complete. + // Waiting for second `.await` to complete. SecondRoll { modifier: u32, first_roll: u32, fut: RollD10Future }, } From d7f8eb045f4efbe402875479d339341810e64830 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Wed, 6 Aug 2025 03:50:46 -0400 Subject: [PATCH 021/103] Remove reference to discontuned async-std package (#2841) Fixes #2839. --- src/concurrency/async/runtimes.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/concurrency/async/runtimes.md b/src/concurrency/async/runtimes.md index aae19665..f555338d 100644 --- a/src/concurrency/async/runtimes.md +++ b/src/concurrency/async/runtimes.md @@ -11,8 +11,6 @@ not have a "built-in" runtime, but several options are available: - [Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://github.com/hyperium/tonic) for gRPC. -- [async-std](https://async.rs/): aims to be a "std for async", and includes a - basic runtime in `async::task`. - [smol](https://docs.rs/smol/latest/smol/): simple and lightweight Several larger applications have their own runtimes. For example, From 90c0879239544a50d2256b8dca21a7d386a65a49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 09:51:28 +0200 Subject: [PATCH 022/103] cargo: bump aarch64-rt from 0.2.1 to 0.2.2 in /src/exercises/bare-metal/rtc in the patch group (#2836) Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update: [aarch64-rt](https://github.com/google/aarch64-rt). Updates `aarch64-rt` from 0.2.1 to 0.2.2
Changelog

Sourced from aarch64-rt's changelog.

0.2.2

Improvements

  • Added optional parameters to initial_pagetable! to allow initial MAIR, TCR and SCTLR values to be specified. The default values are exposed as constants.
Commits
  • 2ba1c51 Prepare for 0.2.2 release.
  • 02b0802 Merge pull request #17 from google/pagetable
  • 442899c Specify MAIR in example.
  • 141090a Allow just MAIR to be specified.
  • 5720896 Allow initial MAIR, TCR and SCTLR values to be specified.
  • 76b1699 Bump smccc from 0.2.1 to 0.2.2 (#16)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aarch64-rt&package-manager=cargo&previous-version=0.2.1&new-version=0.2.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/exercises/bare-metal/rtc/Cargo.lock | 4 ++-- src/exercises/bare-metal/rtc/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/exercises/bare-metal/rtc/Cargo.lock b/src/exercises/bare-metal/rtc/Cargo.lock index ad64d1e3..6e99dd1e 100644 --- a/src/exercises/bare-metal/rtc/Cargo.lock +++ b/src/exercises/bare-metal/rtc/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "aarch64-rt" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8069db67616de3ec8d024aa717f447a6995f159a3b46b4379d600a6224640c03" +checksum = "683c4295f0608c531130ed6daf301785844c1f71eb126eb56343838968e728c5" dependencies = [ "smccc", ] diff --git a/src/exercises/bare-metal/rtc/Cargo.toml b/src/exercises/bare-metal/rtc/Cargo.toml index ec197933..ae7d0580 100644 --- a/src/exercises/bare-metal/rtc/Cargo.toml +++ b/src/exercises/bare-metal/rtc/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aarch64-paging = { version = "0.9.1", default-features = false } -aarch64-rt = "0.2.1" +aarch64-rt = "0.2.2" arm-gic = "0.4.0" arm-pl011-uart = "0.3.1" bitflags = "2.9.1" From bb1f5646f95b64fe1c7719523b5d1e65400ddb46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 09:52:14 +0200 Subject: [PATCH 023/103] cargo: bump aarch64-paging from 0.9.1 to 0.10.0 in /src/bare-metal/aps/examples in the minor group (#2834) Bumps the minor group in /src/bare-metal/aps/examples with 1 update: [aarch64-paging](https://github.com/google/aarch64-paging). Updates `aarch64-paging` from 0.9.1 to 0.10.0
Release notes

Sourced from aarch64-paging's releases.

0.10.0

New features

  • Added Attributes::GP bit for BTI guarded pages.

Breaking changes

  • zerocopy feature has been removed. PageTable::write_to is provided instead.
  • IdMap::activate now returns the previous TTBR value rather than storing it, and IdMap::deactivate takes the TTBR value to restore as a parameter. IdMap::mark_active no longer takes a previous TTBR value parameter. The same applies to the equivalent methods on LinearMap.
  • Renamed Mapping::activate_raw to activate, and added previous TTBR value parameter to Mapping::deactivate.
  • A page table may be activated multiple times (e.g. on multiple cores) and will keep track of how many times it has been activated. It will only be considered inactive once it has been deactivated the same number of times.
  • MapError::PteUpdateFault now contains a usize rather than a Descriptor.
  • Descriptor no longer implements Copy, Clone, Default, PartialEq or Eq, as it now contains an AtomicUsize rather than just a usize. Various methods on Descriptor now take &self rather than self.
Changelog

Sourced from aarch64-paging's changelog.

0.10.0

New features

  • Added Attributes::GP bit for BTI guarded pages.

Breaking changes

  • zerocopy feature has been removed. PageTable::write_to is provided instead.
  • IdMap::activate now returns the previous TTBR value rather than storing it, and IdMap::deactivate takes the TTBR value to restore as a parameter. IdMap::mark_active no longer takes a previous TTBR value parameter. The same applies to the equivalent methods on LinearMap.
  • Renamed Mapping::activate_raw to activate, and added previous TTBR value parameter to Mapping::deactivate.
  • A page table may be activated multiple times (e.g. on multiple cores) and will keep track of how many times it has been activated. It will only be considered inactive once it has been deactivated the same number of times.
  • MapError::PteUpdateFault now contains a usize rather than a Descriptor.
  • Descriptor no longer implements Copy, Clone, Default, PartialEq or Eq, as it now contains an AtomicUsize rather than just a usize. Various methods on Descriptor now take &self rather than self.
Commits
  • 3aa97a9 Prepare for 0.10.0 release.
  • 426f0eb Add changes to changelog. (#81)
  • 3046d1f Add changes to changelog.
  • ffaefdd Add support for GP bit (#80)
  • f7073ed Bump bitflags from 2.9.0 to 2.9.1 (#78)
  • 3146fc9 Deal with memory ordering in page tables
  • 83c51b4 Drop dependency on zerocopy
  • 73cf4de Mark page tables active before loading them into the MMU
  • c58a108 Move TTBR preserve/restore out of the API
  • 0d3a2d6 Revert "Factor out Mapping::activate_raw."
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aarch64-paging&package-manager=cargo&previous-version=0.9.1&new-version=0.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/bare-metal/aps/examples/Cargo.lock | 4 ++-- src/bare-metal/aps/examples/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bare-metal/aps/examples/Cargo.lock b/src/bare-metal/aps/examples/Cargo.lock index 497ed1ed..5900fee5 100644 --- a/src/bare-metal/aps/examples/Cargo.lock +++ b/src/bare-metal/aps/examples/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "aarch64-paging" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b8f725e9256b2fac2d25e013e22a6a391b8c07e23c4c5eac6e037a78a28801" +checksum = "1f02b5bfa3a481fdade5948a994ce93aa6c76f67fc19f3a9b270565cf7dfc657" dependencies = [ "bitflags", "thiserror", diff --git a/src/bare-metal/aps/examples/Cargo.toml b/src/bare-metal/aps/examples/Cargo.toml index 5f99d876..5ebe16f5 100644 --- a/src/bare-metal/aps/examples/Cargo.toml +++ b/src/bare-metal/aps/examples/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" publish = false [dependencies] -aarch64-paging = { version = "0.9.1", default-features = false } +aarch64-paging = { version = "0.10.0", default-features = false } aarch64-rt = "0.2.2" arm-pl011-uart = "0.3.1" bitflags = "2.9.1" From 7fbaa23a2edae50e0942cd4963fa80260234167f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:24:36 +0000 Subject: [PATCH 024/103] cargo: bump the minor group in /src/exercises/bare-metal/rtc with 2 updates (#2835) Bumps the minor group in /src/exercises/bare-metal/rtc with 2 updates: [aarch64-paging](https://github.com/google/aarch64-paging) and [arm-gic](https://github.com/google/arm-gic). --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Walbran --- src/exercises/bare-metal/rtc/Cargo.lock | 8 ++++---- src/exercises/bare-metal/rtc/Cargo.toml | 4 ++-- src/exercises/bare-metal/rtc/src/exceptions.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/exercises/bare-metal/rtc/Cargo.lock b/src/exercises/bare-metal/rtc/Cargo.lock index 6e99dd1e..e2a46054 100644 --- a/src/exercises/bare-metal/rtc/Cargo.lock +++ b/src/exercises/bare-metal/rtc/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "aarch64-paging" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b8f725e9256b2fac2d25e013e22a6a391b8c07e23c4c5eac6e037a78a28801" +checksum = "1f02b5bfa3a481fdade5948a994ce93aa6c76f67fc19f3a9b270565cf7dfc657" dependencies = [ "bitflags", "thiserror", @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "arm-gic" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd58684ee8041735b64d9e731b18c5515397ee4487f56f7cb9a409c8cbd17839" +checksum = "7ef1a9754e7f526d1740ac6bc7db15cd804294917e66fed899f9a94176ac19b9" dependencies = [ "bitflags", "safe-mmio", diff --git a/src/exercises/bare-metal/rtc/Cargo.toml b/src/exercises/bare-metal/rtc/Cargo.toml index ae7d0580..9d795079 100644 --- a/src/exercises/bare-metal/rtc/Cargo.toml +++ b/src/exercises/bare-metal/rtc/Cargo.toml @@ -7,9 +7,9 @@ edition = "2024" publish = false [dependencies] -aarch64-paging = { version = "0.9.1", default-features = false } +aarch64-paging = { version = "0.10.0", default-features = false } aarch64-rt = "0.2.2" -arm-gic = "0.4.0" +arm-gic = "0.6.0" arm-pl011-uart = "0.3.1" bitflags = "2.9.1" chrono = { version = "0.4.41", default-features = false } diff --git a/src/exercises/bare-metal/rtc/src/exceptions.rs b/src/exercises/bare-metal/rtc/src/exceptions.rs index ba9cd225..6c4c3016 100644 --- a/src/exercises/bare-metal/rtc/src/exceptions.rs +++ b/src/exercises/bare-metal/rtc/src/exceptions.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use arm_gic::gicv3::GicV3; +use arm_gic::gicv3::{GicV3, InterruptGroup}; use log::{error, info, trace}; use smccc::Hvc; use smccc::psci::system_off; @@ -28,8 +28,8 @@ extern "C" fn sync_exception_current(_elr: u64, _spsr: u64) { #[unsafe(no_mangle)] extern "C" fn irq_current(_elr: u64, _spsr: u64) { trace!("irq_current"); - let intid = - GicV3::get_and_acknowledge_interrupt().expect("No pending interrupt"); + let intid = GicV3::get_and_acknowledge_interrupt(InterruptGroup::Group1) + .expect("No pending interrupt"); info!("IRQ {intid:?}"); } From d502398934fe4d5dd526eef62d5c098d9a4283a8 Mon Sep 17 00:00:00 2001 From: handohun <40396941+handohun@users.noreply.github.com> Date: Fri, 8 Aug 2025 11:18:16 +0900 Subject: [PATCH 025/103] Fix typo in ko.po (#2844) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Day 4 is translated into 1일차(Day 1) --- po/ko.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ko.po b/po/ko.po index 678a37f8..9aa1e05c 100644 --- a/po/ko.po +++ b/po/ko.po @@ -565,7 +565,7 @@ msgstr "연습문제: Protobuf 파싱" #: src/SUMMARY.md #, fuzzy msgid "Day 4: Morning" -msgstr "1일차 오전" +msgstr "4일차 오전" #: src/SUMMARY.md src/iterators.md msgid "Iterators" @@ -636,7 +636,7 @@ msgstr "룬 알고리즘" #: src/SUMMARY.md #, fuzzy msgid "Day 4: Afternoon" -msgstr "1일차 오후" +msgstr "4일차 오후" #: src/SUMMARY.md src/error-handling.md msgid "Error Handling" From 9e936b6b70eb13195337dffa539b6f28f46e2c85 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Fri, 8 Aug 2025 14:55:14 +0300 Subject: [PATCH 026/103] Fix build github workflow reference (#2843) ## PR Summary This small PR fixes the build github workflow reference in `tests/README.md`. --------- Signed-off-by: Emmanuel Ferdman --- tests/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/README.md b/tests/README.md index e66a63d1..3d274cc0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -10,9 +10,9 @@ accessing the webpage with a real browser and can access the state of the page so behavior can be asserted. The [Static Server Service](https://webdriver.io/docs/static-server-service/) is -used mainly in the [CI](../github/workflows/build.yml) to serve the book on port -`localhost:8080` such that the test runner can access it. This mode is used when -`npm start` or `npm test` is executed. +used mainly in the [CI](../.github/workflows/build.yml) to serve the book on +port `localhost:8080` such that the test runner can access it. This mode is used +when `npm start` or `npm test` is executed. > **Tip:** Use `cargo xtask web-tests` to run the tests in this directory from > anywhere in the repository. From 6d3dec9c4cf098b818fe5d7f065b1e24c9f8dddf Mon Sep 17 00:00:00 2001 From: Eric Githinji <51313777+egithinji@users.noreply.github.com> Date: Wed, 13 Aug 2025 05:08:56 +0300 Subject: [PATCH 027/103] Add note clarifying xtask not a package to be installed. (#2847) As mentioned in #2803 , if someone has the `cargo-xtask` crate installed in their system, they will get a deprecation warning every time they run one of the `cargo xtask ...` commands. The only way to encounter the deprecation warning is by someone intentionally running `cargo install cargo-xtask`. To mitigate this we are adding a note in the README to explain the usage of xtask in the project and that it is not a package to be installed. A previous PR #2804 addressed this by adding aliases for each xtask subcommand and deprecating the use of `cargo xtask` as a prefix for these commands. While this fixes the warning, the disadvantage is that it doesn't allow one to run `cargo xtask` to view all available subcommands in the project with help instructions. Also the help message that appears if one does e.g. `cargo install-tools --help` still refers to `xtask` which might be confusing for the user. So overall it's a better user experience to keep the usage as `cargo xtask `. Also the use of `cargo xtask` is a pattern used in other large rust projects (see some examples [here](https://github.com/matklad/cargo-xtask?tab=readme-ov-file#external-examples)). Co-authored-by: Eric Githinji --- .cargo/config.toml | 7 ------- README.md | 35 +++++++++++++---------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index c0909084..bcfe0c92 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,12 +1,5 @@ [alias] -# WARNING: Using the `xtask` alias is deprecated and will be unsupported in a -# future version of Cargo. See https://github.com/rust-lang/cargo/issues/10049. xtask = "run --package xtask --" -install-tools = "run --package xtask -- install-tools" -web-tests = "run --package xtask -- web-tests" -rust-tests = "run --package xtask -- rust-tests" -serve = "run --package xtask -- serve" -build-book = "run --package xtask -- build" [env] # To provide an anchor to the root of the workspace when working with paths. diff --git a/README.md b/README.md index 9345895c..5c28c8f2 100644 --- a/README.md +++ b/README.md @@ -71,35 +71,26 @@ Then install these tools with: cargo xtask install-tools ``` +> **Note** We use `xtask` for task automation within the project (e.g. +> installing required tools). Xtask is not a package that you should install. +> Visit https://github.com/matklad/cargo-xtask for more information. + ## Commands -Here is a summary of the various commands you can run in the project. +Here are some of the commonly used commands you can run in the project. Run +`cargo xtask` to view all available commands. -| Command | Description | -| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cargo install-tools` | Install all the tools the project depends on. | -| `cargo serve` | Start a web server with the course. You'll find the content on http://localhost:3000. To serve any of the translated versions of the course, add the language flag (`--language` or `-l`) followed by xx, where xx is the ISO 639 language code (e.g. `cargo xtask serve -l da` for the Danish translation). | -| `cargo rust-tests` | Test the included Rust snippets. | -| `cargo web-tests` | Run the web driver tests in the tests directory. | -| `cargo build-book` | Create a static version of the course in the `book/` directory. Note that you have to separately build and zip exercises and add them to book/html. To build any of the translated versions of the course, add the language flag (`--language` or `-l`) followed by xx, where xx is the ISO 639 language code (e.g. `cargo xtask build -l da` for the Danish translation). [TRANSLATIONS.md](TRANSLATIONS.md) contains further instructions. | +| Command | Description | +| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cargo xtask install-tools` | Install all the tools the project depends on. | +| `cargo xtask serve` | Start a web server with the course. You'll find the content on http://localhost:3000. To serve any of the translated versions of the course, add the language flag (--language or -l) followed by xx, where xx is the ISO 639 language code (e.g. cargo xtask serve -l da for the Danish translation). | +| `cargo xtask rust-tests` | Test the included Rust snippets. | +| `cargo xtask web-tests` | Run the web driver tests in the tests directory. | +| `cargo xtask build` | Create a static version of the course in the `book/` directory. Note that you have to separately build and zip exercises and add them to book/html. To build any of the translated versions of the course, add the language flag (--language or -l) followed by xx, where xx is the ISO 639 language code (e.g. cargo xtask build -l da for the Danish translation). [TRANSLATIONS.md](TRANSLATIONS.md) contains further instructions. | > **Note** On Windows, you need to enable symlinks > (`git config --global core.symlinks true`) and Developer Mode. -> **Note** Previous versions this README recommended that you use -> `cargo xtool `, i.e. `cargo xtool install-tools`. This causes issues -> with pre-existing installations of `cargo-xtool` and is now deprecated. -> -> The new syntax is almost a 1:1 mapping, although `cargo xtool build` has -> become `cargo build-book` to avoid conflicting with the built-in Cargo -> subcommand. -> -> - `cargo xtool build` -> `cargo build-book` -> - `cargo xtool install-tools` -> `cargo install-tools` -> - `cargo xtool serve` -> `cargo serve` -> - `cargo xtool run-tests` -> `cargo run-tests` -> - `cargo xtool web-tests` -> `cargo web-tests` - ## Contributing We would like to receive your contributions. Please see From 301170f17eadec98bb1b5d1dc2e2a886c2ff3be8 Mon Sep 17 00:00:00 2001 From: Eric Githinji <51313777+egithinji@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:15:53 +0300 Subject: [PATCH 028/103] Uninstall old mdbook-linkcheck while installing project tools. (#2846) Fixes #2773 . --- xtask/src/main.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 6a469b46..f46eabd9 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -22,6 +22,7 @@ use anyhow::{Ok, Result, anyhow}; use clap::{Parser, Subcommand}; use std::path::{Path, PathBuf}; +use std::process::Stdio; use std::{env, process::Command}; fn main() -> Result<()> { @@ -128,9 +129,35 @@ fn install_tools() -> Result<()> { } } + // Uninstall original linkcheck if currently installed (see issue no 2773) + uninstall_mdbook_linkcheck(); + Ok(()) } +fn uninstall_mdbook_linkcheck() { + println!("Uninstalling old mdbook-linkcheck if installed..."); + let output = Command::new(env!("CARGO")) + .arg("uninstall") + .arg("mdbook-linkcheck") + .output() + .expect("Failed to execute cargo uninstall mdbook-linkcheck"); + + if !output.status.success() { + if String::from_utf8_lossy(&output.stderr) + .into_owned() + .contains("did not match any packages") + { + println!("mdbook-linkcheck not installed. Continuing..."); + } else { + eprintln!( + "An error occurred during uninstallation of mdbook-linkcheck:\n{:#?}", + String::from_utf8_lossy(&output.stderr) + ); + } + } +} + fn run_web_tests(dir: Option) -> Result<()> { println!("Running web tests..."); From 144fe6b971d343d96c3f159b8279fd1ffc2a34bc Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Wed, 20 Aug 2025 05:13:37 -0400 Subject: [PATCH 029/103] Add speaker note regarding passing slices instead (#2851) This section covers both references and slices, but the exercise focuses on references. This speaker note briefly discusses the option to use slices instead, and a cost of doing so. --- src/references/solution.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/references/solution.md b/src/references/solution.md index 5517c2d4..f7b469b4 100644 --- a/src/references/solution.md +++ b/src/references/solution.md @@ -10,4 +10,9 @@ element. This is because we're iterating using a mutable reference to an array, which causes the `for` loop to give mutable references to each element. +- It is also possible to take slice references here, e.g., + `fn + magnitude(vector: &[f64]) -> f64`. This makes the function more general, + at the cost of a runtime length check. + From 9620f8967fee0c9c87669affea268201afcc3952 Mon Sep 17 00:00:00 2001 From: Nicole L Date: Fri, 22 Aug 2025 14:03:08 -0700 Subject: [PATCH 030/103] Move closures section to beginning of day 2 afternoon (#2854) --- src/SUMMARY.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 1dca1f14..8b67ecaf 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -108,6 +108,12 @@ # Day 2: Afternoon - [Welcome](welcome-day-2-afternoon.md) +- [Closures](closures.md) + - [Closure Syntax](closures/syntax.md) + - [Capturing](closures/capturing.md) + - [Closure Traits](closures/traits.md) + - [Exercise: Log Filter](closures/exercise.md) + - [Solution](closures/solution.md) - [Standard Library Types](std-types.md) - [Standard Library](std-types/std.md) - [Documentation](std-types/docs.md) @@ -118,12 +124,6 @@ - [`HashMap`](std-types/hashmap.md) - [Exercise: Counter](std-types/exercise.md) - [Solution](std-types/solution.md) -- [Closures](closures.md) - - [Closure Syntax](closures/syntax.md) - - [Capturing](closures/capturing.md) - - [Closure Traits](closures/traits.md) - - [Exercise: Log Filter](closures/exercise.md) - - [Solution](closures/solution.md) - [Standard Library Traits](std-traits.md) - [Comparisons](std-traits/comparisons.md) - [Operators](std-traits/operators.md) From f645223749fa6b39b72cb70b0b632cdb44748fa6 Mon Sep 17 00:00:00 2001 From: domicmeia <71815610+domicmeia@users.noreply.github.com> Date: Sat, 30 Aug 2025 00:06:21 +0900 Subject: [PATCH 031/103] ko: fix ko typo (#2857) Related on [error while building /ko #2855](https://github.com/google/comprehensive-rust/issues/2855) --- po/ko.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/po/ko.po b/po/ko.po index 9aa1e05c..e23a22ba 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1440,7 +1440,7 @@ msgid "" "based browsers. This includes interoperability with C++ and how to include " "third-party crates in Chromium." msgstr "" -"[Chromium의 Rust](../chromium.md) 심층 분석은 Chromium 브라우저의 일부로 Rust" +"[Chromium의 Rust](chromium.md) 심층 분석은 Chromium 브라우저의 일부로 Rust" "를 사용하는 방법에 관한 반나절 과정입니다. 여기에는 Chromium의 'gn' 빌드 시스" "템에서 Rust를 사용하여 서드 파티 라이브러리(\"crates\")와 C++ 상호 운용성을 " "가져오는 방법이 포함되어 있습니다." @@ -2253,7 +2253,8 @@ msgid "" "Dependencies can also be resolved from alternative [registries](https://doc." "rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" -"의존성은 다양한 [저장소](registries), git 프로젝트, 디렉터리 등에서 제공될 " +"의존성은 다양한 [저장소](https://doc." +"rust-lang.org/cargo/reference/registries.html), git 프로젝트, 디렉터리 등에서 제공될 " "수 있습니다." #: src/cargo/rust-ecosystem.md From 3633b85adb117ba1f49231980f628b13b2a60b3f Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 31 Aug 2025 23:36:05 +0200 Subject: [PATCH 032/103] Fix link in README.md (#2858) I don't know how, but the existing link points to an article that doesn't actually discuss the course. I updated it to the link I originally had in mind now. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c28c8f2..8152d972 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Articles and blog posts from around the web which cover Comprehensive Rust: _[Scaling Rust Adoption Through Training](https://security.googleblog.com/2023/09/scaling-rust-adoption-through-training.html)_. We published a blog post with details on the development of the course. - 2023-10-02: - _[In Search of Rust Developers, Companies Turn to In-House Training](https://www.darkreading.com/application-security/google-microsoft-take-refuge-in-rust-languages-better-security)_. + _[In Search of Rust Developers, Companies Turn to In-House Training](https://www.darkreading.com/application-security/seeking-rust-developers-in-house-training)_. About how Microsoft, Google, and others are training people in Rust. - 2024-10-18: _[Rust Training at Scale | Rust Global @ RustConf 2024](https://youtu.be/7h5KyMqt2-Q?si=4M99HdWWxMaqN8Zr)_. From 5a310d840ea9b75cee8fd1d764e44d0fe2031550 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:23:09 +0100 Subject: [PATCH 033/103] cargo: bump the patch group in /src/exercises/bare-metal/rtc with 3 updates (#2859) Bumps the patch group in /src/exercises/bare-metal/rtc with 3 updates: arm-gic, arm-pl011-uart and [bitflags](https://github.com/bitflags/bitflags). Updates `arm-gic` from 0.6.0 to 0.6.1 Updates `arm-pl011-uart` from 0.3.1 to 0.3.2 Updates `bitflags` from 2.9.1 to 2.9.3 Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/exercises/bare-metal/rtc/Cargo.lock | 20 ++++++++++---------- src/exercises/bare-metal/rtc/Cargo.toml | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/exercises/bare-metal/rtc/Cargo.lock b/src/exercises/bare-metal/rtc/Cargo.lock index e2a46054..420ddc4b 100644 --- a/src/exercises/bare-metal/rtc/Cargo.lock +++ b/src/exercises/bare-metal/rtc/Cargo.lock @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "arm-gic" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1a9754e7f526d1740ac6bc7db15cd804294917e66fed899f9a94176ac19b9" +checksum = "6bfdb03424c95b58315a4cb0ff4ca919568a5a28ae5ba960a1ad92c9ccaf49b9" dependencies = [ "bitflags", "safe-mmio", @@ -35,9 +35,9 @@ dependencies = [ [[package]] name = "arm-pl011-uart" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5b0f1e39ec186e409c6fd80bbb83aa00622ca71c9c0561b5571df3b5f5391f" +checksum = "8797e113733a36b5fa906c81aefc126d255b88dd1c10a737749aa22ec7736b6a" dependencies = [ "bitflags", "embedded-hal-nb", @@ -55,9 +55,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" [[package]] name = "chrono" @@ -202,18 +202,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", diff --git a/src/exercises/bare-metal/rtc/Cargo.toml b/src/exercises/bare-metal/rtc/Cargo.toml index 9d795079..40325c56 100644 --- a/src/exercises/bare-metal/rtc/Cargo.toml +++ b/src/exercises/bare-metal/rtc/Cargo.toml @@ -9,9 +9,9 @@ publish = false [dependencies] aarch64-paging = { version = "0.10.0", default-features = false } aarch64-rt = "0.2.2" -arm-gic = "0.6.0" -arm-pl011-uart = "0.3.1" -bitflags = "2.9.1" +arm-gic = "0.6.1" +arm-pl011-uart = "0.3.2" +bitflags = "2.9.3" chrono = { version = "0.4.41", default-features = false } log = "0.4.27" safe-mmio = "0.2.5" From 59d698c579a791ae97ae8c63fc1d899e6c219496 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:23:50 +0100 Subject: [PATCH 034/103] cargo: bump the patch group in /src/bare-metal/aps/examples with 2 updates (#2860) Bumps the patch group in /src/bare-metal/aps/examples with 2 updates: arm-pl011-uart and [bitflags](https://github.com/bitflags/bitflags). Updates `arm-pl011-uart` from 0.3.1 to 0.3.2 Updates `bitflags` from 2.9.1 to 2.9.3 Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/bare-metal/aps/examples/Cargo.lock | 8 ++++---- src/bare-metal/aps/examples/Cargo.toml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bare-metal/aps/examples/Cargo.lock b/src/bare-metal/aps/examples/Cargo.lock index 5900fee5..4743bcae 100644 --- a/src/bare-metal/aps/examples/Cargo.lock +++ b/src/bare-metal/aps/examples/Cargo.lock @@ -38,9 +38,9 @@ dependencies = [ [[package]] name = "arm-pl011-uart" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5b0f1e39ec186e409c6fd80bbb83aa00622ca71c9c0561b5571df3b5f5391f" +checksum = "8797e113733a36b5fa906c81aefc126d255b88dd1c10a737749aa22ec7736b6a" dependencies = [ "bitflags", "embedded-hal-nb", @@ -58,9 +58,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" [[package]] name = "embedded-hal" diff --git a/src/bare-metal/aps/examples/Cargo.toml b/src/bare-metal/aps/examples/Cargo.toml index 5ebe16f5..f6f4692f 100644 --- a/src/bare-metal/aps/examples/Cargo.toml +++ b/src/bare-metal/aps/examples/Cargo.toml @@ -9,8 +9,8 @@ publish = false [dependencies] aarch64-paging = { version = "0.10.0", default-features = false } aarch64-rt = "0.2.2" -arm-pl011-uart = "0.3.1" -bitflags = "2.9.1" +arm-pl011-uart = "0.3.2" +bitflags = "2.9.3" log = "0.4.27" safe-mmio = "0.2.5" smccc = "0.2.0" From 6252183538cb07873da558a982df6026e58c11a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:24:31 +0100 Subject: [PATCH 035/103] cargo: bump the minor group with 2 updates (#2861) Bumps the minor group with 2 updates: [scraper](https://github.com/causal-agent/scraper) and [tempfile](https://github.com/Stebalien/tempfile). Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 193 +++++++++++----------- src/concurrency/sync-exercises/Cargo.toml | 4 +- src/unsafe-rust/Cargo.toml | 2 +- 3 files changed, 97 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27851417..251efc91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -396,9 +396,9 @@ dependencies = [ [[package]] name = "cssparser" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c66d1cd8ed61bf80b38432613a7a2f09401ab8d0501110655f8b341484a3e3" +checksum = "4e901edd733a1472f944a45116df3f846f54d37e67e68640ac8bb69689aca2aa" dependencies = [ "cssparser-macros", "dtoa-short", @@ -414,7 +414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -442,7 +442,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.104", + "syn", ] [[package]] @@ -455,7 +455,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -473,7 +473,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.104", + "syn", ] [[package]] @@ -492,13 +492,22 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -519,7 +528,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -745,7 +754,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -802,9 +811,9 @@ version = "0.1.0" [[package]] name = "getopts" -version = "0.2.21" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" dependencies = [ "unicode-width", ] @@ -871,7 +880,7 @@ checksum = "c31d9f07c9c19b855faebf71637be3b43f8e13a518aece5d61a3beee7710b4ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -986,21 +995,18 @@ dependencies = [ "markup5ever 0.12.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] name = "html5ever" -version = "0.29.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e15626aaf9c351bc696217cbe29cb9b5e86c43f8a46b5e2f5c6c5cf7cb904ce" +checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" dependencies = [ "log", - "mac", - "markup5ever 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.104", + "markup5ever 0.35.0", + "match_token", ] [[package]] @@ -1318,7 +1324,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -1565,16 +1571,24 @@ dependencies = [ [[package]] name = "markup5ever" -version = "0.14.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c88c6129bd24319e62a0359cb6b958fa7e8be6e19bb1663bc396b90883aca5" +checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3" dependencies = [ "log", - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", "tendril", + "web_atoms", +] + +[[package]] +name = "match_token" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1736,7 +1750,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -1886,7 +1900,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -1977,7 +1991,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -1998,7 +2012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared", ] [[package]] @@ -2007,18 +2021,8 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared 0.10.0", - "rand", + "phf_generator", + "phf_shared", ] [[package]] @@ -2027,7 +2031,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", "rand", ] @@ -2037,20 +2041,11 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", + "phf_generator", + "phf_shared", "proc-macro2", "quote", - "syn 2.0.104", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", + "syn", ] [[package]] @@ -2079,7 +2074,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -2442,14 +2437,14 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scraper" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e65d9d888567588db4c12da1087598d0f6f8b346cc2c5abc91f05fc2dffe2" +checksum = "e5f3a24d916e78954af99281a455168d4a9515d65eca99a18da1b813689c4ad9" dependencies = [ "cssparser", "ego-tree", "getopts", - "html5ever 0.29.0", + "html5ever 0.35.0", "precomputed-hash", "selectors", "tendril", @@ -2486,9 +2481,9 @@ dependencies = [ [[package]] name = "selectors" -version = "0.26.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd568a4c9bb598e291a08244a5c1f5a8a6650bee243b5b0f8dbb3d9cc1d87fe8" +checksum = "5685b6ae43bfcf7d2e7dfcfb5d8e8f61b46442c902531e41a32a9a8bf0ee0fb6" dependencies = [ "bitflags 2.8.0", "cssparser", @@ -2520,7 +2515,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -2688,26 +2683,25 @@ version = "0.1.0" [[package]] name = "string_cache" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ "new_debug_unreachable", - "once_cell", "parking_lot", - "phf_shared 0.10.0", + "phf_shared", "precomputed-hash", "serde", ] [[package]] name = "string_cache_codegen" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", + "phf_generator", + "phf_shared", "proc-macro2", "quote", ] @@ -2724,17 +2718,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.104" @@ -2773,7 +2756,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -2799,9 +2782,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.20.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ "fastrand", "getrandom 0.3.1", @@ -2876,7 +2859,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -2887,7 +2870,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -2928,7 +2911,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -3149,9 +3132,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unsafe-libyaml" @@ -3309,7 +3292,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.104", + "syn", "wasm-bindgen-shared", ] @@ -3343,7 +3326,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3367,6 +3350,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web_atoms" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3703,7 +3698,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", "synstructure", ] @@ -3724,7 +3719,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] [[package]] @@ -3751,7 +3746,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", "synstructure", ] @@ -3780,5 +3775,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn", ] diff --git a/src/concurrency/sync-exercises/Cargo.toml b/src/concurrency/sync-exercises/Cargo.toml index 570ec763..9073066d 100644 --- a/src/concurrency/sync-exercises/Cargo.toml +++ b/src/concurrency/sync-exercises/Cargo.toml @@ -14,8 +14,8 @@ path = "link-checker.rs" [dependencies] reqwest = { version = "0.12.22", features = ["blocking"] } -scraper = "0.23.1" +scraper = "0.24.0" thiserror = "2.0.12" [dev-dependencies] -tempfile = "3.20.0" +tempfile = "3.21.0" diff --git a/src/unsafe-rust/Cargo.toml b/src/unsafe-rust/Cargo.toml index cbff743c..f02a5edb 100644 --- a/src/unsafe-rust/Cargo.toml +++ b/src/unsafe-rust/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -tempfile = "3.20.0" +tempfile = "3.21.0" [[bin]] name = "listdir" From f1de2fda36d8437fde2bf3f15d476e02b14b6906 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:40:44 +0100 Subject: [PATCH 036/103] Bump actions/checkout from 4 to 5 (#2863) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 14 +++++++------- .github/workflows/check-msgid-changes.yml | 2 +- .github/workflows/publish.yml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 141352e5..69832ec2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install formatting dependencies run: | @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Check for typos uses: crate-ci/typos@v1.34.0 @@ -50,7 +50,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Update Rust run: rustup update @@ -81,7 +81,7 @@ jobs: target: aarch64-unknown-none steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install toolchain run: | @@ -106,7 +106,7 @@ jobs: languages: ${{ steps.find-languages.outputs.languages }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Find languages id: find-languages @@ -131,7 +131,7 @@ jobs: LINK_CHECKED_LANGUAGES: '["en", "fa"]' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 # We need the full history for build.sh below. @@ -202,7 +202,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/check-msgid-changes.yml b/.github/workflows/check-msgid-changes.yml index 0ec63ca1..31fd8e63 100644 --- a/.github/workflows/check-msgid-changes.yml +++ b/.github/workflows/check-msgid-changes.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fe0ac230..bb3dc860 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 # We need the full history for build.sh below. From fe43ce5a019b57f6e3846953ee205df59daa7090 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:41:16 +0100 Subject: [PATCH 037/103] Bump actions/upload-pages-artifact from 3 to 4 (#2864) Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bb3dc860..7c501012 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -73,7 +73,7 @@ jobs: uses: actions/configure-pages@v5 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: path: book/html From 7339c04b9c2f6e11d43f87809abb258c876ebb3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:05:20 +0100 Subject: [PATCH 038/103] cargo: bump the patch group with 8 updates (#2862) Bumps the patch group with 8 updates: | Package | From | To | | --- | --- | --- | | [anyhow](https://github.com/dtolnay/anyhow) | `1.0.98` | `1.0.99` | | [clap](https://github.com/clap-rs/clap) | `4.5.42` | `4.5.46` | | [regex](https://github.com/rust-lang/regex) | `1.11.1` | `1.11.2` | | [serde_json](https://github.com/serde-rs/json) | `1.0.142` | `1.0.143` | | [tokio](https://github.com/tokio-rs/tokio) | `1.47.0` | `1.47.1` | | [tokio-websockets](https://github.com/Gelbpunkt/tokio-websockets) | `0.12.0` | `0.12.1` | | [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.22` | `0.12.23` | | [thiserror](https://github.com/dtolnay/thiserror) | `2.0.12` | `2.0.16` | Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 52 +++++++++---------- mdbook-course/Cargo.toml | 6 +-- mdbook-exerciser/Cargo.toml | 2 +- .../async-exercises/chat-async/Cargo.toml | 4 +- src/concurrency/sync-exercises/Cargo.toml | 4 +- src/lifetimes/Cargo.toml | 2 +- xtask/Cargo.toml | 4 +- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 251efc91..5d56efef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" [[package]] name = "autocfg" @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.42" +version = "4.5.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" +checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57" dependencies = [ "clap_builder", "clap_derive", @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.42" +version = "4.5.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" +checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41" dependencies = [ "anstream", "anstyle", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.41" +version = "4.5.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" +checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" dependencies = [ "heck", "proc-macro2", @@ -642,7 +642,7 @@ name = "error-handling" version = "0.1.0" dependencies = [ "anyhow", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -1497,7 +1497,7 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" name = "lifetimes" version = "0.1.0" dependencies = [ - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -2236,9 +2236,9 @@ version = "0.1.0" [[package]] name = "regex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -2265,9 +2265,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.22" +version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ "base64 0.22.0", "bytes", @@ -2520,9 +2520,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ "itoa", "memchr", @@ -2736,7 +2736,7 @@ dependencies = [ "reqwest", "scraper", "tempfile", - "thiserror 2.0.12", + "thiserror 2.0.16", ] [[package]] @@ -2844,11 +2844,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.16", ] [[package]] @@ -2864,9 +2864,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", @@ -2885,9 +2885,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.47.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", @@ -2973,9 +2973,9 @@ dependencies = [ [[package]] name = "tokio-websockets" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f29ba084eb43becc9864ba514b4a64f5f65b82f9a6ffbafa5436c1c80605f03" +checksum = "5190767f03b86528ab9f4f6a9158072a6d0ef240d9a9591772eb411f315920f4" dependencies = [ "base64 0.22.0", "bytes", diff --git a/mdbook-course/Cargo.toml b/mdbook-course/Cargo.toml index 471c7057..bb9ac7ac 100644 --- a/mdbook-course/Cargo.toml +++ b/mdbook-course/Cargo.toml @@ -9,8 +9,8 @@ repository = "https://github.com/google/comprehensive-rust" description = "An mdbook preprocessor for comprehensive-rust." [dependencies] -anyhow = "1.0.98" -clap = "4.5.42" +anyhow = "1.0.99" +clap = "4.5.46" lazy_static = "1.5" log = "0.4.27" matter = "0.1.0-alpha4" @@ -18,5 +18,5 @@ mdbook = "0.4.51" pretty_env_logger = "0.5.0" regex = "1.11" serde = "1.0.219" -serde_json = "1.0.142" +serde_json = "1.0.143" serde_yaml = "0.9" diff --git a/mdbook-exerciser/Cargo.toml b/mdbook-exerciser/Cargo.toml index e5612067..017ff675 100644 --- a/mdbook-exerciser/Cargo.toml +++ b/mdbook-exerciser/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/google/comprehensive-rust" description = "A tool for extracting starter code for exercises from Markdown files." [dependencies] -anyhow = "1.0.98" +anyhow = "1.0.99" log = "0.4.27" mdbook = "0.4.51" pretty_env_logger = "0.5.0" diff --git a/src/concurrency/async-exercises/chat-async/Cargo.toml b/src/concurrency/async-exercises/chat-async/Cargo.toml index edf6b49f..b0dfc1c5 100644 --- a/src/concurrency/async-exercises/chat-async/Cargo.toml +++ b/src/concurrency/async-exercises/chat-async/Cargo.toml @@ -6,5 +6,5 @@ edition = "2024" [dependencies] futures-util = { version = "0.3.31", features = ["sink"] } http = "1.3.1" -tokio = { version = "1.47.0", features = ["full"] } -tokio-websockets = { version = "0.12.0", features = ["client", "fastrand", "server", "sha1_smol"] } +tokio = { version = "1.47.1", features = ["full"] } +tokio-websockets = { version = "0.12.1", features = ["client", "fastrand", "server", "sha1_smol"] } diff --git a/src/concurrency/sync-exercises/Cargo.toml b/src/concurrency/sync-exercises/Cargo.toml index 9073066d..70b650ab 100644 --- a/src/concurrency/sync-exercises/Cargo.toml +++ b/src/concurrency/sync-exercises/Cargo.toml @@ -13,9 +13,9 @@ name = "link-checker" path = "link-checker.rs" [dependencies] -reqwest = { version = "0.12.22", features = ["blocking"] } +reqwest = { version = "0.12.23", features = ["blocking"] } scraper = "0.24.0" -thiserror = "2.0.12" +thiserror = "2.0.16" [dev-dependencies] tempfile = "3.21.0" diff --git a/src/lifetimes/Cargo.toml b/src/lifetimes/Cargo.toml index 44f73820..7946a29e 100644 --- a/src/lifetimes/Cargo.toml +++ b/src/lifetimes/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" publish = false [dependencies] -thiserror = "2.0.11" +thiserror = "2.0.16" [lib] name = "protobuf" diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 57dd6f48..8228f02c 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -5,5 +5,5 @@ edition = "2024" publish = false [dependencies] -anyhow = "1.0.98" -clap = { version = "4.5.42", features = ["derive"] } +anyhow = "1.0.99" +clap = { version = "4.5.46", features = ["derive"] } From 5e2859fca324d6e74589b6a10ca00a476651c9d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:07:04 +0100 Subject: [PATCH 039/103] Bump crate-ci/typos from 1.34.0 to 1.35.7 (#2865) Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.34.0 to 1.35.7. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69832ec2..ed3f0699 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v5 - name: Check for typos - uses: crate-ci/typos@v1.34.0 + uses: crate-ci/typos@v1.35.7 with: config: ./.github/typos.toml From 17065839c1c221fd8abe2519b9e6a69d8128e66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Mon, 1 Sep 2025 23:35:10 +0300 Subject: [PATCH 040/103] tr: day 2 morning translation with GEMINI :) (#2809) **I had Google Gemini do this Turkish translation.** I gave Gemini my previous translations and the part I wanted it to translate as two separate PO files. As a prompt, I told it to stick to my terminology and methodology. Then, I went through the output that Gemini produced one by one. I estimated that I corrected a small percentage of the entire translation, around 1-5%. Part of #500 --- po/tr.po | 10211 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 6368 insertions(+), 3843 deletions(-) diff --git a/po/tr.po b/po/tr.po index ffd561f2..08ec8894 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-04-07T05:11:51+03:00\n" -"PO-Revision-Date: 2024-04-09 12:31+0300\n" +"POT-Creation-Date: 2025-07-06T18:27:10+03:00\n" +"PO-Revision-Date: 2025-07-06 17:14+0300\n" "Last-Translator: akerem@protonmail.com\n" "Language-Team: Turkish \n" "Language: tr\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.6\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🦀" @@ -34,7 +34,7 @@ msgstr "Çeviriler" #: src/SUMMARY.md src/cargo.md msgid "Using Cargo" -msgstr "Cargo Kullanımı" +msgstr "Cargo'yu Kullanmak" #: src/SUMMARY.md msgid "Rust Ecosystem" @@ -52,47 +52,52 @@ msgstr "Cargo'nun Yerel (Local) Olarak Çalıştırılması" msgid "Day 1: Morning" msgstr "Gün 1: Sabah" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "Hoş Geldiniz" -#: src/SUMMARY.md src/hello-world.md src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "Merhaba, Dünya" -#: src/SUMMARY.md src/hello-world/what-is-rust.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md msgid "What is Rust?" msgstr "Rust Nedir?" -#: src/SUMMARY.md src/hello-world/benefits.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md msgid "Benefits of Rust" msgstr "Rust'ın Faydaları" -#: src/SUMMARY.md src/hello-world/playground.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md msgid "Playground" msgstr "Deneme Alanı (Playground)" -#: src/SUMMARY.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "Türler ve Değerler" -#: src/SUMMARY.md src/types-and-values/variables.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md msgid "Variables" msgstr "Değişkenler" -#: src/SUMMARY.md src/types-and-values/values.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md msgid "Values" msgstr "Değerler" -#: src/SUMMARY.md src/types-and-values/arithmetic.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md msgid "Arithmetic" msgstr "Aritmetik" -#: src/SUMMARY.md src/types-and-values/inference.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md msgid "Type Inference" -msgstr "Tür Çıkarımı" +msgstr "Tür Çıkarımı (Type Inference)" -#: src/SUMMARY.md src/types-and-values/exercise.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md msgid "Exercise: Fibonacci" msgstr "Alıştırma: Fibonacci" @@ -100,7 +105,7 @@ msgstr "Alıştırma: Fibonacci" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md +#: src/generics/solution.md src/std-types/solution.md src/closures/solution.md #: src/std-traits/solution.md src/memory-management/solution.md #: src/smart-pointers/solution.md src/borrowing/solution.md #: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md @@ -109,15 +114,25 @@ msgstr "Alıştırma: Fibonacci" msgid "Solution" msgstr "Çözüm" -#: src/SUMMARY.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "Kontrol Akışı Temelleri" +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md +msgid "Blocks and Scopes" +msgstr "Bloklar ve Kapsamlar" + #: src/SUMMARY.md msgid "`if` Expressions" msgstr "`if` İfadeleri" -#: src/SUMMARY.md src/control-flow-basics/loops.md +#: src/SUMMARY.md src/control-flow-basics/match.md +msgid "`match` Expressions" +msgstr "`match` İfadeleri" + +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md msgid "Loops" msgstr "Döngüler" @@ -137,23 +152,17 @@ msgstr "`break` ve `continue`" msgid "Labels" msgstr "Etiketler" -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes.md -msgid "Blocks and Scopes" -msgstr "Bloklar ve Kapsamlar" - -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "Scopes and Shadowing" -msgstr "Kapsamlar (Scopes) ve Gölgeleme (Shadowing)" - -#: src/SUMMARY.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "Fonksiyonlar" -#: src/SUMMARY.md src/control-flow-basics/macros.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/macros.md msgid "Macros" msgstr "Makrolar" -#: src/SUMMARY.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "Alıştırma: Collatz Sekansı" @@ -161,120 +170,153 @@ msgstr "Alıştırma: Collatz Sekansı" msgid "Day 1: Afternoon" msgstr "Gün 1: Öğleden Sonra" -#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "Demetler (Tuples) ve Diziler (Arrays)" -#: src/SUMMARY.md src/tuples-and-arrays/arrays.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md msgid "Arrays" msgstr "Diziler" -#: src/SUMMARY.md src/tuples-and-arrays/tuples.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md msgid "Tuples" msgstr "Demetler" -#: src/SUMMARY.md src/tuples-and-arrays/iteration.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md msgid "Array Iteration" -msgstr "Dizi İterasyonu" +msgstr "Dizi Adımlama (Iteration)" -#: src/SUMMARY.md src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "Desenler ve Çözümlenme (Destructuring)" -#: src/SUMMARY.md src/tuples-and-arrays/exercise.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md msgid "Exercise: Nested Arrays" msgstr "Alıştırma: İçiçe Diziler" -#: src/SUMMARY.md src/references.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "Referanslar" -#: src/SUMMARY.md src/references/shared.md +#: src/SUMMARY.md src/references.md src/references/shared.md msgid "Shared References" -msgstr "Paylaşılan Referanslar" +msgstr "Paylaşılan (Shared) Referanslar" -#: src/SUMMARY.md src/references/exclusive.md +#: src/SUMMARY.md src/references.md src/references/exclusive.md msgid "Exclusive References" msgstr "Özel (Exclusive) Referanslar" -#: src/SUMMARY.md -msgid "Slices: `&[T]`" -msgstr "Dilimler: `&[T]`" +#: src/SUMMARY.md src/references.md src/references/slices.md +msgid "Slices" +msgstr "Dilimler (Slices)" -#: src/SUMMARY.md src/references/strings.md +#: src/SUMMARY.md src/references.md src/references/strings.md msgid "Strings" msgstr "Dizeler (Strings)" -#: src/SUMMARY.md src/references/exercise.md +#: src/SUMMARY.md src/references.md src/references/dangling.md +msgid "Reference Validity" +msgstr "Referans Geçerliliği (Validity)" + +#: src/SUMMARY.md src/references.md src/references/exercise.md msgid "Exercise: Geometry" msgstr "Alıştırma: Geometri" -#: src/SUMMARY.md src/user-defined-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/user-defined-types.md msgid "User-Defined Types" msgstr "Kullanıcı Tanımlı Türler" -#: src/SUMMARY.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md msgid "Named Structs" -msgstr "İsimli Yapılar" +msgstr "İsimli Yapılar (Named Structs)" -#: src/SUMMARY.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "Demet Yapıları (Tuple Structs)" -#: src/SUMMARY.md src/user-defined-types/enums.md -#: src/pattern-matching/destructuring.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md +#: src/pattern-matching/destructuring-enums.md msgid "Enums" msgstr "Enumlar" -#: src/SUMMARY.md -msgid "Static" -msgstr "Static" - -#: src/SUMMARY.md -msgid "Const" -msgstr "Const" - -#: src/SUMMARY.md src/user-defined-types/aliases.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md msgid "Type Aliases" msgstr "Tür Eş İsimleri (Type Aliases)" -#: src/SUMMARY.md src/user-defined-types/exercise.md +#: src/SUMMARY.md src/user-defined-types.md +msgid "Const" +msgstr "Const" + +#: src/SUMMARY.md src/user-defined-types.md +msgid "Static" +msgstr "Static" + +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/exercise.md msgid "Exercise: Elevator Events" -msgstr "Alıştırma: Asansör Etkinlikleri" +msgstr "Alıştırma: Asansör Olayları" #: src/SUMMARY.md msgid "Day 2: Morning" msgstr "Gün 2: Sabah" -#: src/SUMMARY.md src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "Desen Eşleştirme" -#: src/SUMMARY.md src/pattern-matching/match.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/infallible.md +msgid "Irrefutable Patterns" +msgstr "Reddedilemez Desenler (Irrefutable Patterns)" + +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md msgid "Matching Values" -msgstr "Değerleri Eşleştirme" +msgstr "Değerleri Eşleştirmek" -#: src/SUMMARY.md src/pattern-matching/destructuring.md -msgid "Destructuring" -msgstr "Çözümlenme" +#: src/SUMMARY.md src/pattern-matching.md +msgid "Destructuring Structs" +msgstr "Yapıların (Struct) Çözümlenmesi" -#: src/SUMMARY.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md +msgid "Destructuring Enums" +msgstr "Enum'ların (Struct) Çözümlenmesi" + +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "Let'li Kontrol Akışı" -#: src/SUMMARY.md src/pattern-matching/exercise.md +#: src/SUMMARY.md src/pattern-matching/let-control-flow/if-let.md +msgid "`if let` Expressions" +msgstr "`if let` İfadeleri" + +#: src/SUMMARY.md src/pattern-matching/let-control-flow/while-let.md +msgid "`while let` Statements" +msgstr "`while let` Deyimleri" + +#: src/SUMMARY.md +msgid "`let else`" +msgstr "`let else`" + +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md msgid "Exercise: Expression Evaluation" msgstr "Alıştırma: İfade Değerlendirmesi" -#: src/SUMMARY.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "Metotlar ve Özellikler (Traits)" -#: src/SUMMARY.md src/methods-and-traits/methods.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md msgid "Methods" msgstr "Metotlar" -#: src/SUMMARY.md src/methods-and-traits/traits.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md msgid "Traits" msgstr "Özellikler (Traits)" @@ -283,7 +325,6 @@ msgid "Implementing Traits" msgstr "Özelliklerin (Traits) Gerçekleştirimi" #: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md -#, fuzzy msgid "Supertraits" msgstr "Üstözellikler (Supertraits)" @@ -291,55 +332,61 @@ msgstr "Üstözellikler (Supertraits)" msgid "Associated Types" msgstr "İlişkili Türler" -#: src/SUMMARY.md src/methods-and-traits/deriving.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/deriving.md msgid "Deriving" msgstr "Türetme" -#: src/SUMMARY.md +#: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" msgstr "Alıştırma: Genel Kaydedici" -#: src/SUMMARY.md src/generics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/generics.md msgid "Generics" -msgstr "Jenerikler" +msgstr "Genelleştirmeler (Generics)" -#: src/SUMMARY.md src/generics/generic-functions.md +#: src/SUMMARY.md src/generics.md src/generics/generic-functions.md msgid "Generic Functions" -msgstr "Jenerik Fonksiyonlar" +msgstr "Genelleştirilmiş (Generic) Fonksiyonlar" -#: src/SUMMARY.md src/generics/generic-data.md +#: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md +msgid "Trait Bounds" +msgstr "Özellik (Trait) Sınırları" + +#: src/SUMMARY.md src/generics.md src/generics/generic-data.md msgid "Generic Data Types" -msgstr "Jenerik Veri Türleri" +msgstr "Genelleştirilmiş (Generic) Veri Türleri" #: src/SUMMARY.md src/generics/generic-traits.md msgid "Generic Traits" -msgstr "Jenerik Özellikler (Traits)" - -#: src/SUMMARY.md src/generics/trait-bounds.md -msgid "Trait Bounds" -msgstr "Özellik (Trait) Sınırları" +msgstr "Genelleştirilmiş (Generic) Özellikler (Traits)" #: src/SUMMARY.md src/generics/impl-trait.md msgid "`impl Trait`" msgstr "`impl Trait`" +#: src/SUMMARY.md src/generics/dyn-trait.md +msgid "`dyn Trait`" +msgstr "`dyn Trait`" + #: src/SUMMARY.md src/generics/exercise.md msgid "Exercise: Generic `min`" -msgstr "Alıştırma: Jenerik `min`" +msgstr "Alıştırma: Genelleştirilmiş (Generic) `min`" #: src/SUMMARY.md msgid "Day 2: Afternoon" msgstr "Gün 2: Öğleden Sonra" -#: src/SUMMARY.md src/std-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" msgstr "Standart Kütüphane Türleri" -#: src/SUMMARY.md src/std-types/std.md +#: src/SUMMARY.md src/std-types.md src/std-types/std.md msgid "Standard Library" msgstr "Standart Kütüphane" -#: src/SUMMARY.md src/std-types/docs.md +#: src/SUMMARY.md src/std-types.md src/std-types/docs.md msgid "Documentation" msgstr "Dokümantasyon" @@ -347,7 +394,7 @@ msgstr "Dokümantasyon" msgid "`Option`" msgstr "`Option`" -#: src/SUMMARY.md +#: src/SUMMARY.md src/error-handling/result.md msgid "`Result`" msgstr "`Result`" @@ -364,19 +411,42 @@ msgstr "`Vec`" msgid "`HashMap`" msgstr "`HashMap`" -#: src/SUMMARY.md src/std-types/exercise.md +#: src/SUMMARY.md src/std-types.md src/std-types/exercise.md msgid "Exercise: Counter" msgstr "Alıştırma: Sayıcı" -#: src/SUMMARY.md src/std-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/closures.md +msgid "Closures" +msgstr "Çevreleyiciler (Closures)" + +#: src/SUMMARY.md src/closures.md src/closures/syntax.md +msgid "Closure Syntax" +msgstr "Çevreleyici Sözdizimi (Closure Syntax)" + +#: src/SUMMARY.md src/closures.md src/closures/capturing.md +msgid "Capturing" +msgstr "Yakalama (Capturing)" + +#: src/SUMMARY.md src/closures.md +msgid "Closure Traits" +msgstr "Çevreleyici Özellikler (Closure Traits)" + +#: src/SUMMARY.md src/closures.md src/closures/exercise.md +msgid "Exercise: Log Filter" +msgstr "Alıştırma: Kaydedici (Log) Filtresi" + +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" msgstr "Standart Kütüphanedeki Özellikler (Traits)" -#: src/SUMMARY.md src/std-traits/comparisons.md src/async.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md +#: src/concurrency/welcome-async.md msgid "Comparisons" msgstr "Karşılaştırmalar" -#: src/SUMMARY.md src/std-traits/operators.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md msgid "Operators" msgstr "Operatörler" @@ -384,9 +454,9 @@ msgstr "Operatörler" msgid "`From` and `Into`" msgstr "`From` ve `Into`" -#: src/SUMMARY.md src/std-traits/casting.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md msgid "Casting" -msgstr "Casting" +msgstr "Tür Çevirimi" #: src/SUMMARY.md src/std-traits/read-and-write.md msgid "`Read` and `Write`" @@ -396,11 +466,7 @@ msgstr "`Read` ve `Write`" msgid "`Default`, struct update syntax" msgstr "`Default`, yapı (struct) güncelleme sözdizimi" -#: src/SUMMARY.md src/std-traits/closures.md -msgid "Closures" -msgstr "Kapanışlar (Closures)" - -#: src/SUMMARY.md src/std-traits/exercise.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md msgid "Exercise: ROT13" msgstr "Alıştırma: ROT13" @@ -408,23 +474,24 @@ msgstr "Alıştırma: ROT13" msgid "Day 3: Morning" msgstr "Gün 3: Sabah" -#: src/SUMMARY.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "Bellek Yönetimi" -#: src/SUMMARY.md src/memory-management/review.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/review.md msgid "Review of Program Memory" msgstr "Program Belleğinin Gözden Geçirilmesi" -#: src/SUMMARY.md src/memory-management/approaches.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/approaches.md msgid "Approaches to Memory Management" msgstr "Bellek Yönetimine Yaklaşımlar" -#: src/SUMMARY.md src/memory-management/ownership.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md msgid "Ownership" msgstr "Sahiplik" -#: src/SUMMARY.md src/memory-management/move.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/move.md msgid "Move Semantics" msgstr "Taşıma Semantiği" @@ -432,7 +499,7 @@ msgstr "Taşıma Semantiği" msgid "`Clone`" msgstr "`Clone`" -#: src/SUMMARY.md src/memory-management/copy-types.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/copy-types.md msgid "Copy Types" msgstr "Kopyalanan Türler" @@ -440,11 +507,12 @@ msgstr "Kopyalanan Türler" msgid "`Drop`" msgstr "`Drop`" -#: src/SUMMARY.md src/memory-management/exercise.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md msgid "Exercise: Builder Type" msgstr "Alıştırma: İnşa Edici / Yapıcı Tür (Builder Type)" -#: src/SUMMARY.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "Akıllı Göstericiler" @@ -457,11 +525,11 @@ msgstr "`Box`" msgid "`Rc`" msgstr "`Rc`" -#: src/SUMMARY.md src/smart-pointers/trait-objects.md -msgid "Trait Objects" -msgstr "Özellik Nesneleri" +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/trait-objects.md +msgid "Owned Trait Objects" +msgstr "Sahipli Özellik Nesneleri (Owned Trait Objects)" -#: src/SUMMARY.md src/smart-pointers/exercise.md +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/exercise.md msgid "Exercise: Binary Tree" msgstr "Alıştırma: İkili Ağaç" @@ -469,43 +537,57 @@ msgstr "Alıştırma: İkili Ağaç" msgid "Day 3: Afternoon" msgstr "Gün 3: Öğleden Sonra" -#: src/SUMMARY.md src/borrowing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3-afternoon.md src/borrowing.md msgid "Borrowing" msgstr "Ödünç Alma" -#: src/SUMMARY.md src/borrowing/shared.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/shared.md msgid "Borrowing a Value" msgstr "Bir Değeri Ödünç Alma" -#: src/SUMMARY.md src/borrowing/borrowck.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/borrowck.md msgid "Borrow Checking" msgstr "Ödünç Alma Kontrolü" -#: src/SUMMARY.md src/borrowing/interior-mutability.md -msgid "Interior Mutability" -msgstr "İç (Interior) Değiştirilebilirlik" +#: src/SUMMARY.md src/borrowing.md src/borrowing/examples.md +msgid "Borrow Errors" +msgstr "Ödünç Alma Hataları" -#: src/SUMMARY.md src/borrowing/exercise.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/interior-mutability.md +msgid "Interior Mutability" +msgstr "İç Değişebilirlik (Interior Mutability)" + +#: src/SUMMARY.md src/borrowing/interior-mutability/cell.md +msgid "`Cell`" +msgstr "`Cell`" + +#: src/SUMMARY.md src/borrowing/interior-mutability/refcell.md +msgid "`RefCell`" +msgstr "`RefCell`" + +#: src/SUMMARY.md src/borrowing.md src/borrowing/exercise.md msgid "Exercise: Health Statistics" msgstr "Alıştırma: Sağlık İstatistikleri" -#: src/SUMMARY.md src/lifetimes.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3-afternoon.md src/lifetimes.md msgid "Lifetimes" msgstr "Ömürler (Lifetimes)" -#: src/SUMMARY.md src/lifetimes/lifetime-annotations.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/lifetime-annotations.md msgid "Lifetime Annotations" msgstr "Ömür için Ek Açıklamalar (Annotations)" -#: src/SUMMARY.md +#: src/SUMMARY.md src/lifetimes.md msgid "Lifetime Elision" msgstr "Ömür Atlaması (Elision)" -#: src/SUMMARY.md -msgid "Struct Lifetimes" -msgstr "Yapıların Ömürleri" +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/struct-lifetimes.md +msgid "Lifetimes in Data Structures" +msgstr "Veri Yapılarında Ömürler" -#: src/SUMMARY.md src/lifetimes/exercise.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/exercise.md msgid "Exercise: Protobuf Parsing" msgstr "Alıştırma: Protobuf Ayrıştırma" @@ -513,63 +595,78 @@ msgstr "Alıştırma: Protobuf Ayrıştırma" msgid "Day 4: Morning" msgstr "Gün 4: Sabah" -#: src/SUMMARY.md src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/iterators.md msgid "Iterators" -msgstr "Adımlayıcıyılar (Iterators)" +msgstr "Adımlayıcılar (Iterators)" -#: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md -msgid "`Iterator`" -msgstr "`Iterator`" +#: src/SUMMARY.md src/iterators.md +msgid "Motivation" +msgstr "Motivasyon" + +#: src/SUMMARY.md src/iterators/iterator.md +msgid "`Iterator` Trait" +msgstr "`Iterator` Özelliği (Trait)" + +#: src/SUMMARY.md src/iterators/helpers.md +msgid "`Iterator` Helper Methods" +msgstr "`Iterator` Yardımcı Metotları" + +#: src/SUMMARY.md src/iterators/collect.md +msgid "`collect`" +msgstr "`collect`" #: src/SUMMARY.md src/iterators/intoiterator.md msgid "`IntoIterator`" msgstr "`IntoIterator`" -#: src/SUMMARY.md -msgid "`FromIterator`" -msgstr "`FromIterator`" - -#: src/SUMMARY.md src/iterators/exercise.md +#: src/SUMMARY.md src/iterators.md src/iterators/exercise.md msgid "Exercise: Iterator Method Chaining" msgstr "Alıştırma: Adımlayıcı Metot Zincirleme" -#: src/SUMMARY.md src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/modules.md src/modules/modules.md msgid "Modules" msgstr "Modüller" -#: src/SUMMARY.md src/modules/filesystem.md +#: src/SUMMARY.md src/modules.md src/modules/filesystem.md msgid "Filesystem Hierarchy" msgstr "Dosya Sistemi Hiyerarşisi" -#: src/SUMMARY.md src/modules/visibility.md +#: src/SUMMARY.md src/modules.md src/modules/visibility.md msgid "Visibility" msgstr "Görünürlük" +#: src/SUMMARY.md src/modules.md +msgid "Encapsulation" +msgstr "Kapsülleme (Encapsulation)" + #: src/SUMMARY.md msgid "`use`, `super`, `self`" msgstr "`use`, `super`, `self`" -#: src/SUMMARY.md src/modules/exercise.md +#: src/SUMMARY.md src/modules.md src/modules/exercise.md msgid "Exercise: Modules for a GUI Library" msgstr "Alıştırma: Bir GUI Kütüphanesi için Modüller" -#: src/SUMMARY.md src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/testing.md src/chromium/testing.md msgid "Testing" msgstr "Test Etme" -#: src/SUMMARY.md -msgid "Test Modules" -msgstr "Test Modülleri" +#: src/SUMMARY.md src/testing.md src/testing/unit-tests.md +msgid "Unit Tests" +msgstr "Birim Testleri" -#: src/SUMMARY.md src/testing/other.md +#: src/SUMMARY.md src/testing.md src/testing/other.md msgid "Other Types of Tests" msgstr "Diğer Test Türleri" -#: src/SUMMARY.md src/testing/lints.md +#: src/SUMMARY.md src/testing.md src/testing/lints.md msgid "Compiler Lints and Clippy" -msgstr "Derleyicinin Tüyleri ve Clippy Aracı" +msgstr "Derleyici Tüyleri (Lint) ve Clippy Aracı" -#: src/SUMMARY.md src/testing/exercise.md +#: src/SUMMARY.md src/testing.md src/testing/exercise.md msgid "Exercise: Luhn Algorithm" msgstr "Alıştırma: Luhn Algrotiması" @@ -577,19 +674,20 @@ msgstr "Alıştırma: Luhn Algrotiması" msgid "Day 4: Afternoon" msgstr "Gün 4: Öğleden Sonra" -#: src/SUMMARY.md src/error-handling.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4-afternoon.md src/error-handling.md msgid "Error Handling" msgstr "Hata İşleme" -#: src/SUMMARY.md src/error-handling/panics.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/panics.md msgid "Panics" -msgstr "Panic'ler" +msgstr "Panikler (Panics)" -#: src/SUMMARY.md src/error-handling/try.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try.md msgid "Try Operator" msgstr "Try Operatörü" -#: src/SUMMARY.md src/error-handling/try-conversions.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md msgid "Try Conversions" msgstr "Try Dönüşümleri" @@ -597,47 +695,64 @@ msgstr "Try Dönüşümleri" msgid "`Error` Trait" msgstr "`Error` Özelliği (Trait)" -#: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md -msgid "`thiserror` and `anyhow`" -msgstr "`thiserror` ve `anyhow`" +#: src/SUMMARY.md src/error-handling/thiserror.md +msgid "`thiserror`" +msgstr "`thiserror`" + +#: src/SUMMARY.md src/error-handling/anyhow.md +msgid "`anyhow`" +msgstr "`anyhow`" #: src/SUMMARY.md msgid "Exercise: Rewriting with `Result`" msgstr "Alıştırma: `Result` ile Yeniden Yazma" -#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4-afternoon.md src/unsafe-rust.md src/unsafe-rust/unsafe.md msgid "Unsafe Rust" msgstr "Emniyetsiz (Unsafe) Rust" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md msgid "Unsafe" msgstr "Emniyetsiz" -#: src/SUMMARY.md src/unsafe-rust/dereferencing.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/dereferencing.md msgid "Dereferencing Raw Pointers" msgstr "Ham Göstericilerinin İçeriği (Dereferencing)" -#: src/SUMMARY.md src/unsafe-rust/mutable-static.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/mutable-static.md msgid "Mutable Static Variables" -msgstr "Değiştirilebilir Statik Değişkenler" +msgstr "Değişebilir Statik Değişkenler" -#: src/SUMMARY.md src/unsafe-rust/unions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unions.md msgid "Unions" msgstr "Birlikler (Unions)" -#: src/SUMMARY.md src/unsafe-rust/unsafe-functions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe-functions.md msgid "Unsafe Functions" -msgstr "Emniyetsiz Fonksiyonlar" +msgstr "Emniyetsiz (Unsafe) Fonksiyonlar" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/rust.md +msgid "Unsafe Rust Functions" +msgstr "Emniyetsiz (Unsafe) Rust Fonksiyonlar" + +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/extern-c.md +msgid "Unsafe External Functions" +msgstr "Emniyetsiz (Unsafe) Harici Fonksiyonlar" + +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/calling.md +msgid "Calling Unsafe Functions" +msgstr "Emniyetsiz (Unsafe) Fonksiyonları Çağırma" + +#: src/SUMMARY.md src/unsafe-rust.md msgid "Unsafe Traits" -msgstr "Emniyetsiz Özellikler (Traits)" +msgstr "Emniyetsiz Özellikler (Unsafe Traits)" + +#: src/SUMMARY.md src/unsafe-rust.md +msgid "Exercise: FFI Wrapper" +msgstr "Alıştırma: FFI Sarmalayıcı" #: src/SUMMARY.md -msgid "Exercise: FFI Wrapper" -msgstr "Alıştırma: FFI Sarıcı" - -#: src/SUMMARY.md src/bare-metal/android.md msgid "Android" msgstr "Android" @@ -735,15 +850,27 @@ msgstr "Kayıt Tutma (Logging)" #: src/SUMMARY.md src/android/interoperability.md msgid "Interoperability" -msgstr "Birlikte Çalışabilirlik" +msgstr "Birlikte Çalışabilirlik (Interoperability)" #: src/SUMMARY.md msgid "With C" msgstr "C ile" +#: src/SUMMARY.md src/android/interoperability/with-c/c-library.md +msgid "A Simple C Library" +msgstr "Basit bir C Kütüphanesi" + #: src/SUMMARY.md -msgid "Calling C with Bindgen" -msgstr "Bindgen ile Rust Tarafından C'yi Kullanma" +msgid "Bindgen" +msgstr "Bindgen" + +#: src/SUMMARY.md src/android/interoperability/with-c/run-our-binary.md +msgid "Running Our Binary" +msgstr "İkili Dosyamızı Çalıştırmak" + +#: src/SUMMARY.md src/android/interoperability/with-c/rust-library.md +msgid "A Simple Rust Library" +msgstr "Basit bir Rust Kütüphanesi" #: src/SUMMARY.md msgid "Calling Rust from C" @@ -789,14 +916,14 @@ msgstr "C++ Hata İşleme" msgid "Additional Types" msgstr "Ek Türler" -#: src/SUMMARY.md -msgid "Building for Android: C++" -msgstr "Android için inşa: C++" - #: src/SUMMARY.md msgid "Building for Android: Genrules" msgstr "Android için inşa: Genrules" +#: src/SUMMARY.md +msgid "Building for Android: C++" +msgstr "Android için inşa: C++" + #: src/SUMMARY.md msgid "Building for Android: Rust" msgstr "Android için inşa: Rust" @@ -805,12 +932,6 @@ msgstr "Android için inşa: Rust" msgid "With Java" msgstr "Java ile" -#: src/SUMMARY.md src/exercises/android/morning.md -#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md -#: src/exercises/concurrency/morning.md src/exercises/concurrency/afternoon.md -msgid "Exercises" -msgstr "Egzersizler" - #: src/SUMMARY.md msgid "Chromium" msgstr "Chromium" @@ -835,7 +956,8 @@ msgstr "Chromium C++'dan Rust Koduna Bağımlılık" msgid "Visual Studio Code" msgstr "Visual Studio Code" -#: src/SUMMARY.md src/exercises/chromium/third-party.md +#: src/SUMMARY.md src/lifetimes/exercise.md +#: src/exercises/chromium/third-party.md msgid "Exercise" msgstr "Alıştırma" @@ -853,7 +975,7 @@ msgstr "`chromium::import!` Makrosu" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md msgid "Interoperability with C++" -msgstr "C++ ile Birlikte Çalışabilirlik" +msgstr "C++ ile Birlikte Çalışabilirlik (Interoperability)" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md msgid "Example Bindings" @@ -944,7 +1066,7 @@ msgstr "Alıştırma Çözümleri" #: src/SUMMARY.md msgid "Bare Metal: Morning" -msgstr "Yalın Metal (Bare Metal): Sabah" +msgstr "Yalın Sistem (Bare Metal): Sabah" #: src/SUMMARY.md src/bare-metal/no_std.md msgid "`no_std`" @@ -998,18 +1120,28 @@ msgstr "Hata Ayıklama" msgid "Other Projects" msgstr "Diğer Projeler" +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async-exercises.md +msgid "Exercises" +msgstr "Alıştırmalar" + #: src/SUMMARY.md src/exercises/bare-metal/compass.md #: src/exercises/bare-metal/solutions-morning.md msgid "Compass" msgstr "Pusula" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "Çözümler" #: src/SUMMARY.md msgid "Bare Metal: Afternoon" -msgstr "Yalın Metal (Bare Metal): Öğleden Sonra" +msgstr "Yalın Sistem (Bare Metal): Öğleden Sonra" #: src/SUMMARY.md msgid "Application Processors" @@ -1035,6 +1167,10 @@ msgstr "Bir UART Sürücü Yazalım" msgid "More Traits" msgstr "Daha Fazla Özellik (Trait)" +#: src/SUMMARY.md src/bare-metal/aps/safemmio/using.md +msgid "Using It" +msgstr "Onu Kullan" + #: src/SUMMARY.md msgid "A Better UART Driver" msgstr "Daha İyi Bir UART Sürücüsü" @@ -1048,17 +1184,22 @@ msgid "Multiple Registers" msgstr "Çoklu Yazmaçlar (Registers)" #: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "Driver" msgstr "Sürücü" -#: src/SUMMARY.md -msgid "Using It" -msgstr "Onu Kullan" +#: src/SUMMARY.md src/bare-metal/aps/safemmio/registers.md +msgid "safe-mmio" +msgstr "safe-mmio" -#: src/SUMMARY.md src/bare-metal/aps/exceptions.md +#: src/SUMMARY.md src/error-handling/result.md src/bare-metal/aps/exceptions.md msgid "Exceptions" msgstr "İstisnalar" +#: src/SUMMARY.md src/bare-metal/aps/aarch64-rt.md +msgid "aarch64-rt" +msgstr "aarch64-rt" + #: src/SUMMARY.md msgid "Useful Crates" msgstr "Kullanışlı Kasalar (Crates)" @@ -1083,6 +1224,10 @@ msgstr "`tinyvec`" msgid "`spin`" msgstr "`spin`" +#: src/SUMMARY.md src/bare-metal/android.md +msgid "Bare-Metal on Android" +msgstr "Android'de Yalın Sistem (Bare Metal)" + #: src/SUMMARY.md msgid "`vmbase`" msgstr "`vmbase`" @@ -1095,23 +1240,36 @@ msgstr "RTC Sürücüsü" msgid "Concurrency: Morning" msgstr "Eşzamanlılık: Sabah" -#: src/SUMMARY.md src/concurrency/threads.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/threads.md msgid "Threads" msgstr "İş Parçacıkları (Threads)" -#: src/SUMMARY.md src/concurrency/scoped-threads.md +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md +msgid "Plain Threads" +msgstr "Temel İş Parçacıkları (Plain Threads)" + +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/scoped.md msgid "Scoped Threads" msgstr "Kapsamlı İş Parçacıkları (Threads)" -#: src/SUMMARY.md src/concurrency/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/channels.md msgid "Channels" msgstr "Kanallar" -#: src/SUMMARY.md src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md +msgid "Senders and Receivers" +msgstr "Vericiler ve Alıcılar" + +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "Sınırsız Kanallar" -#: src/SUMMARY.md src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "Sınırlı Kanallar" @@ -1119,6 +1277,11 @@ msgstr "Sınırlı Kanallar" msgid "`Send` and `Sync`" msgstr "`Send` ve `Sync`" +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md +msgid "Marker Traits" +msgstr "Marker Özellikleri (Traits)" + #: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" msgstr "`Send`" @@ -1127,34 +1290,39 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "Örnekler" -#: src/SUMMARY.md src/concurrency/shared_state.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/shared-state.md msgid "Shared State" msgstr "Paylaşımlı Durum (State)" -#: src/SUMMARY.md src/concurrency/shared_state/arc.md +#: src/SUMMARY.md src/concurrency/shared-state/arc.md msgid "`Arc`" msgstr "`Arc`" -#: src/SUMMARY.md src/concurrency/shared_state/mutex.md +#: src/SUMMARY.md src/concurrency/shared-state/mutex.md msgid "`Mutex`" msgstr "`Mutex`" #: src/SUMMARY.md src/memory-management/review.md -#: src/error-handling/try-conversions.md -#: src/concurrency/shared_state/example.md +#: src/error-handling/try-conversions.md src/concurrency/shared-state.md +#: src/concurrency/shared-state/example.md msgid "Example" msgstr "Örnek" -#: src/SUMMARY.md src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "Filozofların Akşam Yemeği" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Multi-threaded Link Checker" msgstr "Çok İş Parçacıklı Link Denetleyicisi" @@ -1162,69 +1330,84 @@ msgstr "Çok İş Parçacıklı Link Denetleyicisi" msgid "Concurrency: Afternoon" msgstr "Eşzamanlılık: Öğleden Sonra" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" msgstr "Async Temelleri" -#: src/SUMMARY.md src/async/async-await.md +#: src/SUMMARY.md src/concurrency/async/async-await.md msgid "`async`/`await`" msgstr "`async`/`await`" -#: src/SUMMARY.md src/async/futures.md +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md msgid "Futures" msgstr "Future Özellikleri (Traits)" -#: src/SUMMARY.md src/async/runtimes.md +#: src/SUMMARY.md src/concurrency/async.md +#: src/concurrency/async/state-machine.md +msgid "State Machine" +msgstr "Durum Makinesi" + +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md msgid "Runtimes" msgstr "Çalışma Zamanları" -#: src/SUMMARY.md src/async/runtimes/tokio.md +#: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md msgid "Tokio" msgstr "Tokio Kasası" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md src/async/tasks.md -#: src/exercises/concurrency/chat-app.md +#: src/SUMMARY.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/async.md src/concurrency/async/tasks.md +#: src/concurrency/async-exercises/chat-app.md msgid "Tasks" msgstr "Görevler" -#: src/SUMMARY.md src/async/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md +msgid "Channels and Control Flow" +msgstr "Kanallar ve Kontrol Akışı" + +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/channels.md msgid "Async Channels" msgstr "Async Kanalları" -#: src/SUMMARY.md -msgid "Control Flow" -msgstr "Kontrol Akışı" - -#: src/SUMMARY.md src/async/control-flow/join.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/join.md msgid "Join" msgstr "Join" -#: src/SUMMARY.md src/async/control-flow/select.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/select.md msgid "Select" msgstr "Select" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" msgstr "Tuzaklar" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" msgstr "Yürütücünün/Çalıştırıcının (Executor) Engellenmesi" -#: src/SUMMARY.md src/async/pitfalls/pin.md +#: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md msgid "`Pin`" msgstr "`Pin`" -#: src/SUMMARY.md src/async/pitfalls/async-traits.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "Async Traits" msgstr "Async Özellikleri (Traits)" -#: src/SUMMARY.md src/async/pitfalls/cancellation.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "Cancellation" msgstr "İptal (Cancellation)" -#: src/SUMMARY.md src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/SUMMARY.md src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "Broadcast Chat Application" msgstr "Yayımlamalı Sohbet Uygulaması" @@ -1236,6 +1419,7 @@ msgstr "Son sözler" msgid "Thanks!" msgstr "Teşekkürler!" +#. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md msgid "Glossary" msgstr "Sözlük" @@ -1275,8 +1459,8 @@ msgid "" "topics like generics and error handling." msgstr "" "Bu, Google'daki Android ekibi tarafından geliştirilen ücretsiz bir Rust " -"kursudur. Kurs, temel sözdiziminden jenerikler ve hata işleme gibi ileri " -"düzey konulara kadar Rust'ın tüm yelpazesini kapsar." +"kursudur. Kurs, temel sözdiziminden genelleştirmeler (generics) ve hata " +"işleme gibi ileri düzey konulara kadar Rust'ın tüm yelpazesini kapsar." #: src/index.md msgid "" @@ -1289,7 +1473,16 @@ msgstr "" "kontrol edin." #: src/index.md -#, fuzzy +msgid "" +"The course is available in other languages. Select your preferred language " +"in the top right corner of the page or check the [Translations](running-the-" +"course/translations.md) page for a list of all available translations." +msgstr "" +"Kurs diğer dillerde de mevcuttur. Sayfanın sağ üst köşesinden tercih " +"ettiğiniz dili seçin veya tüm mevcut çevirilerin listesi için [Çeviriler]" +"(running-the-course/translations.md) sayfasını kontrol edin." + +#: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." msgstr "Kurs ayrıca [PDF olarak](comprehensive-rust.pdf) da mevcuttur." @@ -1313,7 +1506,7 @@ msgstr "" #: src/index.md msgid "Show you common Rust idioms." -msgstr "Yaygın Rust kod kaplarını göstermeyi." +msgstr "Yaygın Rust kod kalıplarını göstermeyi." #: src/index.md msgid "We call the first four course days Rust Fundamentals." @@ -1333,7 +1526,7 @@ msgid "" msgstr "" "[Android](android.md): Android platformu geliştirme (AOSP) için Rust'ın " "kullanımına ilişkin yarım günlük bir kurs. Buna C, C++ ve Java ile birlikte " -"çalışabilirlik de dahildir." +"çalışabilirlik (interoperability) de dahildir." #: src/index.md msgid "" @@ -1352,21 +1545,21 @@ msgid "" "(embedded) development. Both microcontrollers and application processors are " "covered." msgstr "" -"[Yalın-metal](bare-metal.md): Yalın metal (gömülü) geliştirme için Rust'ın " +"[Yalın-metal](bare-metal.md): Yalın sistem (gömülü) geliştirme için Rust'ın " "kullanımına ilişkin tam günlük bir ders. Hem mikrodenetleyiciler hem de " "uygulama işlemcileri kapsanmaktadır." #: src/index.md msgid "" -"[Concurrency](concurrency.md): a whole-day class on concurrency in Rust. We " -"cover both classical concurrency (preemptively scheduling using threads and " -"mutexes) and async/await concurrency (cooperative multitasking using " -"futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " +"Rust. We cover both classical concurrency (preemptively scheduling using " +"threads and mutexes) and async/await concurrency (cooperative multitasking " +"using futures)." msgstr "" -"[Eşzamanlılık](concurrency.md): Rust'ta eşzamanlılık üzerine tam günlük bir " -"ders. Hem klasik eşzamanlılığı (iş parçacıkları ve mutexleri kullanarak " -"kesintili/geçişli zamanlama) hem de async/await eşzamanlılığını (future " -"özelliklerini kullanarak işbirlikçi çoklu görev) ele alıyoruz." +"[Eşzamanlılık](concurrency/welcome.md): Rust'ta eşzamanlılık üzerine tam " +"günlük bir ders. Hem klasik eşzamanlılığı (iş parçacıkları ve muteksleri " +"kullanarak kesintili/geçişli zamanlama) hem de async/await eşzamanlılığını " +"(future özelliklerini kullanarak işbirlikçi çoklu görev) ele alıyoruz." #: src/index.md msgid "Non-Goals" @@ -1382,14 +1575,13 @@ msgstr "" #: src/index.md msgid "" -"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) instead." +"Learning how to develop macros: please see [the Rust Book](https://doc.rust-" +"lang.org/book/) and [Rust by Example](https://doc.rust-lang.org/rust-by-" +"example/macros.html) instead." msgstr "" "Makroların nasıl geliştirileceğini öğrenmek: lütfen bunun yerine [Rust " -"Book'ta Bölüm 19.5](https://doc.rust-lang.org/book/ch19-06-macros.html) ve " -"[Örneklerle Rust](https://doc.rust-lang.org/rust-by-example/macros.html) " -"bakınız." +"Kitabı](https://doc.rust-lang.org/book/)'na ve [Örneklerle Rust](https://doc." +"rust-lang.org/rust-by-example/macros.html)'a bakınız." #: src/index.md msgid "Assumptions" @@ -1401,9 +1593,10 @@ msgid "" "statically-typed language and we will sometimes make comparisons with C and " "C++ to better explain or contrast the Rust approach." msgstr "" -"Kurs, nasıl programlanacağını zaten bildiğinizi varsayar. Rust, statik " -"olarak türlenen bir dildir ve Rust yaklaşımını daha iyi açıklamak veya " -"karşılaştırmak için bazen C ve C++ ile karşılaştırmalar yapacağız." +"Kurs, nasıl programlanacağını zaten bildiğinizi varsayar. Rust, statik tür " +"sistemine sahip (statically-typed) bir dildir ve Rust yaklaşımını daha iyi " +"açıklamak veya karşılaştırmak için bazen C ve C++ ile karşılaştırmalar " +"yapacağız." #: src/index.md msgid "" @@ -1525,8 +1718,8 @@ msgid "" "information in the standard library." msgstr "" "İnsanların alıştırmaları kendi başlarına veya küçük gruplar halinde " -"çözmelerine izin verin. Genellikle sabah ve öğleden sonra egzersizlere 30-45 " -"dakika harcıyoruz (çözümleri gözden geçirme (review) zamanı da dahil). " +"çözmelerine izin verin. Genellikle sabah ve öğleden sonra alıştırmalara " +"30-45 dakika harcıyoruz (çözümleri gözden geçirme (review) zamanı da dahil). " "İnsanlara takılıp kalmadıklarını veya yardımcı olabileceğiniz bir konu olup " "olmadığını sorduğunuzdan emin olun. Birkaç kişinin aynı sorunu yaşadığını " "gördüğünüzde bunu sınıfa söyleyin ve bir çözüm önerin; örneğin insanlara " @@ -1571,133 +1764,133 @@ msgid "Course schedule:" msgstr "Kurs programı:" #: src/running-the-course/course-structure.md -msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" -msgstr "1. Gün Sabah (2 saat 5 dakika, aralar dahil)" +msgid "Day 1 Morning (2 hours and 10 minutes, including breaks)" +msgstr "1. Gün Sabah (2 saat 10 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +#: src/welcome-day-3-afternoon.md src/welcome-day-4.md +#: src/welcome-day-4-afternoon.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "Segment" +msgstr "Bölüm" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md +#: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md +#: src/methods-and-traits.md src/generics.md src/welcome-day-2-afternoon.md +#: src/std-types.md src/closures.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "Duration" +msgstr "Süre" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/user-defined-types.md src/pattern-matching.md +#: src/generics.md src/std-types.md src/closures.md src/std-traits.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "5 minutes" +msgstr "5 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/user-defined-types.md src/pattern-matching.md src/methods-and-traits.md +#: src/modules.md src/unsafe-rust.md src/concurrency/welcome.md +#: src/concurrency/threads.md src/concurrency/shared-state.md +msgid "15 minutes" +msgstr "15 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/concurrency/welcome-async.md +msgid "40 minutes" +msgstr "40 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-4.md +msgid "45 minutes" +msgstr "45 dakika" #: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-1.md) (5 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-1.md) (5 dakika)" +msgid "Day 1 Afternoon (2 hours and 45 minutes, including breaks)" +msgstr "1. Gün Öğleden Sonra (2 saat 45 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +msgid "35 minutes" +msgstr "35 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-3.md src/welcome-day-3-afternoon.md src/welcome-day-4.md +#: src/welcome-day-4-afternoon.md src/concurrency/welcome-async.md +msgid "55 minutes" +msgstr "55 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +msgid "1 hour" +msgstr "1 saat" #: src/running-the-course/course-structure.md -msgid "[Hello, World](../hello-world.md) (15 minutes)" -msgstr "[Merhaba, Dünya](../hello-world.md) (15 dakika)" +msgid "Day 2 Morning (2 hours and 45 minutes, including breaks)" +msgstr "2. Gün Sabah (2 saat 45 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/hello-world.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/welcome-day-2.md src/methods-and-traits.md +#: src/std-types.md src/closures.md src/welcome-day-3.md src/borrowing.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/error-handling.md +msgid "3 minutes" +msgstr "3 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/welcome-day-3-afternoon.md +msgid "50 minutes" +msgstr "50 dakika" #: src/running-the-course/course-structure.md -msgid "[Types and Values](../types-and-values.md) (40 minutes)" -msgstr "[Türler ve Değerler](../types-and-values.md) (40 dakika)" +msgid "Day 2 Afternoon (2 hours and 50 minutes, including breaks)" +msgstr "2. Gün Öğleden Sonra (2 saat 50 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "[Control Flow Basics](../control-flow-basics.md) (40 minutes)" -msgstr "[Kontrol Akışı Temelleri](../control-flow-basics.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" -msgstr "1. Gün Öğleden Sonra (2 saat 35 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Tuples and Arrays](../tuples-and-arrays.md) (35 minutes)" -msgstr "[Demetler ve Diziler](../tuples-and-arrays.md) (35 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[References](../references.md) (55 minutes)" -msgstr "[Referanslar](../references.md) (55 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" -msgstr "[Kullanıcı Tanımlı Türler](../user-defined-types.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 2 Morning (2 hours and 55 minutes, including breaks)" -msgstr "2. Gün Sabah (2 saat 55 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-2.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-2.md) (3 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Pattern Matching](../pattern-matching.md) (1 hour)" -msgstr "[Desen Eşleştirme](../pattern-matching.md) (1 saat)" - -#: src/running-the-course/course-structure.md -msgid "[Methods and Traits](../methods-and-traits.md) (50 minutes)" -msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Generics](../generics.md) (40 minutes)" -msgstr "[Jenerikler](../generics.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 2 Afternoon (3 hours and 10 minutes, including breaks)" -msgstr "2. Gün Öğleden Sonra (3 saat 10 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Standard Library Types](../std-types.md) (1 hour and 20 minutes)" -msgstr "[Standart Kütüphanedeki Türler](../std-types.md) (1 saat 20 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" -msgstr "" -"[Standart Kütüphanedeki Özellikler](../std-traits.md) (1 saat 40 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/testing.md src/unsafe-rust.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/async-exercises.md +msgid "30 minutes" +msgstr "30 dakika" #: src/running-the-course/course-structure.md msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" msgstr "3. Gün Sabah (2 saat 20 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-3.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-3.md) (3 dakika)" +msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" +msgstr "3. Gün Öğleden Sonra (1 saat 55 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "[Memory Management](../memory-management.md) (1 hour)" -msgstr "[Bellek Yönetimi](../memory-management.md) (1 saat)" +msgid "Day 4 Morning (2 hours and 50 minutes, including breaks)" +msgstr "4. Gün Sabah (2 saat 50 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "[Smart Pointers](../smart-pointers.md) (55 minutes)" -msgstr "[Akıllı Göstericiler](../smart-pointers.md) (55 dakika)" +msgid "Day 4 Afternoon (2 hours and 20 minutes, including breaks)" +msgstr "4. Gün Öğleden Sonra (2 saat 20 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "Day 3 Afternoon (1 hour and 50 minutes, including breaks)" -msgstr "3. Gün Öğleden Sonra (1 saat 50 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Borrowing](../borrowing.md) (50 minutes)" -msgstr "[Ödünç Alma](../borrowing.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Lifetimes](../lifetimes.md) (50 minutes)" -msgstr "[Ömürler](../lifetimes.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" -msgstr "4. Gün Sabah (2 saat 40 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-4.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-4.md) (3 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Iterators](../iterators.md) (45 minutes)" -msgstr "[Adımlayıcılar](../iterators.md) (45 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Modules](../modules.md) (40 minutes)" -msgstr "[Modüller](../modules.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Testing](../testing.md) (45 minutes)" -msgstr "[Test Etme](../testing.md) (45 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Afternoon (2 hours and 10 minutes, including breaks)" -msgstr "4. Gün Öğleden Sonra (2 saat 10 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Error Handling](../error-handling.md) (55 minutes)" -msgstr "[Hata İşleme](../error-handling.md) (55 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "[Emniyetsiz Rust](../unsafe-rust.md) (1 saat 5 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-4-afternoon.md +msgid "1 hour and 15 minutes" +msgstr "1 saat 15 dakika" #: src/running-the-course/course-structure.md msgid "Deep Dives" @@ -1782,7 +1975,7 @@ msgstr "" #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" -msgstr "Yalın-Metal (Bare-metal) Rust" +msgstr "Yalın-Sistem (Bare-metal) Rust" #: src/running-the-course/course-structure.md msgid "" @@ -1790,7 +1983,7 @@ msgid "" "using Rust for bare-metal (embedded) development. Both microcontrollers and " "application processors are covered." msgstr "" -"[Yalın-Metal Rust](../bare-metal.md) ayrıntılı incelemesi, yalın metal " +"[Yalın-Sistem Rust](../bare-metal.md) ayrıntılı incelemesi, yalın sistem " "(gömülü) geliştirme için Rust kullanımına ilişkin tam günlük bir derstir. " "Hem mikrodenetleyiciler hem de uygulama işlemcileri kapsanmaktadır." @@ -1812,11 +2005,12 @@ msgstr "Rust'ta Eşzamanlılık" #: src/running-the-course/course-structure.md msgid "" -"The [Concurrency in Rust](../concurrency.md) deep dive is a full day class " -"on classical as well as `async`/`await` concurrency." +"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " +"class on classical as well as `async`/`await` concurrency." msgstr "" -"[Rust'ta Eşzamanlılık](../concurrency.md) ayrıntılı incelemesi, klasik ve " -"aynı zamanda `async`/`await` eşzamanlılığı üzerine tam günlük bir derstir." +"[Rust'ta Eşzamanlılık](../concurrency/welcome.md) ayrıntılı incelemesi, " +"klasik ve aynı zamanda `async`/`await` eşzamanlılığı üzerine tam günlük bir " +"derstir." #: src/running-the-course/course-structure.md msgid "" @@ -1828,6 +2022,31 @@ msgstr "" "hazır hale getirilmesine ihtiyacınız olacak. Daha sonra örnekleri denemek " "için kopyalayıp `src/main.rs` dosyasına yapıştırabilirsiniz:" +#: src/running-the-course/course-structure.md +msgid "Morning (3 hours and 20 minutes, including breaks)" +msgstr "Sabah (3 saat 20 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/references.md +#: src/std-types.md src/memory-management.md src/borrowing.md +#: src/error-handling.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md +#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +msgid "20 minutes" +msgstr "20 dakika" + +#: src/running-the-course/course-structure.md src/concurrency/welcome.md +msgid "Send and Sync" +msgstr "Send ve Sync" + +#: src/running-the-course/course-structure.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "1 hour and 10 minutes" +msgstr "1 saat 10 dakika" + +#: src/running-the-course/course-structure.md +msgid "Afternoon (3 hours and 30 minutes, including breaks)" +msgstr "Öğleden Sonra (3 saat 30 dakika, aralar dahil)" + #: src/running-the-course/course-structure.md msgid "Format" msgstr "Format" @@ -1845,36 +2064,20 @@ msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "Bu mdBook'ta birkaç kullanışlı klavye kısayolu vardır:" #: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Left" -msgstr "Yön Oku-Sol" +msgid "Arrow-Left: Navigate to the previous page." +msgstr "Arrow-Left: Önceki sayfaya gidin." #: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the previous page." -msgstr ": Önceki sayfaya gidin." +msgid "Arrow-Right: Navigate to the next page." +msgstr "Arrow-Right: Sonraki sayfaya gidin." #: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Right" -msgstr "Yön Oku-Sağ" +msgid "Ctrl + Enter: Execute the code sample that has focus." +msgstr "Ctrl + Enter: Odaklı kod örneğini yürütün." #: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the next page." -msgstr ": Sonraki sayfaya gidin." - -#: src/running-the-course/keyboard-shortcuts.md src/cargo/code-samples.md -msgid "Ctrl + Enter" -msgstr "Ctrl + Enter" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Execute the code sample that has focus." -msgstr ": Odaklı kod örneğini yürütün." - -#: src/running-the-course/keyboard-shortcuts.md -msgid "s" -msgstr "s" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Activate the search bar." -msgstr ": Arama çubuğunu etkinleştirin." +msgid "s: Activate the search bar." +msgstr "s: Arama çubuğunu etkinleştirin." #: src/running-the-course/translations.md msgid "" @@ -1900,8 +2103,7 @@ msgid "" "by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" "wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" "kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), [@SketchK](https://github.com/SketchK), and [@nodmp]" -"(https://github.com/nodmp)." +"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[Çince (Basitleştirilmiş)](https://google.github.io/comprehensive-rust/zh-" "CN/) yazanlar: [@suetfei](https://github.com/suetfei), [@wnghl](https://" @@ -1924,6 +2126,32 @@ msgstr "" "[@kuanhungchen](https://github.com/kuanhungchen) ve [@johnathan79717]" "(https://github.com/johnathan79717)." +#: src/running-the-course/translations.md +msgid "" +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@DannyRavi]" +"(https://github.com/DannyRavi), [@javad-jafari](https://github.com/javad-" +"jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi](https://" +"github.com/moaminsharifi) , [@hamidrezakp](https://github.com/hamidrezakp) " +"and [@mehrad77](https://github.com/mehrad77)." +msgstr "" +"[Farsça](https://google.github.io/comprehensive-rust/fa/) yazanlar: " +"[@DannyRavi](https://github.com/DannyRavi), [@javad-jafari](https://github." +"com/javad-jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi]" +"(https://github.com/moaminsharifi), [@hamidrezakp](https://github.com/" +"hamidrezakp) ve [@mehrad77](https://github.com/mehrad77)." + +#: src/running-the-course/translations.md +msgid "" +"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " +"and [@kantasv](https://github.com/kantasv)." +msgstr "" +"[Japonca](https://google.github.io/comprehensive-rust/ja/) yazanlar: " +"[@CoinEZ-JPN](https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) ve " +"[@kantasv](https://github.com/kantasv)." + #: src/running-the-course/translations.md msgid "" "[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" @@ -1932,7 +2160,7 @@ msgid "" "com/namhyung)." msgstr "" "[Korece](https://google.github.io/comprehensive-rust/ko/) yazanlar: " -"[@keispace](https://github.com/keispace), [@jiyongp](https://github.com) /" +"[@keispace](https://github.com/keispace), [@jiyongp](https://github.com/" "jiyongp), [@jooyunghan](https://github.com/jooyunghan) ve [@namhyung]" "(https://github.com/namhyung)." @@ -1944,6 +2172,16 @@ msgstr "" "[Bengalce](https://google.github.io/comprehensive-rust/bn/) yazanlar: " "[@raselmandol](https://github.com/raselmandol)." +#: src/running-the-course/translations.md +msgid "" +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" +"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) and [@reta](https://github.com/reta)." +msgstr "" +"[Ukraynaca](https://google.github.io/comprehensive-rust/uk/) yazanlar: [@git-" +"user-cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) ve [@reta](https://github.com/reta)." + #: src/running-the-course/translations.md msgid "" "Use the language picker in the top-right corner to switch between languages." @@ -1962,6 +2200,14 @@ msgstr "" "Devam eden çok sayıda çeviri var. En son güncellenen çevirilere bağlantı " "veriyoruz:" +#: src/running-the-course/translations.md +msgid "" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" +"(https://github.com/younies)" +msgstr "" +"[Arapça](https://google.github.io/comprehensive-rust/ar/) yazanlar: " +"[@younies](https://github.com/younies)" + #: src/running-the-course/translations.md msgid "" "[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" @@ -1973,10 +2219,12 @@ msgstr "" #: src/running-the-course/translations.md msgid "" "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS) and [@vcaen](https://github.com/vcaen)." +"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" "[Fransızca](https://google.github.io/comprehensive-rust/fr/) yazanlar: " -"[@KookaS](https://github.com/KookaS) ve [@vcaen](https://github.com) /vcaen)." +"[@KookaS](https://github.com/KookaS), [@vcaen](https://github.com/vcaen) ve " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." #: src/running-the-course/translations.md msgid "" @@ -1984,19 +2232,9 @@ msgid "" "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" "[Almanca](https://google.github.io/comprehensive-rust/de/) yazanlar: " -"[@Throvn](https://github.com/Throvn) ve [@ronaldfw](https://github.com) /" +"[@Throvn](https://github.com/Throvn) ve [@ronaldfw](https://github.com/" "ronaldfw)." -#: src/running-the-course/translations.md -msgid "" -"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) and [@momotaro1105](https://github.com/" -"momotaro1105)." -msgstr "" -"[Japonca](https://google.github.io/comprehensive-rust/ja/) yazanlar: " -"[@CoinEZ-JPN](https://github.com/CoinEZ) ve [@momotaro1105](https://github) ." -"com/momotaro1105)." - #: src/running-the-course/translations.md msgid "" "[Italian](https://google.github.io/comprehensive-rust/it/) by " @@ -2007,6 +2245,19 @@ msgstr "" "[@henrythebuilder](https://github.com/henrythebuilder) ve [@detro](https://" "github.com/detro)." +#: src/running-the-course/translations.md +msgid "" +"The full list of translations with their current status is also available " +"either [as of their last update](https://google.github.io/comprehensive-rust/" +"translation-report.html) or [synced to the latest version of the course]" +"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." +msgstr "" +"Çevirilerin tam listesi ve güncel durumları [son güncelleme tarihi " +"itibarıyla](https://google.github.io/comprehensive-rust/translation-report." +"html) veya [kursun en son sürümüyle senkronize edilmiş olarak](https://" +"google.github.io/comprehensive-rust/synced-translation-report.html) da " +"mevcuttur." + #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" @@ -2050,7 +2301,7 @@ msgstr "" "Bu size Cargo oluşturma aracını (`cargo`) ve Rust derleyicisini (`rustc`) " "sağlayacaktır. Ayrıca, araç zincirlerini (toolchain) kurmak/değiştirmek, " "çapraz derlemeyi ayarlamak vb. için kullanabileceğiniz bir komut satırı " -"yardımcı programı olan `rustup` a sahip olacaksınız." +"yardımcı programı olan `rustup`'a sahip olacaksınız." #: src/cargo.md msgid "" @@ -2065,23 +2316,33 @@ msgstr "" "Rust'u kurduktan sonra editörünüzü/düzenleyicinizi veya IDE'nizi Rust ile " "çalışacak şekilde yapılandırmalısınız. Çoğu editör bunu, [VS Code](https://" "code.visualstudio.com/), [Emacs](https://rust-analyzer.github.io/manual." -"html#emacs), [Vim/Neovim](https://rust-analyzer.github.io/manual. " -"html#vimneovim) ve diğerleri için otomatik tamamlama ve tanıma atlama işlevi " -"sağlayan [rust-analyzer](https://rust-analyzer.github.io/) ile haberleşerek " -"yapar. Ayrıca [RustRover](https://www.jetbrains.com/rust/) adında farklı bir " -"IDE de mevcuttur." +"html#emacs), [Vim/Neovim](https://rust-analyzer.github.io/manual." +"html#vimneovim) ve diğerleri için otomatik tamamlama ve tanıma atlama " +"işlevselliği sağlayan [rust-analyzer](https://rust-analyzer.github.io/) ile " +"haberleşerek yapar. Ayrıca [RustRover](https://www.jetbrains.com/rust/) " +"adında farklı bir IDE de mevcuttur." #: src/cargo.md msgid "" "On Debian/Ubuntu, you can also install Cargo, the Rust source and the [Rust " "formatter](https://github.com/rust-lang/rustfmt) via `apt`. However, this " -"gets you an outdated rust version and may lead to unexpected behavior. The " +"gets you an outdated Rust version and may lead to unexpected behavior. The " "command would be:" msgstr "" -"Debian/Ubuntu'da ayrıca Cargo'yu, Rust kaynak kodunu ve [Rust " -"biçimlendiriciyi](https://github.com/rust-lang/rustfmt) `apt` aracılığıyla " -"yükleyebilirsiniz. Ancak bu, eski bir Rust sürümüne sahip olmanızı sağlar ve " -"beklenmeyen davranışlara yol açabilir. Komut şöyle olacaktır:" +"Debian/Ubuntu'da ayrıca `apt` aracılığıyla Cargo'yu, Rust kaynak kodunu ve " +"[Rust biçimlendiricisini (formatter)](https://github.com/rust-lang/rustfmt) " +"kurabilirsiniz. Ancak bu size eski bir Rust sürümü verir ve beklenmeyen " +"davranışlara yol açabilir. Komut şu şekilde olacaktır:" + +#: src/cargo.md +msgid "" +"On macOS, you can use [Homebrew](https://brew.sh/) to install Rust, but this " +"may provide an outdated version. Therefore, it is recommended to install " +"Rust from the official site." +msgstr "" +"Mac işletim sisteminde Rust'ı yüklemek için [Homebrew](https://brew.sh/)'i " +"kullanabilirsiniz, ancak bu eski bir sürüm sağlayabilir. Bu nedenle Rust'ı " +"resmi sitesinden kurmanız önerilir." #: src/cargo/rust-ecosystem.md msgid "The Rust Ecosystem" @@ -2130,9 +2391,9 @@ msgstr "" "yapmanıza olanak tanır." #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md -#: src/references/exclusive.md src/pattern-matching/destructuring.md -#: src/memory-management/move.md src/error-handling/try.md src/android/setup.md -#: src/async/async-await.md +#: src/references/exclusive.md src/memory-management/move.md +#: src/error-handling/try.md src/unsafe-rust/unsafe-functions/calling.md +#: src/android/setup.md src/concurrency/async/async-await.md msgid "Key points:" msgstr "Anahtar noktalar:" @@ -2173,11 +2434,12 @@ msgstr "" #: src/cargo/rust-ecosystem.md msgid "" "Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"current edition is Rust 2024. Previous editions were Rust 2015, Rust 2018 " +"and Rust 2021." msgstr "" "Rust'ın ayrıca [yayınları](https://doc.rust-lang.org/edition-guide/) " -"(editions) vardır: mevcut yayın (edition) Rust 2021'dir. Önceki yayınlar " -"Rust 2015 ve Rust 2018'di." +"(editions) vardır: mevcut yayın (edition) Rust 2024'dür. Önceki yayınlar " +"Rust 2015, Rust 2018 ve Rust 2021'di." #: src/cargo/rust-ecosystem.md msgid "" @@ -2276,9 +2538,9 @@ msgid "" "which can be executed through your browser. This makes the setup much easier " "and ensures a consistent experience for everyone." msgstr "" -"Bu eğitimde çoğunlukla Rust dilini tarayıcınız üzerinden " -"çalıştırabileceğiniz örnekler üzerinden inceleyeceğiz. Bu, kurulumu çok daha " -"kolay hale getirir ve herkes için tutarlı bir deneyim sağlar." +"Bu eğitimde çoğunlukla Rust dilini tarayıcınız üzerinden yürütebileceğiniz " +"örnekler üzerinden inceleyeceğiz. Bu, kurulumu çok daha kolay hale getirir " +"ve herkes için tutarlı bir deneyim sağlar." #: src/cargo/code-samples.md msgid "" @@ -2286,7 +2548,7 @@ msgid "" "the exercises. On the last day, we will do a larger exercise which shows you " "how to work with dependencies and for that you need Cargo." msgstr "" -"Cargo'nun kurulumu hala teşvik edilmektedir: egzersizleri yapmanızı " +"Cargo'nun kurulumu hala teşvik edilmektedir: alıştırmaları yapmanızı " "kolaylaştıracaktır. Son gün, bağımlılıklarla nasıl çalışacağınızı ve bunun " "için Cargo'ya ihtiyacınız olduğunu gösteren daha büyük bir alıştırma " "yapacağız." @@ -2300,12 +2562,12 @@ msgid "\"Edit me!\"" msgstr "\"Düzenle beni!\"" #: src/cargo/code-samples.md -msgid "You can use " -msgstr "Odak metin kutusundayken kodu yürütmek için " - -#: src/cargo/code-samples.md -msgid " to execute the code when focus is in the text box." -msgstr " kullanabilirsiniz.." +msgid "" +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." +msgstr "" +"Metin kutusu odaklanmışken kodu çalıştırmak için Ctrl + Enter " +"tuşlarını kullanabilirsiniz." #: src/cargo/code-samples.md msgid "" @@ -2320,7 +2582,7 @@ msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." msgstr "" -"Gömülü deneme alanları (playgrounds) birim testleri gerçekleştiremez. Birim " +"Gömülü deneme alanları (playgrounds) birim testlerini yürütemez. Birim " "testlerini göstermek için kodu kopyalayıp yapıştırın ve gerçek Deneme " "Alanında (Playground) açın." @@ -2456,7 +2718,7 @@ msgstr "" #: src/welcome-day-1.md msgid "Types and type inference." -msgstr "Türler ve tür çıkarımı." +msgstr "Türler ve tür çıkarımı (inference)." #: src/welcome-day-1.md msgid "Control flow constructs: loops, conditionals, and so on." @@ -2467,46 +2729,19 @@ msgid "User-defined types: structs and enums." msgstr "" "Kullanıcı tanımlı türler: yapılar (structs) ve numaralandırmalar (enums)" -#: src/welcome-day-1.md -msgid "Pattern matching: destructuring enums, structs, and arrays." -msgstr "" -"Desen eşleştirme: numaralandırmaların (enums), yapıların ve dizilerin " -"çözümlenmesi (destructuring)." - #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "Zamanlama (Schedule)" -#: src/welcome-day-1.md src/welcome-day-1-afternoon.md src/welcome-day-2.md -#: src/welcome-day-2-afternoon.md src/welcome-day-3.md -#: src/welcome-day-3-afternoon.md src/welcome-day-4.md -#: src/welcome-day-4-afternoon.md -msgid "In this session:" -msgstr "Bu oturumda:" - -#: src/welcome-day-1.md -msgid "[Welcome](./welcome-day-1.md) (5 minutes)" -msgstr "[Hoş Geldiniz](./welcome-day-1.md) (5 dakika)" - -#: src/welcome-day-1.md -msgid "[Hello, World](./hello-world.md) (15 minutes)" -msgstr "[Merhaba, Dünya](./hello-world.md) (15 dakika)" - -#: src/welcome-day-1.md -msgid "[Types and Values](./types-and-values.md) (40 minutes)" -msgstr "[Türler ve Değerler](./types-and-values.md) (40 dakika)" - -#: src/welcome-day-1.md -msgid "[Control Flow Basics](./control-flow-basics.md) (40 minutes)" -msgstr "[Kontrol Akışı Temelleri](./control-flow-basics.md) (40 dakika)" - #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 " -"minutes" +"Including 10 minute breaks, this session should take about 2 hours and 10 " +"minutes. It contains:" msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 5 dakika sürecektir" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 10 dakika sürmelidir. " +"İçeriği:" #: src/welcome-day-1.md msgid "Please remind the students that:" @@ -2550,7 +2785,7 @@ msgid "" "Remember that the slides are just a support and you are free to skip them as " "you like." msgstr "" -"Bu kesinlikle sorun değil! Tekrar etkemk, öğrenmenin önemli bir parçasıdır. " +"Bu kesinlikle sorun değil! Tekrar etmek, öğrenmenin önemli bir parçasıdır. " "Slaytların sadece bir destek olduğunu ve istediğiniz gibi atlamakta özgür " "olduğunuzu unutmayın." @@ -2574,34 +2809,43 @@ msgid "" msgstr "" "Eğer bunu bir sınıfta öğretiyorsanız, burası programın üzerinden geçmek için " "iyi bir yerdir. Her bölümün sonunda bir alıştırma ve ardından bir ara " -"olduğunu unutmayın. Aradan sonra egzersiz çözümünü tamamlamayı planlayın. " +"olduğunu unutmayın. Aradan sonra alıştırma çözümünü tamamlamayı planlayın. " "Burada listelenen zamanlar kursun programa uygun devam etmesi için bir " "öneridir. Esnek olmaktan ve gerektiği gibi ayarlamaktan çekinmeyin!" +#: src/hello-world.md src/concurrency/send-sync.md +msgid "This segment should take about 15 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 15 dakika sürmelidir. İçeriği:" + #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/std-traits.md src/memory-management.md +#: src/std-types.md src/closures.md src/std-traits.md src/memory-management.md #: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md #: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md -msgid "In this segment:" -msgstr "Bu bölümde:" +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/concurrency/sync-exercises.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "Slide" +msgstr "Slayt" -#: src/hello-world.md -msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" -msgstr "[Rust Nedir?](./hello-world/what-is-rust.md) (10 dakika)" +#: src/hello-world.md src/references.md src/user-defined-types.md +#: src/pattern-matching.md src/methods-and-traits.md src/generics.md +#: src/std-types.md src/closures.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "10 minutes" +msgstr "10 dakika" -#: src/hello-world.md -msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" -msgstr "[Rust'ın Faydaları](./hello-world/benefits.md) (3 dakika)" - -#: src/hello-world.md -msgid "[Playground](./hello-world/playground.md) (2 minutes)" -msgstr "[Deneme Alanı](./hello-world/playground.md) (2 dakika)" - -#: src/hello-world.md -msgid "This segment should take about 15 minutes" -msgstr "Bu bölüm yaklaşık 15 dakika sürecektir" +#: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md +msgid "2 minutes" +msgstr "2 dakika" #: src/hello-world/what-is-rust.md msgid "" @@ -2613,7 +2857,7 @@ msgstr "" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" -msgstr "Rust, C++ ile benzer role sahip statik olarak derlenmiş bir dildir" +msgstr "Rust, C++ ile benzer role sahip statik olarak derlenen bir dildir" #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2694,7 +2938,7 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_Derleme zamanı bellek güvenliği_ - derleme zamanında tüm bellek hataları " +"_Derleme zamanı bellek emniyeti_ - derleme zamanında tüm bellek hataları " "sınıfları önlenir" #: src/hello-world/benefits.md @@ -2703,7 +2947,7 @@ msgstr "İlklendirilmemiş değişken yok." #: src/hello-world/benefits.md msgid "No double-frees." -msgstr "Double free ((adresi iki kez serbest bırakma)) yok." +msgstr "Adresi iki kez serbest bırakma (double free) yok." #: src/hello-world/benefits.md msgid "No use-after-free." @@ -2715,7 +2959,7 @@ msgstr "`NULL` göstericileri yok." #: src/hello-world/benefits.md msgid "No forgotten locked mutexes." -msgstr "Unutulan kilitli muteksler yok." +msgstr "Kilitli halde unutulmuş hiçbir mutex yok." #: src/hello-world/benefits.md msgid "No data races between threads." @@ -2723,7 +2967,7 @@ msgstr "İş parçacıkları (threads) arasında veri yarışları (data races) #: src/hello-world/benefits.md msgid "No iterator invalidation." -msgstr "Adımlayıcıyı (iterator) geçersiz kılma (invalidation) yok." +msgstr "Adımlayıcıyının (iterator) geçersiz kılınması (invalidation) yok." #: src/hello-world/benefits.md msgid "" @@ -2739,7 +2983,7 @@ msgstr "Dizi erişiminde sınırlar kontrol edilir." #: src/hello-world/benefits.md msgid "Integer overflow is defined (panic or wrap-around)." -msgstr "Tamsayı taşması tanımlandı (panic veya wrap-around)." +msgstr "Tamsayı taşması tanımlıdır (panic veya wrap-around)." #: src/hello-world/benefits.md msgid "" @@ -2754,7 +2998,7 @@ msgstr "Numaralandırmalar (Enums) ve desen eşleştirme." #: src/hello-world/benefits.md msgid "Generics." -msgstr "Jenerikler." +msgstr "Genelleştirmeler (Generics)." #: src/hello-world/benefits.md msgid "No overhead FFI." @@ -2766,7 +3010,7 @@ msgstr "Sıfır maliyetli soyutlamalar." #: src/hello-world/benefits.md msgid "Great compiler errors." -msgstr "Mükemmel derleyici hatala mesajları." +msgstr "Mükemmel derleyici hata mesajları." #: src/hello-world/benefits.md msgid "Built-in dependency manager." @@ -2806,22 +3050,22 @@ msgstr "" "C veya C++ deneyimi: Rust, ödünç alma denetleyicisi (borrow checker) " "aracılığıyla tüm _çalışma zamanı hatalarını(runtime errors)_ ortadan " "kaldırır. C ve C++'daki gibi performans elde edersiniz bununla birlikte " -"bellek güvenliği sorunları yaşamazsınız. Ayrıca desen eşleştirme (pattern " -"matching) ve yerleşik bağımlılık yönetimi (dependency management) gibi " -"yapılara sahip modern bir dil elde edersiniz." +"bellek emniyetsizliği sorunları yaşamazsınız. Ayrıca desen eşleştirme " +"(pattern matching) ve yerleşik bağımlılık yönetimi (dependency management) " +"gibi yapılara sahip modern bir dil elde edersiniz." #: src/hello-world/benefits.md msgid "" "Experience with Java, Go, Python, JavaScript...: You get the same memory " "safety as in those languages, plus a similar high-level language feeling. In " "addition you get fast and predictable performance like C and C++ (no garbage " -"collector) as well as access to low-level hardware (should you need it)" +"collector) as well as access to low-level hardware (should you need it)." msgstr "" -"Java, Go, Python, JavaScript... deneyimi: Bu dillerdekiyle aynı bellek " -"emniyetine (safety) ve ayrıca benzer yüksek seviyeli dil hissine sahip " -"olursunuz. Ayrıca, C ve C++ (çöp toplayıcı yok) gibi hızlı ve öngörülebilir " -"performansın yanı sıra düşük seviyeli donanıma erişim (ihtiyaç duymanız " -"halinde) elde edersiniz." +"Java, Go, Python, JavaScript... ile deneyim: Bu dillerdekiyle aynı bellek " +"emniyetine (safety) ve benzer bir yüksek seviyeli dil hissini elde " +"edersiniz. Ayrıca C ve C++ gibi hızlı ve öngörülebilir performans (çöp " +"toplayıcı yok) ve düşük seviyeli donanıma erişim (ihtiyaç duymanız halinde) " +"elde edersiniz." #: src/hello-world/playground.md msgid "" @@ -2877,34 +3121,9 @@ msgstr "" "oluşturulan asm kodu hakkında daha fazla bilgi edinmek isteyen ileri düzey " "öğrenciler için faydalıdır." -#: src/types-and-values.md -msgid "[Hello, World](./types-and-values/hello-world.md) (5 minutes)" -msgstr "[Merhaba, Dünya](./types-and-values/hello-world.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Variables](./types-and-values/variables.md) (5 minutes)" -msgstr "[Değişkenler](./types-and-values/variables.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Values](./types-and-values/values.md) (5 minutes)" -msgstr "[Değerler](./types-and-values/values.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Arithmetic](./types-and-values/arithmetic.md) (3 minutes)" -msgstr "[Aritmetik](./types-and-values/arithmetic.md) (3 dakika)" - -#: src/types-and-values.md -msgid "[Type Inference](./types-and-values/inference.md) (3 minutes)" -msgstr "[Tür Çıkarımı](./types-and-values/inference.md) (3 dakika)" - -#: src/types-and-values.md -msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (15 minutes)" -msgstr "[Alıştırma: Fibonacci](./types-and-values/exercise.md) (15 dakika)" - -#: src/types-and-values.md src/control-flow-basics.md src/generics.md -#: src/modules.md -msgid "This segment should take about 40 minutes" -msgstr "Bu bölüm yaklaşık 40 dakika sürecektir" +#: src/types-and-values.md src/concurrency/async.md +msgid "This segment should take about 40 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 40 dakika sürmelidir. İçeriği:" #: src/types-and-values/hello-world.md msgid "" @@ -2926,14 +3145,18 @@ msgstr "Ne görüyorsunuz:" msgid "Functions are introduced with `fn`." msgstr "Fonksiyonlar `fn` ile tanıtılır." +#: src/types-and-values/hello-world.md +msgid "The `main` function is the entry point of the program." +msgstr "`main` fonksiyon programın giriş noktasıdır (entry point)." + #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" "Bloklar, C ve C++'daki gibi küme parantezleriyle sınırları belirlenmiştir." #: src/types-and-values/hello-world.md -msgid "The `main` function is the entry point of the program." -msgstr "'main' fonksiyon programın giriş noktasıdır (entry point)." +msgid "Statements end with `;`." +msgstr "Deyimler (Statements) `;` ile biter." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." @@ -2977,8 +3200,8 @@ msgid "" "arguments (no function [overloading](../control-flow-basics/functions.md))." msgstr "" "Rust, değişken sayıda argümana sahip olmak istediğiniz durumlar için " -"makroları kullanır (fonksiyon [yüklemesi](../control-flow-basics/functions." -"md) yoktur)." +"makroları kullanır (fonksiyon [yüklemesi (overloading)](../control-flow-" +"basics/functions.md) yoktur)." #: src/types-and-values/hello-world.md msgid "" @@ -2989,8 +3212,8 @@ msgid "" msgstr "" "Makroların 'arınmış/pak' olması, kullanıldıkları kapsamdaki (scope) " "tanımlayıcıları (identifiers) yanlışlıkla yakalamadıkları anlamına gelir. " -"Rust makroları aslında yalnızca [kısmen hijyeniktir](https://veykril.github." -"io/tlborm/decl-macros/minutiae/hygiene.html)." +"Rust makroları aslında yalnızca [kısmi paktır (hygienic)](https://veykril." +"github.io/tlborm/decl-macros/minutiae/hygiene.html)." #: src/types-and-values/hello-world.md msgid "" @@ -3009,11 +3232,10 @@ msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"Rust, statik tür özelliğine sahip olmasıyla tür güvenliği sağlar. Değişken " +"Rust, statik tür sistemine sahip olmasıyla tür emniyeti sağlar. Değişken " "bağlamaları (binding) `let` ile yapılır:" -#: src/types-and-values/variables.md src/control-flow-basics/loops/for.md -#: src/control-flow-basics/blocks-and-scopes.md +#: src/types-and-values/variables.md msgid "\"x: {x}\"" msgstr "\"x: {x}\"" @@ -3030,9 +3252,20 @@ msgid "" "Uncomment the `x = 20` to demonstrate that variables are immutable by " "default. Add the `mut` keyword to allow changes." msgstr "" -"Değişkenlerin varsayılan olarak değişmez (immutable) olduğunu göstermek için " -"`x = 20`'in yorum satırını kaldırın. Değişikliklere izin vermek için `mut` " -"anahtar kelimesini ekleyin." +"Değişkenlerin varsayılan olarak değiştirilemez (immutable) olduğunu " +"göstermek için `x = 20`'in yorum satırını kaldırın. Değişikliklere izin " +"vermek için `mut` anahtar kelimesini ekleyin." + +#: src/types-and-values/variables.md +msgid "" +"Warnings are enabled for this slide, such as for unused variables or " +"unnecessary `mut`. These are omitted in most slides to avoid distracting " +"warnings. Try removing the mutation but leaving the `mut` keyword in place." +msgstr "" +"Bu slayt için kullanılmayan değişkenler veya gereksiz `mut` gibi uyarılar " +"(warnings) etkinleştirildi. Dikkat dağıtan uyarılardan kaçınmak için çoğu " +"slaytta bunlar atlanır. Atamayı içeren yorum satırını kaldırmayı deneyin, " +"ancak `mut` anahtar sözcüğünü yerinde kalmaya devam etsin." #: src/types-and-values/variables.md msgid "" @@ -3041,8 +3274,8 @@ msgid "" "many cases." msgstr "" "Buradaki `i32` değişkenin türüdür. Bunun derleme zamanında bilinmesi " -"gerekir, ancak tür çıkarımı (daha sonra ele alınacaktır), programcının " -"birçok durumda bunu atlamasına olanak tanır." +"gerekir, ancak tür çıkarımı (type inference) (daha sonra ele alınacaktır), " +"programcının birçok durumda bunu atlamasına olanak tanır." #: src/types-and-values/values.md msgid "" @@ -3050,7 +3283,7 @@ msgid "" "each type." msgstr "" "Burada bazı temel yerleşik türler ve her türün değişmez değerlerinin " -"sözdizimi (syntax) verilmiştir." +"(literal values) sözdizimi (syntax) verilmiştir." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3098,7 +3331,7 @@ msgstr "`3.14`, `-10.0e20`, `2_f32`" #: src/types-and-values/values.md msgid "Unicode scalar values" -msgstr "Ünicode skaler değerler" +msgstr "Ünikod skaler değerler" #: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`char`" @@ -3171,18 +3404,18 @@ msgstr "" #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." msgstr "" -"Aritmetik işlemleri, diğer dillerinkine benzer öncelik sıralamasıyla çok " -"benzerdir." +"Aritmetik, benzer öncelik (precedence) kurallarıyla birlikte diğer " +"dillerdeki aritmetiğe oldukça benzerdir." #: src/types-and-values/arithmetic.md msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do different things on different platforms or " -"compilers. In Rust, it's defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's " +"defined." msgstr "" "Peki, tamsayı taşması ne olacak? C ve C++'da _işaretli_ tamsayıların taşması " -"aslında tanımsızdır (undefined) ve farklı platformlarda veya derleyicilerde " -"farklı şeyler olabilir. Rust'ta bu tanımlanmıştır." +"aslında tanımsızdır (undefined) ve çalışma zamanında bilinmeyen şeyler " +"olabilir. Rust'ta ise bu tanımlıdır." #: src/types-and-values/arithmetic.md msgid "" @@ -3204,12 +3437,13 @@ msgid "" "In fact, the compiler will detect overflow of constant expressions, which is " "why the example requires a separate function." msgstr "" -"Aslında derleyici sabit (constant) ifadelerin (expression) taşmasını " +"Aslında derleyici sabit ifadelerin (constant expression) taşmasını " "algılayacaktır, bu nedenle örnek ayrı bir fonksiyon gerektirir." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" -msgstr "Rust, türü belirlemek için değişkenin nasıl _kullanıldığına_ bakacak:" +msgstr "" +"Rust, türü belirlemek için değişkenin nasıl _kullanıldığına_ bakacaktır:" #: src/types-and-values/inference.md msgid "" @@ -3217,8 +3451,8 @@ msgid "" "constraints given by variable declarations and usages." msgstr "" "Bu slayt, Rust derleyicisinin değişken bildirimleri ve kullanımları " -"tarafından verilen kısıtlamalara dayanarak türleri nasıl çıkarım yaptığını " -"gösterir." +"tarafından verilen kısıtlamalara (constraints) dayanarak türleri nasıl " +"çıkarım (inference) yapabildiğini gösterir." #: src/types-and-values/inference.md msgid "" @@ -3240,10 +3474,10 @@ msgid "" "`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " "floating-point literals default to `f64`." msgstr "" -"Hiçbir şey bir tamsayı değişmezinin türünü kısıtlamadığında, Rust varsayılan " -"olarak türü `i32` yapar. Bu bazen hata mesajlarında \"{integer}\" olarak " -"görünür. Benzer şekilde, ondalıklı sayı değişmezleri için varsayılan tür " -"`f64`'tür." +"Bir tamsayı değişmezinin (integer literal) türünü hiçbir " +"şeykısıtlamadığında, Rust varsayılan olarak türü `i32` yapar. Bu bazen hata " +"mesajlarında \"{integer}\" olarak görünür. Benzer şekilde, ondalıklı sayı " +"değişmezleri (floating-point literals) için varsayılan tür `f64`'tür." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3253,13 +3487,13 @@ msgstr "" #: src/types-and-values/exercise.md msgid "" -"The first and second Fibonacci numbers are both `1`. For n>2, the n'th " -"Fibonacci number is calculated recursively as the sum of the n-1'th and " -"n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -"Birinci ve ikinci Fibonacci sayılarının her ikisi de `1`'dir. n>2 için, " -"n'inci Fibonacci sayısı yinelemeli olarak n-1'inci ve n-2'inci Fibonacci " -"sayılarının toplamı olarak hesaplanır." +"Fibonacci dizisi `[0,1]` ile başlar. n>1 için, n'inci Fibonacci sayısı " +"yinelemeli olarak n-1'inci ve n-2'inci Fibonacci sayılarının toplamı olarak " +"hesaplanır." #: src/types-and-values/exercise.md msgid "" @@ -3267,7 +3501,7 @@ msgid "" "will this function panic?" msgstr "" "N'inci Fibonacci sayısını hesaplayan bir `fib(n)` fonksiyonu yazın. Bu " -"fonksiyon ne zaman paniğe kapılacak?" +"fonksiyon ne zaman paniğe (panic) uğrar?" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3279,45 +3513,107 @@ msgstr "\"Bunu gerçekleştirin (implement)\"" #: src/types-and-values/exercise.md msgid "// The recursive case.\n" -msgstr "// Özyinelemeli durum.\n" +msgstr "// Özyinelemeli (recursive) durum.\n" #: src/types-and-values/exercise.md src/types-and-values/solution.md msgid "\"fib({n}) = {}\"" msgstr "\"fib({n}) = {}\"" -#: src/control-flow-basics.md -msgid "[if Expressions](./control-flow-basics/if.md) (4 minutes)" -msgstr "[if İfadeleri](./control-flow-basics/if.md) (4 dakika)" +#: src/control-flow-basics.md src/methods-and-traits.md src/generics.md +#: src/modules.md src/testing.md +msgid "This segment should take about 45 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 45 dakika sürmelidir. İçeriği:" #: src/control-flow-basics.md -msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" -msgstr "[Döngüler](./control-flow-basics/loops.md) (5 dakika)" +msgid "if Expressions" +msgstr "if İfadeleri (Expressions)" + +#: src/control-flow-basics.md src/pattern-matching.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md +msgid "4 minutes" +msgstr "4 dakika" + +#: src/control-flow-basics.md +msgid "match Expressions" +msgstr "match İfadeleri (Expressions)" + +#: src/control-flow-basics.md +msgid "break and continue" +msgstr "break ve continue" + +#: src/control-flow-basics.md +msgid "We will now cover the many kinds of flow control found in Rust." +msgstr "" +"Şimdi, Rust'ta bulunan birçok akış kontrol (flow control) çeşitlerini ele " +"alacağız." #: src/control-flow-basics.md msgid "" -"[break and continue](./control-flow-basics/break-continue.md) (4 minutes)" +"Most of this will be very familiar to what you have seen in other " +"programming languages." msgstr "" -"[break ve continue](./control-flow-basics/break-continue.md) (4 dakika)" +"Bunların çoğu diğer programlama dillerinde gördüklerinize çok tanıdık " +"gelecektir." -#: src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md msgid "" -"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (5 minutes)" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " +"Each block has a value and a type, which are those of the last expression of " +"the block:" msgstr "" -"[Bloklar ve Kapsamlar](./control-flow-basics/blocks-and-scopes.md) (5 dakika)" +"Rust dilindeki bir blok, `{}` parantezleri içine alınmış bir ifadeler dizisi " +"(sequence of expressions) içerir. Her bloğun bir değeri ve bir türü vardır, " +"bunlar, bloğun son ifadesinin değer ve türüdür:" -#: src/control-flow-basics.md -msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" -msgstr "[Fonksiyonlar](./control-flow-basics/functions.md) (3 dakika)" +#: src/control-flow-basics/blocks-and-scopes.md +msgid "// dbg!(y);\n" +msgstr "// dbg!(y);\n" -#: src/control-flow-basics.md -msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" -msgstr "[Makrolar](./control-flow-basics/macros.md) (2 dakika)" - -#: src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md msgid "" -"[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (15 minutes)" +"If the last expression ends with `;`, then the resulting value and type is " +"`()`." +msgstr "Son ifade `;` ile bitiyorsa, ortaya çıkan değer ve tür `()` olur." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "A variable's scope is limited to the enclosing block." msgstr "" -"[Alıştırma: Collatz Sekansı](./control-flow-basics/exercise.md) (15 dakika)" +"Bir değişkenin kapsamı (scope) onu çevreleyen blokla (enclosing block) " +"sınırlıdır." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"You can explain that dbg! is a Rust macro that prints and returns the value " +"of a given expression for quick and dirty debugging." +msgstr "" +"\"dbg!\"'nin, hızlı ve basitçe hata ayıklama için verilen bir ifadenin " +"değerini yazdırmaya ve geri döndürmeye yarayan bir Rust makrosu olduğunu " +"açıklayabilirsiniz." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"You can show how the value of the block changes by changing the last line in " +"the block. For instance, adding/removing a semicolon or using a `return`." +msgstr "" +"Bloktaki son satırı değiştirerek bloğun değerinin nasıl değiştiğini " +"gösterebilirsiniz. Örneğin, noktalı virgül eklemek/kaldırmak veya bir " +"`return` kullanmak." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"Demonstrate that attempting to access `y` outside of its scope won't compile." +msgstr "" +"`y` değişkenine kapsamı (scope) dışından erişmeye çalışmanın derleme hatası " +"olacağını gösterin." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"Values are effectively \"deallocated\" when they go out of their scope, even " +"if their data on the stack is still there." +msgstr "" +"Değerler, yığındaki (stack) verileri hala orada olsa bile, kapsamlarının " +"(scope) dışına çıktıklarında etkili bir şekilde \"tahsisleri geri verilir " +"(deallocated)\"." #: src/control-flow-basics/if.md msgid "`if` expressions" @@ -3376,13 +3672,141 @@ msgstr "" #: src/control-flow-basics/if.md msgid "" -"When `if` is used in an expression, the expression must have a `;` to " -"separate it from the next statement. Remove the `;` before `println!` to see " -"the compiler error." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." msgstr "" -"Bir ifadede `if` kullanıldığında, ifadeyi bir sonraki ifadeden ayırmak için " -"ifadenin `;` olması gerekir. Derleyici hatasını görmek için `println!`den " -"önceki `;` işaretini kaldırın." +"Bir `if` ifadesi diğer ifadelerle aynı şekilde kullanılmalıdır. Örneğin, bir " +"`let` ifadesinde kullanıldığında, ifadenin `;` ile de sonlandırılması " +"gerekir. Derleyici hatasını görmek için `println!`'den önceki `;`'yi " +"kaldırın." + +#: src/control-flow-basics/match.md +msgid "`match` can be used to check a value against one or more options:" +msgstr "" +"`match` bir değeri bir veya daha fazla seçeneğe göre kontrol etmek için " +"kullanılabilir:" + +#: src/control-flow-basics/match.md +msgid "\"one\"" +msgstr "\"bir\"" + +#: src/control-flow-basics/match.md +msgid "\"ten\"" +msgstr "\"on\"" + +#: src/control-flow-basics/match.md +msgid "\"one hundred\"" +msgstr "\"yüz\"" + +#: src/control-flow-basics/match.md +msgid "\"something else\"" +msgstr "\"başka bir şey\"" + +#: src/control-flow-basics/match.md +msgid "Like `if` expressions, `match` can also return a value;" +msgstr "" +"`if` ifadeleri gibi `match` ifadesi de bir değeri geri döndürebilir (return);" + +#: src/control-flow-basics/match.md +msgid "\"The value of {flag} is {val}\"" +msgstr "\"{flag}'in değeri = {val}\"" + +#: src/control-flow-basics/match.md +msgid "" +"`match` arms are evaluated from top to bottom, and the first one that " +"matches has its corresponding body executed." +msgstr "" +"`match` kolları (arms) yukarıdan aşağıya doğru değerlendirilir ve eşleşen " +"ilk kolun karşılık gelen gövdesi (body) çalıştırılır." + +#: src/control-flow-basics/match.md +msgid "" +"There is no fall-through between cases the way that `switch` works in other " +"languages." +msgstr "" +"`switch`'in diğer dillerdeki çalışma şekli gibi durumlar (cases) arasında " +"aşağıya geçiş (fall-through) yoktur." + +#: src/control-flow-basics/match.md +msgid "" +"The body of a `match` arm can be a single expression or a block. Technically " +"this is the same thing, since blocks are also expressions, but students may " +"not fully understand that symmetry at this point." +msgstr "" +"Bir `match` kolunun gövdesi tek bir ifade (expression) veya bir blok " +"olabilir. Teknik olarak bu aynı şeydir, çünkü bloklar da bir ifadedir, ancak " +"öğrenciler bu noktadaki denk yapıyı (symmetry) tam olarak anlamayabilirler." + +#: src/control-flow-basics/match.md +msgid "" +"`match` expressions need to be exhaustive, meaning they either need to cover " +"all possible values or they need to have a default case such as `_`. " +"Exhaustiveness is easiest to demonstrate with enums, but enums haven't been " +"introduced yet. Instead we demonstrate matching on a `bool`, which is the " +"simplest primitive type." +msgstr "" +"`match` ifadelerinin kapsamlı (exhaustive) olması gerekir, yani ya tüm olası " +"değerleri kapsamaları ya da `_` gibi varsayılan bir duruma (case) sahip " +"olmaları gerekir. Kapsamlılık (Exhaustiveness) enumlarla gösterilmesi en " +"kolay olanıdır, ancak enumlar henüz tanıtılmadı. Bunun yerine, en basit " +"ilkel tür olan `bool` üzerinde eşleştirmeyi (matching) gösteriyoruz." + +#: src/control-flow-basics/match.md +msgid "" +"This slide introduces `match` without talking about pattern matching, giving " +"students a chance to get familiar with the syntax without front-loading too " +"much information. We'll be talking about pattern matching in more detail " +"tomorrow, so try not to go into too much detail here." +msgstr "" +"Bu slayt, desen eşleştirmesinden (pattern matching) bahsetmeden `match`'i " +"tanıtıyor ve öğrencilere çok fazla bilgi yüklemeden sözdizimine (syntax) " +"aşina olma şansı veriyor. Desen eşleştirmesi hakkında yarın daha detaylı " +"konuşacağız, bu yüzden burada çok fazla detaya girmemeye çalışın." + +#: src/control-flow-basics/match.md src/references/dangling.md +#: src/user-defined-types/named-structs.md src/user-defined-types/enums.md +#: src/user-defined-types/static.md src/pattern-matching/infallible.md +#: src/pattern-matching/destructuring-structs.md +#: src/pattern-matching/let-control-flow/let-else.md src/closures/syntax.md +#: src/memory-management/review.md src/memory-management/move.md +#: src/memory-management/copy-types.md src/borrowing/shared.md +#: src/borrowing/borrowck.md src/borrowing/interior-mutability/refcell.md +#: src/iterators/motivation.md src/iterators/iterator.md +#: src/iterators/helpers.md src/iterators/collect.md +#: src/modules/encapsulation.md src/error-handling/result.md +#: src/error-handling/anyhow.md src/concurrency/async/state-machine.md +msgid "More to Explore" +msgstr "Daha Fazlasını Keşfedin" + +#: src/control-flow-basics/match.md +msgid "" +"To further motivate the usage of `match`, you can compare the examples to " +"their equivalents written with `if`. In the second case matching on a `bool` " +"an `if {} else {}` block is pretty similar. But in the first example that " +"checks multiple cases, a `match` expression can be more concise than `if {} " +"else if {} else if {} else`." +msgstr "" +"`match` kullanımını daha da motive etmek için, örnekleri `if` ile yazılmış " +"eşdeğerleriyle karşılaştırabilirsiniz. İkinci durumda, bir `bool` üzerinde " +"eşleme (matching) yapmak, `if {} else {}` bloğuna oldukça benzer. Ancak " +"birden fazla durumu kontrol eden ilk örnekte, bir `match` ifadesi `if {} " +"else if {} else if {} else` ifadesinden daha az ve öz olabilir." + +#: src/control-flow-basics/match.md +msgid "" +"`match` also supports match guards, which allow you to add an arbitrary " +"logical condition that will get evaluated to determine if the match arm " +"should be taken. However talking about match guards requires explaining " +"about pattern matching, which we're trying to avoid on this slide." +msgstr "" +"`match` ayrıca eşleşme filtrelerini (match guards) da destekler, bu da " +"eşleşme kolunun (match arm) alınıp alınmaması gerektiğini belirlemek için " +"değerlendirilecek keyfi bir mantıksal koşul (condition) eklemenize olanak " +"tanır. Ancak eşleşme filtreleri hakkında konuşmak, bu slaytta kaçınmaya " +"çalıştığımız desen eşleştirmesi (pattern matching) hakkında açıklama " +"gerektirir." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" @@ -3401,11 +3825,7 @@ msgid "" msgstr "" "[`while` anahtar kelimesi](https://doc.rust-lang.org/reference/expressions/" "loop-expr.html#predicate-loops) diğer dillerdeki gibi işler ve koşul doğru " -"olduğu sürece döngü gövdesini çalıştırır." - -#: src/control-flow-basics/loops.md -msgid "\"Final x: {x}\"" -msgstr "\"Son x: {x}\"" +"olduğu sürece döngü gövdesini yürütür (execute)." #: src/control-flow-basics/loops/for.md msgid "" @@ -3413,11 +3833,8 @@ msgid "" "over ranges of values or the items in a collection:" msgstr "" "[`for` döngüsü](https://doc.rust-lang.org/std/keyword.for.html) değer " -"aralıkları veya bir koleksiyondaki öğeler üzerinde tekrarlar:" - -#: src/control-flow-basics/loops/for.md -msgid "\"elem: {elem}\"" -msgstr "\"elem: {elem}\"" +"aralıkları (ranges of values) veya bir koleksiyondaki (collection) öğeler " +"üzerinde adımlama yapar (iterate):" #: src/control-flow-basics/loops/for.md msgid "" @@ -3426,17 +3843,17 @@ msgid "" "discussed in more detail later." msgstr "" "`for` döngülerinin başlığının altında, farklı türdeki aralıklar/" -"koleksiyonlar üzerinde tekrarlamayı gerçekleştirmek için \"adımlayıcılar\" " -"adı verilen bir kavram kullanılır. Adımlayıcılar (iterators) daha sonra daha " +"koleksiyonlar üzerinde adımlamayı gerçekleştirmek için \"adımlayıcılar\" adı " +"verilen bir kavram kullanılır. Adımlayıcılar (iterators) daha sonra daha " "ayrıntılı olarak tartışılacaktır." #: src/control-flow-basics/loops/for.md msgid "" -"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -"`for` döngüsünün yalnızca `4`'e kadar adım attığını unutmayın. Kapalı aralık " -"için `1..=5` sözdizimini gösterin." +"İlk `for` döngüsünün yalnızca `4`'e kadar adımladığını unutmayın. Kapalı bir " +"aralık için `1..=5` sözdizimini gösterin." #: src/control-flow-basics/loops/loop.md msgid "" @@ -3447,8 +3864,12 @@ msgstr "" "`break`'e kadar sonsuz döner." #: src/control-flow-basics/loops/loop.md -msgid "\"{i}\"" -msgstr "\"{i}\"" +msgid "" +"The `loop` statement works like a `while true` loop. Use it for things like " +"servers which will serve connections forever." +msgstr "" +"`loop` deyimi `while true` döngüsü gibi çalışır. Bağlantılara sonsuza kadar " +"hizmet edecek sunucular gibi şeyler için kullanın." #: src/control-flow-basics/break-continue.md msgid "" @@ -3461,23 +3882,26 @@ msgstr "" #: src/control-flow-basics/break-continue.md msgid "" "If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). For " +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " "`loop`, this can take an optional expression that becomes the value of the " "`loop` expression." msgstr "" -"Bir döngüden erken çıkmak istiyorsanız [`break`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#break-expressions) kullanın. `loop` " -"için bu, `loop` ifadesinin değeri haline gelen isteğe bağlı bir ifadeyi " -"(optional expression) alabilir." +"Herhangi bir döngüden erken çıkmak istiyorsanız, [`break`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#break-expressions) kullanın. " +"`loop` ile, isteğe bağlı bir ifade yazılabilir ve bu ifade, `loop` " +"ifadesinin değeri olur." -#: src/control-flow-basics/break-continue.md src/std-traits/exercise.md -#: src/std-traits/solution.md src/smart-pointers/trait-objects.md -#: src/modules/exercise.md src/modules/solution.md -#: src/android/build-rules/library.md -#: src/android/interoperability/cpp/rust-bridge.md -#: src/async/pitfalls/cancellation.md -msgid "\"{}\"" -msgstr "\"{}\"" +#: src/control-flow-basics/break-continue.md +msgid "" +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." +msgstr "" +"`loop`'un önemsiz olmayan (non-trivial) bir değer döndüren tek döngüsel yapı " +"olduğunu unutmayın. Bunun nedeni, en az bir `break` ifadesinde sonlanmasının " +"garantili olmasıdır (koşul başarısız olduğunda da sonlanabilen `while` ve " +"`for` döngülerinin aksine)." #: src/control-flow-basics/break-continue/labels.md msgid "" @@ -3488,116 +3912,12 @@ msgstr "" "çıkmak için kullanılan bir etiket (label) argümanını alabilir:" #: src/control-flow-basics/break-continue/labels.md -msgid "\"elements searched: {elements_searched}\"" -msgstr "\"aranan öğeler: {elements_searched}\"" +msgid "Labeled break also works on arbitrary blocks, e.g." +msgstr "Etiketli break, keyfi olarak yazılan bloklarda da çalışır, örneğin." #: src/control-flow-basics/break-continue/labels.md -msgid "" -"Note that `loop` is the only looping construct which returns a non-trivial " -"value. This is because it's guaranteed to be entered at least once (unlike " -"`while` and `for` loops)." -msgstr "" -"`loop`'un önemsiz olmayan (non-trivial) bir değer döndüren tek döngüsel yapı " -"olduğunu unutmayın. Bunun nedeni, en az bir kez girilmesinin (`while` ve " -"`for` döngülerinden farklı olarak) garanti altında olmasıdır ." - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "Blocks" -msgstr "Bloklar" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " -"Each block has a value and a type, which are those of the last expression of " -"the block:" -msgstr "" -"Rust dilindeki bir blok, `{}` parantezleri içine alınmış bir ifadeler dizisi " -"(sequence of expressions) içerir. Her bloğun, bloğun son ifadesine ait olan " -"bir değeri ve türü vardır:" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "\"y: {y}\"" -msgstr "\"y: {y}\"" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"If the last expression ends with `;`, then the resulting value and type is " -"`()`." -msgstr "Son ifade `;` ile bitiyorsa, ortaya çıkan değer ve tür `()` olur." - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"You can show how the value of the block changes by changing the last line in " -"the block. For instance, adding/removing a semicolon or using a `return`." -msgstr "" -"Bloktaki son satırı değiştirerek bloğun değerinin nasıl değiştiğini " -"gösterebilirsiniz. Örneğin, noktalı virgül eklemek/kaldırmak veya bir " -"`return` kullanmak." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "A variable's scope is limited to the enclosing block." -msgstr "Bir değişkenin kapsamı (scope) onu çevreleyen blokla sınırlıdır." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"You can shadow variables, both those from outer scopes and variables from " -"the same scope:" -msgstr "" -"Hem dış kapsamlardaki (outer scopes) değişkenleri hem de aynı kapsamdaki " -"değişkenleri gölgeleyebilirsiniz (shadow):" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"before: {a}\"" -msgstr "\"önce: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md src/generics/exercise.md -#: src/generics/solution.md src/std-traits/from-and-into.md -#: src/lifetimes/solution.md -msgid "\"hello\"" -msgstr "\"merhaba\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"inner scope: {a}\"" -msgstr "\"iç kapsam: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"shadowed in inner scope: {a}\"" -msgstr "\"iç kapsamda gölgelendi: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"after: {a}\"" -msgstr "\"sonra: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"Show that a variable's scope is limited by adding a `b` in the inner block " -"in the last example, and then trying to access it outside that block." -msgstr "" -"Son örnekte iç bloğa (inner block) bir `b` ekleyerek ve ardından bu bloğun " -"dışından ona erişmeye çalışarak bir değişkenin kapsamının (scope) sınırlı " -"olduğunu gösterin." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"Shadowing is different from mutation, because after shadowing both " -"variable's memory locations exist at the same time. Both are available under " -"the same name, depending where you use it in the code." -msgstr "" -"Gölgeleme mutasyondan farklıdır çünkü gölgeleme sonrasında her iki " -"değişkenin hafıza konumları aynı anda mevcuttur. Her ikisi de kodda nerede " -"kullandığınıza bağlı olarak aynı ad altında mevcuttur." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "A shadowing variable can have a different type." -msgstr "Bir gölgeleme (shadowing) değişkeni farklı bir türe sahip olabilir." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"Shadowing looks obscure at first, but is convenient for holding on to values " -"after `.unwrap()`." -msgstr "" -"Gölgelendirme ilk başta anlaşılmaz görünebilir, ancak `.unwrap()` " -"sonrasındaki değerleri korumak için kullanışlıdır." +msgid "\"This line gets skipped\"" +msgstr "\"Bu satır geçilece\"" #: src/control-flow-basics/functions.md msgid "" @@ -3617,25 +3937,25 @@ msgstr "" "Bir fonksiyon gövdesindeki (veya herhangi bir bloktaki) son ifade " "(expression), geri dönüş değeri (return value) olur. İfadenin sonundaki `;` " "işaretini silmeniz yeterlidir. `return` anahtar kelimesi erken geri dönüş " -"(early return) için kullanılabilir, ancak \"yalın (bare) değer\" formu bir " -"fonksiyonun sonunda tercih edilen yaklaşımdır (idiomatic) (`return`kullanmak " -"için `gcd`'yi yeniden düzenleyin - refactor)." +"(early return) için kullanılabilir, ancak fonksiyonun sonunda \"yalın (bare) " +"değer\" kullanmak daha yaygındır (idiomatic) (`return`kullanmak için " +"`gcd`'yi yeniden düzenleyin - refactor)." #: src/control-flow-basics/functions.md msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " -"compiler will infer this if the `-> ()` return type is omitted." +"compiler will infer this if the return type is omitted." msgstr "" -"Bazı fonksiyonların geri dönüş değeri (return value) yoktur ve 'birim türü' " -"olan `()` değerini döndürür. Eğer `->()` dönüş tipi atlanırsa derleyici bunu " -"anlayacaktır." +"Bazı fonksiyonların dönüş değeri (return value) yoktur ve 'birim türü (unit " +"type)', `()` döndürürler. Eğer dönüş türü yazılmazsa, derleyici birim türünü " +"çıkarım (infer) yapacaktır." #: src/control-flow-basics/functions.md msgid "" "Overloading is not supported -- each function has a single implementation." msgstr "" -"Yüklenme (overloading) desteklenmez -- her fonksiyonun tek bir uygulaması " -"(implementation) vardır." +"Fonksiyon yüklemesi (overloading) desteklenmez -- her fonksiyonun tek bir " +"uygulaması (implementation) vardır." #: src/control-flow-basics/functions.md msgid "" @@ -3651,8 +3971,8 @@ msgid "" "Always takes a single set of parameter types. These types can be generic, " "which will be covered later." msgstr "" -"Her zaman tek bir parametre türü kümesini alır. Bu türler, daha sonra ele " -"alınacak olan jenerik olabilir." +"Her zaman tek bir parametre türü kümesi alır. Bu türler genelleştirilmiş " +"(generic) olabilir, bu konuya daha sonra değinilecektir." #: src/control-flow-basics/macros.md msgid "" @@ -3661,7 +3981,7 @@ msgid "" "The Rust standard library includes an assortment of useful macros." msgstr "" "Makrolar, derleme sırasında Rust koduna genişletilir ve değişken sayıda " -"argüman alabilir. Sonunda `!` işaretiyle ayırt edilirler. Rust standart " +"argüman alabilir. Sonda olan `!` işaretiyle ayırt edilirler. Rust standart " "kütüphanesi çeşitli yararlı makrolar içerir." #: src/control-flow-basics/macros.md @@ -3670,7 +3990,8 @@ msgid "" "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" "`println!(format, ..)`, [`std::fmt`](https://doc.rust-lang.org/std/fmt/index." -"html)'de açıklanan biçimi uygulayarak standart çıktıya bir satır yazdırır." +"html)'de açıklanan biçimi (formatting) uygulayarak standart çıktıya bir " +"satır yazdırır." #: src/control-flow-basics/macros.md msgid "" @@ -3683,7 +4004,7 @@ msgstr "" #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "" -"`dbg!(expression)` ifadenin değerini kayıt tutar (loggging) ve onu geri " +"`dbg!(expression)` ifadenin değerini kaydeder (loggging) ve onu geri " "döndürür." #: src/control-flow-basics/macros.md @@ -3692,15 +4013,7 @@ msgid "" "panic." msgstr "" "`todo!()` kodun bir kısmını henüz uygulanmamış (not-yet-implemented) olarak " -"işaretler. Eğer çalıştırılırsa, paniğe neden olur." - -#: src/control-flow-basics/macros.md -msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will " -"panic." -msgstr "" -"`unreachable!()` kodun bir kısmını erişilemez (unreachable) olarak " -"işaretler. Eğer çalıştırılırsa, paniğe neden olur." +"işaretler. Eğer yürütülürse (execute), paniğe neden olur." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3722,159 +4035,103 @@ msgid "" "use of derive macros." msgstr "" "Kurs, makroların tanımlanmasını (define) kapsamaz, ancak daha sonraki bir " -"bölümde türetilmiş makroların kullanımı anlatılacaktır." +"bölümde `derive` makrolarının kullanımı anlatılacaktır." + +#: src/control-flow-basics/macros.md src/pattern-matching/match.md +msgid "More To Explore" +msgstr "Daha Fazlasını Keşfedin" + +#: src/control-flow-basics/macros.md +msgid "" +"There are a number of other useful macros provided by the standard library. " +"Some other examples you can share with students if they want to know more:" +msgstr "" +"Standart kütüphane tarafından sağlanan birçok başka kullanışlı makro vardır. " +"Öğrenciler daha fazlasını öğrenmek isterse onlarla paylaşabileceğiniz bazı " +"diğer örnekler:" + +#: src/control-flow-basics/macros.md +msgid "" +"[`assert!`](https://doc.rust-lang.org/stable/std/macro.assert.html) and " +"related macros can be used to add assertions to your code. These are used " +"heavily in writing tests." +msgstr "" +"[`assert!`](https://doc.rust-lang.org/stable/std/macro.assert.html) ve " +"ilgili makrolar, kodunuza doğrulamalar (assertions) eklemek için " +"kullanılabilir. Bu makrolar, test yazımında yoğun şekilde kullanılır." + +#: src/control-flow-basics/macros.md +msgid "" +"[`unreachable!`](https://doc.rust-lang.org/stable/std/macro.unreachable." +"html) is used to mark a branch of control flow that should never be hit." +msgstr "" +"[`unreachable!`](https://doc.rust-lang.org/stable/std/macro.unreachable." +"html), hiçbir zaman ulaşılmaması gereken bir kontrol akışı dalını " +"işaretlemek için kullanılır." + +#: src/control-flow-basics/macros.md +msgid "" +"[`eprintln!`](https://doc.rust-lang.org/stable/std/macro.eprintln.html) " +"allows you to print to stderr." +msgstr "" +"[`eprintln!`](https://doc.rust-lang.org/stable/std/macro.eprintln.html) " +"stderr'e yazdırmanıza olanak tanır." #: src/control-flow-basics/exercise.md msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " -"defined as follows, for an arbitrary n" +"defined as follows, for an arbitrary n1 greater than zero:" msgstr "" -"[Collatz sanısı](https://en.wikipedia.org/wiki/Collatz_conjecture) şu " -"şekilde tanımlanır, keyfi bir" +"[Collatz sanısı](https://en.wikipedia.org/wiki/Collatz_conjecture), sıfırdan " +"büyük herhangi bir n1 için aşağıdaki şekilde tanımlanır:" #: src/control-flow-basics/exercise.md -msgid "1" -msgstr "1" +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." +msgstr "Eğer _ni_ 1 ise, dizi _ni_'de sonlanır." #: src/control-flow-basics/exercise.md -msgid " greater than zero:" -msgstr " sıfırdan büyük sayısı için:" +msgid "If _ni_ is even, then _ni+1 = ni / 2_." +msgstr "" +"Eğer _ni_ çift ise, o zaman _ni+1 = ni / 2_." #: src/control-flow-basics/exercise.md -msgid "If _n" -msgstr "If _n" +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgstr "" +"Eğer _ni_ tek sayı ise _ni+1 = 3 * ni + 1_." #: src/control-flow-basics/exercise.md -msgid "i" -msgstr "i" +msgid "For example, beginning with _n1_ = 3:" +msgstr "Örneğin, _n1_ = 3 ile başalrsak:" #: src/control-flow-basics/exercise.md -msgid "_ is 1, then the sequence terminates at _n" -msgstr "_ 1 ise, o zaman sekans bu sayıda sonlanır, _n" +msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" +msgstr "3 tek sayıdır, dolayısıyla _n2_ = 3 * 3 + 1 = 10;" #: src/control-flow-basics/exercise.md -msgid "_." -msgstr "_." +msgid "10 is even, so _n3_ = 10 / 2 = 5;" +msgstr "10 çift sayıdır, dolayısıyla _n3_ = 10 / 2 = 5;" #: src/control-flow-basics/exercise.md -msgid "_ is even, then _n" -msgstr "_ çifttir, o zaman _n" +msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" +msgstr "5 tek sayıdır, dolayısıyla _n4_ = 3 * 5 + 1 = 16;" #: src/control-flow-basics/exercise.md -msgid "i+1" -msgstr "i+1" +msgid "16 is even, so _n5_ = 16 / 2 = 8;" +msgstr "16 çift sayıdır, dolayısıyla _n5_ = 16 / 2 = 8;" #: src/control-flow-basics/exercise.md -msgid " = n" -msgstr " = n" +msgid "8 is even, so _n6_ = 8 / 2 = 4;" +msgstr "8 çift sayıdır, dolayısıyla _n6_ = 8 / 2 = 4;" #: src/control-flow-basics/exercise.md -msgid " / 2_." -msgstr " / 2_." +msgid "4 is even, so _n7_ = 4 / 2 = 2;" +msgstr "4 çift sayıdır, dolayısıyla _n7_ = 4 / 2 = 2;" #: src/control-flow-basics/exercise.md -msgid "_ is odd, then _n" -msgstr "_ tektir, o zaman _n" - -#: src/control-flow-basics/exercise.md -msgid " = 3 * n" -msgstr " = 3 * n" - -#: src/control-flow-basics/exercise.md -msgid " + 1_." -msgstr " + 1_." - -#: src/control-flow-basics/exercise.md -msgid "For example, beginning with _n" -msgstr "Örneğin, başlangıcımız _n" - -#: src/control-flow-basics/exercise.md -msgid "_ = 3:" -msgstr "_ = 3:" - -#: src/control-flow-basics/exercise.md -msgid "3 is odd, so _n" -msgstr "3 tektir, yani _n" - -#: src/control-flow-basics/exercise.md -msgid "2" -msgstr "2" - -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 3 + 1 = 10;" -msgstr "_ = 3 * 3 + 1 = 10;" - -#: src/control-flow-basics/exercise.md -msgid "10 is even, so _n" -msgstr "10 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "3" -msgstr "3" - -#: src/control-flow-basics/exercise.md -msgid "_ = 10 / 2 = 5;" -msgstr "_ = 10 / 2 = 5;" - -#: src/control-flow-basics/exercise.md -msgid "5 is odd, so _n" -msgstr "5 tektir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "4" -msgstr "4" - -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 5 + 1 = 16;" -msgstr "_ = 3 * 5 + 1 = 16;" - -#: src/control-flow-basics/exercise.md -msgid "16 is even, so _n" -msgstr "16 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md -msgid "5" -msgstr "5" - -#: src/control-flow-basics/exercise.md -msgid "_ = 16 / 2 = 8;" -msgstr "_ = 16 / 2 = 8;" - -#: src/control-flow-basics/exercise.md -msgid "8 is even, so _n" -msgstr "8 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "6" -msgstr "6" - -#: src/control-flow-basics/exercise.md -msgid "_ = 8 / 2 = 4;" -msgstr "_ = 8 / 2 = 4;" - -#: src/control-flow-basics/exercise.md -msgid "4 is even, so _n" -msgstr "4 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md -msgid "7" -msgstr "7" - -#: src/control-flow-basics/exercise.md -msgid "_ = 4 / 2 = 2;" -msgstr "_ = 4 / 2 = 2;" - -#: src/control-flow-basics/exercise.md -msgid "2 is even, so _n" -msgstr "2 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "8" -msgstr "8" - -#: src/control-flow-basics/exercise.md -msgid "_ = 1; and" -msgstr "_ = 1; ve" +msgid "2 is even, so _n8_ = 1; and" +msgstr "2 çifttir, bu yüzden _n8_ = 1; ve" #: src/control-flow-basics/exercise.md msgid "the sequence terminates." @@ -3892,59 +4149,50 @@ msgstr "" msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" msgstr "/// `n`'den başlayan collatz sekansının uzunluğunu belirle.\n" -#: src/control-flow-basics/solution.md src/concurrency/scoped-threads.md +#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "\"Length: {}\"" -msgstr "\"Length: {}\"" +msgstr "\"Uzunluk: {}\"" + +#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md +msgid "// should be 15\n" +msgstr "// 15 olmalı\n" #: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md #: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md msgid "Welcome Back" msgstr "Tekrar Hoş Geldiniz" -#: src/welcome-day-1-afternoon.md -msgid "[Tuples and Arrays](./tuples-and-arrays.md) (35 minutes)" -msgstr "[Demetler ve Diziler](./tuples-and-arrays.md) (35 dakika)" - -#: src/welcome-day-1-afternoon.md -msgid "[References](./references.md) (55 minutes)" -msgstr "[Referanslar](../references.md) (55 dakika)" - -#: src/welcome-day-1-afternoon.md -msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" -msgstr "[Kullanıcı Tanımlı Türler](./user-defined-types.md) (50 dakika)" - -#: src/welcome-day-1-afternoon.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 35 " -"minutes" +"Including 10 minute breaks, this session should take about 2 hours and 45 " +"minutes. It contains:" msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 35 dakika sürecektir" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 45 dakika sürmelidir. " +"İçeriği:" #: src/tuples-and-arrays.md -msgid "[Arrays](./tuples-and-arrays/arrays.md) (5 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Tuples](./tuples-and-arrays/tuples.md) (5 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" -msgstr "" +msgid "This segment should take about 35 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 35 dakika sürmelidir. İçeriği:" #: src/tuples-and-arrays.md msgid "" -"[Patterns and Destructuring](./tuples-and-arrays/destructuring.md) (5 " -"minutes)" +"We have seen how primitive types work in Rust. Now it's time for you to " +"start building new composite types." msgstr "" +"Rust'ta (primitive) ilkel türlerin nasıl çalıştığını gördük. Şimdi yeni " +"bileşik (composite) türler oluşturmaya başlamanın zamanı geldi." -#: src/tuples-and-arrays.md -msgid "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (15 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "This segment should take about 35 minutes" +#: src/tuples-and-arrays/arrays.md +msgid "" +"Arrays can also be initialized using the shorthand syntax, e.g. `[0; 1024]`. " +"This can be useful when you want to initialize all elements to the same " +"value, or if you have a large array that would be hard to initialize " +"manually." msgstr "" +"Diziler ayrıca kısaltma sözdizimi (shorthand syntax) kullanılarak da " +"ilklendirilebilir, örneğin `[0; 1024]`. Bu, tüm elemanları aynı değere " +"başlatmak istediğinizde veya manuel olarak başlatılması zor olan büyük bir " +"diziniz varsa yararlı olabilir." #: src/tuples-and-arrays/arrays.md msgid "" @@ -3954,17 +4202,45 @@ msgid "" "different types. Slices, which have a size determined at runtime, are " "covered later." msgstr "" +"Bir `[T; N]` dizi türünün değeri , aynı `T` türdeki `N` (derleme zamanı " +"sabiti) öğelerini/elemanlarını tutar. Dizinin uzunluğunun _türünün parçası_ " +"olduğuna dikkat edin, bu da `[u8; 3]' ve '[u8; 4]` dizilerinin iki farklı " +"tür olarak kabul edildiği anlamına gelir. Dilimler (slices), ki çalışma " +"zamanında belirlenen bir boyuta sahiptir, daha sonra ele alınacaktır." #: src/tuples-and-arrays/arrays.md msgid "" -"Try accessing an out-of-bounds array element. Array accesses are checked at " -"runtime. Rust can usually optimize these checks away, and they can be " -"avoided using unsafe Rust." +"Try accessing an out-of-bounds array element. The compiler is able to " +"determine that the index is unsafe, and will not compile the code:" msgstr "" +"Sınırların dışında (out-of-bounds) bir dizi (array) elemanına erişmeyi " +"deneyin. Derleyici, indeksin emniyetsiz (unsafe) olduğunu belirleyebilir ve " +"kodu derlemez:" + +#: src/tuples-and-arrays/arrays.md +msgid "\"a: {a:?}\"" +msgstr "\"a: {a:?}\"" + +#: src/tuples-and-arrays/arrays.md +msgid "" +"Array accesses are checked at runtime. Rust can usually optimize these " +"checks away; meaning if the compiler can prove the access is safe, it " +"removes the runtime check for better performance. They can be avoided using " +"unsafe Rust. The optimization is so good that it's hard to give an example " +"of runtime checks failing. The following code will compile but panic at " +"runtime:" +msgstr "" +"Dizi erişimleri çalışma zamanında kontrol edilir. Rust genellikle bu " +"kontrolleri optimize edebilir; yani, derleyici erişimin güvenli olduğunu " +"kanıtlayabilirse, daha iyi performans için çalışma zamanı kontrolünü " +"kaldırır. Bu kontroller, unsafe Rust kullanılarak da atlanabilir. " +"Optimizasyon o kadar iyidir ki, çalışma zamanı kontrollerinin başarısız " +"olduğu bir örnek vermek zordur. Aşağıdaki kod derlenecektir ancak çalışma " +"zamanında panik (panic) ile sonuçlanacaktır:" #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." -msgstr "" +msgstr "Dizilere değer atamak için değişmezleri (literals) kullanabiliriz." #: src/tuples-and-arrays/arrays.md msgid "" @@ -3974,66 +4250,94 @@ msgid "" "only implement the debug output. This means that we must use debug output " "here." msgstr "" +"`println!` makrosu `?` biçim (format) parametresiyle hata ayıklama " +"gerçekleştirimini/uyarlamasını (implementation) ister: `{}` varsayılan " +"çıktıyı verir, `{:?}` hata ayıklama çıktısını verir. Tamsayılar (integer) ve " +"dizeler (string) gibi türler varsayılan çıktıyı uygular (default output), " +"ancak diziler (arrays) yalnızca hata ayıklama çıktısını (debug output) " +"uygular. Bu, bahsi geçen kodda hata ayıklama çıktısını kullanmamız gerektiği " +"anlamına gelir." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" +"`#` eklemek, örneğin `{a:#?}`, okunması daha kolay olabilecek \"güzel " +"yazdırma (pretty printing)\" biçimini (format) çağırır." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." -msgstr "" +msgstr "Diziler gibi, demetlerin (tuple) de sabit bir uzunluğu vardır." #: src/tuples-and-arrays/tuples.md msgid "Tuples group together values of different types into a compound type." msgstr "" +"Demetler farklı türdeki değerleri bir bileşik tür (compound type) halinde " +"gruplandırır." #: src/tuples-and-arrays/tuples.md msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " "e.g. `t.0`, `t.1`." msgstr "" +"Bir demetin alanlarına (fields) nokta ve değerin indeksi ile erişilebilir, " +"örneğin `t.0`, `t.1`." #: src/tuples-and-arrays/tuples.md msgid "" "The empty tuple `()` is referred to as the \"unit type\" and signifies " "absence of a return value, akin to `void` in other languages." msgstr "" +"Boş demet `()`, \"birim türü (unit type)\" olarak anılır ve, diğer " +"dillerdeki `void`'e benzer şekilde, bir geri dönüş değerinin (return value) " +"bulunmadığını belirtir." #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "" +"'for' deyimi (statement) diziler üzerinde adımlamayı/dolaşmayı destekler " +"(ancak demetler (tuples) üzerinde desteklemez)." #: src/tuples-and-arrays/iteration.md msgid "" "This functionality uses the `IntoIterator` trait, but we haven't covered " "that yet." msgstr "" +"Bu fonksiyonellik `IntoIterator` özelliğini (trait) kullanıyor, ancak bunu " +"henüz ele almadık." #: src/tuples-and-arrays/iteration.md msgid "" "The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked while, debug-only variants like " +"` macros. These are always checked, while debug-only variants like " "`debug_assert!` compile to nothing in release builds." msgstr "" +"`assert_ne!` makrosu burada yenidir. Ayrıca `assert_eq!` ve `assert!` " +"makroları da vardır. Bunlar her zaman kontrol edilirken, `debug_assert!` " +"gibi yalnızca hata ayıklama varyantları sürüm inşasında (release build) " +"hiçbir şeye derlenmez." #: src/tuples-and-arrays/destructuring.md msgid "" -"When working with tuples and other structured values it's common to want to " -"extract the inner values into local variables. This can be done manually by " -"directly accessing the inner values:" +"Rust supports using pattern matching to destructure a larger value like a " +"tuple into its constituent parts:" msgstr "" +"Rust, bir demet (tuple) gibi daha büyük bir değeri, onu oluşturan parçalara " +"çözümlemek (destructure) için desen eşleştirmeyi (pattern matching) " +"kullanmayı destekler:" #: src/tuples-and-arrays/destructuring.md -msgid "\"left: {left}, right: {right}\"" -msgstr "" +msgid "\"{tuple:?}: {}\"" +msgstr "\"{tuple:?}: {}\"" #: src/tuples-and-arrays/destructuring.md -msgid "" -"However, Rust also supports using pattern matching to destructure a larger " -"value into its constituent parts:" -msgstr "" +msgid "\"ordered\"" +msgstr "\"sıralanmış\"" + +#: src/tuples-and-arrays/destructuring.md +msgid "\"unordered\"" +msgstr "\"sıralı de\"" #: src/tuples-and-arrays/destructuring.md msgid "" @@ -4041,12 +4345,18 @@ msgid "" "statically verify that the value on the right of `=` has the same structure " "as the pattern." msgstr "" +"Burada kullanılan desenler (patterns) \"reddedilemez (irrefutable)\"dir, " +"yani derleyici `=` sağındaki değerin desenle aynı yapıya sahip olduğunu " +"statik olarak doğrulayabilir." #: src/tuples-and-arrays/destructuring.md msgid "" "A variable name is an irrefutable pattern that always matches any value, " "hence why we can also use `let` to declare a single variable." msgstr "" +"Bir değişken adı, her zaman herhangi bir değerle eşleşen reddedilemez " +"(irrefutable) bir desendir, bu nedenle tek bir değişkeni bildirmek için " +"`let`'i kullanabiliriz." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -4054,88 +4364,71 @@ msgid "" "comparison and destructuring to happen at the same time. This form of " "pattern matching will be discussed in more detail later." msgstr "" +"Rust ayrıca koşullu ifadelerde desenlerin (patterns) kullanılmasını " +"destekleyerek eşitlik karşılaştırmasının (comparison) ve çözümlenmenin " +"(destructuring) aynı anda gerçekleşmesine olanak tanır. Bu desen eşleştirme " +"stili daha sonra daha ayrıntılı olarak tartışılacaktır." #: src/tuples-and-arrays/destructuring.md msgid "" "Edit the examples above to show the compiler error when the pattern doesn't " "match the value being matched on." msgstr "" +"Desenin (pattern) eşleştirilen değerle eşleşmediğinde oluşacak derleyici " +"hatasını göstermek için yukarıdaki örnekleri düzenleyin." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" -msgstr "" +msgstr "Diziler başka diziler de içerebilir:" #: src/tuples-and-arrays/exercise.md msgid "What is the type of this variable?" -msgstr "" +msgstr "Bu değişkenin türü nedir?" #: src/tuples-and-arrays/exercise.md msgid "" "Use an array such as the above to write a function `transpose` which will " "transpose a matrix (turn rows into columns):" msgstr "" - -#: src/tuples-and-arrays/exercise.md -msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "" +"Bir matrisin devrini (transpose) yapacak (satırları sütunlara çevirecek) " +"`transpose` fonksiyonu yazmak için yukarıdaki gibi bir dizi kullanın:" #: src/tuples-and-arrays/exercise.md msgid "" "Copy the code below to and implement the " -"functions:" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md -#: src/unsafe-rust/exercise.md -msgid "// TODO: remove this when you're done with your implementation.\n" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "//\n" +"function. This function only operates on 3x3 matrices." msgstr "" +"Aşağıdaki kodu adresine kopyalayın ve " +"fonksiyonu gerçekleştirin (implement). Bu fonksiyon yalnızca 3x3'lük " +"matrislerde çalışır." #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "// <-- the comment makes rustfmt add a newline\n" -msgstr "" +msgstr "// <-- bu yorum, rustfmt'nin yeni satır eklemesini sağlar\n" -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"matrix: {:#?}\"" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"transposed: {:#?}\"" -msgstr "" - -#: src/references.md -msgid "[Shared References](./references/shared.md) (10 minutes)" -msgstr "" - -#: src/references.md -msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" -msgstr "" - -#: src/references.md -msgid "[Slices: &\\[T\\]](./references/slices.md) (10 minutes)" -msgstr "[Dilimler: &\\[T\\]](../references/slices.md) (10 dakika)" - -#: src/references.md -msgid "[Strings](./references/strings.md) (10 minutes)" -msgstr "[Dizgeler](./references/strings.md) (10 dakika)" - -#: src/references.md -msgid "[Exercise: Geometry](./references/exercise.md) (15 minutes)" -msgstr "" - -#: src/references.md src/smart-pointers.md src/error-handling.md -msgid "This segment should take about 55 minutes" -msgstr "" +#: src/references.md src/smart-pointers.md src/borrowing.md src/iterators.md +#: src/error-handling.md src/concurrency/async-pitfalls.md +msgid "This segment should take about 55 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 55 dakika sürmelidir. İçerir:" #: src/references/shared.md msgid "" -"A reference provides a way to access another value without taking " -"responsibility for the value, and is also called \"borrowing\". Shared " -"references are read-only, and the referenced data cannot change." +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" +"Bir referans, değerin sahipliğini almadan başka bir değere erişmenin bir " +"yolunu sağlar ve \"ödünç alma (borrowing)\" olarak da adlandırılır. " +"Paylaşılan referanslar (shared reference) salt okunurdur (read-only) ve " +"referans edilen veriler değiştirilemez." + +#: src/references/shared.md src/std-traits/solution.md +msgid "'A'" +msgstr "'A'" + +#: src/references/shared.md +msgid "'B'" +msgstr "'B'" #: src/references/shared.md msgid "" @@ -4143,10 +4436,16 @@ msgid "" "with the `&` operator. The `*` operator \"dereferences\" a reference, " "yielding its value." msgstr "" +"`T` türüne yönelik paylaşılan referansın türü `&T`'dir. `&` operatörüyle bir " +"referans değeri (reference value) oluşturulur. `*` operatörü bir referansın " +"içeriğine eriştirir (dereference) ve onun değerini verir." #: src/references/shared.md -msgid "Rust will statically forbid dangling references:" +msgid "" +"References can never be null in Rust, so null checking is not necessary." msgstr "" +"Rust'ta referanslar hiçbir zaman null olamaz, bu yüzden null kontrolü (null " +"checking) gerekli değildir." #: src/references/shared.md msgid "" @@ -4155,6 +4454,11 @@ msgid "" "access the value, but is still \"owned\" by the original variable. The " "course will get into more detail on ownership in day 3." msgstr "" +"Bir referansın, atıfta bulunduğu (refer) değeri \"ödünç aldığı (barrow)\" " +"söylenir ve bu, göstericilere aşina olmayan öğrenciler için iyi bir " +"modeldir: kod, değere erişmek için referansı kullanabilir, ancak değer yine " +"de orijinal değişken tarafından \"sahiplidir (owned)\". Kurs, 3. günde " +"sahiplik (ownership) konusunda daha ayrıntılı bilgi verecektir." #: src/references/shared.md msgid "" @@ -4164,12 +4468,21 @@ msgid "" "cover how Rust prevents the memory-safety bugs that come from using raw " "pointers." msgstr "" +"Referanslar göstericiler (pointers) olarak gerçekleştirilir (implement) ve " +"önemli bir avantaj şudur ki, gösterdikleri şeyin boyutundan çok daha küçük " +"olabilmeleridir. C veya C++'a aşina olan öğrenciler referansları " +"göstericiler olarak tanıyacaklardır. Kursun ilerleyen bölümlerinde Rust'ın, " +"ham göstericilerin (raw pointers) kullanılmasından kaynaklanan bellek " +"emniyeti hatalarını (memory-safety bugs) nasıl önlediği ele alınacaktır." #: src/references/shared.md msgid "" -"Rust does not automatically create references for you - the `&` is always " -"required." +"Explicit referencing with `&` is usually required. However, Rust performs " +"automatic referencing and dereferencing when invoking methods." msgstr "" +"Açık bir şekilde (explicit) `&` ile referans vermek genellikle gereklidir. " +"Ancak, Rust metotları çağırırken referans verme ve referanstan çıkarma " +"(dereferencing) işlemlerini otomatik olarak gerçekleştirir." #: src/references/shared.md msgid "" @@ -4177,6 +4490,9 @@ msgid "" "methods (try `r.is_ascii()`). There is no need for an `->` operator like in " "C++." msgstr "" +"Rust bazı durumlarda, özellikle de metotları çağırırken (`r.is_ascii()`'i " +"deneyin) otomatik olarak referansın içeriğine erişecektir (auto-" +"dereference). C++'daki gibi `->` operatörüne gerek yoktur." #: src/references/shared.md msgid "" @@ -4185,30 +4501,48 @@ msgid "" "different from C++, where assignment to a reference changes the referenced " "value." msgstr "" +"Bu örnekte, `r` değiştirilebilir (mutable) olduğundan ona tekrar atama " +"yapılabilir (reassigned) (`r = &b`). Bunun `r`'yi yeniden bağladığını (re-" +"bind) ve böylece başka bir şeye atıfta bulunduğunu (refer) unutmayın. Bu C++ " +"dilinden, bir referansa atamanın (assignment) referans verilenin değerini " +"değiştirmesinden, farklıdır." #: src/references/shared.md msgid "" "A shared reference does not allow modifying the value it refers to, even if " "that value was mutable. Try `*r = 'X'`." msgstr "" +"Paylaşılan bir referans (shared reference), atıfta bulunduğu (refer) değerin " +"değiştirilmesine (modify), bu değer değiştirilebilir (mutable) olsa bile, " +"izin vermez. `*r = 'X'`'i deneyin." #: src/references/shared.md msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." +"enough. Dangling references cannot occur in safe Rust." msgstr "" +"Rust, yeterince uzun süre hayatta olmalarını sağlamak için tüm referansların " +"ömrülerini (lifetime) takip eder. Emniyetli (safe) Rust'ta boşa çıkan " +"referanslar (dangling reference) oluşamaz." #: src/references/shared.md -msgid "We will talk more about borrowing when we get to ownership." +msgid "" +"We will talk more about borrowing and preventing dangling references when we " +"get to ownership." msgstr "" +"Sahipliğe (ownership) geçince ödünç alma (borrowing) konusunu daha detaylı " +"konuşacağız.\n" +"Sahiplik (ownership) konusuna geldiğimizde ödünç alma ve boşa çıkan " +"referansları (dangling references) daha detaylı konuşacağız." #: src/references/exclusive.md msgid "" "Exclusive references, also known as mutable references, allow changing the " "value they refer to. They have type `&mut T`." msgstr "" +"Değiştirilebilir referanslar (mutable reference) olarak da bilinen özel " +"(exclusive) referanslar, atıfta bulundukları (refer) değerin " +"değiştirilmesine olanak tanır. Aynı zamanda, `&mut T` türüne sahiplerdir." #: src/references/exclusive.md msgid "" @@ -4218,6 +4552,11 @@ msgid "" "exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " "alive." msgstr "" +"\"Özel (exclusive)\", değere erişmek için yalnızca bu referansın " +"kullanılabileceği anlamına gelir. Aynı anda başka hiçbir referans " +"(paylaşılan veya özel olsun farketmez) mevcut olamaz ve özel referans " +"(exclusive) varken atıfta bulunan değere erişilemez. `x_coord` hayattayken " +"bir `&point.0` oluşturmayı veya `point.0`'ı değiştirmeyi deneyin." #: src/references/exclusive.md msgid "" @@ -4226,28 +4565,28 @@ msgid "" "bound to different values, while the second represents an exclusive " "reference to a mutable value." msgstr "" - -#: src/references/slices.md -msgid "Slices" -msgstr "Dilimler (Slices)" +"`let mut x_coord: &i32` ve `let x_coord: &mut i32` arasındaki farka dikkat " +"ettiğinizden emin olun. Birincisi, farklı değerlere bağlanabilen (bind) " +"paylaşılan bir referansı (shared reference) temsil ederken, ikincisi, " +"değiştirilebilir bir değere (mutable value) özel bir referansı (exclusive " +"reference) temsil eder (represent)." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" msgstr "" +"Bir dilim (slice) size daha büyük bir koleksiyonun içinden bir görüntü verir:" #: src/references/slices.md msgid "Slices borrow data from the sliced type." -msgstr "" - -#: src/references/slices.md -msgid "Question: What happens if you modify `a[3]` right before printing `s`?" -msgstr "" +msgstr "Dilimler (slice), dilimlenmiş türden verileri ödünç alır (borrowing)." #: src/references/slices.md msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" +"`a`'yı ödünç alıp (borrowing) başlangıç ​​ve bitiş indekslerini köşeli " +"parantez içinde belirterek bir dilim (slice) oluşturuyoruz." #: src/references/slices.md msgid "" @@ -4255,17 +4594,24 @@ msgid "" "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" +"Dilim (slice) indeks 0'da başlıyorsa, Rust'ın aralık sözdizimi (range " +"syntax) başlangıç indeksini kullanmamaya izin verir; bu, `&a[0..a.len()]` ve " +"`&a[..a.len()]`dilimlerinin aynı olduğu anlamına gelir." #: src/references/slices.md msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." msgstr "" +"Aynı şey bitiş indeksi için de geçerlidir, dolayısıyla `&a[2..a.len()]` ve " +"`&a[2..]` aynıdır." #: src/references/slices.md msgid "" "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" +"Tüm bir dizinin dilimini (slice) kolayca oluşturmak için `&a[..]`'ı " +"kullanabiliriz." #: src/references/slices.md msgid "" @@ -4273,33 +4619,66 @@ msgid "" "(`&[i32]`) no longer mentions the array length. This allows us to perform " "computation on slices of different sizes." msgstr "" +"`s`,`i32`'lerin bir dilimine (slice) referanstır. `s` (`&[i32]`) türünün " +"artık dizi uzunluğundan bahsetmediğine dikkat edin. Bu bize farklı " +"boyutlardaki dilimler üzerinde hesaplama yapmamızı sağlar." #: src/references/slices.md msgid "" "Slices always borrow from another object. In this example, `a` has to remain " "'alive' (in scope) for at least as long as our slice." msgstr "" +"Dilimler (slice) her zaman başka bir nesneden ödünç alır (borrow). Bu " +"örnekte `a`'nın en azından dilimimiz (slice) kadar 'canlı " +"(alive)' (kapsamında) kalması gerekiyor." + +#: src/references/slices.md +msgid "You can't \"grow\" a slice once it's created:" +msgstr "Bir dilimi (slice) oluşturduktan sonra onu \"büyütemezsiniz\":" #: src/references/slices.md msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." +"You can't append elements of the slice, since it doesn't own the backing " +"buffer." msgstr "" +"Dilim (slice), destekleyici arabelleğe (backing buffer) sahip olmadığından, " +"dilimin öğelerine ekleyemezsiniz." + +#: src/references/slices.md +msgid "" +"You can't grow a slice to point to a larger section of the backing buffer. " +"The slice loses information about the underlying buffer and so you can't " +"know how larger the slice can be grown." +msgstr "" +"Bir dilimi (slice), destekleyici arabelleğin (backing buffer) daha büyük bir " +"bölümünü gösterecek şekilde büyütemezsiniz. Dilim, temel arabellek " +"(underlying buffer) hakkında bilgiyi kaybeder ve bu nedenle ne kadar " +"büyütülebileceğini bilemezsiniz." + +#: src/references/slices.md +msgid "" +"To get a larger slice you have to back to the original buffer and create a " +"larger slice from there." +msgstr "" +"Daha büyük bir dilim (slice) elde etmek için, orijinal arabelleği (buffer) " +"kullanarak daha büyük bir dilim (slice) oluşturmalısınız." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" -msgstr "" +msgstr "Artık Rust'taki iki dize (string) türünü anlayabiliyoruz:" #: src/references/strings.md msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgstr "" +"`&str`, `&[u8]`e benzer şekilde, UTF-8 olarak kodlanmış baytların bir " +"dilimidir (slice)." #: src/references/strings.md -msgid "`String` is an owned, heap-allocated buffer of UTF-8 bytes." +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "" +"`String`, `Vec`ye benzer şekildedir, UTF-8 olarak kodlanmış baytlardan " +"oluşan sahipli bir arabellektir." #: src/references/strings.md src/std-traits/read-and-write.md msgid "\"World\"" @@ -4307,19 +4686,19 @@ msgstr "\"Dünya\"" #: src/references/strings.md msgid "\"s1: {s1}\"" -msgstr "" +msgstr "\"s1: {s1}\"" #: src/references/strings.md msgid "\"Hello \"" msgstr "\"Merhaba \"" -#: src/references/strings.md src/memory-management/move.md +#: src/references/strings.md msgid "\"s2: {s2}\"" -msgstr "" +msgstr "\"s2: {s2}\"" #: src/references/strings.md msgid "\"s3: {s3}\"" -msgstr "" +msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" @@ -4327,12 +4706,19 @@ msgid "" "encoded string data stored in a block of memory. String literals " "(`\"Hello\"`), are stored in the program’s binary." msgstr "" +"`&str`, bir bellek bloğunda saklanan UTF-8 olarak kodlanmış dize (string) " +"verilerine değiştirilemez (immutable) referans olan bir dize dilimi (string " +"slice) sunar. Dize değişmezleri (string literals) (`\"Hello\"`), programın " +"ikili (binary) dosyasında saklanır." #: src/references/strings.md msgid "" "Rust's `String` type is a wrapper around a vector of bytes. As with a " "`Vec`, it is owned." msgstr "" +"Rust'ın `String` türü, baytlardan oluşan bir vektörün bir sarmalayıcı " +"türüdür. Bir `Vec` gibi, bu türden veri `String` türü tarafından " +"sahiplidir (owned)." #: src/references/strings.md msgid "" @@ -4340,12 +4726,19 @@ msgid "" "literal; `String::new()` creates a new empty string, to which string data " "can be added using the `push()` and `push_str()` methods." msgstr "" +"Diğer birçok türde olduğu gibi, `String::from()` bir dize değişmezinden " +"(string literal) bir string oluşturur; `String::new()` yeni bir boş dize " +"oluşturur ve dizeye veriler `push()` ve `push_str()` metotları kullanılarak " +"eklenebilir." #: src/references/strings.md msgid "" "The `format!()` macro is a convenient way to generate an owned string from " "dynamic values. It accepts the same format specification as `println!()`." msgstr "" +"`format!()` makrosu, dinamik değerlerden sahipli bir dize oluşturmak için " +"uygun bir yoldur. Aynı biçimin `println!()` makrosundaki gibi aynı biçim " +"tanımlamasını kabul eder." #: src/references/strings.md msgid "" @@ -4354,6 +4747,12 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" +"`String`'den `&str` dilimlerini (slices) `&` ve isteğe bağlı olarak aralık " +"seçimi (range selection) ile ödünç alabilirsiniz (barrow). Karakter " +"sınırlarının dışını da kapsayacak bir bayt aralığı seçerseniz, ifade " +"(expression) paniğe neden olacaktır. `chars` adımlayıcısı, karakterler " +"üzerinde adımlama yapar ve karakter sınırlarını doğru bulmaya çalışmak " +"yerine tercih edilir." #: src/references/strings.md msgid "" @@ -4362,10 +4761,17 @@ msgid "" "equivalent of `std::string` from C++ (main difference: it can only contain " "UTF-8 encoded bytes and will never use a small-string optimization)." msgstr "" +"C++ programcıları için: `&str`'yi C++'daki `std::string_view` olarak " +"düşünün, ancak her zaman bellekteki geçerli bir dizeye işaret eder. Rust " +"dilindeki `String`, C++'daki `std::string`'in kabaca eşdeğeridir (ana fark: " +"yalnızca UTF-8 olarak kodlanmış baytlar içerebilir ve asla küçük dize " +"optimizasyonu / small-string optimization kullanmaz)." #: src/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" +"Bayt dizelerinden değişmezler (Byte strings literals), doğrudan bir `&[u8]` " +"değeri oluşturmanıza olanak tanır:" #: src/references/strings.md msgid "" @@ -4373,6 +4779,53 @@ msgid "" "`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " "amount of `#` on either side of the quotes:" msgstr "" +"Ham (raw) dizeler, kaçış karakterlerininin devre dışı bırakıldığı bir `&str` " +"değeri oluşturmanıza olanak tanır: `r\"\\n\" == \"\\\\n\"`. Dizenin içindeki " +"çift tırnakları, dizeyi oluşturan tırnakların her iki tarafınaa eşit sayıda " +"`#` karakteri koyarak görebilirsiniz:" + +#: src/references/dangling.md +msgid "" +"Rust enforces a number of rules for references that make them always safe to " +"use. One rule is that references can never be `null`, making them safe to " +"use without `null` checks. The other rule we'll look at for now is that " +"references can't _outlive_ the data they point to." +msgstr "" +"Rust, referansların her zaman emniyetli (safe) kullanılmasını sağlayan bir " +"dizi kural uygular. Bunlardan biri, referansların asla `null` " +"olamayacağıdır; bu da `null` kontrolü yapmadan emniyetli kullanılmalarını " +"sağlar. Şimdi bakacağımız diğer kural ise, referansların gösterdikleri " +"veriden _daha uzun ömürlü (outlive)_ olamayacaklarıdır." + +#: src/references/dangling.md +msgid "" +"This slide gets students thinking about references as not simply being " +"pointers, since Rust has different rules for references than other languages." +msgstr "" +"Bu slayt, Rust'ın referanslar için diğer dillerden farklı kuralları " +"olduğundan, öğrencilerin referansların sadece göstericiler (pointers) " +"olmadığını düşünmelerini sağlar." + +#: src/references/dangling.md +msgid "" +"We'll look at the rest of Rust's borrowing rules on day 3 when we talk about " +"Rust's ownership system." +msgstr "" +"Rust'ın ödünç alma (borrowing) kurallarının geri kalanına, 3. günde Rust'ın " +"sahiplik (ownership) sisteminden bahsederken bakacağız." + +#: src/references/dangling.md +msgid "" +"Rust's equivalent of nullability is the `Option` type, which can be used to " +"make any type \"nullable\" (not just references/pointers). We haven't yet " +"introduced enums or pattern matching, though, so try not to go into too much " +"detail about this here." +msgstr "" +"Rust dilindeki null olabilirliğin karşılığı `Option` türüdür, bu tür " +"herhangi bir türü \"null olabilir (nullable)\" hâle getirmek için " +"kullanılabilir (sadece referanslar/göstericiler değil). Ancak henüz " +"enum'ları veya desen eşleştirmeyi (pattern matching) tanıtmadık, bu yüzden " +"burada bu konulara fazla girmemeye çalış." #: src/references/exercise.md msgid "" @@ -4380,6 +4833,9 @@ msgid "" "representing a point as `[f64;3]`. It is up to you to determine the function " "signatures." msgstr "" +"3 boyutlu geometri için, bir noktayı `[f64;3]` olarak temsil eden birkaç " +"yardımcı fonksiyon oluşturacağız. Fonksiyon imzalarını belirlemek size " +"kalmış." #: src/references/exercise.md msgid "" @@ -4389,112 +4845,109 @@ msgid "" "square\n" "// root, like `v.sqrt()`.\n" msgstr "" +"// Bir vektörün büyüklüğünü, koordinatlarının karelerini toplayarak " +"hesaplayın\n" +"// ve karekökünü alın. Karekökü hesaplamak için `sqrt()` metodunu kullanın,\n" +"// örneğin `v.sqrt()` gibi.\n" #: src/references/exercise.md msgid "" "// Normalize a vector by calculating its magnitude and dividing all of its\n" "// coordinates by that magnitude.\n" msgstr "" +"// Bir vektörü, büyüklüğünü hesaplayarak ve tüm koordinatlarını bu " +"büyüklüğe\n" +"// bölererek normalize edin.\n" #: src/references/exercise.md msgid "// Use the following `main` to test your work.\n" msgstr "" +"// Çalışmanızı test etmek için aşağıdaki `main` fonksiyonunu kullanın.\n" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of a unit vector: {}\"" -msgstr "" +msgstr "\"Birim vektörünün büyüklüğü: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?}: {}\"" -msgstr "" +msgstr "\"{v:?} vektörünün büyüklüğü: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?} after normalization: {}\"" -msgstr "" +msgstr "\"Normalize edildikten sonra {v:?} vektörünün büyüklüğü: {}\"" #: src/references/solution.md msgid "/// Calculate the magnitude of the given vector.\n" -msgstr "" +msgstr "/// Verilen vektörün büyüklüğünü hesaplayın.\n" #: src/references/solution.md msgid "" "/// Change the magnitude of the vector to 1.0 without changing its " "direction.\n" -msgstr "" +msgstr "/// Vektörün büyüklüğünü, yönünü değiştirmeden 1.0'a değiştirin.\n" -#: src/user-defined-types.md -msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Static](./user-defined-types/static.md) (5 minutes)" -msgstr "[Static](./user-defined-types/static.md) (5 dakika)" - -#: src/user-defined-types.md -msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" -msgstr "" - -#: src/user-defined-types.md +#: src/references/solution.md msgid "" -"[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" +"Note that in `normalize` we were able to do `*item /= mag` to modify each " +"element. This is because we're iterating using a mutable reference to an " +"array, which causes the `for` loop to give mutable references to each " +"element." msgstr "" +"`normalize` fonksiyonunda her bir elemanı değiştirmek için `*item /= mag` " +"yapabildiğimize dikkat edin. Bunun sebebi, bir diziye değiştirilebilir " +"(mutable) referans kullanarak döngü de dönmemizdir; bu da `for` döngüsünün " +"her elemana değiştirilebilir (mutable) referanslar vermesini sağlar." -#: src/user-defined-types.md src/methods-and-traits.md src/borrowing.md -#: src/lifetimes.md -msgid "This segment should take about 50 minutes" -msgstr "" +#: src/user-defined-types.md src/std-types.md src/std-traits.md +#: src/memory-management.md +msgid "This segment should take about 1 hour. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat sürmelidir. İçeriği:" #: src/user-defined-types/named-structs.md msgid "Like C and C++, Rust has support for custom structs:" msgstr "" +"C ve C++ dillerindeki gibi Rust'ın da özel (kullanıcı tanımlı) yapılara " +"desteği vardır:" #: src/user-defined-types/named-structs.md msgid "\"{} is {} years old\"" -msgstr "" +msgstr "\"{} {} yaşında\"" #: src/user-defined-types/named-structs.md #: src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" -msgstr "" +msgstr "\"Peter\"" #: src/user-defined-types/named-structs.md msgid "\"Avery\"" -msgstr "" - -#: src/user-defined-types/named-structs.md -msgid "\"Jackie\"" -msgstr "" +msgstr "\"Avery\"" #: src/user-defined-types/named-structs.md src/user-defined-types/enums.md #: src/pattern-matching/match.md src/methods-and-traits/methods.md msgid "Key Points:" -msgstr "" +msgstr "Önemli Noktalar:" #: src/user-defined-types/named-structs.md msgid "Structs work like in C or C++." -msgstr "" +msgstr "Yapılar C veya C++'daki gibi çalışır." #: src/user-defined-types/named-structs.md msgid "Like in C++, and unlike in C, no typedef is needed to define a type." msgstr "" +"C++'daki gibi ve C'den farklı olarak, bir türü tanımlamak için typedef'e " +"gerek yoktur." #: src/user-defined-types/named-structs.md msgid "Unlike in C++, there is no inheritance between structs." -msgstr "" +msgstr "C++'dan farklı olarak yapılar arasında kalıtım (inheritance) yoktur." #: src/user-defined-types/named-structs.md msgid "" "This may be a good time to let people know there are different types of " "structs." msgstr "" +"Bu, insanlara farklı yapı türleri olduğunu duyurmak için iyi bir zaman " +"olabilir." #: src/user-defined-types/named-structs.md msgid "" @@ -4502,118 +4955,197 @@ msgid "" "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" +"Sıfır boyutlu (zero-sized) yapılar (örn. `struct Foo;`), bir özelliğin " +"(trait) bazı türlere gerçekleştiriminde (implementing) kullanılabilir, ancak " +"değer olarak kendisinde saklamak istenilen herhangi bir veri yoktur." #: src/user-defined-types/named-structs.md msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" +"Sonraki slaytta alan adları (field names) önemli olmadığında kullanılan " +"Demet (Tuple) yapıları tanıtılacaktır." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" +"Eğer zaten doğru adlara sahip değişkenleriniz varsa, o zaman yapıyı bir " +"kısaltma kullanarak oluşturabilirsiniz." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the " -"old struct without having to explicitly type it all out. It must always be " -"the last element." +"Struct fields do not support default values. Default values are specified by " +"implementing the `Default` trait which we will cover later." msgstr "" +"Yapı alanları (struct fields) varsayılan değerleri desteklemez. Varsayılan " +"değerler, daha sonra ele alacağımız `Default` özelliği (trait) uygulanarak " +"belirtilir." + +#: src/user-defined-types/named-structs.md +msgid "You can also demonstrate the struct update syntax here:" +msgstr "" +"Burada aynı zamanda yapı güncelleme sözdizimini (struct update syntax) de " +"gösterebilirsiniz:" + +#: src/user-defined-types/named-structs.md +msgid "\"Jackie\"" +msgstr "\"Jackie\"" + +#: src/user-defined-types/named-structs.md +msgid "" +"It allows us to copy the majority of the fields from the old struct without " +"having to explicitly type it all out. It must always be the last element." +msgstr "" +"Bu, eski yapının (struct) alanlarının çoğunu açıkça tek tek yazmak zorunda " +"kalmadan kopyalamamıza olanak tanır. Bu her zaman son öğe olmalıdır." + +#: src/user-defined-types/named-structs.md +msgid "" +"It is mainly used in combination with the `Default` trait. We will talk " +"about struct update syntax in more detail on the slide on the `Default` " +"trait, so we don't need to talk about it here unless students ask about it." +msgstr "" +"Bu, çoğunlukla `Default` özelliği (trait) ile birlikte kullanılır. `Default` " +"özelliği ile ilgili slaytta yapı güncelleme sözdizimini (struct update " +"syntax) daha detaylı ele alacağız, bu yüzden öğrenciler sormadıkça burada " +"bahsetmemize gerek yok." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" msgstr "" +"Alan adları (field names) önemsizse demet (tuple) yapısını kullanabilirsiniz:" #: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" -msgstr "" +msgstr "\"({}, {})\"" #: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" +"Bu genellikle tek alanlı sarmalayıcılar (single-field wrappers - newtype " +"deseni olarak adlandırılır) için kullanılır:" #: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" -msgstr "" +msgstr "\"NASA'daki bir roket bilim adamına sorun\"" #: src/user-defined-types/tuple-structs.md #: src/android/interoperability/cpp/cpp-bridge.md #: src/bare-metal/microcontrollers/type-state.md -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" -msgstr "" +msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" +"Yeni tür (newtype) deseni, ilkel (primitive) bir türdeki değer hakkındaki ek " +"bilgileri kodlamanın harika bir yoludur, örneğin:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." -msgstr "" +msgstr "Sayı bazı birimlerde ölçülür: Yukarıdaki örnekte `Newtons`." #: src/user-defined-types/tuple-structs.md msgid "" "The value passed some validation when it was created, so you no longer have " "to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" +"Değer, oluşturulduğunda bir miktar doğrulamadan geçti, bu nedenle artık onu " +"her kullanımda yeniden doğrulamanız gerekmiyor: `PhoneNumber(String)` veya " +"`OddNumber(u32)`." #: src/user-defined-types/tuple-structs.md msgid "" "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " "single field in the newtype." msgstr "" +"Yeni türde desenindeki tek alana erişerek bir `Newtons` türüne `f64` " +"değerinin nasıl ekleneceğini gösterin." #: src/user-defined-types/tuple-structs.md msgid "" "Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "for instance using booleans as integers." msgstr "" +"Rust genellikle bir nesnenin değerinin otomatik çözülmesini (automatic " +"unwrapping) veya boole değerlerini tamsayı olarak kullanmak gibi açık " +"olmayan şeylerden hoşlanmaz." #: src/user-defined-types/tuple-structs.md msgid "Operator overloading is discussed on Day 3 (generics)." +msgstr "Operatör yüklemesi 3. günde (genelleştirmeler(generics)) tartışıldı." + +#: src/user-defined-types/tuple-structs.md +msgid "" +"When a tuple struct has zero fields, the `()` can be omitted. The result is " +"a zero-sized type (ZST), of which there is only one value (the name of the " +"type)." msgstr "" +"Bir demet (tuple) yapısının sıfır alanı varsa, `()` kısmı atlanabilir. " +"Böylece ortaya sıfır boyutlu (zero-sized) bir tür (SBT/ZST) çıkar ve bu " +"türün yalnızca bir değeri vardır (türün adı)." + +#: src/user-defined-types/tuple-structs.md +msgid "" +"This is common for types that implement some behavior but have no data " +"(imagine a `NullReader` that implements some reader behavior by always " +"returning EOF)." +msgstr "" +"Bu, bazı davranışları uygulayan verisi olmayan türler için yaygındır (her " +"zaman EOF döndüren bir `NullReader` hayal edin; okuma davranışını uygular " +"ama veri içermez)." #: src/user-defined-types/tuple-structs.md msgid "" "The example is a subtle reference to the [Mars Climate Orbiter](https://en." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" +"Örnek, [Mars İklim Yörünge Aracı](https://en.wikipedia.org/wiki/" +"Mars_Climate_Orbiter) hatasına incelikli bir göndermedir." #: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" +"`enum` anahtar sözcüğü birkaç farklı varyanta sahip bir türün yaratılmasına " +"olanak sağlar:" #: src/user-defined-types/enums.md msgid "// Simple variant\n" -msgstr "" +msgstr "// Basit (Simple) varyant\n" #: src/user-defined-types/enums.md msgid "// Tuple variant\n" -msgstr "" +msgstr "// Demet (Tuple) varyantı\n" #: src/user-defined-types/enums.md msgid "// Struct variant\n" -msgstr "" +msgstr "// Yapı (Struct) varyantı\n" #: src/user-defined-types/enums.md -msgid "\"On this turn: {:?}\"" -msgstr "" +msgid "\"On this turn: {player_move:?}\"" +msgstr "\"Sıradaki hamle: {player_move:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" +"Numaralandırmalar, bir dizi değeri tek bir tür altında toplamanıza olanak " +"tanır." #: src/user-defined-types/enums.md msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" +"`Direction`, varyantları olan bir türdür. `Direction`'ın iki değeri vardır: " +"`Direction::Left` ve `Direction::Right`." #: src/user-defined-types/enums.md msgid "" @@ -4621,16 +5153,24 @@ msgid "" "Rust will store a discriminant so that it knows at runtime which variant is " "in a `PlayerMove` value." msgstr "" +"`PlayerMove` üç varyantı olan bir türdür. Rust, varyant ek yüküne (variant " +"payloads) ek olarak, çalışma zamanında hangi varyantın `PlayerMove` " +"değerinde olduğunu bilmesi için bir ayırıcı (discriminant) da depolar." #: src/user-defined-types/enums.md msgid "This might be a good time to compare structs and enums:" msgstr "" +"Bu, yapıları ve numaralandırmaları karşılaştırmak için iyi bir zaman " +"olabilir:" #: src/user-defined-types/enums.md msgid "" "In both, you can have a simple version without fields (unit struct) or one " "with different types of fields (variant payloads)." msgstr "" +"Her ikisinde de, alanları olmayan basit bir versiyona (birim yapı) veya " +"farklı alan türlerine sahip bir versiyona (varyant ek yükleri) sahip " +"olabilirsiniz." #: src/user-defined-types/enums.md msgid "" @@ -4638,14 +5178,17 @@ msgid "" "structs but then they wouldn’t be the same type as they would if they were " "all defined in an enum." msgstr "" +"Bir enum'ın farklı varyantlarını ayrı yapılarla bile uygulayabilirsiniz " +"ancak o zaman da hepsi bir enum'da tanımlanmış olduğunda olacağı gibi aynı " +"türde olmazlardı." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "" +msgstr "Rust, ayırıcıyı (discriminant) depolamak için minimum alan kullanır." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" -msgstr "" +msgstr "Gerekirse, gereken en küçük boyuttaki bir tam sayıyı depolar" #: src/user-defined-types/enums.md msgid "" @@ -4654,29 +5197,30 @@ msgid "" "optimization\"). For example, `Option<&u8>` stores either a pointer to an " "integer or `NULL` for the `None` variant." msgstr "" +"İzin verilen varyant değerleri tüm bit desenlerini kapsamıyorsa, ayırıcıyı " +"kodlamak için geçersiz bit desenleri kullanır (\"niş/oyuk/niche " +"optimizasyonu\"). Örneğin, `Option<&u8>`, `None` varyantı için bir tamsayıya " +"gösterici veya `NULL` depolar." #: src/user-defined-types/enums.md msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" +"Gerekirse ayırıcıyı kontrol edebilirsiniz (örneğin, C ile uyumluluk için):" #: src/user-defined-types/enums.md msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." -msgstr "" - -#: src/user-defined-types/enums.md src/user-defined-types/static.md -#: src/memory-management/review.md src/memory-management/move.md -#: src/smart-pointers/box.md src/borrowing/shared.md -msgid "More to Explore" -msgstr "" +msgstr "`repr` olmadan, ayırıcı tür 2 baytlık olur, çünkü 10001 2 bayta sığar." #: src/user-defined-types/enums.md msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." msgstr "" +"Rust, enum'ların daha az yer kaplamasını sağlamak için kullanabileceği " +"çeşitli optimizasyonlara sahiptir." #: src/user-defined-types/enums.md msgid "" @@ -4684,6 +5228,9 @@ msgid "" "option/#representation), Rust guarantees that `size_of::()` equals " "`size_of::>()`." msgstr "" +"Null gösterici optimizasyonu: [Bazı türler](https://doc.rust-lang.org/std/" +"option/#representation) için, Rust `size_of::()`'nin `size_of::" +">()`'ye eşit olduğunu garanti eder." #: src/user-defined-types/enums.md msgid "" @@ -4691,16 +5238,84 @@ msgid "" "like in practice. It's important to note that the compiler provides no " "guarantees regarding this representation, therefore this is totally unsafe." msgstr "" +"Bitsel gösterimin pratikte nasıl _görünebileceğini_ göstermek istiyorsanız " +"örnek kod aşağıdadır. Derleyicinin bu gösterimle (representation) ilgili " +"hiçbir garanti sağlamadığını, dolayısıyla bunun tamamen emniyetsiz olduğunu " +"belirtmek önemlidir." + +#: src/user-defined-types/aliases.md +msgid "" +"A type alias creates a name for another type. The two types can be used " +"interchangeably." +msgstr "" +"Bir tür eş ismi, başka bir tür için bir isim oluşturur. Her iki tür de " +"birbirinin yerine kullanılabilir." + +#: src/user-defined-types/aliases.md +msgid "// Aliases are more useful with long, complex types:\n" +msgstr "" +"// Eş isimler (aliases) uzun ve karmaşık türlerde daha kullanışlıdır:\n" + +#: src/user-defined-types/aliases.md +msgid "" +"A [newtype](tuple-structs.html) is often a better alternative since it " +"creates a distinct type. Prefer `struct InventoryCount(usize)` to `type " +"InventoryCount = usize`." +msgstr "" +"Bir [yeni tür (newtype)](tuple-structs.html) deseni genellikle farklı bir " +"tür oluşturduğu için daha iyi bir seçenektir. `type InventoryCount = usize` " +"yerine `struct InventoryCount(usize)`'ı tercih edin." + +#: src/user-defined-types/aliases.md +msgid "C programmers will recognize this as similar to a `typedef`." +msgstr "C programcıları bunun, `typedef`'e benzer olduğunu anlayacaklardır." + +#: src/user-defined-types/const.md +msgid "`const`" +msgstr "`const`" + +#: src/user-defined-types/const.md +msgid "" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" +msgstr "" +"Sabitler (constants) derleme zamanında (compile-time) değerlendirilir ve " +"değerleri kullanıldıkları her yerde satır içi (inline) olarak belirtilir:" + +#: src/user-defined-types/const.md +msgid "" +"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html) these are inlined upon use." +msgstr "" +"[Rust RFC Book'a](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html) göre bunlar kullanım sırasında satır içidir (inline)." + +#: src/user-defined-types/const.md +msgid "" +"Only functions marked `const` can be called at compile time to generate " +"`const` values. `const` functions can however be called at runtime." +msgstr "" +"Sadece `const` olarak işaretlenen fonksiyonlar derleme zamanında çağrılarak " +"`const` değerler üretilebilir. Ancak `const` fonksiyonlar çalışma zamanında " +"da çağrılabilir." + +#: src/user-defined-types/const.md +msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" +msgstr "" +"`const`'un C++'ın `constexpr`'ına anlamsal olarak benzer davrandığını " +"belirtin" #: src/user-defined-types/static.md msgid "`static`" -msgstr "" +msgstr "`static`" #: src/user-defined-types/static.md msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" +"Statik değişkenler programın tüm yürütmesi (execution) boyunca yaşayacak ve " +"bu nedenle taşınmayacaklar (not move):" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4708,7 +5323,7 @@ msgstr "\"RustOS 3.14'e Hoş Geldiniz\"" #: src/user-defined-types/static.md msgid "\"{BANNER}\"" -msgstr "" +msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md msgid "" @@ -4719,16 +5334,26 @@ msgid "" "globally-scoped value does not have a reason to need object identity, " "`const` is generally preferred." msgstr "" +"[Rust RFC Kitabında](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html) belirtildiği gibi, statik kullanımı satır içi (inline) özelliği vermez " +"ve gerçek bir ilişkili bellek konumuna sahiptir. Bu, emniyetsiz (unsafe) ve " +"gömülü (embedded) kod için yararlıdır ve değişken, program yürütmesinin " +"tamamı boyunca yaşar. Global kapsamlı (globally-scoped) bir değerin nesne " +"kimliğine (object identity) ihtiyaç duyması için bir nedeni olmadığında, " +"genellikle `const` tercih edilir." #: src/user-defined-types/static.md msgid "`static` is similar to mutable global variables in C++." -msgstr "" +msgstr "`statik`, C++'daki değiştirilebilir olan global değişkenlere benzer." #: src/user-defined-types/static.md msgid "" "`static` provides object identity: an address in memory and state as " "required by types with interior mutability such as `Mutex`." msgstr "" +"`static`, `Mutex` gibi iç değişebilirliğe (interior mutability) sahip " +"türlerin gerektirdiği şekilde bellekteki bir adres ve durumu nesneye kimlik " +"olarak sağlar." #: src/user-defined-types/static.md msgid "" @@ -4736,56 +5361,26 @@ msgid "" "`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html), atomic or similar." msgstr "" +"Çünkü `static` değişkenlere herhangi bir iş parçacığından (thread) " +"erişilebildiğinden, bunların `Sync` olması gerekir. İç değişebilirlik " +"(Interior mutability) [`Mutex`](https://doc.rust-lang.org/std/sync/struct." +"Mutex.html), atomik veya benzer yöntemlerle mümkündür." + +#: src/user-defined-types/static.md +msgid "" +"It is common to use `OnceLock` in a static as a way to support " +"initialization on first use. `OnceCell` is not `Sync` and thus cannot be " +"used in this context." +msgstr "" +"İlk kullanımda ilklendirmeyi (initialization) desteklemek için `static` " +"içinde `OnceLock` kullanmak yaygındır. `OnceCell`, `Sync` olmadığı için bu " +"bağlamda kullanılamaz." #: src/user-defined-types/static.md msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" - -#: src/user-defined-types/const.md -msgid "`const`" -msgstr "" - -#: src/user-defined-types/const.md -msgid "" -"Constants are evaluated at compile time and their values are inlined " -"wherever they are used:" -msgstr "" - -#: src/user-defined-types/const.md -msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." -msgstr "" - -#: src/user-defined-types/const.md -msgid "" -"Only functions marked `const` can be called at compile time to generate " -"`const` values. `const` functions can however be called at runtime." -msgstr "" - -#: src/user-defined-types/const.md -msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" -msgstr "" - -#: src/user-defined-types/const.md -msgid "" -"It isn't super common that one would need a runtime evaluated constant, but " -"it is helpful and safer than using a static." -msgstr "" - -#: src/user-defined-types/aliases.md -msgid "" -"A type alias creates a name for another type. The two types can be used " -"interchangeably." -msgstr "" - -#: src/user-defined-types/aliases.md -msgid "// Aliases are more useful with long, complex types:\n" -msgstr "" - -#: src/user-defined-types/aliases.md -msgid "C programmers will recognize this as similar to a `typedef`." -msgstr "" +"İş parçacığı için yerel (thread-local) veriler `std::thread_local` makrosu " +"ile oluşturulabilir." #: src/user-defined-types/exercise.md msgid "" @@ -4794,6 +5389,10 @@ msgid "" "various events. Use `#[derive(Debug)]` to allow the types to be formatted " "with `{:?}`." msgstr "" +"Bir asansör kontrol sistemindeki bir olayı temsil etmek için bir veri yapısı " +"oluşturacağız. Çeşitli olayları yapılandırmak için türleri ve fonksiyonları " +"tanımlamak size kalmış. Türlerin `{:?}` ile biçimlendirilmesine (format) " +"izin vermek için `#[derive(Debug)]` kullanın." #: src/user-defined-types/exercise.md msgid "" @@ -4801,285 +5400,339 @@ msgid "" "`main` runs without errors. The next part of the course will cover getting " "data out of these structures." msgstr "" +"Bu alıştırma yalnızca, `main`'in hatasız çalışması için veri yapıları " +"oluşturmayı ve doldurmayı gerektirir. Kursun bir sonraki kısmı bu yapılardan " +"veri almayı kapsayacaktır." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// An event in the elevator system that the controller must react to.\n" -msgstr "" +msgstr "/// Asansör sisteminde kontrolörün tepki vermesi gereken bir olay.\n" #: src/user-defined-types/exercise.md msgid "// TODO: add required variants\n" -msgstr "" +msgstr "// TODO: gerekli değişkeleri (variant) ekle\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A direction of travel.\n" msgstr "" +"/// Bir seyahat yönü.\n" +"\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car has arrived on the given floor.\n" -msgstr "" +msgstr "/// Kabin verilen kata ulaşmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have opened.\n" -msgstr "" +msgstr "/// Kabin kapıları açılmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have closed.\n" -msgstr "" +msgstr "/// Kabin kapıları kapanmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// A directional button was pressed in an elevator lobby on the given " "floor.\n" -msgstr "" +msgstr "/// Verilen kattaki asansör lobisinde yön düğmesine basıldı.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A floor button was pressed in the elevator car.\n" -msgstr "" +msgstr "/// Asansör kabininde bir kat düğmesine basıldı.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A ground floor passenger has pressed the up button: {:?}\"" -msgstr "" +msgstr "\"Zemin kattaki bir yolcu yukarı düğmesine basmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" -msgstr "" +msgstr "\"Kabin zemin kata ulaşmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door opened: {:?}\"" -msgstr "" +msgstr "\"Kabin kapısı açıldı: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" -msgstr "" +msgstr "\"Bir yolcu 3. katın düğmesine basmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" -msgstr "" +msgstr "\"Kabin kapısı kapandı: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the 3rd floor: {:?}\"" +msgstr "\"Kabin 3. kata ulaşmış durumda: {:?}\"" + +#: src/user-defined-types/exercise.md +msgid "" +"If students ask about `#![allow(dead_code)]` at the top of the exercise, " +"it's necessary because the only thing we do with the `Event` type is print " +"it out. Due to a nuance of how the compiler checks for dead code this causes " +"it to think that the code is unused. They can ignore it for the purpose of " +"this exercise." msgstr "" +"Eğer öğrenciler alıştırmanın en üstündeki `#![allow(dead_code)]` satırını " +"sorarlarsa, bunun nedeni `Event` türüyle yaptığımız tek şeyin onu ekrana " +"yazdırmak olmasıdır. Derleyicinin ölü kodu (dead code) kontrol etme " +"biçimindeki bir ayrıntı nedeniyle, bu durum kodun kullanılmadığını sanmasına " +"yol açar. Öğrenciler bu satırı bu alıştırma özelinde görmezden gelebilirler." #: src/user-defined-types/solution.md msgid "/// A button was pressed.\n" -msgstr "" +msgstr "/// Bir düğmeye basıldı.\n" #: src/user-defined-types/solution.md msgid "/// The car has arrived at the given floor.\n" -msgstr "" +msgstr "/// Kabin verilen kata ulaşmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have opened.\n" -msgstr "" +msgstr "/// Kabin kapıları açılmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have closed.\n" -msgstr "" +msgstr "/// Kabin kapıları kapanmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// A floor is represented as an integer.\n" -msgstr "" +msgstr "/// Bir kat tamsayı olarak temsil edilir.\n" #: src/user-defined-types/solution.md msgid "/// A user-accessible button.\n" -msgstr "" +msgstr "/// Kullanıcının erişebileceği bir düğme.\n" #: src/user-defined-types/solution.md msgid "/// A button in the elevator lobby on the given floor.\n" -msgstr "" +msgstr "/// Verilem katta asansör lobisinde bulunan bir düğme.\n" #: src/user-defined-types/solution.md msgid "/// A floor button within the car.\n" -msgstr "" +msgstr "/// Kabinin içindeki bir kat düğmesi.\n" #: src/welcome-day-2.md msgid "Welcome to Day 2" -msgstr "" +msgstr "2. Gün'e Hoş Geldiniz" #: src/welcome-day-2.md msgid "" "Now that we have seen a fair amount of Rust, today will focus on Rust's type " "system:" msgstr "" +"Rust'ı artık yeterince gördüğümüze göre, bugün Rust'ın tür sistemine " +"odaklanacağız:" #: src/welcome-day-2.md msgid "Pattern matching: extracting data from structures." -msgstr "Desen eşleştirme: yapılardan veri çıkarma." +msgstr "Desen eşleştirme (pattern matching): yapılardan veri çıkarma." #: src/welcome-day-2.md msgid "Methods: associating functions with types." -msgstr "" +msgstr "Metotlar: fonksiyonları türlerle ilişkilendirme." #: src/welcome-day-2.md msgid "Traits: behaviors shared by multiple types." msgstr "" +"Özellikler (traits): birden fazla tür tarafından paylaşılan davranışlar." #: src/welcome-day-2.md msgid "Generics: parameterizing types on other types." msgstr "" +"Genelleştirmeler (Generics): türleri diğer türler üzerinden " +"parametrelendirme." #: src/welcome-day-2.md msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" +"Standart kütüphane türleri ve özellikleri (traits): Rust'ın zengin standart " +"kütüphanesinde bir tur." #: src/welcome-day-2.md -msgid "[Welcome](./welcome-day-2.md) (3 minutes)" -msgstr "" +msgid "Closures: function pointers with data." +msgstr "Çevreleyiciler (closures): veriyle birlikte fonksiyon göstericileri." -#: src/welcome-day-2.md -msgid "[Pattern Matching](./pattern-matching.md) (1 hour)" -msgstr "" +#: src/pattern-matching.md src/lifetimes.md +msgid "This segment should take about 50 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 50 dakika sürmelidir. İçeriği:" -#: src/welcome-day-2.md -msgid "[Methods and Traits](./methods-and-traits.md) (50 minutes)" -msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" - -#: src/welcome-day-2.md -msgid "[Generics](./generics.md) (40 minutes)" -msgstr "" - -#: src/welcome-day-2.md +#: src/pattern-matching/infallible.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 55 " -"minutes" +"In day 1 we briefly saw how patterns can be used to _destructure_ compound " +"values. Let's review that and talk about a few other things patterns can " +"express:" msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 55 dakika sürecektir" +"1. günde, desenlerin bileşik değerlerini (compound values) _çözümlemek " +"(destructure)_ için nasıl kullanılabileceğini kısaca görmüştük. Şimdi bunu " +"gözden geçirelim ve desenlerin ifade edebileceği birkaç diğer şey hakkında " +"konuşalım:" -#: src/pattern-matching.md -msgid "[Matching Values](./pattern-matching/match.md) (10 minutes)" -msgstr "" +#: src/pattern-matching/infallible.md +msgid "// This does the same thing as above.\n" +msgstr "// Bu, yukarıdakiyle aynı şeyi yapar.\n" -#: src/pattern-matching.md -msgid "[Destructuring](./pattern-matching/destructuring.md) (10 minutes)" -msgstr "" +#: src/pattern-matching/infallible.md +msgid "// Ignore the first element, only bind the second and third.\n" +msgstr "// İlk elemanı yoksay, sadece ikinci ve üçüncüyü bağla.\n" -#: src/pattern-matching.md -msgid "[Let Control Flow](./pattern-matching/let-control-flow.md) (10 minutes)" -msgstr "" +#: src/pattern-matching/infallible.md +msgid "// Ignore everything but the last element.\n" +msgstr "// Son eleman hariç her şeyi yoksay.\n" -#: src/pattern-matching.md +#: src/pattern-matching/infallible.md src/pattern-matching/match.md +#: src/generics/exercise.md src/generics/solution.md src/std-traits/solution.md +msgid "'a'" +msgstr "'a'" + +#: src/pattern-matching/infallible.md msgid "" -"[Exercise: Expression Evaluation](./pattern-matching/exercise.md) (30 " -"minutes)" +"All of the demonstrated patterns are _irrefutable_, meaning that they will " +"always match the value on the right hand side." msgstr "" +"Gösterilen desenlerin tümü _reddedilemezdir (irrefutable)_, yani her zaman " +"sağ taraftaki değerle eşleşeceklerdir." -#: src/pattern-matching.md src/memory-management.md -msgid "This segment should take about 1 hour" +#: src/pattern-matching/infallible.md +msgid "" +"Patterns are type-specific, including irrefutable patterns. Try adding or " +"removing an element to the tuple and look at the resulting compiler errors." msgstr "" +"Desenler, reddedilemez (irrefutable) desenler de dahil olmak üzere türe " +"özgüdür (type-specific). Demete (tuple) bir eleman eklemeyi veya çıkarmayı " +"deneyin ve ortaya çıkan derleyici hatalarına bakın." + +#: src/pattern-matching/infallible.md +msgid "" +"Variable names are patterns that always match and which bind the matched " +"value into a new variable with that name." +msgstr "" +"Değişken adları her zaman eşleşen ve eşleştikleri değeri bu isimle yeni bir " +"değişkene bağlayan (bind) desenlerdir." + +#: src/pattern-matching/infallible.md +msgid "" +"`_` is a pattern that always matches any value, discarding the matched value." +msgstr "" +"`_` her zaman herhangi bir değerle eşleşen ve eşleşen değeri atan " +"(discarding) bir desendir." + +#: src/pattern-matching/infallible.md +msgid "`..` allows you to ignore multiple values at once." +msgstr "`..` aynı anda birden fazla değeri yok saymanıza olanak tanır." + +#: src/pattern-matching/infallible.md +msgid "" +"You can also demonstrate more advanced usages of `..`, such as ignoring the " +"middle elements of a tuple." +msgstr "" +"Ayrıca, bir demetin (tuple) ortadaki elemanlarını yok saymak gibi `..`'nın " +"daha gelişmiş kullanımlarını da gösterebilirsiniz." + +#: src/pattern-matching/infallible.md +msgid "All of these patterns work with arrays as well:" +msgstr "Bu desenlerin tümü dizilerle (arrays) de çalışır:" #: src/pattern-matching/match.md msgid "" "The `match` keyword lets you match a value against one or more _patterns_. " -"The comparisons are done from top to bottom and the first match wins." -msgstr "" - -#: src/pattern-matching/match.md -msgid "The patterns can be simple values, similarly to `switch` in C and C++:" +"The patterns can be simple values, similarly to `switch` in C and C++, but " +"they can also be used to express more complex conditions:" msgstr "" +"`match` anahtar kelimesi, bir değeri bir veya daha fazla _desene (pattern)_ " +"göre eşleştirmenizi sağlar. Desenler, C ve C++'daki `switch`'e benzer " +"şekilde basit değerler olabilir, ancak daha karmaşık koşulları ifade etmek " +"için de kullanılabilirler:" #: src/pattern-matching/match.md msgid "'x'" -msgstr "" +msgstr "'x'" #: src/pattern-matching/match.md msgid "'q'" -msgstr "" +msgstr "'q'" #: src/pattern-matching/match.md msgid "\"Quitting\"" -msgstr "" - -#: src/pattern-matching/match.md src/generics/exercise.md -#: src/generics/solution.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'a'" -msgstr "" +msgstr "\"Çıkılıyor\"" #: src/pattern-matching/match.md msgid "'s'" -msgstr "" +msgstr "'s'" #: src/pattern-matching/match.md msgid "'w'" -msgstr "" +msgstr "'w'" #: src/pattern-matching/match.md msgid "'d'" -msgstr "" +msgstr "'d'" #: src/pattern-matching/match.md msgid "\"Moving around\"" -msgstr "" +msgstr "\"Etrafta hareket ediliyor\"" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md msgid "'0'" -msgstr "" +msgstr "'0'" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md msgid "'9'" -msgstr "" +msgstr "'9'" #: src/pattern-matching/match.md msgid "\"Number input\"" -msgstr "" +msgstr "\"Sayı girişi\"" #: src/pattern-matching/match.md msgid "\"Lowercase: {key}\"" -msgstr "" +msgstr "\"Küçük harf: {key}\"" #: src/pattern-matching/match.md msgid "\"Something else\"" -msgstr "" - -#: src/pattern-matching/match.md -msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be exhaustive, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." -msgstr "" - -#: src/pattern-matching/match.md -msgid "" -"Match can be used as an expression. Just like `if`, each match arm must have " -"the same type. The type is the last expression of the block, if any. In the " -"example above, the type is `()`." -msgstr "" +msgstr "\"Başka bir şey\"" #: src/pattern-matching/match.md msgid "" "A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." +"can be used within the match arm. We will learn more about this on the next " +"slide." msgstr "" +"Desendeki bir değişken (bu örnekte `key`) eşleşme kolu (match arm) içinde " +"kullanılabilecek bir bağlama (binding) oluşturacaktır. Bunu bir sonraki " +"slaytta daha ayrıntılı öğreneceğiz." #: src/pattern-matching/match.md -msgid "A match guard causes the arm to match only if the condition is true." +msgid "" +"A match guard causes the arm to match only if the condition is true. If the " +"condition is false the match will continue checking later cases." msgstr "" +"Bir eşleşme filtresi (match guard), kolun yalnızca koşul doğruysa " +"eşleşmesine neden olur. Koşul yanlışsa, eşleşme diğer durumları kontrol " +"etmeye devam edecektir." #: src/pattern-matching/match.md msgid "" "You might point out how some specific characters are being used when in a " "pattern" msgstr "" +"Bir desendeyken bazı özel karakterlerin nasıl kullanıldığına dikkat edin" #: src/pattern-matching/match.md msgid "`|` as an `or`" -msgstr "" +msgstr "`|` bir `veya (or)` olarak" #: src/pattern-matching/match.md msgid "`..` can expand as much as it needs to be" -msgstr "" +msgstr "`..` gerektiği kadar genişleyebilir" #: src/pattern-matching/match.md msgid "`1..=5` represents an inclusive range" -msgstr "" +msgstr "`1..=5` kapsayıcı bir aralığı (inclusive range) temsil eder" #: src/pattern-matching/match.md msgid "`_` is a wild card" -msgstr "" +msgstr "`_` bir joker karakterdir" #: src/pattern-matching/match.md msgid "" @@ -5087,6 +5740,9 @@ msgid "" "we wish to concisely express more complex ideas than patterns alone would " "allow." msgstr "" +"Ayrı bir sözdizimi özelliği olarak eşleşme filtreleri (match guards), tek " +"başına desenlerin izin verdiğinden daha karmaşık fikirleri kısaca ifade " +"etmek istediğimizde önemli ve gereklidir." #: src/pattern-matching/match.md msgid "" @@ -5095,114 +5751,235 @@ msgid "" "match arm is selected. Failing the `if` condition inside of that block won't " "result in other arms of the original `match` expression being considered." msgstr "" +"Bunlar, eşleşme kolunun (match arm) içindeki ayrı bir `if` ifadesiyle aynı " +"değildir. Dal (branch) bloğunun içindeki bir `if` ifadesi (`=>`'dan sonra), " +"eşleşme kolu seçildikten sonra gerçekleşir. O bloğun içindeki `if` koşulunun " +"başarısız olması, orijinal `match` ifadesinin diğer kollarının dikkate " +"alınmasıyla sonuçlanmaz." #: src/pattern-matching/match.md msgid "" "The condition defined in the guard applies to every expression in a pattern " "with an `|`." msgstr "" +"Filtrede tanımlanan koşul, bir `|` içeren bir desendeki her ifade için " +"geçerlidir." -#: src/pattern-matching/destructuring.md -msgid "Like tuples, structs and enums can also be destructured by matching:" +#: src/pattern-matching/match.md +msgid "" +"Note that you can't use an existing variable as the condition in a match " +"arm, as it will instead be interpreted as a variable name pattern, which " +"creates a new variable that will shadow the existing one. For example:" msgstr "" +"Bir eşleşme kolunda (match arm) mevcut bir değişkeni koşul olarak " +"kullanamayacağınızı unutmayın, çünkü bunun yerine bir değişken adı deseni " +"(variable name pattern) olarak yorumlanacaktır, bu da mevcut olanı " +"gölgeleyecek (shadow) yeni bir değişken oluşturur. Örneğin:" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/match.md +msgid "\"Expected value is 5, actual is {expected}\"" +msgstr "\"Beklenen değer 5, gerçek değer {expected}\"" + +#: src/pattern-matching/match.md +msgid "\"Value was something else\"" +msgstr "\"Değer başka bir şeydi\"" + +#: src/pattern-matching/match.md +msgid "" +"Here we're trying to match on the number 123, where we want the first case " +"to check if the value is 5. The naive expectation is that the first case " +"won't match because the value isn't 5, but instead this is interpreted as a " +"variable pattern which always matches, meaning the first branch will always " +"be taken. If a constant is used instead this will then work as expected." +msgstr "" +"Burada 123 sayısıyla eşleştirmeye çalışıyoruz, ilk durumun değerin 5 olup " +"olmadığını kontrol etmesini istiyoruz. Doğal beklenti, değer 5 olmadığı için " +"ilk durumun eşleşmeyeceğidir, ancak bunun yerine bu, her zaman eşleşen bir " +"değişken deseni olarak yorumlanır, yani her zaman ilk dal alınacaktır. Bunun " +"yerine bir sabit (constant) kullanılırsa bu beklendiği gibi çalışacaktır." + +#: src/pattern-matching/match.md +msgid "" +"Another piece of pattern syntax you can show students is the `@` syntax " +"which binds a part of a pattern to a variable. For example:" +msgstr "" +"Öğrencilere gösterebileceğiniz başka bir desen sözdizimi parçası, bir " +"desenin bir bölümünü bir değişkene bağlayan `@` sözdizimidir. Örneğin:" + +#: src/pattern-matching/match.md +msgid "\"outer: {outer:?}, inner: {inner}\"" +msgstr "\"dış: {outer:?}, iç: {inner}\"" + +#: src/pattern-matching/match.md +msgid "" +"In this example `inner` has the value 123 which it pulled from the `Option` " +"via destructuring, `outer` captures the entire `Some(inner)` expression, so " +"it contains the full `Option::Some(123)`. This is rarely used but can be " +"useful in more complex patterns." +msgstr "" +"Bu örnekte `inner`, çözümleme (destructuring) yoluyla `Option`'dan çektiği " +"123 değerine sahiptir, `outer` ise tüm `Some(inner)` ifadesini yakalar, bu " +"nedenle tam `Option::Some(123)`'ü içerir. Bu nadiren kullanılır ancak daha " +"karmaşık desenlerde faydalı olabilir." + +#: src/pattern-matching/destructuring-structs.md msgid "Structs" msgstr "Yapılar (Structs)" -#: src/pattern-matching/destructuring.md -msgid "\"x.0 = 1, b = {b}, y = {y}\"" +#: src/pattern-matching/destructuring-structs.md +msgid "Like tuples, Struct can also be destructured by matching:" msgstr "" +"Demetler (tuples) gibi, yapılar (structs) da eşleştirme (matching) yoluyla " +"çözümlenebilir (destructured):" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" -msgstr "" +msgstr "\"y = 2, x = {i:?}\"" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md +msgid "\"x.0 = 1, b = {b}, y = {y}\"" +msgstr "\"x.0 = 1, b = {b}, y = {y}\"" + +#: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" -msgstr "" +msgstr "\"y = {y}, diğer alanlar yoksayıldı\"" -#: src/pattern-matching/destructuring.md -msgid "" -"Patterns can also be used to bind variables to parts of your values. This is " -"how you inspect the structure of your types. Let us start with a simple " -"`enum` type:" -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "\"cannot divide {n} into two equal parts\"" -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "\"{n} divided in two is {half}\"" -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "\"sorry, an error happened: {msg}\"" -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "" -"Here we have used the arms to _destructure_ the `Result` value. In the first " -"arm, `half` is bound to the value inside the `Ok` variant. In the second " -"arm, `msg` is bound to the error message." -msgstr "" - -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md msgid "Change the literal values in `foo` to match with the other patterns." msgstr "" +"`foo`'daki değişmez (literal) değerleri diğer desenlerle eşleşecek şekilde " +"değiştirin." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md msgid "Add a new field to `Foo` and make changes to the pattern as needed." msgstr "" +"`Foo`'ya yeni bir alan ekleyin ve desende gerektiği gibi değişiklikler yapın." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md +msgid "" +"Try `match &foo` and check the type of captures. The pattern syntax remains " +"the same, but the captures become shared references. This is [match " +"ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) and " +"is often useful with `match self` when implementing methods on an enum." +msgstr "" +"`match &foo`'yu deneyin ve yakalanan (captures) değerlerin türünü kontrol " +"edin. Desen sözdizimi aynı kalır, ancak yakalananlar paylaşılan referanslar " +"(shared references) haline gelir. Bu [eşleşme ergonomisidir (match " +"ergonomics)](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) ve " +"bir enum üzerinde metotlar uygularken `match self` ile genellikle " +"kullanışlıdır." + +#: src/pattern-matching/destructuring-structs.md +msgid "" +"The same effect occurs with `match &mut foo`: the captures become exclusive " +"references." +msgstr "" +"Aynı etki `match &mut foo` ile de meydana gelir: yakalanan (captures) " +"değerler özel (exclusive) referanslar haline gelir." + +#: src/pattern-matching/destructuring-structs.md msgid "" "The distinction between a capture and a constant expression can be hard to " "spot. Try changing the `2` in the second arm to a variable, and see that it " "subtly doesn't work. Change it to a `const` and see it working again." msgstr "" +"Bir yakalanan(capture) değer ile bir sabit (constant) ifade arasındaki " +"ayrımı fark etmek zor olabilir. İlk koldaki `2`'yi bir değişken yapmayı " +"deneyin ve çalışmadığını görün. Sonra o değişkeni bir `const` olacak şekilde " +"değiştirin ve tekrar çalıştığını görün." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md +msgid "Like tuples, enums can also be destructured by matching:" +msgstr "" +"Demetler (tuples) gibi, enum'lar da eşleştirme yoluyla çözümlenebilir " +"(destructured):" + +#: src/pattern-matching/destructuring-enums.md +msgid "" +"Patterns can also be used to bind variables to parts of your values. This is " +"how you inspect the structure of your types. Let us start with a simple " +"`enum` type:" +msgstr "" +"Desenler, değişkenleri değerlerinizin parçalarına bağlamak için de " +"kullanılabilir. Türlerinizin yapısını bu şekilde inceleyebilirsiniz. Basit " +"bir `enum` türüyle başlayalım:" + +#: src/pattern-matching/destructuring-enums.md +msgid "\"cannot divide {n} into two equal parts\"" +msgstr "\"{n} iki eşit parçaya bölünemez\"" + +#: src/pattern-matching/destructuring-enums.md +msgid "\"{n} divided in two is {half}\"" +msgstr "\"{n} ikiye bölündüğünde {half}\"" + +#: src/pattern-matching/destructuring-enums.md +msgid "\"sorry, an error happened: {msg}\"" +msgstr "\"üzgünüm, bir hata oluştu: {msg}\"" + +#: src/pattern-matching/destructuring-enums.md +msgid "" +"Here we have used the arms to _destructure_ the `Result` value. In the first " +"arm, `half` is bound to the value inside the `Ok` variant. In the second " +"arm, `msg` is bound to the error message." +msgstr "" +"Burada `Result` değerini _çözümlemek (destructure)_ için kolları (arm) " +"kullandık. İlk kolda, `half`, `Ok` varyantının içindeki değere bağlanır. " +"İkinci kolda, `msg` hata mesajına bağlanır." + +#: src/pattern-matching/destructuring-enums.md msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" +"`if`/`else` ifadesi, daha sonra bir `match` ile açılan (unpacked) bir enum " +"döndürüyor." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "You can try adding a third variant to the enum definition and displaying the " "errors when running the code. Point out the places where your code is now " "inexhaustive and how the compiler tries to give you hints." msgstr "" +"Enum tanımına üçüncü bir varyant eklemeyi ve kodu çalıştırırken hataları " +"göstermeyi deneyebilirsiniz. Kodunuzun artık kapsayıcı olmadığı " +"(inexhaustive) yerlere ve derleyicinin size nasıl ipuçları vermeye " +"çalıştığına dikkat çekin." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "The values in the enum variants can only be accessed after being pattern " "matched." msgstr "" +"Enum varyantlarındaki değerlere yalnızca desen eşleştirmesi yapıldıktan " +"sonra erişilebilir." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "Demonstrate what happens when the search is inexhaustive. Note the advantage " "the Rust compiler provides by confirming when all cases are handled." msgstr "" +"Aramanın kapsayıcı olmadığında (inexhaustive) ne olduğunu gösterin. Rust " +"derleyicisinin tüm durumların ele alındığını onaylayarak sağladığı avantaja " +"dikkat edin." -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it " -"in a loop. That won't compile because `msg` is consumed when matched. To fix " -"it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." +"Demonstrate the syntax for a struct-style variant by adding one to the enum " +"definition and the `match`. Point out how this is syntactically similar to " +"matching on a struct." msgstr "" +"Enum tanımına ve `match`'e bir tane ekleyerek yapı stili (struct-style) bir " +"varyant için sözdizimini (syntax) gösterin. Bunun sözdizimsel olarak bir " +"yapı (struct) üzerinde eşleştirmeye (matching) nasıl benzediğine dikkat " +"çekin." #: src/pattern-matching/let-control-flow.md msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" msgstr "" +"Rust'ın diğer dillerden farklı olan birkaç kontrol akışı yapısı vardır. " +"Bunlar desen eşleştirme (pattern matching) için kullanılır:" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" @@ -5213,123 +5990,207 @@ msgid "`while let` expressions" msgstr "`while let` ifadeleri" #: src/pattern-matching/let-control-flow.md -msgid "`match` expressions" -msgstr "`match` ifadeleri" +msgid "`let else` expressions" +msgstr "`let else` ifadeleri" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/if-let.md msgid "" "The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" "expr.html#if-let-expressions) lets you execute different code depending on " "whether a value matches a pattern:" msgstr "" +"[`if let` ifadesi](https://doc.rust-lang.org/reference/expressions/if-expr." +"html#if-let-expressions), bir değerin bir desenle eşleşip eşleşmediğine " +"bağlı olarak farklı kod çalıştırmanıza olanak tanır:" -#: src/pattern-matching/let-control-flow.md -msgid "\"slept for {:?}\"" -msgstr "" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "\"slept for {duration:?}\"" +msgstr "\"{duration:?} kadar uyunuldu\"" -#: src/pattern-matching/let-control-flow.md -msgid "`let else` expressions" -msgstr "`let else` ifadeleri" - -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/if-let.md msgid "" -"For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " -"- anything but falling off the end of the block)." +"Unlike `match`, `if let` does not have to cover all branches. This can make " +"it more concise than `match`." msgstr "" +"`match`'in aksine, `if let` tüm dalları kapsamak zorunda değildir. Bu onu " +"`match`'den daha özlü (concise) yapabilir." -#: src/pattern-matching/let-control-flow.md -msgid "\"got None\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" +"`Option` ile çalışırken yaygın bir kullanım, `Some` değerlerini işlemektir." -#: src/pattern-matching/let-control-flow.md -msgid "\"got empty string\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "" +"Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" +"`match`'in aksine, `if let` desen eşleştirme için filtre koşul grubu (guard " +"clauses) desteklemez." -#: src/pattern-matching/let-control-flow.md -msgid "\"not a hex digit\"" -msgstr "" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "With an `else` clause, this can be used as an expression." +msgstr "Bir `else` durumuyla, bu bir ifade (expression) olarak kullanılabilir." -#: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md -msgid "\"result: {:?}\"" -msgstr "" - -#: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md -#: src/android/testing.md src/android/testing/googletest.md -msgid "\"foo\"" -msgstr "" - -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " "repeatedly tests a value against a pattern:" msgstr "" +"`if let`'te olduğu gibi, bir değeri tekrar tekrar bir desene göre test eden " +"bir [`while let`](https://doc.rust-lang.org/reference/expressions/loop-expr." +"html#predicate-pattern-loops) çeşidi vardır:" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md +msgid "\"Comprehensive Rust 🦀\"" +msgstr "\"Comprehensive Rust 🦀\"" + +#: src/pattern-matching/let-control-flow/while-let.md +msgid "// (There are more efficient ways to reverse a string!)\n" +msgstr "// (Bir dizeyi tersine çevirmenin daha verimli yolları var!)\n" + +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) returns `Some(c)` until the string is empty, after " "which it will return `None`. The `while let` lets us keep iterating through " "all items." msgstr "" +"Burada [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." +"String.html#method.pop) dize boşalana kadar `Some(c)` döndürür, ardından " +"`None` döndürür. `while let` tüm öğeler arasında adımlamaya (iterating) " +"devam etmemizi sağlar." -#: src/pattern-matching/let-control-flow.md -msgid "if-let" -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make " -"it more concise than `match`." -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "A common usage is handling `Some` values when working with `Option`." -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "" -"Unlike `match`, `if let` does not support guard clauses for pattern matching." -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "let-else" -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports " -"flattening this nested code. Rewrite the awkward version for students, so " -"they can see the transformation." -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "The rewritten version is:" -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "while-let" -msgstr "while-let" - -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "Point out that the `while let` loop will keep going as long as the value " "matches the pattern." msgstr "" +"`while let` döngüsünün, değer desenle eşleştiği sürece devam edeceğine " +"dikkat çekin." -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "You could rewrite the `while let` loop as an infinite loop with an if " "statement that breaks when there is no value to unwrap for `name.pop()`. The " "`while let` provides syntactic sugar for the above scenario." msgstr "" +"`while let` döngüsünü, `name.pop()` için açılacak bir değer olmadığında " +"kesintiye uğrayan bir if ifadesiyle sonsuz bir döngü olarak yeniden " +"yazabilirsiniz. `while let` yukarıdaki senaryo için sözdizimsel kolaylık " +"sağlar." + +#: src/pattern-matching/let-control-flow/while-let.md +msgid "" +"This form cannot be used as an expression, because it may have no value if " +"the condition is false." +msgstr "" +"Bu form bir ifade (expression) olarak kullanılamaz, çünkü koşul yanlışsa " +"hiçbir değeri olmayabilir." + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "`let else` Statements" +msgstr "`let else` Deyimleri" + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "" +"For the common case of matching a pattern and returning from the function, " +"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" +"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"- anything but falling off the end of the block)." +msgstr "" +"Bir deseni eşleştirip fonksiyondan geri dönmenin yaygın durumu için [`let " +"else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) " +"kullanın. \"else\" durumu farklı olmalıdır (diverge) (`return`, `break` veya " +"`panic` - bloğun sonundan çıkmak dışında her şey)." + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"got None\"" +msgstr "\"None alındı\"" + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"got empty string\"" +msgstr "\"boş dize alındı\"" + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"not a hex digit\"" +msgstr "\"onaltılık bir basamak değil\"" + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"result: {:?}\"" +msgstr "\"sonuç: {:?}\"" + +#: src/pattern-matching/let-control-flow/let-else.md +#: src/generics/trait-bounds.md src/testing/solution.md src/android/testing.md +#: src/android/testing/googletest.md +msgid "\"foo\"" +msgstr "\"foo\"" + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "" +"This early return-based control flow is common in Rust error handling code, " +"where you try to get a value out of a `Result`, returning an error if the " +"`Result` was `Err`." +msgstr "" +"Bu erken dönüş tabanlı kontrol akışı (early return-based control flow), Rust " +"hata işleme (error handling) kodunda yaygındır; burada bir `Result`'tan bir " +"değer almaya çalışırsınız ve `Result` `Err` ise bir hata döndürürsünüz." + +#: src/pattern-matching/let-control-flow/let-else.md +msgid "" +"If students ask, you can also demonstrate how real error handling code would " +"be written with `?`." +msgstr "" +"Öğrenciler sorarsa, gerçek hata işleme kodunun `?` ile nasıl yazılacağını da " +"gösterebilirsiniz." #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." msgstr "" +"Aritmetik ifadeler için basit bir özyinelemeli değerlendirici (recursive " +"evaluator) yazalım." + +#: src/pattern-matching/exercise.md +msgid "" +"An example of a small arithmetic expression could be `10 + 20`, which " +"evaluates to `30`. We can represent the expression as a tree:" +msgstr "" +"Küçük bir aritmetik ifadenin bir örneği, `30` olarak değerlendirilen `10 + " +"20` olabilir. İfadeyi bir ağaç olarak temsil edebiliriz:" + +#: src/pattern-matching/exercise.md +msgid "" +"A bigger and more complex expression would be `(10 * 9) + ((3 - 4) * 5)`, " +"which evaluate to `85`. We represent this as a much bigger tree:" +msgstr "" +"Daha büyük ve daha karmaşık bir ifade, `85` olarak değerlendirilen `(10 * 9) " +"+ ((3 - 4) * 5)` olacaktır. Bunu çok daha büyük bir ağaç olarak temsil " +"ediyoruz:" + +#: src/pattern-matching/exercise.md +msgid "In code, we will represent the tree with two types:" +msgstr "Kodda, ağacı iki türle temsil (represent) edeceğiz:" + +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "/// An operation to perform on two subexpressions.\n" +msgstr "" +"/// İki alt ifade (subexpression) üzerinde gerçekleştirilecek bir işlem.\n" + +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "/// An expression, in tree form.\n" +msgstr "/// Ağaç şeklinde bir ifade (expression).\n" + +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "/// An operation on two subexpressions.\n" +msgstr "/// İki alt ifade üzerinde bir işlem.\n" + +#: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "/// A literal value\n" +msgstr "/// Bir değişmez (literal) değer\n" #: src/pattern-matching/exercise.md msgid "" @@ -5338,15 +6199,12 @@ msgid "" "tests. To evaluate a boxed expression, use the deref operator (`*`) to " "\"unbox\" it: `eval(*boxed_expr)`." msgstr "" - -#: src/pattern-matching/exercise.md -msgid "" -"Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." -msgstr "" +"`Box` türü burada bir akıllı göstericidir (smart pointer) ve kursun " +"ilerleyen bölümlerinde ayrıntılı olarak ele alınacaktır. Bir ifade, " +"testlerde görüldüğü gibi `Box::new` ile \"kutulanabilir (boxed)\". " +"Kutulanmış bir ifadeyi değerlendirmek için, onu \"kutudan çıkarmak (unbox)\" " +"için referans kaldırma (deref) operatörünü (`*`) kullanın: " +"`eval(*boxed_expr)`." #: src/pattern-matching/exercise.md msgid "" @@ -5355,113 +6213,83 @@ msgid "" "`todo!()` and get the tests to pass one-by-one. You can also skip a test " "temporarily with `#[ignore]`:" msgstr "" - -#: src/pattern-matching/exercise.md -msgid "" -"If you finish early, try writing a test that results in division by zero or " -"integer overflow. How could you handle this with `Result` instead of a panic?" -msgstr "" - -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An operation to perform on two subexpressions.\n" -msgstr "" - -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An expression, in tree form.\n" -msgstr "" - -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// An operation on two subexpressions.\n" -msgstr "" - -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "/// A literal value\n" -msgstr "" - -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "\"division by zero\"" -msgstr "" - -#: src/pattern-matching/solution.md -msgid "\"expr: {:?}\"" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Methods](./methods-and-traits/methods.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Traits](./methods-and-traits/traits.md) (15 minutes)" -msgstr "[Özellikler](../methods-and-traits/traits.md) (15 dakika)" - -#: src/methods-and-traits.md -msgid "[Deriving](./methods-and-traits/deriving.md) (3 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "" -"[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" -msgstr "" +"Kodu Rust deneme alanına (playground) kopyalayıp yapıştırın ve `eval`'i " +"uygulamaya başlayın. Son ürün testleri geçmelidir. `todo!()` kullanmak ve " +"testleri birer birer geçmek yardımcı olabilir. Bir testi geçici olarak " +"`#[ignore]` ile de atlayabilirsiniz:" #: src/methods-and-traits/methods.md msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" msgstr "" +"Rust, fonksiyonları yeni türlerinizle ilişkilendirmenize (associate) olanak " +"tanır. Bunu bir `impl` bloğu ile yaparsınız:" #: src/methods-and-traits/methods.md msgid "// No receiver, a static method\n" -msgstr "" +msgstr "// Alıcı (receiver) yok, statik bir metot\n" #: src/methods-and-traits/methods.md msgid "// Exclusive borrowed read-write access to self\n" msgstr "" +"// self'e özel (exclusive) ödünç alınmış (borrowed) okuma-yazma erişimi\n" #: src/methods-and-traits/methods.md msgid "// Shared and read-only borrowed access to self\n" msgstr "" +"// self'e paylaşılan ve salt okunur (read-only) ödünç alınmış (borrowed) " +"erişim\n" #: src/methods-and-traits/methods.md msgid "\"Recorded {} laps for {}:\"" -msgstr "" +msgstr "\"{} tur kaydedildi, {} için:\"" #: src/methods-and-traits/methods.md msgid "\"Lap {idx}: {lap} sec\"" -msgstr "" +msgstr "\"Tur {idx}: {lap} sn\"" #: src/methods-and-traits/methods.md -msgid "// Exclusive ownership of self\n" -msgstr "" +msgid "// Exclusive ownership of self (covered later)\n" +msgstr "// self'in özel (exclusive) sahipliği (daha sonra ele alınacak)\n" #: src/methods-and-traits/methods.md msgid "\"Race {} is finished, total lap time: {}\"" -msgstr "" +msgstr "\"Yarış {} bitti, toplam tur süresi: {}\"" #: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" -msgstr "" +msgstr "\"Türkiye Grand Prix\"" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" -msgstr "" +msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" msgstr "" +"`self` argümanları \"alıcıyı (receiver)\" ( metodun üzerinde işlem yaptığı " +"nesne) belirtir. Bir metot için birkaç yaygın alıcı vardır:" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" +"`&self`: nesneyi çağırandan paylaşılan ve değiştirilemez (shared and " +"immutable) bir referans kullanarak ödünç alır (borrows). Nesne daha sonra " +"tekrar kullanılabilir." #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" +"`&mut self`: nesneyi çağırandan benzersiz ve değiştirilebilir (unique and " +"mutable) bir referans kullanarak ödünç alır (borrows). Nesne daha sonra " +"tekrar kullanılabilir." #: src/methods-and-traits/methods.md msgid "" @@ -5470,26 +6298,35 @@ msgid "" "(deallocated) when the method returns, unless its ownership is explicitly " "transmitted. Complete ownership does not automatically mean mutability." msgstr "" +"`self`: nesnenin sahipliğini (ownership) alır ve onu çağırandan uzağa taşır. " +"Metot, nesnenin sahibi olur. Sahipliği açıkça (explicitly) aktarılmadığı " +"sürece, metot geri döndüğünde nesne düşürülür (deallocated). Tam sahiplik " +"otomatik olarak değiştirilebilirlik (mutability) anlamına gelmez." #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." -msgstr "" +msgstr "`mut self`: yukarıdakiyle aynı, ancak metot nesneyi değiştirebilir." #: src/methods-and-traits/methods.md msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." msgstr "" +"Alıcı (receiver) yok: bu, yapı (struct) üzerinde statik bir metot haline " +"gelir. Genellikle geleneksel olarak `new` olarak adlandırılan yapıcılar " +"(constructors) oluşturmak için kullanılır." #: src/methods-and-traits/methods.md msgid "It can be helpful to introduce methods by comparing them to functions." -msgstr "" +msgstr "Metotları fonksiyonlarla karşılaştırarak tanıtmak faydalı olabilir." #: src/methods-and-traits/methods.md msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." msgstr "" +"Metotlar bir türün (bir yapı veya enum gibi) bir örneği üzerinden çağrılır; " +"ilk parametre, örneği (instance) `self` olarak temsil (represents) eder." #: src/methods-and-traits/methods.md msgid "" @@ -5497,34 +6334,57 @@ msgid "" "syntax and to help keep them more organized. By using methods we can keep " "all the implementation code in one predictable place." msgstr "" +"Geliştiriciler, metot alıcı sözdiziminden (method receiver syntax) " +"yararlanmak ve onları daha düzenli tutmaya yardımcı olmak için metotları " +"kullanmayı seçebilirler. Metotları kullanarak tüm gerçekleştirim " +"(implementation) kodunu tek bir öngörülebilir yerde tutabiliriz." + +#: src/methods-and-traits/methods.md +msgid "" +"Note that methods can also be called like associated functions by explicitly " +"passing the receiver in, e.g. `CarRace::add_lap(&mut race, 20)`." +msgstr "" +"Metotların, alıcıyı (receiver) açıkça ileterek ilişkili fonksiyonlar gibi de " +"çağrılabileceğini unutmayın, örn. `CarRace::add_lap(&mut race, 20)`." #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" +"Bir metot alıcısı (receiver) olan `self` anahtar kelimesinin kullanımına " +"dikkat çekin." #: src/methods-and-traits/methods.md msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." msgstr "" +"Bunun `self: Self` için kısaltılmış bir terim olduğunu gösterin ve belki de " +"yapı (struct) adının nasıl kullanılabileceğini de gösterin." #: src/methods-and-traits/methods.md msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." msgstr "" +"`Self`'in, `impl` bloğunun içinde olduğu tür için bir tür takma adı (type " +"alias) olduğunu ve bloğun başka yerlerinde de kullanılabileceğini açıklayın." #: src/methods-and-traits/methods.md msgid "" "Note how `self` is used like other structs and dot notation can be used to " "refer to individual fields." msgstr "" +"`self`'in diğer yapılar gibi nasıl kullanıldığına ve bireysel alanlara " +"(individual fields) atıfta bulunmak için nokta (.) notasyonunun nasıl " +"kullanılabileceğine dikkat edin." #: src/methods-and-traits/methods.md msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." msgstr "" +"`finish`'i iki kez çalıştırmayı deneyerek `&self`'in `self`'ten nasıl farklı " +"olduğunu göstermek için bu iyi bir zaman olabilir." #: src/methods-and-traits/methods.md msgid "" @@ -5532,51 +6392,63 @@ msgid "" "doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " "receiver types, such as `Box`." msgstr "" +"`self` üzerindeki varyantların ötesinde, `Box` gibi alıcı (receiver) " +"türleri olmasına izin verilen [özel sarmalayıcı türleri](https://doc.rust-" +"lang.org/reference/special-types-and-traits.html) de vardır." #: src/methods-and-traits/traits.md msgid "" "Rust lets you abstract over types with traits. They're similar to interfaces:" msgstr "" +"Rust, özellikler (traits) ile türler üzerinde soyutlama yapmanıza olanak " +"tanır. Arayüzlere (interfaces) benzerler:" #: src/methods-and-traits/traits.md msgid "/// Return a sentence from this pet.\n" -msgstr "" +msgstr "/// Bu evcil hayvandan bir cümle döndürün.\n" #: src/methods-and-traits/traits.md msgid "/// Print a string to the terminal greeting this pet.\n" -msgstr "" +msgstr "/// Bu evcil hayvanı selamlayan bir dizeyi terminale yazdırın.\n" #: src/methods-and-traits/traits.md msgid "" "A trait defines a number of methods that types must have in order to " "implement the trait." msgstr "" +"Bir özellik (trait), türlerin özelliği gerçekleştirmek (implement) için " +"sahip olması gereken bir dizi metodu tanımlar." #: src/methods-and-traits/traits.md msgid "" "In the \"Generics\" segment, next, we will see how to build functionality " "that is generic over all types implementing a trait." msgstr "" +"Bir sonraki \"Genelleştirmeler (Generics)\" bölümünde, bir özelliği (trait) " +"gerçekleştiren tüm türler üzerinde jenerik olan fonksiyonelliğin nasıl " +"oluşturulacağını göreceğiz." #: src/methods-and-traits/traits/implementing.md msgid "\"Oh you're a cutie! What's your name? {}\"" -msgstr "" +msgstr "\"Ah sen ne şirinsin! Adın ne? {}\"" -#: src/methods-and-traits/traits/implementing.md +#: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Woof, my name is {}!\"" -msgstr "" +msgstr "\"Hav, benim adım {}!\"" -#: src/methods-and-traits/traits/implementing.md +#: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Fido\"" -msgstr "" +msgstr "\"Fido\"" #: src/methods-and-traits/traits/implementing.md msgid "" "To implement `Trait` for `Type`, you use an `impl Trait for Type { .. }` " "block." msgstr "" +"`Type` için `Trait`'i gerçekleştirmek (implement) üzere bir `impl Trait for " +"Type { .. }` bloğu kullanırsınız." #: src/methods-and-traits/traits/implementing.md msgid "" @@ -5584,6 +6456,9 @@ msgid "" "type with a `talk()` method would not automatically satisfy `Pet` unless it " "is in an `impl Pet` block." msgstr "" +"Go arayüzlerinin (interfaces) aksine, sadece eşleşen metotlara sahip olmak " +"yeterli değildir: `talk()` metoduna sahip bir `Cat` türü, bir `impl Pet` " +"bloğunda olmadığı sürece `Pet`'i otomatik olarak karşılamaz." #: src/methods-and-traits/traits/implementing.md msgid "" @@ -5591,6 +6466,22 @@ msgid "" "implementations can rely on all the methods of the trait. In this case, " "`greet` is provided, and relies on `talk`." msgstr "" +"Özellikler (traits), bazı metotların varsayılan gerçekleştirmelerini " +"(implementations) sağlayabilir. Varsayılan gerçekleştirmeler, özelliğin tüm " +"metotlarına dayanabilir. Bu durumda, `greet` sağlanır ve `talk`'a dayanır." + +#: src/methods-and-traits/traits/implementing.md +msgid "" +"Multiple `impl` blocks are allowed for a given type. This includes both " +"inherent `impl` blocks and trait `impl` blocks. Likewise multiple traits can " +"be implemented for a given type (and often types implement many traits!). " +"`impl` blocks can even be spread across multiple modules/files." +msgstr "" +"Belirli bir tür için birden fazla `impl` bloğuna izin verilir. Bu hem doğal " +"`impl` bloklarını hem de özellik (trait) `impl` bloklarını içerir. Aynı " +"şekilde belirli bir tür için birden fazla özellik gerçekleştirilebilir (ve " +"genellikle türler birçok özelliği gerçekleştirir!). `impl` blokları birden " +"fazla modüle/dosyaya bile yayılabilir." #: src/methods-and-traits/traits/supertraits.md msgid "" @@ -5598,15 +6489,18 @@ msgid "" "called _supertraits_. Here, any type implementing `Pet` must implement " "`Animal`." msgstr "" +"Bir özellik (trait), onu gerçekleştiren türlerin _üstözellikler " +"(supertraits)_ olarak adlandırılan diğer özellikleri de gerçekleştirmesini " +"gerektirebilir. Burada, `Pet`'i gerçekleştiren herhangi bir tür `Animal`'ı " +"da gerçekleştirmelidir." #: src/methods-and-traits/traits/supertraits.md -#: src/async/control-flow/select.md msgid "\"Rex\"" -msgstr "" +msgstr "\"Rex\"" #: src/methods-and-traits/traits/supertraits.md msgid "\"{} has {} legs\"" -msgstr "" +msgstr "\"{}, {} bacağa sahip\"" #: src/methods-and-traits/traits/supertraits.md msgid "" @@ -5614,15 +6508,21 @@ msgid "" "expect this to behave like OO inheritance. It just specifies an additional " "requirement on implementations of a trait." msgstr "" +"Bu bazen \"özellik kalıtımı (trait inheritance)\" olarak adlandırılır ancak " +"öğrencilerin bunun nesne yönelimli kalıtım (OO inheritance) gibi " +"davranmasını beklememesi gerekir. Bu sadece bir özelliğin gerçekleştirmeleri " +"üzerinde ek bir gereksinimi (requirement) belirtir." #: src/methods-and-traits/traits/associated-types.md msgid "" "Associated types are placeholder types which are supplied by the trait " "implementation." msgstr "" +"İlişkili türler (associated types), özellik (trait) gerçekleştirimi " +"tarafından sağlanan yer tutucu (placeholder) türlerdir." #: src/methods-and-traits/traits/associated-types.md -#: src/async/control-flow/join.md +#: src/lifetimes/lifetime-elision.md msgid "\"{:?}\"" msgstr "\"{:?}\"" @@ -5631,38 +6531,46 @@ msgid "" "Associated types are sometimes also called \"output types\". The key " "observation is that the implementer, not the caller, chooses this type." msgstr "" +"İlişkili türler (associated types) bazen \"çıktı türleri (output types)\" " +"olarak da adlandırılır. Anahtar gözlem, bu türü çağıranın değil, " +"gerçekleştirenin (implementer) seçmesidir." #: src/methods-and-traits/traits/associated-types.md msgid "" "Many standard library traits have associated types, including arithmetic " "operators and `Iterator`." msgstr "" +"Aritmetik operatörler ve `Iterator` da dahil olmak üzere birçok standart " +"kütüphane özelliğinin (traits) ilişkili türleri vardır." #: src/methods-and-traits/deriving.md msgid "" "Supported traits can be automatically implemented for your custom types, as " "follows:" msgstr "" +"Desteklenen özellikler (traits), özel türleriniz için aşağıdaki gibi " +"otomatik olarak gerçekleştirilebilir (implemented):" #: src/methods-and-traits/deriving.md msgid "// Default trait adds `default` constructor.\n" msgstr "" +"// Default özelliği (trait) `default` yapıcısını (constructor) ekler.\n" #: src/methods-and-traits/deriving.md msgid "// Clone trait adds `clone` method.\n" -msgstr "" +msgstr "// Clone özelliği (trait) `clone` metodunu ekler.\n" #: src/methods-and-traits/deriving.md msgid "\"EldurScrollz\"" -msgstr "" +msgstr "\"EldurScrollz\"" #: src/methods-and-traits/deriving.md msgid "// Debug trait adds support for printing with `{:?}`.\n" -msgstr "" +msgstr "// Debug özelliği (trait) `{:?}` ile yazdırma desteği ekler.\n" #: src/methods-and-traits/deriving.md -msgid "\"{:?} vs. {:?}\"" -msgstr "" +msgid "\"{p1:?} vs. {p2:?}\"" +msgstr "\"{p1:?} vs. {p2:?}\"" #: src/methods-and-traits/deriving.md msgid "" @@ -5670,10 +6578,37 @@ msgid "" "macros to add useful functionality. For example, `serde` can derive " "serialization support for a struct using `#[derive(Serialize)]`." msgstr "" +"Türetme (derivation), makrolarla gerçekleştirilir (implemented) ve birçok " +"kasa (crate) kullanışlı fonksiyonellik eklemek için faydalı türetme (derive) " +"makroları sağlar. Örneğin, `serde`, `#[derive(Serialize)]` kullanarak bir " +"yapı (struct) için serileştirme desteği türetebilir." + +#: src/methods-and-traits/deriving.md +msgid "" +"Derivation is usually provided for traits that have a common boilerplate-y " +"implementation that is correct for most cases. For example, demonstrate how " +"a manual `Clone` impl can be repetitive compared to deriving the trait:" +msgstr "" +"Türetme (derivation) genellikle, çoğu durum için doğru olan yaygın bir " +"basmakalıpsal (boilerplate-y) gerçekleştirmeye sahip özellikler (traits) " +"için sağlanır. Örneğin, bir manuel `Clone` gerçekleştiriminin (impl) " +"özelliği (trait) türetmeye kıyasla nasıl tekrarlanabilen bir yapıda " +"olabileceğini gösterin:" + +#: src/methods-and-traits/deriving.md +msgid "" +"Not all of the `.clone()`s in the above are necessary in this case, but this " +"demonstrates the generally boilerplate-y pattern that manual impls would " +"follow, which should help make the use of `derive` clear to students." +msgstr "" +"Yukarıdaki `.clone()`'ların hepsi bu durumda gerekli değildir, ancak bu, " +"manuel gerçekleştirmelerin (impls) izleyeceği genel basmakalıpsal " +"(boilerplate-y) deseni gösterir, bu da öğrencilere `derive` kullanımını " +"netleştirmeye yardımcı olmalıdır." #: src/methods-and-traits/exercise.md msgid "Exercise: Logger Trait" -msgstr "Alıştırma: Kaydedici Özellik" +msgstr "Alıştırma: Kaydedici Özelliği (Logger Trait)" #: src/methods-and-traits/exercise.md msgid "" @@ -5682,6 +6617,11 @@ msgid "" "In testing, this might put messages in the test logfile, while in a " "production build it would send messages to a log server." msgstr "" +"Bir `log` metoduna sahip bir `Logger` özelliği (trait) kullanarak basit bir " +"kayıt (logging) aracı tasarlayalım. İlerlemesini kaydedebilecek kod daha " +"sonra bir `&impl Logger` alabilir. Testte bu, mesajları test kayıt dosyasına " +"(logfile) koyabilirken, bir üretim (production) inşasında mesajları bir " +"kayıt sunucusuna (log server) gönderir." #: src/methods-and-traits/exercise.md msgid "" @@ -5689,98 +6629,138 @@ msgid "" "verbosity. Your task is to write a `VerbosityFilter` type that will ignore " "messages above a maximum verbosity." msgstr "" +"Ancak, aşağıda verilen `StderrLogger` ayrıntı seviyesine (verbosity) " +"bakılmaksızın tüm mesajları kaydeder. Göreviniz, maksimum ayrıntı seviyesi " +"üzerindeki mesajları yoksayacak bir `VerbosityFilter` türü yazmaktır." #: src/methods-and-traits/exercise.md msgid "" "This is a common pattern: a struct wrapping a trait implementation and " -"implementing that same trait, adding behavior in the process. What other " -"kinds of wrappers might be useful in a logging utility?" +"implementing that same trait, adding behavior in the process. In the " +"\"Generics\" segment this afternoon, we will see how to make the wrapper " +"generic over the wrapped type." msgstr "" +"Bu yaygın bir desendir: bir özellik gerçekleştirmesini (trait " +"implementation) saran ve aynı özelliği gerçekleştiren, süreçte davranış " +"ekleyen bir yapı (struct). \"Genelleştirmeler (Generics)\" bölümünde, " +"sarmalayıcıyı (wrapper) sarılmış tür (wrapped type) üzerinde genelleştirmeyi " +"(generic) göreceğiz." #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md msgid "/// Log a message at the given verbosity level.\n" -msgstr "" +msgstr "/// Belirtilen ayrıntı seviyesinde bir mesaj kaydedin.\n" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md msgid "\"verbosity={verbosity}: {message}\"" -msgstr "" +msgstr "\"ayrıntı seviyesi={verbosity}: {message}\"" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md -msgid "\"FYI\"" -msgstr "" - -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md -msgid "\"Uhoh\"" -msgstr "" - -#: src/methods-and-traits/exercise.md -msgid "// TODO: Define and implement `VerbosityFilter`.\n" -msgstr "" - -#: src/methods-and-traits/solution.md +#: src/generics/generic-data.md msgid "/// Only log messages up to the given verbosity level.\n" msgstr "" +"/// Yalnızca belirtilen ayrıntı seviyesine kadar olan mesajları kaydedin.\n" + +#: src/methods-and-traits/exercise.md +msgid "// TODO: Implement the `Logger` trait for `VerbosityFilter`.\n" +msgstr "" +"// TODO: `VerbosityFilter` için `Logger` özelliğini (trait) gerçekleştirin.\n" + +#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md +msgid "\"FYI\"" +msgstr "\"Bilginiz Olsun\"" + +#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md +msgid "\"Uhoh\"" +msgstr "\"Eyvah\"" #: src/generics.md -msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" -msgstr "" +msgid "impl Trait" +msgstr "impl Trait" #: src/generics.md -msgid "[Generic Data Types](./generics/generic-data.md) (10 minutes)" -msgstr "" +msgid "dyn Trait" +msgstr "dyn Trait" #: src/generics.md -msgid "[Trait Bounds](./generics/trait-bounds.md) (10 minutes)" -msgstr "" - -#: src/generics.md -msgid "[impl Trait](./generics/impl-trait.md) (5 minutes)" -msgstr "" - -#: src/generics.md -msgid "[Exercise: Generic min](./generics/exercise.md) (10 minutes)" -msgstr "" +msgid "Exercise: Generic min" +msgstr "Alıştırma: Genelleştirilmiş min" #: src/generics/generic-functions.md msgid "" "Rust supports generics, which lets you abstract algorithms or data " "structures (such as sorting or a binary tree) over the types used or stored." msgstr "" - -#: src/generics/generic-functions.md -msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" -msgstr "" +"Rust, algoritmaları veya veri yapılarını (sıralama veya ikili ağaç gibi) " +"kullanılan veya depolanan türler üzerinde soyutlamanıza olanak tanıyan " +"genelleştirmeleri (generics) destekler." #: src/generics/generic-functions.md msgid "\"picked a number: {:?}\"" -msgstr "" +msgstr "\"bir sayı seçildi: {:?}\"" #: src/generics/generic-functions.md -msgid "\"picked a tuple: {:?}\"" -msgstr "" +msgid "\"picked a string: {:?}\"" +msgstr "\"bir dize seçildi: {:?}\"" #: src/generics/generic-functions.md -msgid "\"dog\"" -msgstr "" +msgid "'L'" +msgstr "'L'" #: src/generics/generic-functions.md -msgid "\"cat\"" +msgid "'R'" +msgstr "'R'" + +#: src/generics/generic-functions.md +msgid "" +"It can be helpful to show the monomorphized versions of `pick`, either " +"before talking about the generic `pick` in order to show how generics can " +"reduce code duplication, or after talking about generics to show how " +"monomorphization works." msgstr "" +"Genelleştirmelerin (generics) kod tekrarını nasıl azaltabileceğini göstermek " +"için genelleştirilmiş `pick`'ten önce veya genelleştirmelerden sonra tek " +"biçimli hâle getirmenin (monomorphization) nasıl çalıştığını göstermek için " +"`pick`'in tek biçimli hâle getirilmiş (monomorphized) sürümlerini göstermek " +"faydalı olabilir." #: src/generics/generic-functions.md msgid "" "Rust infers a type for T based on the types of the arguments and return " "value." msgstr "" +"Rust, argümanların ve dönüş değerinin türlerine dayanarak T için bir tür " +"çıkarır (infers)." + +#: src/generics/generic-functions.md +msgid "" +"In this example we only use the primitive types `i32` and `char` for `T`, " +"but we can use any type here, including user-defined types:" +msgstr "" +"Bu örnekte `T` için yalnızca ilkel (primitive) `i32` ve `char` türlerini " +"kullanıyoruz, ancak burada kullanıcı tanımlı türler (user-defined types) de " +"dahil olmak üzere herhangi bir türü kullanabiliriz:" #: src/generics/generic-functions.md msgid "" "This is similar to C++ templates, but Rust partially compiles the generic " "function immediately, so that function must be valid for all types matching " -"the constraints. For example, try modifying `pick` to return `even + odd` if " -"`n == 0`. Even if only the `pick` instantiation with integers is used, Rust " -"still considers it invalid. C++ would let you do this." +"the constraints. For example, try modifying `pick` to return `left + right` " +"if `cond` is false. Even if only the `pick` instantiation with integers is " +"used, Rust still considers it invalid. C++ would let you do this." msgstr "" +"Bu, C++ şablonlarına (templates) benzer, ancak Rust, genelleştirilmiş " +"(generic) fonksiyonu kısmen de olsa anında derler, bu nedenle bu fonksiyon " +"kısıtlamalarla (constraints) eşleşen tüm türler için geçerli olmalıdır. " +"Örneğin, `cond` yanlışsa `left + right` döndürmek için `pick`'i değiştirmeyi " +"deneyin. Yalnızca tamsayılarla `pick` örneği kullanılsa bile, Rust bunu yine " +"de geçersiz kabul eder. C++ bunu yapmanıza izin verirdi." #: src/generics/generic-functions.md msgid "" @@ -5788,87 +6768,164 @@ msgid "" "is a zero-cost abstraction: you get exactly the same result as if you had " "hand-coded the data structures without the abstraction." msgstr "" +"Genelleştirilmiş (generic) kod, çağrıldığı yerlerde (call sites) " +"genelleştirilmemiş (özelleştirilmiş) koda dönüştürülür. Bu, sıfır maliyetli " +"bir soyutlamadır: soyutlama olmadan veri yapılarını elle kodlamış olsaydınız " +"alacağınız sonucun aynısını elde edersiniz." -#: src/generics/generic-data.md -msgid "You can use generics to abstract over the concrete field type:" +#: src/generics/trait-bounds.md +msgid "" +"When working with generics, you often want to require the types to implement " +"some trait, so that you can call this trait's methods." msgstr "" +"Genelleştirmelerle (generics) çalışırken, genellikle türlerin bazı " +"özellikleri (trait) gerçekleştirmesini (implement) istersiniz, böylece bu " +"özelliğin metotlarını çağırabilirsiniz." -#: src/generics/generic-data.md -msgid "// fn set_x(&mut self, x: T)\n" -msgstr "" +#: src/generics/trait-bounds.md +msgid "You can do this with `T: Trait`:" +msgstr "Bunu `T: Trait` ile yapabilirsiniz:" -#: src/generics/generic-data.md -msgid "\"{integer:?} and {float:?}\"" -msgstr "" +#: src/generics/trait-bounds.md +msgid "\"{pair:?}\"" +msgstr "\"{pair:?}\"" -#: src/generics/generic-data.md -msgid "\"coords: {:?}\"" +#: src/generics/trait-bounds.md +msgid "Try making a `NotCloneable` and passing it to `duplicate`." +msgstr "Bir `NotCloneable` yapıp `duplicate`'e geçirmeyi deneyin." + +#: src/generics/trait-bounds.md +msgid "When multiple traits are necessary, use `+` to join them." msgstr "" +"Birden fazla özellik (trait) gerektiğinde, bunları birleştirmek için `+` " +"kullanın." + +#: src/generics/trait-bounds.md +msgid "Show a `where` clause, students will encounter it when reading code." +msgstr "" +"Öğrencilerin kod okurken karşılaşacakları bir `where` yan tümcesi gösterin." + +#: src/generics/trait-bounds.md +msgid "It declutters the function signature if you have many parameters." +msgstr "" +"Çok sayıda parametreniz varsa fonksiyon imzasını (signature) sadeleştirir." + +#: src/generics/trait-bounds.md +msgid "It has additional features making it more powerful." +msgstr "Daha güçlü kılan ek özelliklere sahiptir." + +#: src/generics/trait-bounds.md +msgid "" +"If someone asks, the extra feature is that the type on the left of \":\" can " +"be arbitrary, like `Option`." +msgstr "" +"Birisi sorarsa, ekstra özellik, \":\" solundaki türün `Option` gibi keyfi " +"olabilmesidir." + +#: src/generics/trait-bounds.md +msgid "" +"Note that Rust does not (yet) support specialization. For example, given the " +"original `duplicate`, it is invalid to add a specialized `duplicate(a: u32)`." +msgstr "" +"Rust'ın (şimdilik) özelleştirmeyi (specialization) desteklemediğini " +"unutmayın. Örneğin, orijinal `duplicate` verildiğinde, özel bir " +"`duplicate(a: u32)` eklemek geçersizdir." #: src/generics/generic-data.md msgid "" -"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " -"redundant?" +"You can use generics to abstract over the concrete field type. Returning to " +"the exercise for the previous segment:" msgstr "" +"Belirli alan türü (concrete field type) üzerinde soyutlama yapmak için " +"genelleştirmeleri (generics) kullanabilirsiniz. Önceki bölümün alıştırmasına " +"dönersek:" + +#: src/generics/generic-data.md +msgid "" +"_Q:_ Why `L` is specified twice in `impl .. VerbosityFilter`? " +"Isn't that redundant?" +msgstr "" +"_S:_ Neden `L`, `impl .. VerbosityFilter`'de iki kez " +"belirtiliyor? Bu gereksiz (redundant) değil mi?" #: src/generics/generic-data.md msgid "" "This is because it is a generic implementation section for generic type. " "They are independently generic." msgstr "" +"Bunun nedeni, genelleştirilmiş (generic) tür için genel bir gerçekleştirme " +"bölümü (generic implementation section) olmasıdır. Onlar, bağımsız olarak " +"genelleştirilmiştir (generic)." #: src/generics/generic-data.md -msgid "It means these methods are defined for any `T`." -msgstr "" +msgid "It means these methods are defined for any `L`." +msgstr "Bu, bu metotların herhangi bir `L` için tanımlandığı anlamına gelir." #: src/generics/generic-data.md -msgid "It is possible to write `impl Point { .. }`." -msgstr "" +msgid "It is possible to write `impl VerbosityFilter { .. }`." +msgstr "`impl VerbosityFilter { .. }` yazmak mümkündür." #: src/generics/generic-data.md msgid "" -"`Point` is still generic and you can use `Point`, but methods in this " -"block will only be available for `Point`." +"`VerbosityFilter` is still generic and you can use `VerbosityFilter`, " +"but methods in this block will only be available for " +"`VerbosityFilter`." msgstr "" +"`VerbosityFilter` hala genelleştirilmiştir türdür ve `VerbosityFilter` " +"türünü kullanabilirsiniz, ancak bu bloktaki metotlar yalnızca " +"`VerbosityFilter` için mevcut olacaktır." #: src/generics/generic-data.md msgid "" -"Try declaring a new variable `let p = Point { x: 5, y: 10.0 };`. Update the " -"code to allow points that have elements of different types, by using two " -"type variables, e.g., `T` and `U`." +"Note that we don't put a trait bound on the `VerbosityFilter` type itself. " +"You can put bounds there as well, but generally in Rust we only put the " +"trait bounds on the impl blocks." msgstr "" +"`VerbosityFilter` türünün kendisine bir özellik sınırı (trait " +"bound)koymadığımıza dikkat edin. Oraya da sınırlar koyabilirsiniz, ancak " +"genellikle Rust'ta özellik sınırlarını (trait bounds) yalnızca `impl` " +"bloklarına koyarız." #: src/generics/generic-traits.md msgid "" "Traits can also be generic, just like types and functions. A trait's " -"parameters get concrete types when it is used." +"parameters get concrete types when it is used. For example the [`From`]" +"(https://doc.rust-lang.org/std/convert/trait.From.html) trait is used to " +"define type conversions:" msgstr "" +"Özellikler (traits), tıpkı türler ve fonksiyonlar gibi genelleştirilmiş " +"(generic) de olabilir. Bir özelliğin parametreleri, kullanıldığında belirli " +"(concrete) türler alır. Örneğin, [`From`](https://doc.rust-lang.org/std/" +"convert/trait.From.html) özelliği tür dönüşümlerini (type conversions) " +"tanımlamak için kullanılır:" #: src/generics/generic-traits.md msgid "\"Converted from integer: {from}\"" -msgstr "" +msgstr "\"Tamsayıdan dönüştürüldü: {from}\"" #: src/generics/generic-traits.md msgid "\"Converted from bool: {from}\"" -msgstr "" - -#: src/generics/generic-traits.md -msgid "\"{from_int:?}, {from_bool:?}\"" -msgstr "" +msgstr "\"Bool'dan dönüştürüldü: {from}\"" #: src/generics/generic-traits.md msgid "" "The `From` trait will be covered later in the course, but its [definition in " "the `std` docs](https://doc.rust-lang.org/std/convert/trait.From.html) is " -"simple." +"simple, and copied here for reference." msgstr "" +"`From` özelliği (trait) kursun ilerleyen bölümlerinde ele alınacaktır, ancak " +"[`std` belgelerindeki tanımı](https://doc.rust-lang.org/std/convert/trait." +"From.html) basittir ve referans için buraya kopyalanmıştır." #: src/generics/generic-traits.md msgid "" "Implementations of the trait do not need to cover all possible type " -"parameters. Here, `Foo::From(\"hello\")` would not compile because there is " +"parameters. Here, `Foo::from(\"hello\")` would not compile because there is " "no `From<&str>` implementation for `Foo`." msgstr "" +"Özelliğin (trait) gerçekleştirmeleri (implementations), olası tüm tür " +"parametrelerini kapsamak zorunda değildir. Burada, `Foo` için `From<&str>` " +"gerçekleştirmesi olmadığından `Foo::from(\"hello\")` derlenmezdi." #: src/generics/generic-traits.md msgid "" @@ -5876,6 +6933,10 @@ msgid "" "\"output\" type. A trait can have multiple implementations for different " "input types." msgstr "" +"Genelleştirilmiş (generic) özellikler (traits) türleri \"girdi\" olarak " +"alırken, ilişkili türler (associated types) bir tür \"çıktı\" türüdür. Bir " +"özelliğin farklı girdi türleri için birden çok gerçekleştirmesi " +"(implementation) olabilir." #: src/generics/generic-traits.md msgid "" @@ -5885,92 +6946,44 @@ msgid "" "[specialization](https://rust-lang.github.io/rfcs/1210-impl-specialization." "html)." msgstr "" - -#: src/generics/trait-bounds.md -msgid "" -"When working with generics, you often want to require the types to implement " -"some trait, so that you can call this trait's methods." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "You can do this with `T: Trait` or `impl Trait`:" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "// struct NotClonable;\n" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "\"{pair:?}\"" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "Try making a `NonClonable` and passing it to `duplicate`." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "When multiple traits are necessary, use `+` to join them." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "Show a `where` clause, students will encounter it when reading code." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "It declutters the function signature if you have many parameters." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "It has additional features making it more powerful." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "" -"If someone asks, the extra feature is that the type on the left of \":\" can " -"be arbitrary, like `Option`." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "" -"Note that Rust does not (yet) support specialization. For example, given the " -"original `duplicate`, it is invalid to add a specialized `duplicate(a: u32)`." -msgstr "" +"Aslında, Rust herhangi bir T türü için bir özelliğin (trait) en fazla bir " +"gerçekleştiriminin (implementation) eşleşmesini gerektirir. Diğer bazı " +"dillerden farklı olarak, Rust'ın \"en spesifik\" eşleşmeyi seçmek için bir " +"sezgisi (heuristic) yoktur. Bu desteği eklemek için [özelleştirme " +"(specialization)](https://rust-lang.github.io/rfcs/1210-impl-specialization." +"html) adı verilen bir çalışma vardır." #: src/generics/impl-trait.md msgid "" "Similar to trait bounds, an `impl Trait` syntax can be used in function " "arguments and return values:" msgstr "" +"Özellik sınırlarına (trait bounds) benzer şekilde, fonksiyon argümanlarında " +"ve geri dönüş değerlerinde bir `impl Trait` sözdizimi kullanılabilir:" #: src/generics/impl-trait.md msgid "" "// Syntactic sugar for:\n" "// fn add_42_millions>(x: T) -> i32 {\n" msgstr "" - -#: src/generics/impl-trait.md -msgid "\"{many}\"" -msgstr "" - -#: src/generics/impl-trait.md -msgid "\"{many_more}\"" -msgstr "" - -#: src/generics/impl-trait.md -msgid "\"debuggable: {debuggable:?}\"" -msgstr "" +"// Sözdizimsel kolaylık:\n" +"// fn add_42_millions>(x: T) -> i32 {\n" #: src/generics/impl-trait.md msgid "" "`impl Trait` allows you to work with types which you cannot name. The " "meaning of `impl Trait` is a bit different in the different positions." msgstr "" +"`impl Trait`, isimlendiremeyeceğiniz türlerle çalışmanıza olanak tanır. " +"`impl Trait`'in anlamı farklı konumlarda biraz farklıdır." #: src/generics/impl-trait.md msgid "" "For a parameter, `impl Trait` is like an anonymous generic parameter with a " "trait bound." msgstr "" +"Bir parametre için, `impl Trait` bir özellik sınırına (trait bound) sahip " +"anonim bir genelleştirilmiş (generic) parametre gibidir." #: src/generics/impl-trait.md msgid "" @@ -5978,6 +6991,10 @@ msgid "" "implements the trait, without naming the type. This can be useful when you " "don't want to expose the concrete type in a public API." msgstr "" +"Bir geri dönüş türü için, bu, geri dönüş türünün, türü isimlendirmeden " +"özelliği (trait) gerçekleştiren (implement) bir belirli (concrete) tür " +"olduğu anlamına gelir. Bu, genel bir API'de belirli olan türü açığa çıkarmak " +"istemediğinizde kullanışlı olabilir." #: src/generics/impl-trait.md msgid "" @@ -5988,12 +7005,121 @@ msgid "" "`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" ">()`." msgstr "" +"Geri dönüş konumunda (return position) çıkarım (inference) yapmak zordur. " +"`impl Foo` döndüren bir fonksiyon, döndürdüğü belirli olan türü kaynakta " +"yazmadan seçer. `collect() -> B` gibi genelleştirilmiş bir tür döndüren " +"bir fonksiyon, `B`'yi sağlayan herhangi bir türü geri döndürebilir ve " +"çağıranın, `let x: Vec<_> = foo.collect()` veya tür belirteciyle (turbo " +"balığı / turbofish) ile `foo.collect::>()` gibi birini seçmesi " +"gerekebilir." #: src/generics/impl-trait.md msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." msgstr "" +"`debuggable`'ın türü nedir? Hata mesajının ne gösterdiğini görmek için `let " +"debuggable: () = ..`'yi deneyin." + +#: src/generics/dyn-trait.md +msgid "" +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" +msgstr "" +"Rust, genelleştirmeler (generics) yoluyla statik yönlendirme (static " +"dispatch) için özellikleri (trait) kullanmaya ek olarak, özellik nesneleri " +"(trait objects) yoluyla silinmiş türle (type-erased), dinamik yönlendirmeyi " +"(dynamic dispatch) destekler:" + +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md +msgid "\"Miau!\"" +msgstr "\"Miyav!\"" + +#: src/generics/dyn-trait.md +msgid "// Uses generics and static dispatch.\n" +msgstr "" +"// Genelleştirmeleri (generics) ve statik yönlendirmeyi (static dispatch) " +"kullanır.\n" + +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md +msgid "\"Hello, who are you? {}\"" +msgstr "\"Merhaba, nasılsın? {}\"" + +#: src/generics/dyn-trait.md +msgid "// Uses type-erasure and dynamic dispatch.\n" +msgstr "" +"// Tür silmeyi (type-erasure) ve dinamik yönlendirmeyi (dynamic dispatch) " +"kullanır.\n" + +#: src/generics/dyn-trait.md +msgid "" +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." +msgstr "" +"`impl Trait` de dahil olmak üzere genelleştirmeler (generics), " +"genelleştirmenin oluşturulduğu her farklı tür için fonksiyonun özel bir " +"örneğini oluşturmak üzere tek biçimli hâle getirmeyi (monomorphization) " +"kullanır. Bu, genelleştirilmiş bir fonksiyon içinden bir özellik (trait) " +"metodunu çağırmanın hala statik yönlendirme (static dispatch) kullandığı " +"anlamına gelir, çünkü derleyici tam tür bilgisine sahiptir ve hangi türün " +"özellik gerçekleştiriminin (trait implementation) kullanılacağını çözebilir." + +#: src/generics/dyn-trait.md +msgid "" +"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " +"This means that there's a single version of `fn dynamic` that is used " +"regardless of what type of `Pet` is passed in." +msgstr "" +"`dyn Trait` kullanırken, bunun yerine bir [sanal metot tablosu (virtual " +"method table)](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable) " +"aracılığıyla dinamik yönlendirme (dynamic dispatch) kullanır. Bu, hangi " +"türde `Pet` geçirilirse geçirilsin kullanılan tek bir `fn dynamic` sürümü " +"olduğu anlamına gelir." + +#: src/generics/dyn-trait.md +msgid "" +"When using `dyn Trait`, the trait object needs to be behind some kind of " +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." +msgstr "" +"`dyn Trait` kullanırken, özellik nesnesinin (trait object) bir tür dolaylı " +"yol (indirection) arkasında olması gerekir. Bu durumda bu bir referanstır, " +"ancak `Box` gibi akıllı gösterici (smart pointer) türleri de kullanılabilir " +"(bu 3. günde gösterilecektir)." + +#: src/generics/dyn-trait.md +msgid "" +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." +msgstr "" +"Çalışma zamanında, bir `&dyn Pet`, \"genişletilmiş bir gösterici (fat " +"pointer)\" olarak temsil edilir, yani iki göstericiden oluşan bir çift: Bir " +"gösterici, `Pet`'i gerçekleştiren (implement) belirli nesneye işaret eder ve " +"diğeri o tür için özellik gerçekleştiriminin (trait implementation) sanal " +"metot tablosuna (vtable) işaret eder. `&dyn Pet` üzerinde `talk` metodunu " +"çağırırken, derleyici sanal metot tablosunda `talk` için fonksiyon " +"göstericisini (function pointer) arar ve ardından `Dog` veya `Cat`'e " +"göstericiyi o fonksiyona geçirerek fonksiyonu çağırır. Derleyicinin bunu " +"yapmak için `Pet`'in belirli olan türünü (concrete type) bilmesi gerekmez." + +#: src/generics/dyn-trait.md +msgid "" +"A `dyn Trait` is considered to be \"type-erased\", because we no longer have " +"compile-time knowledge of what the concrete type is." +msgstr "" +"Bir `dyn Trait`, \"silinmiş tür (type-erased)\" olarak kabul edilir, çünkü " +"artık somut türün ne olduğuna dair derleme zamanı bilgisine sahip değiliz." #: src/generics/exercise.md msgid "" @@ -6001,35 +7127,43 @@ msgid "" "determines the minimum of two values, using the [`Ord`](https://doc.rust-" "lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" +"Bu kısa alıştırmada, [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait." +"Ord.html) özelliğini (trait) kullanarak iki değerin minimumunu belirleyen " +"genelleştirilmiş (generic) bir `min` fonksiyonu gerçekleştireceksiniz " +"(implement)." #: src/generics/exercise.md -msgid "// TODO: implement the `min` function used in `main`.\n" -msgstr "" +msgid "// TODO: implement the `min` function used in the tests.\n" +msgstr "// TODO: testlerde kullanılan `min` fonksiyonunu gerçekleştirin.\n" #: src/generics/exercise.md src/generics/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" -msgstr "" +msgstr "'z'" #: src/generics/exercise.md src/generics/solution.md msgid "'7'" -msgstr "" +msgstr "'7'" #: src/generics/exercise.md src/generics/solution.md msgid "'1'" -msgstr "" +msgstr "'1'" + +#: src/generics/exercise.md src/generics/solution.md +#: src/std-traits/from-and-into.md +msgid "\"hello\"" +msgstr "\"merhaba\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" -msgstr "" +msgstr "\"hoşçakal\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"bat\"" -msgstr "" +msgstr "\"yarasa\"" #: src/generics/exercise.md src/generics/solution.md msgid "\"armadillo\"" -msgstr "" +msgstr "\"armadillo\"" #: src/generics/exercise.md msgid "" @@ -6037,56 +7171,37 @@ msgid "" "html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." "Ordering.html) enum." msgstr "" +"Öğrencilere [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html) " +"özelliğini (trait) ve [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/" +"enum.Ordering.html) enum'ını gösterin." -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Types](./std-types.md) (1 hour and 20 minutes)" -msgstr "" - -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" -msgstr "" - -#: src/welcome-day-2-afternoon.md +#: src/welcome-day-2-afternoon.md src/welcome-day-4.md msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 10 " -"minutes" +"Including 10 minute breaks, this session should take about 2 hours and 50 " +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 50 dakika sürmelidir. " +"İçeriği:" + +#: src/std-types.md src/std-types/option.md +msgid "Option" +msgstr "Option" + +#: src/std-types.md src/std-types/result.md src/error-handling.md +msgid "Result" +msgstr "Result" + +#: src/std-types.md src/std-types/string.md +msgid "String" +msgstr "String" #: src/std-types.md -msgid "[Standard Library](./std-types/std.md) (3 minutes)" -msgstr "" +msgid "Vec" +msgstr "Vec" #: src/std-types.md -msgid "[Documentation](./std-types/docs.md) (5 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Option](./std-types/option.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Result](./std-types/result.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[String](./std-types/string.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Vec](./std-types/vec.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[HashMap](./std-types/hashmap.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Exercise: Counter](./std-types/exercise.md) (20 minutes)" -msgstr "" - -#: src/std-types.md -msgid "This segment should take about 1 hour and 20 minutes" -msgstr "" +msgid "HashMap" +msgstr "HashMap" #: src/std-types.md msgid "" @@ -6147,6 +7262,10 @@ msgid "" "std/collections/struct.BinaryHeap.html)." msgstr "" +#: src/std-types/docs.md +msgid "Use `rustup doc --std` or to view the documentation." +msgstr "" + #: src/std-types/docs.md msgid "In fact, you can document your own code:" msgstr "" @@ -6185,10 +7304,6 @@ msgid "" "rand>." msgstr "" -#: src/std-types/option.md -msgid "Option" -msgstr "" - #: src/std-types/option.md msgid "" "We have already seen some use of `Option`. It stores either a value of " @@ -6204,10 +7319,6 @@ msgstr "" msgid "'é'" msgstr "" -#: src/std-types/option.md -msgid "\"find returned {position:?}\"" -msgstr "" - #: src/std-types/option.md msgid "'Z'" msgstr "" @@ -6240,35 +7351,33 @@ msgstr "" #: src/std-types/option.md msgid "" -"The niche optimization means that `Option` often has the same size in " -"memory as `T`." -msgstr "" - -#: src/std-types/result.md -msgid "Result" +"The \"niche optimization\" means that `Option` often has the same size in " +"memory as `T`, if there is some representation that is not a valid value of " +"T. For example, a reference cannot be NULL, so `Option<&T>` automatically " +"uses NULL to represent the `None` variant, and thus can be stored in the " +"same memory as `&T`." msgstr "" #: src/std-types/result.md msgid "" "`Result` is similar to `Option`, but indicates the success or failure of an " -"operation, each with a different type. This is similar to the `Res` defined " -"in the expression exercise, but generic: `Result` where `T` is used in " -"the `Ok` variant and `E` appears in the `Err` variant." +"operation, each with a different enum variant. It is generic: `Result` " +"where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"diary.txt\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"Dear diary: {contents} ({bytes} bytes)\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"Could not read file content\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" msgstr "" @@ -6293,19 +7402,15 @@ msgid "" "Day 4." msgstr "" -#: src/std-types/string.md -msgid "String" -msgstr "String" - #: src/std-types/string.md msgid "" -"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is the " -"standard heap-allocated growable UTF-8 string buffer:" +"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is a " +"growable UTF-8 encoded string:" msgstr "" -#: src/std-types/string.md src/std-traits/read-and-write.md -#: src/memory-management/review.md src/testing/unit-tests.md -#: src/concurrency/scoped-threads.md +#: src/std-types/string.md src/std-traits/comparisons.md +#: src/std-traits/read-and-write.md src/memory-management/review.md +#: src/testing/unit-tests.md src/concurrency/threads/scoped.md msgid "\"Hello\"" msgstr "\"Merhaba\"" @@ -6526,10 +7631,6 @@ msgstr "" msgid "// Use the .entry() method to insert a value if nothing is found.\n" msgstr "" -#: src/std-types/hashmap.md -msgid "\"{page_counts:#?}\"" -msgstr "" - #: src/std-types/hashmap.md msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." @@ -6568,19 +7669,6 @@ msgid "" "value tuples." msgstr "" -#: src/std-types/hashmap.md -msgid "" -"We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, " -"but it can lead into complications with the borrow checker." -msgstr "" - -#: src/std-types/hashmap.md -msgid "" -"Try removing `to_string()` from the example above and see if it still " -"compiles. Where do you think we might run into issues?" -msgstr "" - #: src/std-types/hashmap.md msgid "" "This type has several \"method-specific\" return types, such as `std::" @@ -6644,41 +7732,259 @@ msgstr "" msgid "\"got {} apples\"" msgstr "" -#: src/std-traits.md -msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" +#: src/closures.md src/concurrency/threads.md src/concurrency/shared-state.md +msgid "This segment should take about 30 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 30 dakika sürmelidir. İçeriği:" + +#: src/closures/syntax.md +msgid "Closures are created with vertical bars: `|..| ..`." +msgstr "" + +#: src/closures/syntax.md +msgid "// Argument and return type can be inferred for lightweight syntax:\n" +msgstr "" + +#: src/closures/syntax.md +msgid "// Or we can specify types and bracket the body to be fully explicit:\n" +msgstr "" + +#: src/closures/syntax.md +msgid "" +"The arguments go between the `|..|`. The body can be surrounded by `{ .. }`, " +"but if it is a single expression these can be omitted." +msgstr "" + +#: src/closures/syntax.md +msgid "" +"Argument types are optional, and are inferred if not given. The return type " +"is also optional, but can only be written if using `{ .. }` around the body." +msgstr "" + +#: src/closures/syntax.md +msgid "" +"The examples can both be written as mere nested functions instead -- they do " +"not capture any variables from their lexical environment. We will see " +"captures next." +msgstr "" + +#: src/closures/syntax.md +msgid "" +"The ability to store functions in variables doesn't just apply to closures, " +"regular functions can be put in variables and then invoked the same way that " +"closures can: [Example in the playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=817cbeeefc49f3d0d180a3d6d54c8bda)." +msgstr "" + +#: src/closures/syntax.md +msgid "" +"The linked example also demonstrates that closures that don't capture " +"anything can also coerce to a regular function pointer." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"A closure can capture variables from the environment where it was defined." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"By default, a closure captures values by reference. Here `max_value` is " +"captured by `clamp`, but still available to `main` for printing. Try making " +"`max_value` mutable, changing it, and printing the clamped values again. Why " +"doesn't this work?" +msgstr "" + +#: src/closures/capturing.md +msgid "" +"If a closure mutates values, it will capture them by mutable reference. Try " +"adding `max_value += 1` to `clamp`." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"You can force a closure to move values instead of referencing them with the " +"`move` keyword. This can help with lifetimes, for example if the closure " +"must outlive the captured values (more on lifetimes later)." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"This looks like `move |v| ..`. Try adding this keyword and see if `main` can " +"still access `max_value` after defining `clamp`." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." +msgstr "" + +#: src/closures/traits.md +msgid "Closure traits" +msgstr "Çevreleyici özellikler (Closures traits)" + +#: src/closures/traits.md +msgid "" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +msgstr "" + +#: src/closures/traits.md +msgid "" +"The special types `fn(..) -> T` refer to function pointers - either the " +"address of a function, or a closure that captures nothing." +msgstr "" + +#: src/closures/traits.md +msgid "\"Calling {func_name}({input}): {}\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"-itis\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"{x}{suffix}\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"add_suffix\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"senior\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"appenix\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"/\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"accumulate\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"red\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"green\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"blue\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"take_and_reverse\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"reversed: \"" +msgstr "" + +#: src/closures/traits.md +msgid "" +"An `Fn` (e.g. `add_suffix`) neither consumes nor mutates captured values. It " +"can be called needing only a shared reference to the closure, which means " +"the closure can be executed repeatedly and even concurrently." +msgstr "" + +#: src/closures/traits.md +msgid "" +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." +msgstr "" + +#: src/closures/traits.md +msgid "" +"If you have an `FnOnce` (e.g. `take_and_reverse`), you may only call it " +"once. Doing so consumes the closure and any values captured by move." +msgstr "" + +#: src/closures/traits.md +msgid "" +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +msgstr "" + +#: src/closures/traits.md +msgid "" +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." +msgstr "" + +#: src/closures/traits.md +msgid "" +"In contrast, when you have a closure, the most flexible you can have is `Fn` " +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." +msgstr "" + +#: src/closures/traits.md +msgid "" +"The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g. " +"`take_and_reverse`), depending on what the closure captures. Function " +"pointers (references to `fn` items) implement `Copy` and `Fn`." +msgstr "" + +#: src/closures/exercise.md +msgid "" +"Building on the generic logger from this morning, implement a `Filter` which " +"uses a closure to filter log messages, sending those which pass the " +"filtering predicate to an inner logger." +msgstr "" + +#: src/closures/exercise.md +msgid "// TODO: Define and implement `Filter`.\n" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes\"" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes, something went wrong\"" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"uhoh\"" +msgstr "" + +#: src/closures/solution.md +msgid "/// Only log messages matching a filtering predicate.\n" +msgstr "" + +#: src/closures/solution.md +msgid "" +"Note that the `P: Fn(u8, &str) -> bool` bound on the first `Filter` impl " +"block isn't strictly necessary, but it helps with type inference when " +"calling `new`. Demonstrate removing it and showing how the compiler now " +"needs type annotations for the closure passed to `new`." msgstr "" #: src/std-traits.md -msgid "[Operators](./std-traits/operators.md) (10 minutes)" -msgstr "" +msgid "From and Into" +msgstr "From ve Into" #: src/std-traits.md -msgid "[From and Into](./std-traits/from-and-into.md) (10 minutes)" -msgstr "" +msgid "Read and Write" +msgstr "Read ve Write" #: src/std-traits.md -msgid "[Casting](./std-traits/casting.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Read and Write](./std-traits/read-and-write.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Default, struct update syntax](./std-traits/default.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Closures](./std-traits/closures.md) (20 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Exercise: ROT13](./std-traits/exercise.md) (30 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "This segment should take about 1 hour and 40 minutes" -msgstr "" +msgid "Default, struct update syntax" +msgstr "Varsayılan, yapı (struct) güncelleme sözdizimi" #: src/std-traits.md msgid "" @@ -6739,6 +8045,14 @@ msgid "" "them." msgstr "" +#: src/std-traits/comparisons.md +msgid "" +"When comparing references in Rust, it will compare the value of the things " +"pointed to, it will NOT compare the references themselves. That means that " +"references to two different things can compare as equal if the values " +"pointed to are the same:" +msgstr "" + #: src/std-traits/operators.md msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." @@ -6746,7 +8060,7 @@ msgid "" msgstr "" #: src/std-traits/operators.md -msgid "\"{:?} + {:?} = {:?}\"" +msgid "\"{p1:?} + {p2:?} = {:?}\"" msgstr "" #: src/std-traits/operators.md src/memory-management/drop.md @@ -6784,11 +8098,20 @@ msgid "" "i32)> for Point` would add a tuple to a `Point`." msgstr "" +#: src/std-traits/operators.md +msgid "" +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." +msgstr "" + #: src/std-traits/from-and-into.md msgid "" "Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." "html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions:" +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" #: src/std-traits/from-and-into.md @@ -6904,7 +8227,7 @@ msgid "\"\\n\"" msgstr "" #: src/std-traits/read-and-write.md -msgid "\"Logged: {:?}\"" +msgid "\"Logged: {buffer:?}\"" msgstr "" #: src/std-traits/default.md @@ -6913,31 +8236,20 @@ msgstr "" #: src/std-traits/default.md msgid "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " -"produces a default value for a type." +"The [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"trait produces a default value for a type." msgstr "" +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"özelliği (trait) bir tür için varsayılan bir değer üretir." #: src/std-traits/default.md msgid "\"John Smith\"" msgstr "" -#: src/std-traits/default.md -msgid "\"{default_struct:#?}\"" -msgstr "" - #: src/std-traits/default.md msgid "\"Y is set!\"" msgstr "" -#: src/std-traits/default.md -msgid "\"{almost_default_struct:#?}\"" -msgstr "" - -#: src/std-traits/default.md src/lifetimes/exercise.md -#: src/lifetimes/solution.md -msgid "\"{:#?}\"" -msgstr "" - #: src/std-traits/default.md msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." @@ -6976,93 +8288,6 @@ msgid "" "with-struct-update-syntax)." msgstr "" -#: src/std-traits/closures.md -msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"Calling function on {input}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"add_3: {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"accumulate: {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"multiply_sum: {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values, or " -"perhaps captures nothing at all. It can be called multiple times " -"concurrently." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " -"multiple times, but not concurrently." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " -"might consume captured values." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " -"`multiply_sum`), depending on what the closure captures." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"By default, closures will capture by reference if they can. The `move` " -"keyword makes them capture by value." -msgstr "" - -#: src/std-traits/closures.md src/smart-pointers/trait-objects.md -msgid "\"{} {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"Hi\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"Greg\"" -msgstr "" - #: src/std-traits/exercise.md msgid "" "In this example, you will implement the classic [\"ROT13\" cipher](https://" @@ -7089,10 +8314,6 @@ msgid "" "by 13 characters?" msgstr "" -#: src/std-traits/solution.md -msgid "'A'" -msgstr "" - #: src/welcome-day-3.md msgid "Welcome to Day 3" msgstr "" @@ -7111,57 +8332,21 @@ msgstr "" msgid "Smart pointers: standard library pointer types." msgstr "" -#: src/welcome-day-3.md -msgid "[Welcome](./welcome-day-3.md) (3 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Memory Management](./memory-management.md) (1 hour)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Smart Pointers](./smart-pointers.md) (55 minutes)" -msgstr "" - -#: src/welcome-day-3.md +#: src/welcome-day-3.md src/welcome-day-4-afternoon.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " -"minutes" +"minutes. It contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 20 dakika sürmelidir. " +"İçeriği:" + +#: src/memory-management.md src/memory-management/clone.md +msgid "Clone" msgstr "" #: src/memory-management.md -msgid "[Review of Program Memory](./memory-management/review.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "" -"[Approaches to Memory Management](./memory-management/approaches.md) (10 " -"minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Ownership](./memory-management/ownership.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Move Semantics](./memory-management/move.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Clone](./memory-management/clone.md) (2 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Copy Types](./memory-management/copy-types.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Drop](./memory-management/drop.md) (10 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Exercise: Builder Type](./memory-management/exercise.md) (20 minutes)" -msgstr "" +msgid "Drop" +msgstr "Drop" #: src/memory-management/review.md msgid "Programs allocate memory in two ways:" @@ -7283,9 +8468,8 @@ msgid "" msgstr "" #: src/memory-management/approaches.md -msgid "" -"Typically implemented with reference counting, garbage collection, or RAII." -msgstr "" +msgid "Typically implemented with reference counting or garbage collection." +msgstr "Genellikle referans sayımı veya çöp toplama ile uygulanır." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7336,8 +8520,8 @@ msgid "" "of C, with alloc and free operations precisely where they are required -- " "zero cost. It also provides tools similar to C++'s smart pointers. When " "required, other options such as reference counting are available, and there " -"are even third-party crates available to support runtime garbage collection " -"(not covered in this class)." +"are even crates available to support runtime garbage collection (not covered " +"in this class)." msgstr "" #: src/memory-management/ownership.md @@ -7369,12 +8553,12 @@ msgstr "" msgid "An assignment will transfer _ownership_ between variables:" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md src/concurrency/async-control-flow/select.md msgid "\"Hello!\"" msgstr "\"Merhaba!\"" #: src/memory-management/move.md -msgid "// println!(\"s1: {s1}\");\n" +msgid "// dbg!(s1);\n" msgstr "" #: src/memory-management/move.md @@ -7427,11 +8611,12 @@ msgid "" "parameter. This transfers ownership:" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" msgstr "\"Merhaba {name}\"" -#: src/memory-management/move.md src/android/interoperability/java.md +#: src/memory-management/move.md src/memory-management/clone.md +#: src/android/aidl/types/parcelables.md src/android/interoperability/java.md msgid "\"Alice\"" msgstr "\"Alice\"" @@ -7550,10 +8735,6 @@ msgid "" "which is being copied or moved." msgstr "" -#: src/memory-management/clone.md -msgid "Clone" -msgstr "" - #: src/memory-management/clone.md msgid "" "Sometimes you _want_ to make a copy of a value. The `Clone` trait " @@ -7563,8 +8744,7 @@ msgstr "" #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " -"occurring. Look for `.clone()` and a few others like `Vec::new` or `Box::" -"new`." +"occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" #: src/memory-management/clone.md @@ -7573,6 +8753,18 @@ msgid "" "and return later to try to optimize those clones away." msgstr "" +#: src/memory-management/clone.md +msgid "" +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." +msgstr "" + +#: src/memory-management/clone.md +msgid "" +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." +msgstr "" + #: src/memory-management/copy-types.md msgid "" "While move semantics are the default, certain types are copied by default:" @@ -7639,6 +8831,14 @@ msgstr "" msgid "Show that it works if you clone `p1` instead." msgstr "" +#: src/memory-management/copy-types.md +msgid "" +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because Rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." +msgstr "" + #: src/memory-management/drop.md msgid "The `Drop` Trait" msgstr "" @@ -7653,8 +8853,8 @@ msgstr "" msgid "\"Dropping {}\"" msgstr "" -#: src/memory-management/drop.md src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/memory-management/drop.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"a\"" msgstr "" @@ -7671,11 +8871,11 @@ msgid "\"d\"" msgstr "" #: src/memory-management/drop.md -msgid "\"Exiting block B\"" +msgid "\"Exiting innermost block\"" msgstr "" #: src/memory-management/drop.md -msgid "\"Exiting block A\"" +msgid "\"Exiting next block\"" msgstr "" #: src/memory-management/drop.md @@ -7799,10 +8999,6 @@ msgstr "" msgid "\"0.13\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"base64: {base64:?}\"" -msgstr "" - #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log\"" msgstr "" @@ -7811,10 +9007,6 @@ msgstr "" msgid "\"0.4\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"log: {log:?}\"" -msgstr "" - #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" msgstr "" @@ -7827,33 +9019,17 @@ msgstr "" msgid "\"4.0\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"serde: {serde:?}\"" -msgstr "" - #: src/memory-management/solution.md msgid "\"0.1\"" msgstr "" #: src/smart-pointers.md -msgid "[Box" -msgstr "" +msgid "Box" +msgstr "Box" #: src/smart-pointers.md -msgid "](./smart-pointers/box.md) (10 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Rc](./smart-pointers/rc.md) (5 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Trait Objects](./smart-pointers/trait-objects.md) (10 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" -msgstr "" +msgid "Rc" +msgstr "Rc" #: src/smart-pointers/box.md msgid "" @@ -7874,7 +9050,8 @@ msgstr "" #: src/smart-pointers/box.md msgid "" -"Recursive data types or data types with dynamic sizes need to use a `Box`:" +"Recursive data types or data types with dynamic sizes cannot be stored " +"inline without a pointer indirection. `Box` accomplishes that indirection:" msgstr "" #: src/smart-pointers/box.md @@ -7923,8 +9100,8 @@ msgstr "" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust " -"compiler wants to know an exact size." +"have a type whose size can't be known at compile time, but the Rust compiler " +"wants to know an exact size." msgstr "" #: src/smart-pointers/box.md @@ -7955,43 +9132,11 @@ msgid "" "storing the value directly." msgstr "" -#: src/smart-pointers/box.md -msgid "Niche Optimization" -msgstr "Niche Optimizasyonu" - #: src/smart-pointers/box.md msgid "" "Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " "This makes `Box` one of the types that allow the compiler to optimize " -"storage of some enums." -msgstr "" - -#: src/smart-pointers/box.md -msgid "" -"For example, `Option>` has the same size, as just `Box`, because " -"compiler uses NULL-value to discriminate variants instead of using explicit " -"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" -"#representation)):" -msgstr "" - -#: src/smart-pointers/box.md -msgid "\"Just box\"" -msgstr "" - -#: src/smart-pointers/box.md -msgid "\"Optional box\"" -msgstr "" - -#: src/smart-pointers/box.md -msgid "\"Size of just_box: {}\"" -msgstr "" - -#: src/smart-pointers/box.md -msgid "\"Size of optional_box: {}\"" -msgstr "" - -#: src/smart-pointers/box.md -msgid "\"Size of none: {}\"" +"storage of some enums (the \"niche optimization\")." msgstr "" #: src/smart-pointers/rc.md @@ -8002,16 +9147,14 @@ msgid "" msgstr "" #: src/smart-pointers/rc.md -msgid "\"a: {a}\"" -msgstr "" - -#: src/smart-pointers/rc.md -msgid "\"b: {b}\"" +msgid "" +"Each `Rc` points to the same shared data structure, containing strong and " +"weak pointers and the value:" msgstr "" #: src/smart-pointers/rc.md msgid "" -"See [`Arc`](../concurrency/shared_state/arc.md) and [`Mutex`](https://doc." +"See [`Arc`](../concurrency/shared-state/arc.md) and [`Mutex`](https://doc." "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " "context." msgstr "" @@ -8057,18 +9200,11 @@ msgstr "" #: src/smart-pointers/trait-objects.md msgid "" -"Trait objects allow for values of different types, for instance in a " -"collection:" +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." msgstr "" -#: src/smart-pointers/trait-objects.md -msgid "\"Miau!\"" -msgstr "" - -#: src/smart-pointers/trait-objects.md -msgid "\"Hello, who are you? {}\"" -msgstr "\"Merhaba, nasılsın? {}\"" - #: src/smart-pointers/trait-objects.md msgid "Memory layout after allocating `pets`:" msgstr "" @@ -8077,59 +9213,59 @@ msgstr "" msgid "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" -": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +".- - - - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - " +"- - - -.\n" +": : : :\n" +": \"pets: Vec>\" : : \"data: Cat\" +----+----" +"+----+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d " +"| o | :\n" +": | ptr | o---+-------+--. : | lives | 9 | +----+----+----" "+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" -": | len | 2 | : | : +-------+-------+ " +": | len | 2 | : | : +-------+-------+ " "^ :\n" -": | capacity | 2 | : | : ^ " +": | capacity | 2 | : | : ^ " "| :\n" -": +-----------+-------+ : | : | " +": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:" +": : | : | data:" "\"Dog\"| :\n" -": : | : | +-------+--|-------" -"+ :\n" -"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " -"| :\n" -" `--+-->| o o | o o-|----->| age | 5 " -"| :\n" -" : +-|---+-|---+ +-------+----------" -"+ :\n" -" : | " +": : | : | +-------" +"+--|-------+ :\n" +"`- - - - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, " +"4, 4 | :\n" +" `--+-->| o o | o o-|----->| age " +"| 5 | :\n" +" : +-|---+-|---+ +-------" +"+----------+ :\n" +" : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" -" | |\n" -" | | " +" `- - -| - - |- - - - - - - - - - - - - " +"- - - -'\n" +" | |\n" +" | | " "\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" -" : | | " +" .- - -| - - |- - - - - - - - - - - - - " +"- - - -.\n" +" : | | " "vtable :\n" -" : | | +----------------------" -"+ :\n" -" : | `----->| \"::" +" : | | " +"+----------------------+ :\n" +" : | `----->| \"::" "talk\" | :\n" -" : | +----------------------" -"+ :\n" -" : | " +" : | " +"+----------------------+ :\n" +" : | " "vtable :\n" -" : | +----------------------" -"+ :\n" -" : '----------->| \"::" +" : | " +"+----------------------+ :\n" +" : '----------->| \"::" "talk\" | :\n" -" : +----------------------" -"+ :\n" -" : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" : " +"+----------------------+ :\n" +" : :\n" +" '- - - - - - - - - - - - - - - - - - - " +"- - - -'\n" "```" msgstr "" @@ -8169,6 +9305,17 @@ msgstr "" msgid "Compare these outputs in the above example:" msgstr "" +#: src/smart-pointers/trait-objects.md +msgid "\"{} {}\"" +msgstr "" + +#: src/smart-pointers/trait-objects.md src/modules/exercise.md +#: src/modules/solution.md src/android/build-rules/library.md +#: src/android/interoperability/cpp/rust-bridge.md +#: src/concurrency/async-pitfalls/cancellation.md +msgid "\"{}\"" +msgstr "\"{}\"" + #: src/smart-pointers/exercise.md msgid "" "A binary tree is a tree-type data structure where every node has two " @@ -8181,12 +9328,6 @@ msgstr "" msgid "Implement the following types, so that the given tests pass." msgstr "" -#: src/smart-pointers/exercise.md -msgid "" -"Extra Credit: implement an iterator over a binary tree that returns the " -"values in order." -msgstr "" - #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "/// A node in the binary tree.\n" msgstr "" @@ -8203,47 +9344,20 @@ msgid "" msgstr "" #: src/smart-pointers/exercise.md -msgid "// Implement `new`, `insert`, `len`, and `has`.\n" +msgid "// Implement `new`, `insert`, `len`, and `has` for `Subtree`.\n" msgstr "" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "// not a unique item\n" msgstr "" -#: src/smart-pointers/solution.md src/android/testing/googletest.md -msgid "\"bar\"" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "[Borrowing](./borrowing.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "[Lifetimes](./lifetimes.md) (50 minutes)" -msgstr "[Ömürler](./lifetimes.md) (50 dakika)" - #: src/welcome-day-3-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 1 hour and 50 " -"minutes" -msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 1 saat 50 dakika sürecektir" - -#: src/borrowing.md -msgid "[Borrowing a Value](./borrowing/shared.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Borrow Checking](./borrowing/borrowck.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Interior Mutability](./borrowing/interior-mutability.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Exercise: Health Statistics](./borrowing/exercise.md) (20 minutes)" +"Including 10 minute breaks, this session should take about 1 hour and 55 " +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 1 saat 55 dakika sürmelidir. " +"İçeriği:" #: src/borrowing/shared.md msgid "" @@ -8266,36 +9380,45 @@ msgid "" msgstr "" #: src/borrowing/shared.md -msgid "Notes on stack returns:" +msgid "Notes on stack returns and inlining:" msgstr "" #: src/borrowing/shared.md msgid "" "Demonstrate that the return from `add` is cheap because the compiler can " -"eliminate the copy operation. Change the above code to print stack addresses " -"and run it on the [Playground](https://play.rust-lang.org/?" -"version=stable&mode=release&edition=2021&gist=0cb13be1c05d7e3446686ad9947c4671) " +"eliminate the copy operation, by inlining the call to add into main. Change " +"the above code to print stack addresses and run it on the [Playground]" +"(https://play.rust-lang.org/?" +"version=stable&mode=release&edition=2024&gist=0cb13be1c05d7e3446686ad9947c4671) " "or look at the assembly in [Godbolt](https://rust.godbolt.org/). In the " "\"DEBUG\" optimization level, the addresses should change, while they stay " "the same when changing to the \"RELEASE\" setting:" msgstr "" #: src/borrowing/shared.md -msgid "The Rust compiler can do return value optimization (RVO)." +msgid "" +"The Rust compiler can do automatic inlining, that can be disabled on a " +"function level with `#[inline(never)]`." msgstr "" #: src/borrowing/shared.md msgid "" -"In C++, copy elision has to be defined in the language specification because " -"constructors can have side effects. In Rust, this is not an issue at all. If " -"RVO did not happen, Rust will always perform a simple and efficient `memcpy` " -"copy." +"Once disabled, the printed address will change on all optimization levels. " +"Looking at Godbolt or Playground, one can see that in this case, the return " +"of the value depends on the ABI, e.g. on amd64 the two i32 that is making up " +"the point will be returned in 2 registers (eax and edx)." msgstr "" #: src/borrowing/borrowck.md msgid "" "Rust's _borrow checker_ puts constraints on the ways you can borrow values. " -"For a given value, at any time:" +"We've already seen that a reference cannot _outlive_ the value it borrows:" +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"There's also a second main rule that the borrow checker enforces: The " +"_aliasing_ rule. For a given value, at any time:" msgstr "" #: src/borrowing/borrowck.md @@ -8308,8 +9431,9 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"Note that the requirement is that conflicting references not _exist_ at the " -"same point. It does not matter where the reference is dereferenced." +"The \"outlives\" rule was demonstrated previously when we first looked at " +"references. We review it here to show students that the borrow checking is " +"following a few different rules to validate borrowing." msgstr "" #: src/borrowing/borrowck.md @@ -8320,8 +9444,24 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"Move the `println!` statement for `b` before the scope that introduces `c` " -"to make the code compile." +"Note that the requirement is that conflicting references not _exist_ at the " +"same point. It does not matter where the reference is dereferenced. Try " +"commenting out `*c = 20` and show that the compiler error still occurs even " +"if we never use `c`." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Note that the intermediate reference `c` isn't necessary to trigger a borrow " +"conflict. Replace `c` with a direct mutation of `a` and demonstrate that " +"this produces a similar error. This is because direct mutation of a value " +"effectively creates a temporary mutable reference." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Move the `dbg!` statement for `b` before the scope that introduces `c` to " +"make the code compile." msgstr "" #: src/borrowing/borrowck.md @@ -8333,18 +9473,54 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"The exclusive reference constraint is quite strong. Rust uses it to ensure " -"that data races do not occur. Rust also _relies_ on this constraint to " -"optimize code. For example, a value behind a shared reference can be safely " -"cached in a register for the lifetime of that reference." +"Technically multiple mutable references to a piece of data can exist at the " +"same time via re-borrowing. This is what allows you to pass a mutable " +"reference into a function without invaliding the original reference. [This " +"playground example](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=8f5896878611566845fe3b0f4dc5af68) " +"demonstrates that behavior." msgstr "" #: src/borrowing/borrowck.md msgid "" -"The borrow checker is designed to accommodate many common patterns, such as " -"taking exclusive references to different fields in a struct at the same " -"time. But, there are some situations where it doesn't quite \"get it\" and " -"this often results in \"fighting with the borrow checker.\"" +"Rust uses the exclusive reference constraint to ensure that data races do " +"not occur in multi-threaded code, since only one thread can have mutable " +"access to a piece of data at a time." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Rust also uses this constraint to optimize code. For example, a value behind " +"a shared reference can be safely cached in a register for the lifetime of " +"that reference." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Fields of a struct can be borrowed independently of each other, but calling " +"a method on a struct will borrow the whole struct, potentially invalidating " +"references to individual fields. See [this playground snippet](https://play." +"rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=f293a31f2d4d0d31770486247c2e8437) " +"for an example of this." +msgstr "" + +#: src/borrowing/examples.md +msgid "" +"As a concrete example of how these borrowing rules prevent memory errors, " +"consider the case of modifying a collection while there are references to " +"its elements:" +msgstr "" + +#: src/borrowing/examples.md +msgid "Similarly, consider the case of iterator invalidation:" +msgstr "" + +#: src/borrowing/examples.md +msgid "" +"In both of these cases, modifying the collection by pushing new elements " +"into it can potentially invalidate existing references to the collection's " +"elements if the collection has to reallocate." msgstr "" #: src/borrowing/interior-mutability.md @@ -8361,37 +9537,64 @@ msgid "" "all while still ensuring safety, typically by performing a runtime check." msgstr "" -#: src/borrowing/interior-mutability.md -msgid "`RefCell`" -msgstr "`RefCell`" - -#: src/borrowing/interior-mutability.md -msgid "\"graph: {root:#?}\"" -msgstr "" - -#: src/borrowing/interior-mutability.md -msgid "\"graph sum: {}\"" -msgstr "" - -#: src/borrowing/interior-mutability.md -msgid "`Cell`" -msgstr "" - -#: src/borrowing/interior-mutability.md -msgid "" -"`Cell` wraps a value and allows getting or setting the value, even with a " -"shared reference to the `Cell`. However, it does not allow any references to " -"the value. Since there are no references, borrowing rules cannot be broken." -msgstr "" - #: src/borrowing/interior-mutability.md msgid "" "The main thing to take away from this slide is that Rust provides _safe_ " "ways to modify data behind a shared reference. There are a variety of ways " -"to ensure that safety, and `RefCell` and `Cell` are two of them." +"to ensure that safety, and the next sub-slides present a few of them." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/cell.md +msgid "" +"`Cell` wraps a value and allows getting or setting the value using only a " +"shared reference to the `Cell`. However, it does not allow any references to " +"the inner value. Since there are no references, borrowing rules cannot be " +"broken." +msgstr "" + +#: src/borrowing/interior-mutability/cell.md +#: src/borrowing/interior-mutability/refcell.md +msgid "// Note that `cell` is NOT declared as mutable.\n" +msgstr "" + +#: src/borrowing/interior-mutability/cell.md +msgid "" +"`Cell` is a simple means to ensure safety: it has a `set` method that takes " +"`&self`. This needs no runtime check, but requires moving values, which can " +"have its own cost." +msgstr "" + +#: src/borrowing/interior-mutability/refcell.md +msgid "" +"`RefCell` allows accessing and mutating a wrapped value by providing " +"alternative types `Ref` and `RefMut` that emulate `&T`/`&mut T` without " +"actually being Rust references." +msgstr "" + +#: src/borrowing/interior-mutability/refcell.md +msgid "" +"These types perform dynamic checks using a counter in the `RefCell` to " +"prevent existence of a `RefMut` alongside another `Ref`/`RefMut`." +msgstr "" + +#: src/borrowing/interior-mutability/refcell.md +msgid "" +"By implementing `Deref` (and `DerefMut` for `RefMut`), these types allow " +"calling methods on the inner value without allowing references to escape." +msgstr "" + +#: src/borrowing/interior-mutability/refcell.md +msgid "" +"// This triggers an error at runtime.\n" +" // let other = cell.borrow();\n" +" // println!(\"{}\", other);\n" +msgstr "" + +#: src/borrowing/interior-mutability/refcell.md +msgid "\"{cell:?}\"" +msgstr "\"{cell:?}\"" + +#: src/borrowing/interior-mutability/refcell.md msgid "" "`RefCell` enforces Rust's usual borrowing rules (either multiple shared " "references or a single exclusive reference) with a runtime check. In this " @@ -8399,32 +9602,18 @@ msgid "" "succeed." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`Rc` only allows shared (read-only) access to its contents, since its " -"purpose is to allow (and count) many references. But we want to modify the " -"value, so we need interior mutability." +"The extra block in the example is to end the borrow created by the call to " +"`borrow_mut` before we print the cell. Trying to print a borrowed `RefCell` " +"just shows the message `\"{borrowed}\"`." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`Cell` is a simpler means to ensure safety: it has a `set` method that takes " -"`&self`. This needs no runtime check, but requires moving values, which can " -"have its own cost." -msgstr "" - -#: src/borrowing/interior-mutability.md -msgid "" -"Demonstrate that reference loops can be created by adding `root` to `subtree." -"children`." -msgstr "" - -#: src/borrowing/interior-mutability.md -msgid "" -"To demonstrate a runtime panic, add a `fn inc(&mut self)` that increments " -"`self.value` and calls the same method on its children. This will panic in " -"the presence of the reference loop, with `thread 'main' panicked at 'already " -"borrowed: BorrowMutError'`." +"There are also `OnceCell` and `OnceLock`, which allow initialization on " +"first use. Making these useful requires some more knowledge than students " +"have at this time." msgstr "" #: src/borrowing/exercise.md @@ -8458,28 +9647,6 @@ msgstr "" msgid "\"Bob\"" msgstr "" -#: src/borrowing/exercise.md src/borrowing/solution.md -msgid "\"I'm {} and my age is {}\"" -msgstr "" - -#: src/lifetimes.md -msgid "" -"[Lifetime Annotations](./lifetimes/lifetime-annotations.md) (10 minutes)" -msgstr "" -"[Ömür için Ek Açıklamalar](./lifetimes/lifetime-annotations.md) (10 dakika)" - -#: src/lifetimes.md -msgid "[Lifetime Elision](./lifetimes/lifetime-elision.md) (5 minutes)" -msgstr "[Ömür Atlaması (Elision)](./lifetimes/lifetime-elision.md) (5 dakika)" - -#: src/lifetimes.md -msgid "[Struct Lifetimes](./lifetimes/struct-lifetimes.md) (5 minutes)" -msgstr "[Yapı Ömürleri](./lifetimes/struct-lifetimes.md) (5 dakika)" - -#: src/lifetimes.md -msgid "[Exercise: Protobuf Parsing](./lifetimes/exercise.md) (30 minutes)" -msgstr "[Alıştırma: Protobuf Ayrıştırma](./lifetimes/exercise.md) (30 dakika)" - #: src/lifetimes/lifetime-annotations.md msgid "" "A reference has a _lifetime_, which must not \"outlive\" the value it refers " @@ -8496,25 +9663,24 @@ msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes are always inferred by the compiler: you cannot assign a lifetime " -"yourself. Explicit lifetime annotations create constraints where there is " -"ambiguity; the compiler verifies that there is a valid solution." +"Only ownership, not lifetime annotations, control when values are destroyed " +"and determine the concrete lifetime of a given value. The borrow checker " +"just validates that borrows never extend beyond the concrete lifetime of the " +"value." msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes become more complicated when considering passing values to and " -"returning values from functions." +"Explicit lifetime annotations, like types, are required on function " +"signatures (but can be elided in common cases). These provide information " +"for inference at callsites and within the function body, helping the borrow " +"checker to do its job." msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" msgstr "" -#: src/lifetimes/lifetime-annotations.md -msgid "\"p3: {p3:?}\"" -msgstr "" - #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " @@ -8530,13 +9696,14 @@ msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"This says there is some lifetime `'a` which both `p1` and `p2` outlive, and " +"which outlives the return value. The borrow checker verifies this within the " +"function body, and uses this information in `main` to determine a lifetime " +"for `p3`." msgstr "" #: src/lifetimes/lifetime-annotations.md -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +msgid "Try dropping `p2` in `main` before printing `p3`." msgstr "" #: src/lifetimes/lifetime-elision.md @@ -8574,7 +9741,8 @@ msgstr "" #: src/lifetimes/lifetime-elision.md msgid "" "The `nearest` function provides another example of a function with multiple " -"references in its arguments that requires explicit annotation." +"references in its arguments that requires explicit annotation. In `main`, " +"the return value is allowed to outlive the query." msgstr "" #: src/lifetimes/lifetime-elision.md @@ -8597,46 +9765,31 @@ msgid "" "just work with owned data by cloning values where necessary." msgstr "" -#: src/lifetimes/struct-lifetimes.md -msgid "Lifetimes in Data Structures" -msgstr "Veri Yapılarında Ömürler" - #: src/lifetimes/struct-lifetimes.md msgid "" "If a data type stores borrowed data, it must be annotated with a lifetime:" msgstr "" -#: src/lifetimes/struct-lifetimes.md -msgid "\"Bye {text}!\"" -msgstr "" - #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "" #: src/lifetimes/struct-lifetimes.md -msgid "// erase(text);\n" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md -msgid "\"{fox:?}\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md -msgid "\"{dog:?}\"" +msgid "// drop(doc);\n" msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "" "In the above example, the annotation on `Highlight` enforces that the data " "underlying the contained `&str` lives at least as long as any instance of " -"`Highlight` that uses that data." +"`Highlight` that uses that data. A struct cannot live longer than the data " +"it references." msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"If `doc` is dropped before the end of the lifetime of `noun` or `verb`, the " +"borrow checker throws an error." msgstr "" #: src/lifetimes/struct-lifetimes.md @@ -8678,20 +9831,58 @@ msgstr "" msgid "We'll use the following proto:" msgstr "" +#: src/lifetimes/exercise.md +msgid "Messages" +msgstr "" + #: src/lifetimes/exercise.md msgid "" "A proto message is encoded as a series of fields, one after the next. Each " "is implemented as a \"tag\" followed by the value. The tag contains a field " "number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"defining how the payload should be determined from the byte stream. These " +"are combined into a single integer, as decoded in `unpack_tag` below." +msgstr "" + +#: src/lifetimes/exercise.md +msgid "Varint" msgstr "" #: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " -"called VARINT. Luckily, `parse_varint` is defined for you below. The given " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +"called VARINT. Luckily, `parse_varint` is defined for you below." +msgstr "" + +#: src/lifetimes/exercise.md +msgid "Wire Types" +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"Proto defines several wire types, only two of which are used in this " +"exercise." +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"The `Varint` wire type contains a single varint, and is used to encode proto " +"values of type `int32` such as `Person.id`." +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"The `Len` wire type contains a length expressed as a varint, followed by a " +"payload of that number of bytes. This is used to encode proto values of type " +"`string` such as `Person.name`. It is also used to encode proto values " +"containing sub-messages such as `Person.phones`, where the payload contains " +"an encoding of the sub-message." +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"The given code also defines callbacks to handle `Person` and `PhoneNumber` " +"fields, and to parse a message into a series of calls to those callbacks." msgstr "" #: src/lifetimes/exercise.md @@ -8700,30 +9891,6 @@ msgid "" "`ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid varint\"" -msgstr "" - -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid wire-type\"" -msgstr "" - -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Unexpected EOF\"" -msgstr "" - -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid length\"" -msgstr "" - -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Unexpected wire-type)\"" -msgstr "" - -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid string (not UTF-8)\"" -msgstr "" - #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" msgstr "" @@ -8734,7 +9901,10 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"//I64, -- not needed for this exercise\n" +"// The I64 WireType indicates that the value is precisely 8 bytes in\n" +" // little-endian order containing a 64-bit signed integer or double " +"type.\n" +" //I64, -- not needed for this exercise\n" " /// The Len WireType indicates that the value is a length represented as " "a\n" " /// VARINT followed by exactly that number of bytes.\n" @@ -8742,8 +9912,10 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"/// The I32 WireType indicates that the value is precisely 4 bytes in\n" -" /// little-endian order containing a 32-bit signed integer.\n" +"// The I32 WireType indicates that the value is precisely 4 bytes in\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" +" //I32, -- not needed for this exercise\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -8754,6 +9926,10 @@ msgstr "" msgid "//I64(i64), -- not needed for this exercise\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//I32(i32), -- not needed for this exercise\n" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field, containing the field number and its value.\n" msgstr "" @@ -8762,11 +9938,39 @@ msgstr "" msgid "//1 => WireType::I64, -- not needed for this exercise\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//5 => WireType::I32, -- not needed for this exercise\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Invalid wire type: {value}\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected string to be a `Len` field\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Invalid string\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected bytes to be a `Len` field\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected `u64` to be a `Varint` field\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Not enough bytes for varint\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// This is the last byte of the VARINT, so convert it to\n" @@ -8777,6 +9981,10 @@ msgstr "" msgid "// More than 7 bytes is invalid.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Too many bytes for varint\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Convert a tag into a field number and a WireType.\n" msgstr "" @@ -8808,18 +10016,68 @@ msgstr "" msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md src/modules/exercise.md +#: src/modules/solution.md src/testing/unit-tests.md src/testing/solution.md +msgid "\"\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"beautiful name\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Evan\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1234-777-9090\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"home\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "// Put that all together into a single parse.\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"maxwell\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1202-555-1212\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1800-867-5308\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"mobile\"" +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." +msgstr "" + #: src/lifetimes/solution.md -msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" +msgid "\"len not a valid `usize`\"" +msgstr "" + +#: src/lifetimes/solution.md +msgid "\"Unexpected EOF\"" msgstr "" #: src/lifetimes/solution.md msgid "// skip everything else\n" msgstr "" -#: src/lifetimes/solution.md -msgid "b\"hello\"" -msgstr "b\"merhaba\"" - #: src/welcome-day-4.md msgid "Welcome to Day 4" msgstr "4. Gün'e Hoş Geldiniz" @@ -8850,76 +10108,251 @@ msgid "" "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" -#: src/welcome-day-4.md -msgid "[Welcome](./welcome-day-4.md) (3 minutes)" +#: src/iterators.md +msgid "Iterator Trait" +msgstr "Adımlayıcı Özelliği (Iterator Trait)" + +#: src/iterators.md +msgid "Iterator Helper Methods" msgstr "" -#: src/welcome-day-4.md -msgid "[Iterators](./iterators.md) (45 minutes)" -msgstr "" +#: src/iterators.md +msgid "collect" +msgstr "collect" -#: src/welcome-day-4.md -msgid "[Modules](./modules.md) (40 minutes)" -msgstr "" +#: src/iterators.md +msgid "IntoIterator" +msgstr "IntoIterator" -#: src/welcome-day-4.md -msgid "[Testing](./testing.md) (45 minutes)" -msgstr "" +#: src/iterators/motivation.md +msgid "Motivating Iterators" +msgstr "Adımlayıcılara (Iterators) Motive Edici Şeyler" -#: src/welcome-day-4.md +#: src/iterators/motivation.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 40 " -"minutes" +"If you want to iterate over the contents of an array, you'll need to define:" msgstr "" -#: src/iterators.md -msgid "[Iterator](./iterators/iterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "[IntoIterator](./iterators/intoiterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "[FromIterator](./iterators/fromiterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md +#: src/iterators/motivation.md msgid "" -"[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" +"Some state to keep track of where you are in the iteration process, e.g. an " +"index." msgstr "" -#: src/iterators.md src/testing.md -msgid "This segment should take about 45 minutes" -msgstr "Bu bölüm yaklaşık 45 dakika sürecektir" +#: src/iterators/motivation.md +msgid "A condition to determine when iteration is done." +msgstr "" + +#: src/iterators/motivation.md +msgid "Logic for updating the state of iteration each loop." +msgstr "" + +#: src/iterators/motivation.md +msgid "Logic for fetching each element using that iteration state." +msgstr "" + +#: src/iterators/motivation.md +msgid "In a C-style for loop you declare these things directly:" +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"In Rust we bundle this state and logic together into an object known as an " +"\"iterator\"." +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"This slide provides context for what Rust iterators do under the hood. We " +"use the (hopefully) familiar construct of a C-style `for` loop to show how " +"iteration requires some state and some logic, that way on the next slide we " +"can show how an iterator bundles these together." +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"Rust doesn't have a C-style `for` loop, but we can express the same thing " +"with `while`:" +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"There's another way to express array iteration using `for` in C and C++: You " +"can use a pointer to the front and a pointer to the end of the array and " +"then compare those pointers to determine when the loop should end." +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"If students ask, you can point out that this is how Rust's slice and array " +"iterators work under the hood (though implemented as a Rust iterator)." +msgstr "" #: src/iterators/iterator.md msgid "" "The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"trait defines how an object can be used to produce a sequence of values. For " +"example, if we wanted to create an iterator that can produce the elements of " +"a slice it might look something like this:" msgstr "" #: src/iterators/iterator.md -msgid "\"fib({i}): {n}\"" +msgid "" +"The `SliceIter` example implements the same logic as the C-style `for` loop " +"demonstrated on the last slide." msgstr "" #: src/iterators/iterator.md msgid "" +"Point out to the students that iterators are lazy: Creating the iterator " +"just initializes the struct but does not otherwise do any work. No work " +"happens until the `next` method is called." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"Iterators don't need to be finite! It's entirely valid to have an iterator " +"that will produce values forever. For example, a half open range like `0..` " +"will keep going until integer overflow occurs." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"The \"real\" version of `SliceIter` is the [`slice::Iter`](https://doc.rust-" +"lang.org/stable/std/slice/struct.Iter.html) type in the standard library, " +"however the real version uses pointers under the hood instead of an index in " +"order to eliminate bounds checks." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"The `SliceIter` example is a good example of a struct that contains a " +"reference and therefore uses lifetime annotations." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"You can also demonstrate adding a generic parameter to `SliceIter` to allow " +"it to work with any kind of slice (not just `&[i32]`)." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"In addition to the `next` method that defines how an iterator behaves, the " +"`Iterator` trait provides 70+ helper methods that can be used to build " +"customized iterators." +msgstr "" + +#: src/iterators/helpers.md +msgid "// Create a range from 1 to 10\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Keep only even numbers\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Square each number\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Sum up all the squared numbers\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "\"The sum of squares of even numbers from 1 to 10 is: {}\"" +msgstr "" + +#: src/iterators/helpers.md +msgid "" "The `Iterator` trait implements many common functional programming " "operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"the trait where you can find all the documentation about them." msgstr "" -#: src/iterators/iterator.md +#: src/iterators/helpers.md msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"Many of these helper methods take the original iterator and produce a new " +"iterator with different behavior. These are know as \"iterator adapter " +"methods\"." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"Some methods, like `sum` and `count`, consume the iterator and pull all of " +"the elements out of it." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"These methods are designed to be chained together so that it's easy to build " +"a custom iterator that does exactly what you need." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"Rust's iterators are extremely efficient and highly optimizable. Even " +"complex iterators made by combining many adapter methods will still result " +"in code as efficient as equivalent imperative implementations." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"The [`collect`](https://doc.rust-lang.org/std/iter/trait.Iterator." +"html#method.collect) method lets you build a collection from an [`Iterator`]" +"(https://doc.rust-lang.org/std/iter/trait.Iterator.html)." +msgstr "" + +#: src/iterators/collect.md +msgid "\"prime_squares: {prime_squares:?}\"" +msgstr "" + +#: src/iterators/collect.md +msgid "" +"Any iterator can be collected in to a `Vec`, `VecDeque`, or `HashSet`. " +"Iterators that produce key-value pairs (i.e. a two-element tuple) can also " +"be collected into `HashMap` and `BTreeMap`." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"Show the students the definition for `collect` in the standard library docs. " +"There are two ways to specify the generic type `B` for this method:" +msgstr "" + +#: src/iterators/collect.md +msgid "" +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"Rewrite the example to use this form." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"If students are curious about how this works, you can bring up the " +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"trait, which defines how each type of collection gets built from an iterator." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"In addition to the basic implementations of `FromIterator` for `Vec`, " +"`HashMap`, etc., there are also more specialized implementations which let " +"you do cool things like convert an `Iterator>` into a " +"`Result, E>`." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"The reason type annotations are often needed with `collect` is because it's " +"generic over its return type. This makes it harder for the compiler to infer " +"the correct type in a lot of cases." msgstr "" #: src/iterators/intoiterator.md @@ -8934,6 +10367,14 @@ msgstr "" msgid "\"point = {x}, {y}\"" msgstr "" +#: src/iterators/intoiterator.md +msgid "" +"`IntoIterator` is the trait that makes for loops work. It is implemented by " +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +msgstr "" + #: src/iterators/intoiterator.md msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " @@ -8966,8 +10407,10 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and creating a " +"`GridRefIter` that iterates by reference. A version with both `GridIter` and " +"`GridRefIter` is available [in this playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=947e371c7295af758504f01f149023a1)." msgstr "" #: src/iterators/intoiterator.md @@ -8978,49 +10421,6 @@ msgid "" "over references to elements of `some_vector`." msgstr "" -#: src/iterators/fromiterator.md -msgid "FromIterator" -msgstr "FromIterator" - -#: src/iterators/fromiterator.md -msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "\"prime_squares: {prime_squares:?}\"" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "`Iterator` implements" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "There are two ways to specify `B` for this method:" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"Rewrite the example to use this form." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." -msgstr "" - #: src/iterators/exercise.md msgid "" "In this exercise, you will need to find and use some of the provided methods " @@ -9044,25 +10444,8 @@ msgid "" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -#: src/modules.md -msgid "[Modules](./modules/modules.md) (3 minutes)" -msgstr "" - -#: src/modules.md -msgid "[Filesystem Hierarchy](./modules/filesystem.md) (5 minutes)" -msgstr "" - -#: src/modules.md -msgid "[Visibility](./modules/visibility.md) (5 minutes)" -msgstr "" - -#: src/modules.md -msgid "[use, super, self](./modules/paths.md) (10 minutes)" -msgstr "" - -#: src/modules.md -msgid "" -"[Exercise: Modules for a GUI Library](./modules/exercise.md) (15 minutes)" +#: src/modules.md src/modules/paths.md +msgid "use, super, self" msgstr "" #: src/modules/modules.md @@ -9104,7 +10487,7 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden." +"This tells Rust that the `garden` module content is found at `src/garden." "rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" "vegetables.rs`." msgstr "" @@ -9243,8 +10626,80 @@ msgid "" "its descendants)." msgstr "" -#: src/modules/paths.md -msgid "use, super, self" +#: src/modules/encapsulation.md +msgid "Visibility and Encapsulation" +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Like with items in a module, struct fields are also private by default. " +"Private fields are likewise visible within the rest of the module (including " +"child modules). This allows us to encapsulate implementation details of " +"struct, controlling what data and functionality is visible externally." +msgstr "" + +#: src/modules/encapsulation.md +msgid "\"Is {} big? {}\"" +msgstr "\"{} büyük mü? {}\"" + +#: src/modules/encapsulation.md +msgid "\"foo.val = {}\"" +msgstr "" + +#: src/modules/encapsulation.md +msgid "// let foo = Foo { val: 42, is_big: true };\n" +msgstr "" + +#: src/modules/encapsulation.md +msgid "// println!(\"Is {} big? {}\", foo.val, foo.is_big);\n" +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"This slide demonstrates how privacy in structs is module-based. Students " +"coming from object oriented languages may be used to types being the " +"encapsulation boundary, so this demonstrates how Rust behaves differently " +"while showing how we can still achieve encapsulation." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Note how the `is_big` field is fully controlled by `Foo`, allowing `Foo` to " +"control how it's initialized and enforce any invariants it needs to (e.g. " +"that `is_big` is only `true` if `val > 100`)." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Point out how helper functions can be defined in the same module (including " +"child modules) in order to get access to the type's private fields/methods." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"The first commented out line demonstrates that you cannot initialize a " +"struct with private fields. The second one demonstrates that you also can't " +"directly access private fields." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Enums do not support privacy: Variants and data within those variants is " +"always public." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"If students want more information about privacy (or lack thereof) in enums, " +"you can bring up `#[doc_hidden]` and `#[non_exhaustive]` and show how " +"they're used to limit what can be done with an enum." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Module privacy still applies when there are `impl` blocks in other modules " +"[(example in the playground)](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=3e61f43c88de12bcdf69c1d6df9ab3da)." msgstr "" #: src/modules/paths.md @@ -9381,11 +10836,6 @@ msgstr "" msgid "\"+-{:-`, `Display`, and the `Error` trait." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`thiserror` is often used in libraries to create custom error types that " -"implement `From`." +#: src/error-handling/thiserror.md +msgid "\"I/O error: {0}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Found no username in {0}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to open {path}\"" +#: src/error-handling/thiserror.md src/error-handling/anyhow.md +msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to read\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Username: {username}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Error: {err:?}\"" msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "`thiserror`" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/thiserror.md msgid "" "The `Error` derive macro is provided by `thiserror`, and has lots of useful " "attributes to help define error types in a compact way." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "The `std::error::Error` trait is derived automatically." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/thiserror.md msgid "The message from `#[error]` is used to derive the `Display` trait." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "`anyhow`" +#: src/error-handling/thiserror.md +msgid "" +"Note that the (`thiserror::`)`Error` derive macro, while it has the effect " +"of implementing the (`std::error::`)`Error` trait, is not the same this; " +"traits and macros do not share a namespace." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/anyhow.md +msgid "" +"The [`anyhow`](https://docs.rs/anyhow/) crate provides a rich error type " +"with support for carrying additional contextual information, which can be " +"used to provide a semantic trace of what the program was doing leading up to " +"the error." +msgstr "" + +#: src/error-handling/anyhow.md +msgid "" +"This can be combined with the convenience macros from [`thiserror`](https://" +"docs.rs/thiserror/) to avoid writing out trait impls explicitly for custom " +"error types." +msgstr "" + +#: src/error-handling/anyhow.md +msgid "\"Failed to open {path}\"" +msgstr "" + +#: src/error-handling/anyhow.md +msgid "\"Failed to read\"" +msgstr "" + +#: src/error-handling/anyhow.md msgid "" "`anyhow::Error` is essentially a wrapper around `Box`. As such " "it's again generally not a good choice for the public API of a library, but " "is widely used in applications." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/anyhow.md msgid "" -"Actual error type inside of it can be extracted for examination if necessary." +"Functionality provided by `anyhow::Error` may be familiar to Go developers, " +"as it provides similar behavior to the Go `error` type and `Result` is much like a Go `(T, error)` (with the convention that " +"only one element of the pair is meaningful)." msgstr "" -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/anyhow.md msgid "" "`anyhow::Context` is a trait implemented for the standard `Result` and " "`Option` types. `use anyhow::Context` is necessary to enable `.context()` " "and `.with_context()` on those types." msgstr "" -#: src/error-handling/exercise.md -msgid "Exercise: Rewriting with Result" +#: src/error-handling/anyhow.md +msgid "" +"`anyhow::Error` has support for downcasting, much like `std::any::Any`; the " +"specific error type stored inside can be extracted for examination if " +"desired with [`Error::downcast`](https://docs.rs/anyhow/latest/anyhow/struct." +"Error.html#method.downcast)." msgstr "" #: src/error-handling/exercise.md msgid "" -"The following implements a very simple parser for an expression language. " -"However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"In this exercise we're revisiting the expression evaluator exercise that we " +"did in day 2. Our initial solution ignores a possible error case: Dividing " +"by zero! Rewrite `eval` to instead use idiomatic error handling to handle " +"this error case and return an error when it occurs. We provide a simple " +"`DivideByZeroError` type to use as the error type for `eval`." msgstr "" #: src/error-handling/exercise.md msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An arithmetic operator.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A token in the expression language.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An expression in the expression language.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A reference to a variable.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A literal number.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A binary operation.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'_'" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'+'" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'-'" +"// The original implementation of the expression evaluator. Update this to\n" +"// return a `Result` and produce an error when dividing by 0.\n" msgstr "" #: src/error-handling/exercise.md -msgid "\"Unexpected character {c}\"" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"Unexpected end of input\"" +msgid "\"Cannot divide by zero!\"" msgstr "" #: src/error-handling/exercise.md -msgid "\"Invalid 32-bit integer'\"" -msgstr "" - -#: src/error-handling/exercise.md -msgid "\"Unexpected token {tok:?}\"" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "// Look ahead to parse a binary operation if present.\n" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"10+foo+20-30\"" -msgstr "" - -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"{expr:?}\"" -msgstr "" - -#: src/error-handling/solution.md -msgid "\"Unexpected character '{0}' in input\"" -msgstr "" - -#: src/error-handling/solution.md -msgid "\"Tokenizer error: {0}\"" -msgstr "" - -#: src/error-handling/solution.md -msgid "\"Unexpected token {0:?}\"" -msgstr "" - -#: src/error-handling/solution.md -msgid "\"Invalid number\"" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unsafe](./unsafe-rust/unsafe.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md msgid "" -"[Dereferencing Raw Pointers](./unsafe-rust/dereferencing.md) (10 minutes)" +"The starting code here isn't exactly the same as the previous exercise's " +"solution: We've added in an explicit panic to show students where the error " +"case is. Point this out if students get confused." msgstr "" #: src/unsafe-rust.md -msgid "[Mutable Static Variables](./unsafe-rust/mutable-static.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unions](./unsafe-rust/unions.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unsafe Functions](./unsafe-rust/unsafe-functions.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unsafe Traits](./unsafe-rust/unsafe-traits.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "This segment should take about 1 hour and 5 minutes" -msgstr "" +msgid "This segment should take about 1 hour and 15 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat 15 dakika sürmelidir. İçeriği:" #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" @@ -10332,38 +11671,33 @@ msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" msgstr "" #: src/unsafe-rust/dereferencing.md -msgid "\"careful!\"" +msgid "" +"// SAFETY: p1 and p2 were created by taking raw pointers to a local, so " +"they\n" +" // are guaranteed to be non-null, aligned, and point into a single " +"(stack-)\n" +" // allocated object.\n" +" //\n" +" // The object underlying the raw pointers lives for the entire function, " +"so\n" +" // it is not deallocated while the raw pointers still exist. It is not\n" +" // accessed through references while the raw pointers exist, nor is it\n" +" // accessed from other threads concurrently.\n" +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "// Mutation may soundly be observed through a raw pointer, like in C.\n" msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"// Safe because r1 and r2 were obtained from references and so are\n" -" // guaranteed to be non-null and properly aligned, the objects " -"underlying\n" -" // the references from which they were obtained are live throughout the\n" -" // whole unsafe block, and they are not accessed either through the\n" -" // references or concurrently through any other pointers.\n" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "\"r1 is: {}\"" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "\"uhoh\"" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "\"r2 is: {}\"" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "" -"// NOT SAFE. DO NOT DO THIS.\n" +"// UNSOUND. DO NOT DO THIS.\n" " /*\n" -" let r3: &String = unsafe { &*r1 };\n" -" drop(s);\n" -" println!(\"r3 is: {}\", *r3);\n" +" let r: &i32 = unsafe { &*p1 };\n" +" dbg!(r);\n" +" x = 50;\n" +" dbg!(r); // Object underlying the reference has been mutated. This is " +"UB.\n" " */" msgstr "" @@ -10410,9 +11744,12 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"UNSOUND\" section gives an example of a common kind of UB bug: naïvely " +"taking a reference to the dereference of a raw pointer sidesteps the " +"compiler's knowledge of what object the reference is actually pointing to. " +"As such, the borrow checker does not freeze `x` and so we are able to modify " +"it despite the existence of a reference to it. Creating a reference from a " +"pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md @@ -10429,27 +11766,47 @@ msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"However, since data races can occur, it is unsafe to read and write mutable " -"static variables:" -msgstr "" - -#: src/unsafe-rust/mutable-static.md -msgid "\"COUNTER: {COUNTER}\"" +"However, mutable static variables are unsafe to read and write because " +"multiple threads could do so concurrently without synchronization, " +"constituting a data race." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"Using mutable statics soundly requires reasoning about concurrency without " +"the compiler's help:" msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"The program here is sound because it is single-threaded. However, the Rust " +"compiler reasons about functions individually so can't assume that. Try " +"removing the `unsafe` and see how the compiler explains that it is undefined " +"behavior to access a mutable static from multiple threads." +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"The 2024 Rust edition goes further and makes accessing a mutable static by " +"reference an error by default." +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"Using a mutable static is almost always a bad idea, you should use interior " +"mutability instead." +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"There are some cases where it might be necessary in low-level `no_std` code, " +"such as implementing a heap allocator or working with some C APIs. In this " +"case you should use pointers rather than references." msgstr "" #: src/unsafe-rust/unions.md @@ -10482,115 +11839,205 @@ msgid "" "crates/zerocopy) crate." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "Calling Unsafe Functions" -msgstr "Emniyetsiz (Unsafe) Fonksiyonları Çağırma" - #: src/unsafe-rust/unsafe-functions.md msgid "" "A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md -#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md -#: src/android/interoperability/with-c/rust.md -#: src/android/interoperability/cpp/cpp-bridge.md -#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"C\"" +"you must uphold to avoid undefined behaviour." msgstr "" #: src/unsafe-rust/unsafe-functions.md -msgid "\"🗻∈🌏\"" +msgid "Unsafe functions may come from two places:" msgstr "" #: src/unsafe-rust/unsafe-functions.md -msgid "" -"// Safe because the indices are in the correct order, within the bounds of\n" -" // the string slice, and lie on UTF-8 sequence boundaries.\n" +#, fuzzy +msgid "Rust functions declared unsafe." +msgstr "Rust fonksiyonları `unsafe fn` ile emniyetli olmadığı bildirildi." + +#: src/unsafe-rust/unsafe-functions.md +msgid "Unsafe foreign functions in `extern \"C\"` blocks." msgstr "" #: src/unsafe-rust/unsafe-functions.md -msgid "\"emoji: {}\"" +msgid "We will look at the two kinds of unsafe functions next." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"char count: {}\"" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md -msgid "// Undefined behavior if abs misbehaves.\n" -msgstr "// Undefined behavior if abs misbehaves.\n" - -#: src/unsafe-rust/unsafe-functions.md -msgid "\"Absolute value of -3 according to C: {}\"" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md -msgid "" -"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" -" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" -" // println!(\"char count: {}\", count_chars(unsafe {\n" -" // emojis.get_unchecked(0..3) }));\n" -msgstr "" - -#: src/unsafe-rust/unsafe-functions.md -msgid "Writing Unsafe Functions" -msgstr "Emniyetsiz (Unsafe) Fonksiyonlar Yazma" - -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md msgid "" "You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +"preconditions to avoid undefined behaviour." msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md msgid "" "/// Swaps the values pointed to by the given pointers.\n" "///\n" "/// # Safety\n" "///\n" -"/// The pointers must be valid and properly aligned.\n" +"/// The pointers must be valid, properly aligned, and not otherwise accessed " +"for\n" +"/// the duration of the function call.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "// Safe because ...\n" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"// SAFETY: Our caller promised that the pointers are valid, properly " +"aligned\n" +" // and have no other access.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"// SAFETY: The pointers must be valid, aligned and unique because they came\n" +" // from references.\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/rust.md msgid "\"a = {}, b = {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"We wouldn't actually use pointers for a `swap` function --- it can be done " +"safely with references." msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"Note that Rust 2021 and earlier allow unsafe code within an unsafe function " +"without an `unsafe` block. This changed in the 2024 edition. We can prohibit " +"it in older editions with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " +"and see what happens." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"You can declare foreign functions for access from Rust with `unsafe extern`. " +"This is unsafe because the compiler has to way to reason about their " +"behavior. Functions declared in an `extern` block must be marked as `safe` " +"or `unsafe`, depending on whether they have preconditions for safe use:" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md src/unsafe-rust/exercise.md +#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md +#: src/android/interoperability/with-c/rust-library.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md +msgid "\"C\"" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"// `abs` doesn't deal with pointers and doesn't have any safety " +"requirements.\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"/// # Safety\n" +" ///\n" +" /// `s` must be a pointer to a NUL-terminated C string which is valid " +"and\n" +" /// not modified for the duration of this function call.\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"Absolute value of -3 according to C: {}\"" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"// SAFETY: We pass a pointer to a C string literal which is valid for\n" +" // the duration of the program.\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"String length: {}\"" +msgstr "\"Dize uzunluğu: {}\"" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"String\"" +msgstr "\"String\"" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"Rust used to consider all extern functions unsafe, but this changed in Rust " +"1.82 with `unsafe extern` blocks." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"`abs` must be explicitly marked as `safe` because it is an external function " +"(FFI). Calling external functions is usually only a problem when those " +"functions do things with pointers which might violate Rust's memory model, " +"but in general any C function might have undefined behaviour under any " +"arbitrary circumstances." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" "The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +"Note that there is no verification that the Rust function signature matches " +"that of the function definition -- that's up to you!" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "Failing to uphold the safety requirements breaks memory safety!" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "// 8 bytes\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "\"{pk:?}\"" +msgstr "\"{pk:?}\"" + +#: src/unsafe-rust/unsafe-functions/calling.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"Always include a safety comment for each `unsafe` block. It must explain why " +"the code is actually safe. This example is missing a safety comment and is " +"unsound." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"The second argument to `slice::from_raw_parts` is the number of _elements_, " +"not bytes! This example demonstrates unexpected behavior by reading past the " +"end of one array and into another." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"This is undefined behavior because we're reading past the end of the array " +"that the pointer was derived from." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"`log_public_key` should be unsafe, because `pk_ptr` must meet certain " +"prerequisites to avoid undefined behaviour. A safe function which can cause " +"undefined behaviour is said to be `unsound`. What should its safety " +"documentation say?" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"The standard library contains many low-level unsafe functions. Prefer the " +"safe alternatives when possible!" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"If you use an unsafe function as an optimization, make sure to add a " +"benchmark to demonstrate the gain." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10606,7 +12053,7 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" "For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.IntoBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10617,7 +12064,7 @@ msgid "" msgstr "" #: src/unsafe-rust/unsafe-traits.md -msgid "// Safe because u32 has a defined representation and no padding.\n" +msgid "// SAFETY: `u32` has a defined representation and no padding.\n" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10628,7 +12075,7 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more " +"The actual safety section for `IntoBytes` is rather longer and more " "complicated." msgstr "" @@ -10638,7 +12085,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "Safe FFI Wrapper" -msgstr "Güvenli FFI Sarıcı (Wrapper)" +msgstr "Emniyetli FFI Sarıcı (Wrapper)" #: src/unsafe-rust/exercise.md msgid "" @@ -10770,6 +12217,11 @@ msgid "" "functions and methods:" msgstr "" +#: src/unsafe-rust/exercise.md +msgid "// TODO: remove this when you're done with your implementation.\n" +msgstr "" +"// TODO: uyarlamanız (implementation) bittiğinde bu yorum satırını silin.\n" + #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" msgstr "" @@ -10818,12 +12270,12 @@ msgstr "" msgid "// Keep calling readdir until we get a NULL pointer back.\n" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/unsafe-rust/exercise.md msgid "// Call closedir as needed.\n" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\".\"" msgstr "" @@ -10840,7 +12292,7 @@ msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" msgstr "" #: src/unsafe-rust/solution.md -msgid "\"Could not open {:?}\"" +msgid "\"Could not open {path:?}\"" msgstr "" #: src/unsafe-rust/solution.md @@ -10860,7 +12312,9 @@ msgid "" msgstr "" #: src/unsafe-rust/solution.md -msgid "// SAFETY: self.dir is not NULL.\n" +msgid "" +"// Call closedir as needed.\n" +" // SAFETY: self.dir is never NULL.\n" msgstr "" #: src/unsafe-rust/solution.md @@ -10914,14 +12368,6 @@ msgid "" "existing code as needed)." msgstr "" -#: src/android.md -msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." -msgstr "" - #: src/android.md msgid "" "The speaker may mention any of the following given the increased use of Rust " @@ -10931,25 +12377,25 @@ msgstr "" #: src/android.md msgid "" "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"over-http3-in-android.html)." msgstr "" #: src/android.md msgid "" "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"appendix/rutabaga_gfx.html)." msgstr "" #: src/android.md msgid "" "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"rust-binder-v1-0-08ba9197f637@google.com/)." msgstr "" #: src/android.md msgid "" "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"rust-in-android.html)." msgstr "" #: src/android/setup.md @@ -10964,6 +12410,14 @@ msgid "" "setup/start) for details." msgstr "" +#: src/android/setup.md +msgid "" +"The code on the following pages can be found in the [`src/android/` " +"directory](https://github.com/google/comprehensive-rust/tree/main/src/" +"android) of the course material. Please `git clone` the repository to follow " +"along." +msgstr "" + #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " @@ -11082,20 +12536,8 @@ msgstr "" #: src/android/build-rules.md msgid "" -"Soong has many similarities to Bazel, which is the open-source variant of " -"Blaze (used in google3)." -msgstr "" - -#: src/android/build-rules.md -msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/" -"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) to Bazel." -msgstr "" - -#: src/android/build-rules.md -msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" #: src/android/build-rules.md @@ -11154,6 +12596,24 @@ msgid "" "```" msgstr "" +#: src/android/build-rules/binary.md src/android/build-rules/library.md +msgid "" +"Go through the build steps and demonstrate them running in your emulator." +msgstr "" + +#: src/android/build-rules/binary.md +msgid "" +"Notice the extensive documentation comments? The Android build rules enforce " +"that all modules have documentation. Try removing it and see what error you " +"get." +msgstr "" + +#: src/android/build-rules/binary.md +msgid "" +"Stress that the Rust build rules look like the other Soong rules. This is on " +"purpose to make it as easy to use Rust as C++ or Java." +msgstr "" + #: src/android/build-rules/library.md msgid "Rust Libraries" msgstr "" @@ -11172,9 +12632,9 @@ msgstr "" #: src/android/build-rules/library.md msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/android-" +"crates-io/crates/`](https://cs.android.com/android/platform/superproject/" +"main/+/main:external/rust/android-crates-io/crates/)." msgstr "" #: src/android/build-rules/library.md @@ -11233,6 +12693,19 @@ msgid "" "```" msgstr "" +#: src/android/build-rules/library.md +msgid "" +"A Rust crate named `greetings` must be built by a rule called " +"`libgreetings`. Note how the Rust code uses the crate name, as is normal in " +"Rust." +msgstr "" + +#: src/android/build-rules/library.md +msgid "" +"Again, the build rules enforce that we add documentation comments to all " +"public items." +msgstr "" + #: src/android/aidl.md msgid "" "The [Android Interface Definition Language (AIDL)](https://developer.android." @@ -11247,6 +12720,16 @@ msgstr "" msgid "You can create new AIDL servers in Rust." msgstr "" +#: src/android/aidl.md +msgid "AIDL is what enables Android apps to interact with each other." +msgstr "" + +#: src/android/aidl.md +msgid "" +"Since Rust is supported as a first-class citizen in this ecosystem, Rust " +"services can be called by any other process on the phone." +msgstr "" + #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " @@ -11264,6 +12747,8 @@ msgstr "" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" @@ -11308,14 +12793,12 @@ msgid "Generated Service API" msgstr "" #: src/android/aidl/example-service/service-bindings.md -msgid "" -"Binder generates a trait corresponding to the interface definition. trait to " -"talk to the service." +msgid "Binder generates a trait for each interface definition." msgstr "" #: src/android/aidl/example-service/service-bindings.md -msgid "_Generated trait_:" -msgstr "_Generated trait_:" +msgid "_out/soong/.intermediates/.../com_example_birthdayservice.rs_:" +msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" @@ -11323,12 +12806,6 @@ msgid "" "this trait to talk to the service." msgstr "" -#: src/android/aidl/example-service/service-bindings.md -msgid "" -"The generated bindings can be found at `out/soong/.intermediates//`." -msgstr "" - #: src/android/aidl/example-service/service-bindings.md msgid "" "Point out how the generated function signature, specifically the argument " @@ -11351,9 +12828,14 @@ msgstr "" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/file-descriptor.md msgid "_birthday_service/src/lib.rs_:" msgstr "" +#: src/android/aidl/example-service/service.md +msgid "//! Implementation of the `IBirthdayService` AIDL interface.\n" +msgstr "" + #: src/android/aidl/example-service/service.md msgid "/// The `IBirthdayService` implementation.\n" msgstr "" @@ -11399,6 +12881,31 @@ msgid "" "why each of the segments is necessary." msgstr "" +#: src/android/aidl/example-service/service.md +msgid "" +"Note that `wishHappyBirthday` and other AIDL IPC methods take `&self` " +"(instead of `&mut self`)." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"This is necessary because binder responds to incoming requests on a thread " +"pool, allowing for multiple requests to be processed in parallel. This " +"requires that the service methods only get a shared reference to `self`." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"Any state that needs to be modified by the service will have to be put in " +"something like a `Mutex` to allow for safe mutation." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"The correct approach for managing service state depends heavily on the " +"details of your service." +msgstr "" + #: src/android/aidl/example-service/service.md msgid "" "TODO: What does the `binder::Interface` trait do? Are there methods to " @@ -11509,6 +13016,8 @@ msgstr "" #: src/android/aidl/example-service/client.md #: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "_birthday_service/src/client.rs_:" msgstr "" @@ -11777,8 +13286,8 @@ msgstr "`Vec`" msgid "" "In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " "becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " -"int\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented " -"as array types." +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" #: src/android/aidl/types/arrays.md @@ -11793,14 +13302,8 @@ msgstr "" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" -msgstr "" - -#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl_:" msgstr "" #: src/android/aidl/types/objects.md @@ -11811,11 +13314,6 @@ msgstr "" msgid "/** The same thing, but using `IBinder`. */" msgstr "" -#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/src/client.rs**:" -msgstr "" - #: src/android/aidl/types/objects.md msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" msgstr "" @@ -11844,8 +13342,7 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "" #: src/android/aidl/types/parcelables.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "_birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl_:" msgstr "" #: src/android/aidl/types/parcelables.md @@ -11882,10 +13379,6 @@ msgstr "" msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" msgstr "" -#: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/src/lib.rs**:" -msgstr "" - #: src/android/aidl/types/file-descriptor.md msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" @@ -11941,10 +13434,42 @@ msgstr "" msgid "\"leftpad_test\"" msgstr "" -#: src/android/testing.md src/android/interoperability/with-c/bindgen.md +#: src/android/testing.md src/android/interoperability/with-c/run-our-binary.md msgid "\"general-tests\"" msgstr "\"general-tests\"" +#: src/android/testing.md +msgid "\"libgoogletest_example\"" +msgstr "" + +#: src/android/testing.md +msgid "\"googletest_example\"" +msgstr "" + +#: src/android/testing.md +msgid "\"googletest.rs\"" +msgstr "\"googletest.rs\"" + +#: src/android/testing.md +msgid "\"libgoogletest_rust\"" +msgstr "" + +#: src/android/testing.md +msgid "\"libmockall_example\"" +msgstr "\"libmockall_example\"" + +#: src/android/testing.md +msgid "\"mockall_example\"" +msgstr "\"mockall_example\"" + +#: src/android/testing.md +msgid "\"mockall.rs\"" +msgstr "" + +#: src/android/testing.md +msgid "\"libmockall\"" +msgstr "\"libmockall\"" + #: src/android/testing.md msgid "_testing/src/lib.rs_:" msgstr "" @@ -12003,6 +13528,10 @@ msgid "" "assertions using _matchers_:" msgstr "" +#: src/android/testing/googletest.md +msgid "\"bar\"" +msgstr "" + #: src/android/testing/googletest.md msgid "\"baz\"" msgstr "" @@ -12032,7 +13561,13 @@ msgid "" msgstr "" #: src/android/testing/googletest.md -msgid "This just scratches the surface, there are many builtin matchers." +msgid "" +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" #: src/android/testing/googletest.md @@ -12175,7 +13710,7 @@ msgstr "" msgid "\"Something went wrong!\"" msgstr "" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md +#: src/android/logging.md src/android/interoperability/with-c/run-our-binary.md #: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" msgstr "" @@ -12194,6 +13729,12 @@ msgstr "" msgid "The logs show up in `adb logcat`:" msgstr "" +#: src/android/logging.md +msgid "" +"The logger implementation in `liblogger` is only needed in the final binary, " +"if you're logging from a library you only need the `log` facade crate." +msgstr "" + #: src/android/interoperability.md msgid "" "Rust has excellent support for interoperability with other languages. This " @@ -12214,6 +13755,19 @@ msgid "" "_foreign function interface_, also known as FFI." msgstr "" +#: src/android/interoperability.md +msgid "" +"This is a key ability of Rust: compiled code becomes indistinguishable from " +"compiled C or C++ code." +msgstr "" + +#: src/android/interoperability.md +msgid "" +"Technically, we say that Rust can be compiled to the same [ABI](https://en." +"wikipedia.org/wiki/Application_binary_interface) (application binary " +"interface) as C code." +msgstr "" + #: src/android/interoperability/with-c.md msgid "Interoperability with C" msgstr "" @@ -12234,8 +13788,8 @@ msgstr "" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../exercises/day-3/" -"safe-ffi-wrapper.md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." msgstr "" #: src/android/interoperability/with-c.md @@ -12248,6 +13802,73 @@ msgstr "" msgid "We will look at better options next." msgstr "" +#: src/android/interoperability/with-c.md +msgid "" +"The [`\"C\"` part](https://doc.rust-lang.org/reference/items/external-blocks." +"html#abi) of the `extern` block tells Rust that `abs` can be called using " +"the C [ABI](https://en.wikipedia.org/wiki/Application_binary_interface) " +"(application binary interface)." +msgstr "" + +#: src/android/interoperability/with-c.md +msgid "" +"The `safe fn abs` part tells that Rust that `abs` is a safe function. By " +"default, extern functions are considered unsafe, but since `abs(x)` is valid " +"for any `x`, we can declare it safe." +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "Let's first create a small C library:" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "_interoperability/bindgen/libbirthday.h_:" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "_interoperability/bindgen/libbirthday.c_:" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +#: src/android/interoperability/with-c/bindgen.md +msgid "\"libbirthday.h\"" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "\"+--------------\\n\"" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "\"| Happy Birthday %s!\\n\"" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "\"| Congratulations with the %i years!\\n\"" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "Add this to your `Android.bp` file:" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md +msgid "_interoperability/bindgen/Android.bp_:" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +#: src/android/interoperability/with-c/bindgen.md +msgid "\"libbirthday\"" +msgstr "" + +#: src/android/interoperability/with-c/c-library.md +msgid "\"libbirthday.c\"" +msgstr "" + #: src/android/interoperability/with-c/bindgen.md msgid "Using Bindgen" msgstr "" @@ -12258,54 +13879,6 @@ msgid "" "tool can auto-generate bindings from a C header file." msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "First create a small C library:" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "_interoperability/bindgen/libbirthday.h_:" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "_interoperability/bindgen/libbirthday.c_:" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"libbirthday.h\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"+--------------\\n\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"| Happy Birthday %s!\\n\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"| Congratulations with the %i years!\\n\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "Add this to your `Android.bp` file:" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "_interoperability/bindgen/Android.bp_:" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"libbirthday\"" -msgstr "" - -#: src/android/interoperability/with-c/bindgen.md -msgid "\"libbirthday.c\"" -msgstr "" - #: src/android/interoperability/with-c/bindgen.md msgid "" "Create a wrapper header file for the library (not strictly needed in this " @@ -12316,10 +13889,6 @@ msgstr "" msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "You can now auto-generate the bindings:" -msgstr "" - #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen\"" msgstr "" @@ -12357,11 +13926,30 @@ msgid "//! Bindgen demo.\n" msgstr "" #: src/android/interoperability/with-c/bindgen.md -msgid "// SAFETY: `print_card` is safe to call with a valid `card` pointer.\n" +msgid "" +"// SAFETY: The pointer we pass is valid because it came from a Rust\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" +" // after it returns.\n" msgstr "" #: src/android/interoperability/with-c/bindgen.md msgid "" +"The Android build rules will automatically call `bindgen` for you behind the " +"scenes." +msgstr "" + +#: src/android/interoperability/with-c/bindgen.md +msgid "" +"Notice that the Rust code in `main` is still hard to write. It is good " +"practice to encapsulate the output of `bindgen` in a Rust library which " +"exposes a safe interface to caller." +msgstr "" + +#: src/android/interoperability/with-c/run-our-binary.md +msgid "" "```shell\n" "m print_birthday_card\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" @@ -12370,78 +13958,90 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\"libbirthday_bindgen_test\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\"none\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "// Generated file, skip linting\n" msgstr "" +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"Exporting Rust functions and types to C is easy. Here's a simple Rust " +"library:" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "_interoperability/rust/libanalyze/analyze.rs_" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "//! Rust FFI demo.\n" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"/// Analyze the numbers.\n" +"// SAFETY: There is no other global function of this name.\n" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "\"x ({x}) is smallest!\"" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "\"y ({y}) is probably larger than x ({x})\"" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "_interoperability/rust/libanalyze/Android.bp_" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +#: src/android/interoperability/with-c/rust.md +msgid "\"libanalyze_ffi\"" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "\"analyze_ffi\"" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "\"analyze.rs\"" +msgstr "" + +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"`#[unsafe(no_mangle)]` disables Rust's usual name mangling, so the exported " +"symbol will just be the name of the function. You can also use " +"`#[unsafe(export_name = \"some_name\")]` to specify whatever name you want." +msgstr "" + #: src/android/interoperability/with-c/rust.md msgid "Calling Rust" msgstr "" #: src/android/interoperability/with-c/rust.md -msgid "Exporting Rust functions and types to C is easy:" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "_interoperability/rust/libanalyze/analyze.rs_" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "//! Rust FFI demo.\n" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "/// Analyze the numbers.\n" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "\"x ({x}) is smallest!\"" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "\"y ({y}) is probably larger than x ({x})\"" +msgid "We can now call this from a C binary:" msgstr "" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.h_" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "_interoperability/rust/libanalyze/Android.bp_" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "\"libanalyze_ffi\"" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "\"analyze_ffi\"" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "\"analyze.rs\"" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "We can now call this from a C binary:" -msgstr "" - #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/main.c_" msgstr "" @@ -12472,13 +14072,6 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " -"\"some_name\"]` to specify whatever name you want." -msgstr "" - #: src/android/interoperability/cpp.md msgid "" "The [CXX crate](https://cxx.rs/) makes it possible to do safe " @@ -12788,63 +14381,12 @@ msgid "" "semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md msgid "Building in Android" msgstr "Android'de İnşa Etme (Build)" -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Create a `cc_library_static` to build the C++ library, including the CXX " -"generated header and source file." -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-build-rust.md -msgid "\"libcxx_test_cpp\"" -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "\"cxx_test.cpp\"" -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "\"cxx-bridge-header\"" -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"libcxx_test_bridge_header\"" -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"libcxx_test_bridge_code\"" -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." -msgstr "" - -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." -msgstr "" - #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" "Create two genrules: One to generate the CXX header, and one to generate the " @@ -12857,6 +14399,11 @@ msgid "" "// to the Rust exported functions in lib.rs.\n" msgstr "" +#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"libcxx_test_bridge_header\"" +msgstr "" + #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"cxxbridge\"" msgstr "" @@ -12878,6 +14425,11 @@ msgstr "" msgid "// Generate the C++ code that Rust calls into.\n" msgstr "" +#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"libcxx_test_bridge_code\"" +msgstr "" + #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"$(location cxxbridge) $(in) > $(out)\"" msgstr "" @@ -12899,6 +14451,47 @@ msgid "" "convention isn't enforced, though." msgstr "" +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Create a `cc_library_static` to build the C++ library, including the CXX " +"generated header and source file." +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-build-rust.md +msgid "\"libcxx_test_cpp\"" +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"cxx_test.cpp\"" +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"cxx-bridge-header\"" +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." +msgstr "" + #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." @@ -12936,7 +14529,9 @@ msgid "//! Rust <-> Java FFI demo.\n" msgstr "" #: src/android/interoperability/java.md -msgid "/// HelloWorld::hello method implementation.\n" +msgid "" +"/// HelloWorld::hello method implementation.\n" +"// SAFETY: There is no other global function of this name.\n" msgstr "" #: src/android/interoperability/java.md @@ -12987,24 +14582,17 @@ msgstr "\"HelloWorld\"" msgid "Finally, you can build, sync, and run the binary:" msgstr "" -#: src/exercises/android/morning.md +#: src/android/interoperability/java.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" +"The `unsafe(no_mangle)` attribute instructs Rust to emit the " +"`Java_HelloWorld_hello` symbol exactly as written. This is important so that " +"Java can recognize the symbol as a `hello` method on the `HelloWorld` class." msgstr "" -#: src/exercises/android/morning.md -msgid "Call your AIDL service with a client written in Rust." -msgstr "" - -#: src/exercises/android/morning.md -msgid "Move a function from your project to Rust and call it." -msgstr "" - -#: src/exercises/android/morning.md +#: src/android/interoperability/java.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"By default, Rust will mangle (rename) symbols so that a binary can link in " +"two versions of the same Rust crate." msgstr "" #: src/chromium.md @@ -13277,25 +14865,38 @@ msgstr "" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium's Rust policy can be found [here](https://source.chromium.org/" +"chromium/chromium/src/+/main:docs/rust.md;l=22). Rust can be used for both " +"first-party and third-party code." +msgstr "" + +#: src/chromium/policy.md +msgid "Using Rust for pure first-party code looks like this:" msgstr "" #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"```bob\n" +"\"C++\" Rust\n" +".- - - - - - - - - -. .- - - - - - - - - - -.\n" +": : : :\n" +": Existing Chromium : : Chromium Rust :\n" +": \"C++\" : : code :\n" +": +---------------+ : : +----------------+ :\n" +": | | : : | | :\n" +": | o-----+-+-----------+-+-> | :\n" +": | | : Language : | | :\n" +": +---------------+ : boundary : +----------------+ :\n" +": : : :\n" +"`- - - - - - - - - -' `- - - - - - - - - - -'\n" +"```" msgstr "" #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"The third-party case is also common. It's likely that you'll also need a " +"small amount of first-party glue code, because very few Rust libraries " +"directly expose a C/C++ API." msgstr "" #: src/chromium/policy.md @@ -13327,12 +14928,8 @@ msgstr "" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." -msgstr "" - -#: src/chromium/policy.md -msgid "Because of this, today's course will be heavily focused on:" +"The scenario of using a third-party crate is the more complex one, so " +"today's course will focus on:" msgstr "" #: src/chromium/policy.md @@ -13340,11 +14937,9 @@ msgid "Bringing in third-party Rust libraries (\"crates\")" msgstr "" #: src/chromium/policy.md -msgid "Writing glue code to be able to use those crates from Chromium C++." -msgstr "" - -#: src/chromium/policy.md -msgid "If this policy changes over time, the course will evolve to keep up." +msgid "" +"Writing glue code to be able to use those crates from Chromium C++. (The " +"same techniques are used when working with first-party Rust code)." msgstr "" #: src/chromium/build-rules.md @@ -13523,7 +15118,7 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quote a few nice examples in the " +"Demo **type annotations** (there are quite a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" @@ -13544,6 +15139,12 @@ msgid "" "containing:" msgstr "" +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md +msgid "// SAFETY: There is no other global function of this name.\n" +msgstr "" + #: src/exercises/chromium/build-rules.md msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " @@ -13587,8 +15188,8 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +"Information about [`#[unsafe(no_mangle)]`](https://doc.rust-lang.org/beta/" +"reference/abi.html#the-no_mangle-attribute)" msgstr "" #: src/exercises/chromium/build-rules.md @@ -13619,9 +15220,9 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[unsafe(no_mangle)]` might " +"allow Rust to generate two functions with the same name, and Rust can no " +"longer guarantee that the right one is called." msgstr "" #: src/exercises/chromium/build-rules.md @@ -14223,7 +15824,7 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " -"`#[no_mangle]`. This is now just a standard Rust function." +"`#[unsafe(no_mangle)]`. This is now just a standard Rust function." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md @@ -15091,7 +16692,7 @@ msgstr "" msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" "(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF51822 microcontroller " +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " "with some LEDs and buttons, an I2C-connected accelerometer and compass, and " "an on-board SWD debugger." msgstr "" @@ -15106,6 +16707,14 @@ msgid "" "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" +#: src/bare-metal.md +msgid "" +"You should see \"NXP ARM mbed\" in the output of `lsusb` if the device is " +"available. If you are using a Linux environment on a Chromebook, you will " +"need to share the USB device with Linux, via `chrome://os-settings/crostini/" +"sharedUsbDevices`." +msgstr "" + #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" msgstr "" @@ -15134,6 +16743,14 @@ msgstr "" msgid "`Display`, `Debug`, `write!`..." msgstr "" +#: src/bare-metal/no_std.md +msgid "`Iterator`" +msgstr "`Iterator`" + +#: src/bare-metal/no_std.md +msgid "`Error`" +msgstr "" + #: src/bare-metal/no_std.md msgid "`panic!`, `assert_eq!`..." msgstr "" @@ -15166,10 +16783,6 @@ msgstr "" msgid "`String`, `CString`, `format!`" msgstr "" -#: src/bare-metal/no_std.md -msgid "`Error`" -msgstr "" - #: src/bare-metal/no_std.md msgid "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" msgstr "" @@ -15246,8 +16859,7 @@ msgid "" msgstr "" #: src/bare-metal/alloc.md -msgid "" -"// Safe because `HEAP` is only used here and `entry` is only called once.\n" +msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" msgstr "" #: src/bare-metal/alloc.md @@ -15264,9 +16876,9 @@ msgstr "" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a crate implementing a basic buddy system " +"allocator. Other crates are available, or you can write your own or hook " +"into your existing allocator." msgstr "" #: src/bare-metal/alloc.md @@ -15340,8 +16952,8 @@ msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"// Safe because the pointers are to valid peripheral control registers, and\n" -" // no aliases exist.\n" +"// SAFETY: The pointers are to valid peripheral control registers, and no\n" +" // aliases exist.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -15502,7 +17114,7 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " -"number of traits covering common microcontroller peripherals." +"number of traits covering common microcontroller peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -15510,30 +17122,37 @@ msgid "GPIO" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "ADC" +msgid "PWM" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "I2C, SPI, UART, CAN" +msgid "Delay timers" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "RNG" +msgid "I2C and SPI buses and devices" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Timers" -msgstr "" - -#: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Watchdogs" +msgid "" +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "Other crates then implement [drivers](https://github.com/rust-embedded/" "awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI bus implementation." +"accelerometer driver might need an I2C or SPI device instance." +msgstr "" + +#: src/bare-metal/microcontrollers/embedded-hal.md +msgid "" +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -15544,8 +17163,15 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There is work in progress on an `async` version of `embedded-hal`, but it " -"isn't stable yet." +"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " +"async versions of the traits." +msgstr "" + +#: src/bare-metal/microcontrollers/embedded-hal.md +msgid "" +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -15647,12 +17273,12 @@ msgid "[RTIC](https://rtic.rs/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "\"Real-Time Interrupt-driven Concurrency\"" +msgid "\"Real-Time Interrupt-driven Concurrency\"." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +"Shared resource management, message passing, task scheduling, timer queue." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15660,7 +17286,7 @@ msgid "[Embassy](https://embassy.dev/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "`async` executors with priorities, timers, networking, USB" +msgid "`async` executors with priorities, timers, networking, USB." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15670,7 +17296,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " -"support" +"support." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15680,11 +17306,11 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +"unprivileged drivers, IPC." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" +msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15728,7 +17354,7 @@ msgid "" "serial port." msgstr "" -#: src/exercises/bare-metal/morning.md src/exercises/concurrency/morning.md +#: src/exercises/bare-metal/morning.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "morning.md) provided." @@ -15765,9 +17391,9 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::" -"blocking::i2c::WriteRead` trait. The [`microbit::hal::Twim`](https://docs.rs/" -"microbit-v2/latest/microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md @@ -15872,16 +17498,31 @@ msgstr "" #: src/bare-metal/aps.md msgid "" "So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"These are typically small systems with very limited resources." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"Larger systems with more resources are typically called application " +"processors, built around processors such as the ARM Cortex-A or Intel Atom." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"For simplicity we'll just work with QEMU's aarch64 ['virt'](https://qemu-" +"project.gitlab.io/qemu/system/arm/virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" "Broadly speaking, microcontrollers don't have an MMU or multiple levels of " -"privilege (exception levels on Arm CPUs, rings on x86), while application " -"processors do." +"privilege (exception levels on Arm CPUs, rings on x86)." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"Application processors have more resources, and often run an operating " +"system, instead of directly executing the target application on startup." msgstr "" #: src/bare-metal/aps.md @@ -15891,6 +17532,12 @@ msgid "" "hardware, but is designed purely for virtual machines." msgstr "" +#: src/bare-metal/aps.md +msgid "" +"We will still address this board as bare-metal, as if we were writing an " +"operating system." +msgstr "" + #: src/bare-metal/aps/entry-point.md msgid "" "Before we can start running Rust code, we need to do some initialisation." @@ -15899,13 +17546,28 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" "```armasm\n" +"/**\n" +" * This is a generic entry point for an image. It carries out the\n" +" * operations required to prepare the loaded image to be run.\n" +" * Specifically, it\n" +" *\n" +" * - sets up the MMU with an identity map of virtual to physical\n" +" * addresses, and enables caching\n" +" * - enables floating point\n" +" * - zeroes the bss section using registers x25 and above\n" +" * - prepares the stack, pointing to a section within the image\n" +" * - sets up the exception vector\n" +" * - branches to the Rust `main` function\n" +" *\n" +" * It preserves x0-x3 for the Rust entry point, as these may contain\n" +" * boot parameters.\n" +" */\n" ".section .init.entry, \"ax\"\n" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" -" * caches.\n" +" * Load and apply the memory management configuration, ready to\n" +" * enable MMU and caches.\n" " */\n" " adrp x30, idmap\n" " msr ttbr0_el1, x30\n" @@ -15923,9 +17585,9 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" -" * potentially stale local TLB entries before they start being used.\n" +" * Ensure everything before this point has completed, then\n" +" * invalidate any potentially stale local TLB entries before they\n" +" * start being used.\n" " */\n" " isb\n" " tlbi vmalle1\n" @@ -15934,9 +17596,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" -" * has completed.\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed\n" +" * until this has completed.\n" " */\n" " msr sctlr_el1, x30\n" " isb\n" @@ -15972,6 +17633,13 @@ msgid "" "```" msgstr "" +#: src/bare-metal/aps/entry-point.md +msgid "" +"This code is in `src/bare-metal/aps/examples/src/entry.S`. It's not " +"necessary to understand this in detail -- the takeaway is that typically " +"some low-level setup is needed to meet Rust's expectations of the system." +msgstr "" + #: src/bare-metal/aps/entry-point.md msgid "" "This is the same as it would be for C: initialising the processor state, " @@ -16052,8 +17720,8 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"// Safe because this only uses the declared registers and doesn't do\n" -" // anything with memory.\n" +"// SAFETY: this only uses the declared registers and doesn't do anything\n" +" // with memory.\n" msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -16115,8 +17783,16 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +"This `main` function needs to be `#[unsafe(no_mangle)]` and `extern \"C\"` " +"because it is called from our entry point in `entry.S`." +msgstr "" + +#: src/bare-metal/aps/inline-assembly.md +msgid "" +"Just `#[no_mangle]` would be sufficient but [RFC3325](https://rust-lang." +"github.io/rfcs/3325-unsafe-attributes.html) uses this notation to draw " +"reviewer attention to attributes which might cause undefined behavior if " +"used incorrectly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -16140,19 +17816,29 @@ msgid "Volatile memory access for MMIO" msgstr "" #: src/bare-metal/aps/mmio.md -msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." -msgstr "" - -#: src/bare-metal/aps/mmio.md -msgid "Never hold a reference." +msgid "" +"Use [`pointer::read_volatile`](https://doc.rust-lang.org/stable/core/" +"primitive.pointer.html#method.read_volatile) and [`pointer::write_volatile`]" +"(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method." +"write_volatile)." msgstr "" #: src/bare-metal/aps/mmio.md msgid "" -"`addr_of!` lets you get fields of structs without creating an intermediate " +"Never hold a reference to a location being accessed with these methods. Rust " +"may read from (or write to, for `&mut`) a reference at any time." +msgstr "" + +#: src/bare-metal/aps/mmio.md +msgid "" +"Use `&raw` to get fields of structs without creating an intermediate " "reference." msgstr "" +#: src/bare-metal/aps/mmio.md +msgid "// SAFETY: Some device is mapped at this address.\n" +msgstr "" + #: src/bare-metal/aps/mmio.md msgid "" "Volatile access: read or write operations may have side-effects, so prevent " @@ -16173,10 +17859,14 @@ msgid "" "dereference it." msgstr "" +#: src/bare-metal/aps/mmio.md +msgid "Use `&raw` to get struct field pointers from a pointer to the struct." +msgstr "" + #: src/bare-metal/aps/mmio.md msgid "" -"Use the `addr_of!` macro to get struct field pointers from a pointer to the " -"struct." +"For compatibility with old versions of Rust you can use the [`addr_of!`]" +"(https://doc.rust-lang.org/stable/core/ptr/macro.addr_of.html) macro instead." msgstr "" #: src/bare-metal/aps/uart.md @@ -16193,7 +17883,7 @@ msgstr "" msgid "/// Minimal driver for a PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/uart.md msgid "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" " /// given base address.\n" @@ -16208,24 +17898,28 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "/// Writes a single byte to the UART.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// Wait until there is room in the TX buffer.\n" msgstr "" #: src/bare-metal/aps/uart.md msgid "" -"// Safe because we know that the base address points to the control\n" +"// SAFETY: We know that the base address points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// Write to the TX buffer.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// Wait until the UART is no longer busy.\n" msgstr "" @@ -16264,9 +17958,8 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart/traits.md -#: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"// Safe because it just contains a pointer to device memory, which can be\n" +"// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" @@ -16278,6 +17971,47 @@ msgstr "" #: src/bare-metal/aps/uart/traits.md msgid "" +"`Send` is an auto-trait, but not implemented automatically because it is not " +"implemented for pointers." +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/logging/using.md +msgid "Using it" +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" +"Let's write a small program using our driver to write to the serial console." +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Base address of the primary PL011 UART.\n" +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "" +"// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" +" // nothing else accesses that address range.\n" +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" @@ -16327,6 +18061,10 @@ msgstr "" msgid "RSR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "4" +msgstr "4" + #: src/bare-metal/aps/better-uart.md msgid "0x18" msgstr "" @@ -16347,6 +18085,10 @@ msgstr "" msgid "ILPR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "8" +msgstr "8" + #: src/bare-metal/aps/better-uart.md msgid "0x24" msgstr "" @@ -16367,6 +18109,10 @@ msgstr "" msgid "FBRD" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "6" +msgstr "6" + #: src/bare-metal/aps/better-uart.md msgid "0x2c" msgstr "" @@ -16435,6 +18181,10 @@ msgstr "" msgid "DMACR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "3" +msgstr "3" + #: src/bare-metal/aps/better-uart.md msgid "There are also some ID registers which have been omitted for brevity." msgstr "" @@ -16487,8 +18237,8 @@ msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `struct Flags(u16)`, " +"along with a bunch of method implementations to get and set flags." msgstr "" #: src/bare-metal/aps/better-uart/registers.md @@ -16510,87 +18260,227 @@ msgid "" msgstr "" #: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "Now let's use the new `Registers` struct in our driver." msgstr "" #: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "/// Driver for a PL011 UART.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"// Safe because we know that self.registers points to the control\n" -" // registers of a PL011 device which is appropriately mapped.\n" +"/// Constructs a new instance of the UART driver for a PL011 device with " +"the\n" +" /// given set of registers.\n" +" ///\n" +" /// # Safety\n" +" ///\n" +" /// The given pointer must point to the 8 MMIO control registers of a " +"PL011\n" +" /// device, which must be mapped into the address space of the process " +"as\n" +" /// device memory and not have any other aliases.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md msgid "" +"// SAFETY: We know that self.registers points to the control registers\n" +" // of a PL011 device which is appropriately mapped.\n" +msgstr "" + +#: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md +msgid "" "/// Reads and returns a pending byte, or `None` if nothing has been\n" " /// received.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md +msgid "" +"// SAFETY: We know that self.registers points to the control\n" +" // registers of a PL011 device which is appropriately mapped.\n" +msgstr "" + +#: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// TODO: Check for error conditions in bits 8-11.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"Note the use of `&raw const` / `&raw mut` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -msgid "Using it" +#: src/bare-metal/aps/better-uart/driver.md +msgid "" +"The example isn't included in the slides because it is very similar to the " +"`safe-mmio` example which comes next. You can run it in QEMU with `make " +"qemu` under `src/bare-metal/aps/examples` if you need to." msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"The [`safe-mmio`](https://crates.io/crates/safe-mmio) crate provides types " +"to wrap registers which can be read or written safely." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can't read" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Read has no side-effects" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Read has side-effects" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can't write" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadPure`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadPure.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadOnly`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadOnly.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can write" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`WriteOnly`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"WriteOnly.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadPureWrite`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadPureWrite.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadWrite`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadWrite.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Reading `dr` has a side effect: it pops a byte from the receive FIFO." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"Reading `rsr` (and other registers) has no side-effects. It is a 'pure' read." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"There are a number of different crates providing safe abstractions around " +"MMIO operations; we recommend the `safe-mmio` crate." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"The difference between `ReadPure` or `ReadOnly` (and likewise between " +"`ReadPureWrite` and `ReadWrite`) is whether reading a register can have side-" +"effects which change the state of the device. E.g. reading the data register " +"pops a byte from the receive FIFO. `ReadPure` means that reads have no side-" +"effects, they are purely reading data." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"/// Constructs a new instance of the UART driver for a PL011 device with " +"the\n" +" /// given set of registers.\n" +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "The driver no longer needs any unsafe code!" +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`UniqueMmioPointer` is a wrapper around a raw pointer to an MMIO device or " +"register. The caller of `UniqueMmioPointer::new` promises that it is valid " +"and unique for the given lifetime, so it can provide safe methods to read " +"and write fields." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"Note that `Uart::new` is now safe; `UniqueMmioPointer::new` is unsafe " +"instead." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"These MMIO accesses are generally a wrapper around `read_volatile` and " +"`write_volatile`, though on aarch64 they are instead implemented in assembly " +"to work around a bug where the compiler can emit instructions that prevent " +"MMIO virtualisation." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"The `field!` and `field_shared!` macros internally use `&raw mut` and `&raw " +"const` to get pointers to individual fields without creating an intermediate " +"reference, which would be unsound." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`field!` needs a mutable reference to a `UniqueMmioPointer`, and returns a " +"`UniqueMmioPointer` which allows reads with side effects and writes." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`field_shared!` works with a shared reference to either a " +"`UniqueMmioPointer` or a `SharedMmioPointer`. It returns a " +"`SharedMmioPointer` which only allows pure reads." +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md msgid "" "Let's write a small program using our driver to write to the serial console, " "and echo incoming bytes." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base address of the primary PL011 UART.\n" -msgstr "" - -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"// Safe because `PL011_BASE_ADDRESS` is the base address of a PL011 device,\n" -" // and nothing else accesses that address range.\n" -msgstr "" - -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" -msgstr "" - -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/using.md msgid "b'\\r'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/async/pitfalls/cancellation.md +#: src/bare-metal/aps/safemmio/using.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "b'\\n'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/using.md msgid "b'q'" msgstr "" -#: src/bare-metal/aps/better-uart/using.md -msgid "\"Bye!\"" +#: src/bare-metal/aps/safemmio/using.md +msgid "\"\\n\\nBye!\"" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/using.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." -msgstr "" - -#: src/bare-metal/aps/better-uart/using.md -msgid "" -"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +"Run the example in QEMU with `make qemu_safemmio` under `src/bare-metal/aps/" +"examples`." msgstr "" #: src/bare-metal/aps/logging.md @@ -16610,8 +18500,9 @@ msgstr "" #: src/bare-metal/aps/logging.md msgid "" -"The unwrap in `log` is safe because we initialise `LOGGER` before calling " -"`set_logger`." +"The first unwrap in `log` will succeed because we initialise `LOGGER` before " +"calling `set_logger`. The second will succeed because `Uart::write_str` " +"always returns `Ok`." msgstr "" #: src/bare-metal/aps/logging/using.md @@ -16668,12 +18559,67 @@ msgid "" "it in something like a `Mutex` and put it in a static." msgstr "" +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"The `aarch64-rt` crate provides the assembly entry point and exception " +"vector that we implemented before. We just need to mark our main function " +"with the `entry!` macro." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"It also provides the `initial_pagetable!` macro to let us define an initial " +"static pagetable in Rust, rather than in assembly code like we did before." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"We can also use the UART driver from the `arm-pl011-uart` crate rather than " +"writing our own." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Attributes to use for device memory in the initial identity map.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Attributes to use for normal memory in the initial identity map.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// 1 GiB of device memory.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// 1 GiB of normal memory.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// Another 1 GiB of device memory starting at 256 GiB.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "\"system_off returned\"" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"Run the example in QEMU with `make qemu_rt` under `src/bare-metal/aps/" +"examples`." +msgstr "" + #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" msgstr "" #: src/bare-metal/aps/other-projects.md -msgid "\"coreboot without the C\"" +msgid "\"coreboot without the C\"." msgstr "" #: src/bare-metal/aps/other-projects.md @@ -16693,7 +18639,7 @@ msgstr "" #: src/bare-metal/aps/other-projects.md msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +"exception handling, page tables." msgstr "" #: src/bare-metal/aps/other-projects.md @@ -16713,26 +18659,9 @@ msgstr "" #: src/bare-metal/aps/other-projects.md msgid "" "The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" -msgstr "" - -#: src/bare-metal/aps/other-projects.md -msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." -msgstr "" - -#: src/bare-metal/aps/other-projects.md -msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." +"enabled. This will read and write memory (e.g. the stack). However, this has " +"the problems mentioned at the beginning of this session regarding unaligned " +"access and cache coherency." msgstr "" #: src/bare-metal/useful-crates.md @@ -16741,7 +18670,7 @@ msgstr "Kullanışlı kasalar (crates)" #: src/bare-metal/useful-crates.md msgid "" -"We'll go over a few crates which solve some common problems in bare-metal " +"We'll look at a few crates which solve some common problems in bare-metal " "programming." msgstr "" @@ -16803,35 +18732,30 @@ msgstr "" msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." -msgstr "" - #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"com/android/platform/superproject/main/+/main:packages/modules/" +"Virtualization/guest/pvmfw/)." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +"There's no easy way to run this example by itself, as it needs to run on " +"real hardware or under QEMU." msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" "[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" +"is a crate implementing a basic buddy system allocator. It can be used both " +"to implement [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) (using [`LockedHeap`](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html)) " +"so you can use the standard `alloc` crate (as we saw [before](../alloc.md)), " +"or for allocating other address space (using [`FrameAllocator`](https://docs." +"rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.FrameAllocator." +"html)) . For example, we might want to allocate MMIO space for PCI BARs:" msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md @@ -16915,9 +18839,9 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" -"master/vmbase/) library provides a linker script and useful defaults for the " -"build rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" #: src/bare-metal/android/vmbase.md @@ -16936,7 +18860,7 @@ msgstr "" msgid "We will write a driver for the PL031 real-time clock device." msgstr "" -#: src/exercises/bare-metal/afternoon.md src/exercises/concurrency/afternoon.md +#: src/exercises/bare-metal/afternoon.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." @@ -17000,28 +18924,12 @@ msgstr "" msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_src/pl011.rs_ (you shouldn't need to change this):" -msgstr "" - #: src/exercises/bare-metal/rtc.md msgid "_build.rs_ (you shouldn't need to change this):" msgstr "" #: src/exercises/bare-metal/rtc.md -msgid "_entry.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_exceptions.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_idmap.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_image.ld_ (you shouldn't need to change this):" +msgid "_memory.ld_ (you shouldn't need to change this):" msgstr "" #: src/exercises/bare-metal/rtc.md @@ -17062,15 +18970,15 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"// Safe because `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" +"// SAFETY: `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" " // addresses of a GICv3 distributor and redistributor respectively, and\n" " // nothing else accesses those address ranges.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"// Safe because `PL031_BASE_ADDRESS` is the base address of a PL031 device,\n" -" // and nothing else accesses that address range.\n" +"// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" +" // nothing else accesses that address range.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md @@ -17139,28 +19047,14 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"/// Constructs a new instance of the RTC driver for a PL031 device at the\n" -" /// given base address.\n" -" ///\n" -" /// # Safety\n" -" ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" +"/// Constructs a new instance of the RTC driver for a PL031 device with the\n" +" /// given set of registers.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Reads the current RTC value.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"// Safe because we know that self.registers points to the control\n" -" // registers of a PL031 device which is appropriately mapped.\n" -msgstr "" - #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" @@ -17195,235 +19089,253 @@ msgstr "" msgid "/// Clears a pending interrupt, if any.\n" msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " "compile time bugs. This is often referred to as _fearless concurrency_ since " "you can rely on the compiler to ensure correctness at runtime." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 20 " +"minutes. It contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 3 saat 20 dakika sürmelidir. " +"İçeriği:" + +#: src/concurrency/welcome.md msgid "" "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "The same tools that help with \"concurrent\" access in a single thread (e." "g., a called function that might mutate an argument or save references to it " "to read later) save us from multi-threading issues." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Rust threads work similarly to threads in other languages:" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "\"Count in thread: {i}!\"" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "\"Main thread: {i}\"" msgstr "" -#: src/concurrency/threads.md -msgid "Threads are all daemon threads, the main thread does not wait for them." +#: src/concurrency/threads/plain.md +msgid "" +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Thread panics are independent of each other." msgstr "" -#: src/concurrency/threads.md -msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." +#: src/concurrency/threads/plain.md +msgid "" +"Panics can carry a payload, which can be unpacked with [`Any::downcast_ref`]" +"(https://doc.rust-lang.org/std/any/trait.Any.html#method.downcast_ref)." msgstr "" -#: src/concurrency/threads.md -msgid "Rust thread APIs look not too different from e.g. C++ ones." -msgstr "" - -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Run the example." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "5ms timing is loose enough that main and spawned threads stay mostly in " "lockstep." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it " +"This is because `main` ends the program and spawned threads do not make it " "persist." msgstr "" -#: src/concurrency/threads.md -msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." +#: src/concurrency/threads/plain.md +msgid "Compare to `pthreads`/C++ `std::thread`/`boost::thread` if desired." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "How do we wait around for the spawned thread to complete?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. Look at the docs." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) method that blocks." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " "the thread to finish and have the program count all the way to 10." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Look at docs again:" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Use the `Result` return value from `handle.join()` to get access to the " "returned value." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Access the panic payload. This is a good time to talk about [`Any`](https://" "doc.rust-lang.org/std/any/index.html)." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "An error message indicates we must move it." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "If we want to borrow?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Main kills child threads when it returns, but another function would just " "return and leave them running." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" -#: src/concurrency/threads.md -msgid "How do we avoid this? see next slide." +#: src/concurrency/threads/plain.md +msgid "How do we avoid this? See next slide." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "Normal threads cannot borrow from their environment:" msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" "fn.scope.html) for this:" msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "The reason for that is that when the `thread::scope` function completes, all " "the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "Normal Rust borrowing rules apply: you can either borrow mutably by one " "thread, or immutably by any number of threads." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels.md src/concurrency/async-control-flow.md +msgid "This segment should take about 20 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 20 dakika sürmelidir. İçeriği:" + +#: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a [`Sender`](https://doc.rust-lang.org/std/" +"sync/mpsc/struct.Sender.html) and a [`Receiver`](https://doc.rust-lang." +"org/std/sync/mpsc/struct.Receiver.html). The two parts are connected via the " +"channel, but you only see the end-points." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"[`mpsc`](https://doc.rust-lang.org/std/sync/mpsc/index.html) stands for " +"Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` " +"(so you can make multiple producers) but `Receiver` does not." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the " +"[`send()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Sender.html#method." +"send) and [`recv()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver." +"html#method.recv) return `Result`. If they return `Err`, it means the " "counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md -msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" +msgid "" +"You get an unbounded and asynchronous channel with [`mpsc::channel()`]" +"(https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html):" msgstr "" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md @@ -17442,63 +19354,88 @@ msgstr "" msgid "\"Main: got {msg}\"" msgstr "" -#: src/concurrency/channels/bounded.md +#: src/concurrency/channels/unbounded.md msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +"An unbounded channel will allocate as much space as is necessary to store " +"pending messages. The `send()` method will not block the calling thread." +msgstr "" + +#: src/concurrency/channels/unbounded.md +msgid "" +"A call to `send()` will abort with an error (that is why it returns " +"`Result`) if the channel is closed. A channel is closed when the receiver is " +"dropped." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the " +"With bounded (synchronous) channels, [`send()`](https://doc.rust-lang.org/" +"std/sync/mpsc/struct.SyncSender.html#method.send) can block the current " +"thread:" +msgstr "" + +#: src/concurrency/channels/bounded.md +msgid "" +"Calling `send()` will block the current thread until there is space in the " "channel for the new message. The thread can be blocked indefinitely if there " "is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"Like unbounded channels, a call to `send()` will abort with an error if the " +"channel is closed." msgstr "" #: src/concurrency/channels/bounded.md msgid "" "A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `recv`." +"Every send will block the current thread until another thread calls " +"[`recv()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver." +"html#method.recv)." msgstr "" #: src/concurrency/send-sync.md +msgid "Send" +msgstr "Send" + +#: src/concurrency/send-sync.md +msgid "Sync" +msgstr "Sync" + +#: src/concurrency/send-sync/marker-traits.md msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " "is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " "is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../unsafe/unsafe-traits.md). The " -"compiler will automatically derive them for your types as long as they only " -"contain `Send` and `Sync` types. You can also implement them manually when " -"you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "One can think of these traits as markers that the type has certain thread-" "safety properties." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." msgstr "" @@ -17621,13 +19558,15 @@ msgstr "" #: src/concurrency/send-sync/examples.md msgid "" -"These types are thread-safe, but they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" msgstr "" #: src/concurrency/send-sync/examples.md msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them." +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" #: src/concurrency/send-sync/examples.md @@ -17650,119 +19589,125 @@ msgid "" "considerations." msgstr "" -#: src/concurrency/shared_state.md +#: src/concurrency/shared-state.md +msgid "Arc" +msgstr "Arc" + +#: src/concurrency/shared-state.md +msgid "Mutex" +msgstr "Mutex" + +#: src/concurrency/shared-state/arc.md msgid "" -"Rust uses the type system to enforce synchronization of shared data. This is " -"primarily done via two types:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows " +"shared, read-only ownership via `Arc::clone`:" msgstr "" -#: src/concurrency/shared_state.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html), atomic " -"reference counted `T`: handles sharing between threads and takes care to " -"deallocate `T` when the last reference is dropped," +#: src/concurrency/shared-state/arc.md +msgid "/// A struct that prints which thread drops it.\n" msgstr "" -#: src/concurrency/shared_state.md -msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): ensures " -"mutually exclusive access to the `T` value." +#: src/concurrency/shared-state/arc.md +msgid "\"Dropped by {:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +#: src/concurrency/shared-state/arc.md +msgid "// Sleep for 0-500ms.\n" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md src/concurrency/shared_state/example.md -msgid "\"v: {v:?}\"" +#: src/concurrency/shared-state/arc.md +msgid "// Now only the spawned threads will hold clones of `v`.\n" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md +msgid "" +"// When the last spawned thread finishes, it will drop `v`'s contents.\n" +msgstr "" + +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " "mutual exclusion _and_ allows mutable access to `T` behind a read-only " "interface (another form of [interior mutability](../../borrowing/interior-" -"mutability)):" +"mutability.md)):" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " "implementation." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +"`Mutex` implements both `Send` and `Sync` if and only if `T` implements " +"`Send`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "Why does `lock()` return a `Result`?" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "If the thread that held the `Mutex` panicked, the `Mutex` becomes " "\"poisoned\" to signal that the data it protected might be in an " @@ -17771,182 +19716,181 @@ msgid "" "You can call `into_inner()` on the error to recover the data regardless." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "// use std::sync::{Arc, Mutex};\n" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md +msgid "\"v: {v:?}\"" +msgstr "" + +#: src/concurrency/shared-state/example.md msgid "Possible solution:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "Notable parts:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " +"`v: Arc<_>` needs to be cloned to make a new reference for each new spawned " "thread. Note `move` was added to the lambda signature." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "" -#: src/exercises/concurrency/morning.md -msgid "Let us practice our new concurrency skills with" -msgstr "" +#: src/concurrency/sync-exercises.md src/concurrency/async-exercises.md +msgid "This segment should take about 1 hour and 10 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat 10 dakika sürmelidir. İçeriği:" -#: src/exercises/concurrency/morning.md -msgid "Dining philosophers: a classic problem in concurrency." -msgstr "" - -#: src/exercises/concurrency/morning.md -msgid "" -"Multi-threaded link checker: a larger project where you'll use Cargo to " -"download dependencies and then check links in parallel." -msgstr "" - -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "The dining philosophers problem is a classic problem in concurrency:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " +"their own place at the table. There is a chopstick between each plate. The " +"dish served is spaghetti which requires two chopsticks to eat. Each " "philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " -"down both forks." +"only eat their spaghetti when they have both a left and right chopstick. " +"Thus two chopsticks will only be available when their two nearest neighbors " +"are thinking, not eating. After an individual philosopher finishes eating, " +"they will put down both chopsticks." msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "You will need a local [Cargo installation](../../cargo/running-locally.md) " "for this exercise. Copy the code below to a file called `src/main.rs`, fill " "out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"// left_fork: ...\n" -" // right_fork: ...\n" +"// left_chopstick: ...\n" +" // right_chopstick: ...\n" " // thoughts: ...\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Eureka! {} has a new idea!\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Pick up forks...\n" +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "// Pick up chopsticks...\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"{} is eating...\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Socrates\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Hypatia\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Plato\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Aristotle\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Pythagoras\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create forks\n" +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md +msgid "// Create chopsticks\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Create philosophers\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "// Make each of them think and eat 100 times\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Output their thoughts\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" "name = \"dining-philosophers\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "" +"Encourage students to focus first on implementing a solution that \"mostly\" " +"works." +msgstr "" + +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "" +"The deadlock in the simplest solution is a general concurrency problem and " +"highlights that Rust does not automatically prevent this sort of bug." +msgstr "" + +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Let us use our new knowledge to create a multi-threaded link checker. It " "should start at a webpage and check that links on the page are valid. It " @@ -17954,7 +19898,7 @@ msgid "" "until all pages have been validated." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" "reqwest/). You will also need a way to find links, we can use [`scraper`]" @@ -17962,28 +19906,28 @@ msgid "" "we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "```toml\n" "[package]\n" "name = \"link-checker\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "publish = false\n" "\n" "[dependencies]\n" @@ -17994,130 +19938,126 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "You can now download the start page. Try with a small site such as `https://" "www.google.org/`." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"bad http response: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Links: {links:#?}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Could not extract links: {err:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Run the code in `src/main.rs` with" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Extend this to recursively extract links from all pages on the `www.google." "org` domain. Put an upper limit of 100 pages or so so that you don't end up " "being blocked by the site." msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "Concurrency Morning Exercise" +#: src/concurrency/sync-exercises/link-checker.md +msgid "" +"This is a complex exercise and intended to give students an opportunity to " +"work on a larger project than others. A success condition for this exercise " +"is to get stuck on some \"real\" issue and work through it with the support " +"of other students or the instructor." msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](dining-philosophers.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" +" // somewhere. This will swap the chopsticks without deinitializing\n" " // either of them.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"{thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "Link Checker" msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](link-checker.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "/// Determine whether links within the given page should be extracted.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "/// Mark the given page as visited, returning false if it had already\n" " /// been visited.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md +msgid "// To multiplex the non-cloneable Receiver, wrap it in Arc>.\n" +msgstr "" + +#: src/concurrency/sync-exercises/solutions.md msgid "// The sender got dropped. No more commands coming in.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Got crawling error: {:#}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Bad URLs: {:#?}\"" msgstr "" -#: src/async.md -msgid "Async Rust" -msgstr "" - -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "\"Async\" is a concurrency model where multiple tasks are executed " "concurrently by executing each task until it would block, then switching to " @@ -18127,88 +20067,92 @@ msgid "" "primitives for efficiently identifying I/O that is able to proceed." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Rust's asynchronous operation is based on \"futures\", which represent work " "that may be completed in the future. Futures are \"polled\" until they " "signal that they are complete." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " "callback-based, and not polled. Async Python programs require a \"loop\", " "similar to a runtime in Rust." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "JavaScript's `Promise` is similar, but again callback-based. The language " "runtime implements the event loop, so many of the details of Promise " "resolution are hidden." msgstr "" -#: src/async/async-await.md +#: src/concurrency/welcome-async.md +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 30 " +"minutes. It contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 3 saat 30 dakika sürmelidir. " +"İçeriği:" + +#: src/concurrency/async.md +msgid "async/await" +msgstr "async/await" + +#: src/concurrency/async/async-await.md msgid "" "At a high level, async Rust code looks very much like \"normal\" sequential " "code:" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "\"Count is: {i}!\"" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -#: src/async/async-await.md -msgid "What is the return type of an async call?" -msgstr "" - -#: src/async/async-await.md -msgid "Use `let future: () = async_main(10);` in `main` to see the type." -msgstr "" - -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "You cannot make `main` async, without additional instructions to the " "compiler on how to use the returned future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "`.await` asynchronously waits for the completion of another operation. " "Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " "trait, implemented by objects that represent an operation that may not be " @@ -18216,7 +20160,7 @@ msgid "" "doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "An async function returns an `impl Future`. It's also possible (but " "uncommon) to implement `Future` for your own types. For example, the " @@ -18224,76 +20168,175 @@ msgid "" "joining to it." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "The `.await` keyword, applied to a Future, causes the current async function " "to pause until that Future is ready, and then evaluates to its output." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "The `Future` and `Poll` types are implemented exactly as shown; click the " "links to show the implementations in the docs." msgstr "" -#: src/async/futures.md -msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" -msgstr "" - -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +"event such as a timeout occurs." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "`Pin` ensures that the Future isn't moved in memory, so that pointers into " "that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"valid after an `.await`. We will address `Pin` in the \"Pitfalls\" segment." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/state-machine.md +msgid "" +"Rust transforms an async function or block to a hidden type that implements " +"`Future`, using a state machine to track the function's progress. The " +"details of this transform are complex, but it helps to have a schematic " +"understanding of what is happening. The following function" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "/// Sum two D10 rolls plus a modifier.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "is transformed to something like" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Function has not begun yet.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Waitig for first `.await` to complete.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Waitig for second `.await` to complete.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Create future for first dice roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Poll sub-future for first dice roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Create future for second roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Poll sub-future for second dice roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"This example is illustrative, and isn't an accurate representation of the " +"Rust compiler's transformation. The important things to notice here are:" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Calling an async function does nothing but construct and return a future." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"All local variables are stored in the function's future, using an enum to " +"identify where execution is currently suspended." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"An `.await` in the async function is translated into an a new state " +"containing all live variables and the awaited future. The `loop` then " +"handles that updated state, polling the future until it returns `Poll::" +"Ready`." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Execution continues eagerly until a `Poll::Pending` occurs. In this simple " +"example, every future is ready immediately." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"`main` contains a naïve executor, which just busy-loops until the future is " +"ready. We will discuss real executors shortly." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Imagine the `Future` data structure for a deeply nested stack of async " +"functions. Each function's `Future` contains the `Future` structures for the " +"functions it calls. This can result in unexpectedly large compiler-generated " +"`Future` types." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"This also means that recursive async functions are challenging. Compare to " +"the common error of building recursive type, such as" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"The fix for a recursive type is to add a layer of indrection, such as with " +"`Box`. Similarly, a recursive async function must box the recursive future:" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "\"{n}\"" +msgstr "\"{n}\"" + +#: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " "_reactor_) and is responsible for executing futures (an _executor_). Rust " "does not have a \"built-in\" runtime, but several options are available:" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " "functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" "github.com/hyperium/tonic) for gRPC." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "[async-std](https://async.rs/): aims to be a \"std for async\", and includes " "a basic runtime in `async::task`." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" "(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" "async/src/lib.rs) already has one." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Note that of the listed runtimes, only Tokio is supported in the Rust " "playground. The playground also does not permit any I/O, so most interesting " "async things can't run in the playground." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " @@ -18301,66 +20344,66 @@ msgid "" "used." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Tokio provides:" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "A large ecosystem of libraries." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "\"Count in task: {i}!\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "\"Main task: {i}\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "With the `tokio::main` macro we can now make `main` async." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "The `spawn` function creates a new, concurrent \"task\"." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " "cancellation. `tokio::spawn` returns a handle which can be awaited to wait " "until it finishes." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Try awaiting the task returned from `tokio::spawn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "Rust has a task system, which is a form of lightweight threading." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "A task has a single top-level future which the executor polls to make " "progress. That future may have one or more nested futures that its `poll` " @@ -18369,170 +20412,155 @@ msgid "" "and an I/O operation." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"listening on port {}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"connection from {addr:?}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "b\"Who are you?\\n\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"socket error\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "" -#: src/async/tasks.md src/async/control-flow/join.md +#: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md msgid "" "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Try connecting to it with a TCP connection tool like [nc](https://www.unix." "com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" "telnet/)." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Ask students to visualize what the state of the example server would be with " "a few connected clients. What tasks exist? What are their Futures?" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "This is the first time we've seen an `async` block. This is similar to a " "closure, but does not take any arguments. Its return value is a Future, " "similar to an `async fn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"ping_handler complete\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Failed to send ping.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Sent {} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Something went wrong in ping handler task.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](concurrency/channels.md)." +"[morning class](../channels.md)." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " "implement both `sync` and `async` `send` and `recv`. This can be convenient " "for complex applications with both IO and heavy CPU processing tasks." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "What makes working with `async` channels preferable is the ability to " "combine them with other `future`s to combine them and create complex control " "flow." msgstr "" -#: src/async/control-flow.md -msgid "Futures Control Flow" -msgstr "" - -#: src/async/control-flow.md -msgid "" -"Futures can be combined together to produce concurrent compute flow graphs. " -"We have already seen tasks, that function as independent threads of " -"execution." -msgstr "" - -#: src/async/control-flow.md -msgid "[Join](control-flow/join.md)" -msgstr "" - -#: src/async/control-flow.md -msgid "[Select](control-flow/select.md)" -msgstr "" - -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "A join operation waits until all of a set of futures are ready, and returns " "a collection of their results. This is similar to `Promise.all` in " "JavaScript or `asyncio.gather` in Python." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://httpbin.org/ip\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://play.rust-lang.org/\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"BAD_URL\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md +msgid "\"{page_sizes_dict:?}\"" +msgstr "" + +#: src/concurrency/async-control-flow/join.md msgid "" "For multiple futures of disjoint types, you can use `std::future::join!` but " "you must know how many futures you will have at compile time. This is " "currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "You can also combine `join_all` with `join!` for instance to join all " "requests to an http service as well as a database query. Try adding a " @@ -18541,7 +20569,7 @@ msgid "" "demonstrates `join!`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" "A select operation waits until any of a set of futures is ready, and " "responds to that future's result. In JavaScript, this is similar to `Promise." @@ -18549,7 +20577,7 @@ msgid "" "FIRST_COMPLETED)`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" "Similar to a match statement, the body of `select!` has a number of arms, " "each of the form `pattern = future => statement`. When a `future` is ready, " @@ -18558,91 +20586,53 @@ msgid "" "of the `select!` macro." msgstr "" -#: src/async/control-flow/select.md -msgid "\"Felix\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"got: {msg}\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Failed to send cat.\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"timeout\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Failed to send dog.\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"Failed to send greeting\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Failed to receive winner\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"Listener failed\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Winner is {winner:?}\"" -msgstr "" - -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md 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." +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" -"You can use `oneshot` channels in this example as the channels are supposed " -"to receive only one `send`." +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" -#: src/async/control-flow/select.md -msgid "" -"Try adding a deadline to the race, demonstrating selecting different sorts " -"of futures." -msgstr "" - -#: src/async/control-flow/select.md -msgid "" -"Note that `select!` drops unmatched branches, which cancels their futures. " -"It is easiest to use when every execution of `select!` creates new futures." -msgstr "" - -#: src/async/control-flow/select.md -msgid "" -"An alternative is to pass `&mut future` instead of the future itself, but " -"this can lead to issues, further discussed in the pinning slide." -msgstr "" - -#: src/async/pitfalls.md -msgid "Pitfalls of async/await" -msgstr "" - -#: src/async/pitfalls.md +#: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " "asynchronous programming. However, the async/await model in Rust also comes " "with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter:" +"chapter." msgstr "" -#: src/async/pitfalls.md -msgid "[Blocking the Executor](pitfalls/blocking-executor.md)" -msgstr "" +#: src/concurrency/async-pitfalls.md +msgid "Pin" +msgstr "Pin" -#: src/async/pitfalls.md -msgid "[Pin](pitfalls/pin.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Async Traits](pitfalls/async-traits.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Cancellation](pitfalls/cancellation.md)" -msgstr "" - -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "Blocking the executor" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Most async runtimes only allow IO tasks to run concurrently. This means that " "CPU blocking tasks will block the executor and prevent other tasks from " @@ -18650,39 +20640,39 @@ msgid "" "possible." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"current_thread\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "The `\"current_thread\"` flavor puts all tasks on a single thread. This " "makes the effect more obvious, but the bug is still present in the multi-" "threaded flavor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " @@ -18692,27 +20682,21 @@ msgid "" "situations." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Use sync mutexes with care. Holding a mutex over an `.await` may cause " "another task to block, and that task may be running on the same thread." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Recall an async function or block creates a type implementing `Future` and " +"containing all of the local variables. Some of those variables can hold " +"references (pointers) to other local variables. To ensure those remain " +"valid, the future can never be moved to a different memory location." msgstr "" -#: src/async/pitfalls/pin.md -msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." -msgstr "" - -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "To prevent moving the future type in memory, it can only be polled through a " "pinned pointer. `Pin` is a wrapper around a reference that disallows all " @@ -18720,95 +20704,95 @@ msgid "" "location." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "// A work item. In this case, just sleep for the given time and respond\n" "// with a message on the `respond_on` channel.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// A worker which listens for work on a queue and performs it.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// Pretend to work.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send response\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// TODO: report number of iterations every 100ms\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// A requester which requests work and waits for it to complete.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send on work queue\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed waiting for response\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"work result for iteration {i}: {resp}\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "You may recognize this as an example of the actor pattern. Actors typically " "call `select!` in a loop." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This serves as a summation of a few of the previous lessons, so take your " "time with it." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " "`timeout_fut` in the `select!` to work around the move, then using `Box::" "pin`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " "iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires." +"`timeout_fut` every time it expires:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " "stabilized, with older code often using `tokio::pin!`) is also an option, " "but that is difficult to use for a future that is reassigned." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Another alternative is to not use `pin` at all but spawn another task that " "will send to a `oneshot` channel every 100ms." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Data that contains pointers to itself is called self-referential. Normally, " "the Rust borrow checker would prevent self-referential data from being " @@ -18817,83 +20801,94 @@ msgid "" "borrow checker." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "`Pin` is a wrapper around a reference. An object cannot be moved from its " "place using a pinned pointer. However, it can still be moved through an " "unpinned pointer." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " "`&mut Self` to refer to the instance. That's why it can only be called on a " "pinned pointer." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Async methods in traits are were stabilized only recently, in the 1.75 " -"release. This required support for using return-position `impl Trait` (RPIT) " -"in traits, as the desugaring for `async fn` includes `-> impl Future`." +"Async methods in traits were stabilized in the 1.75 release. This required " +"support for using return-position `impl Trait` in traits, as the desugaring " +"for `async fn` includes `-> impl Future`." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +"However, even with the native support, there are some pitfalls around `async " +"fn`:" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +"Return-position `impl Trait` captures all in-scope lifetimes (so some " +"patterns of borrowing cannot be expressed)." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +"Async traits cannot be used with [trait objects](../../smart-pointers/trait-" +"objects.md) (`dyn Trait` support)." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" -"trait/latest/async_trait/) provides a workaround through a macro, with some " -"caveats:" +"The [async_trait](https://docs.rs/async-trait/) crate provides a workaround " +"for `dyn` support through a macro, with some caveats:" msgstr "" -#: src/async/pitfalls/async-traits.md -msgid "\"running all sleepers..\"" +#: src/concurrency/async-pitfalls/async-traits.md +msgid "\"Running all sleepers...\"" msgstr "" -#: src/async/pitfalls/async-traits.md -msgid "\"slept for {}ms\"" +#: src/concurrency/async-pitfalls/async-traits.md +msgid "\"Slept for {} ms\"" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"The challenges in language support for `async trait` are too deep to " +"describe in-depth in this class. See [this blog post](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) by Niko Matsakis if you are interested in digging deeper. See also " +"these keywords:" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md +msgid "" +"[RPIT](https://doc.rust-lang.org/reference/types/impl-trait.html#abstract-" +"return-types): short for [return-position `impl Trait`](../../generics/impl-" +"trait.md)." +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md +msgid "" +"[RPITIT](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits." +"html): short for return-position `impl Trait` in trait (RPIT in trait)." +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +"time and adding it to the `Vec`." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " "_cancellation_ and it can occur at any `await` point. Care is needed to " @@ -18901,129 +20896,116 @@ msgid "" "example, it shouldn't deadlock or lose data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"not UTF-8\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"hi\\nthere\\n\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"tick!\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// prefix buf and bytes with self.\n" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." "html#method.tick) is cancellation-safe because it keeps track of whether a " "tick has been 'delivered'." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncReadExt.html#method.read) is cancellation-safe because it either " "returns or doesn't read data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " "cancellation-safe. See its documentation for details and alternatives." msgstr "" -#: src/exercises/concurrency/afternoon.md -msgid "" -"To practice your Async Rust skills, we have again two exercises for you:" -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"Dining philosophers: we already saw this problem in the morning. This time " -"you are going to implement it with Async Rust." -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"A Broadcast Chat Application: this is a larger project that allows you " -"experiment with more advanced Async Rust features." -msgstr "" - -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "Dining Philosophers --- Async" msgstr "Filozofların Akşam Yemeği --- Async" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"See [dining philosophers](dining-philosophers.md) for a description of the " -"problem." +"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " +"description of the problem." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "As before, you will need a local [Cargo installation](../../cargo/running-" "locally.md) for this exercise. Copy the code below to a file called `src/" "main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Keep trying until we have both forks\n" +#: src/concurrency/async-exercises/dining-philosophers.md +msgid "// Keep trying until we have both chopsticks\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md +msgid "// tokio scheduler doesn't deadlock with 5 philosophers, so have 2.\n" +msgstr "" + +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Make them think and eat\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Since this time you are using Async Rust, you'll need a `tokio` dependency. " "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" "name = \"dining-philosophers-async-dine\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "\n" "[dependencies]\n" "tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " @@ -19031,17 +21013,17 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Also note that this time you have to use the `Mutex` and the `mpsc` module " "from the `tokio` crate." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "In this exercise, we want to use our new knowledge to implement a broadcast " "chat application. We have a chat server that the clients connect to and " @@ -19050,7 +21032,7 @@ msgid "" "that it receives to all the clients." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md 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`]" @@ -19058,74 +21040,74 @@ msgid "" "and the server." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "_Cargo.toml_:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "```toml\n" "[package]\n" "name = \"chat-async\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "\n" "[dependencies]\n" -"futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" -"http = \"1.1.0\"\n" -"tokio = { version = \"1.37.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.7.0\", features = [\"client\", " +"futures-util = { version = \"0.3.31\", features = [\"sink\"] }\n" +"http = \"1.3.1\"\n" +"tokio = { version = \"1.45.1\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.11.4\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "The required APIs" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " "[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " "to familiarize yourself with the API." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[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 "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" "trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " "asynchronously sending messages on a Websocket Stream." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." "html#method.next_line): for asynchronously reading user messages from the " "standard input." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Normally in a Cargo project, you can have only one binary, and one `src/main." "rs` file. In this project, we need two binaries. One for the client, and one " @@ -19136,80 +21118,80 @@ msgid "" "targets.html#binaries))." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Copy the following server and client code into `src/bin/server.rs` and `src/" "bin/client.rs`, respectively. Your task is to complete these files as " "described below." msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"listening on port 2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"New connection from {addr:?}\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"ws://127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Running the binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Run the server with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "and the client with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md 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 +#: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " "performing two tasks: (1) reading user messages from standard input and " @@ -19217,68 +21199,50 @@ msgid "" "displaying them for the user." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Optional: Once you are done, change the code to broadcast messages to all " "clients, but the sender of the message." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "Concurrency Afternoon Exercise" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](dining-philosophers-async.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "" -"// If we didn't get the left fork, drop the right fork if we\n" -" // have it and let other tasks make progress.\n" +"// Keep trying until we have both chopsticks\n" +" // Pick up chopsticks...\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "" -"// If we didn't get the right fork, drop the left fork and let\n" -" // other tasks make progress.\n" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// The locks are dropped here\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Here is a thought: {thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](chat-app.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Welcome to chat! Type a message\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "" "// A continuous loop for concurrently performing two tasks: (1) receiving\n" " // messages from `ws_stream` and broadcasting them, and (2) receiving\n" " // messages on `bcast_rx` and sending them to the client.\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"From client {addr:?} {text:?}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// Continuous loop for concurrently sending and receiving messages.\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"From server: {}\"" msgstr "" @@ -19296,6 +21260,14 @@ msgid "" "comprehensive-rust/discussions). We would love to hear from you." msgstr "" +#: src/thanks.md +msgid "" +"Thank you for reading the speaker notes! We hope they have been useful. If " +"you find pages without notes, please send us a PR and link it to [issue " +"#1083](https://github.com/google/comprehensive-rust/issues/1083). We are " +"also very grateful for fixes and improvements to the existing notes." +msgstr "" + #: src/glossary.md msgid "" "The following is a glossary which aims to give a short definition of many " @@ -19303,10 +21275,11 @@ msgid "" "the English original." msgstr "" +#. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md msgid "" "allocate: \n" -"Dynamic memory allocation on [the heap](memory-management/stack-vs-heap.md)." +"Dynamic memory allocation on [the heap](memory-management/review.md)." msgstr "" #: src/glossary.md @@ -19315,6 +21288,13 @@ msgid "" "Information that is passed into a function or method." msgstr "" +#: src/glossary.md +msgid "" +"associated type: \n" +"A type associated with a specific trait. Useful for defining the " +"relationship between types." +msgstr "" + #: src/glossary.md msgid "" "Bare-metal Rust: \n" @@ -19325,13 +21305,13 @@ msgstr "" #: src/glossary.md msgid "" "block: \n" -"See [Blocks](control-flow/blocks.md) and _scope_." +"See [Blocks](control-flow-basics/blocks-and-scopes.md) and _scope_." msgstr "" #: src/glossary.md msgid "" "borrow: \n" -"See [Borrowing](ownership/borrowing.md)." +"See [Borrowing](borrowing/shared.md)." msgstr "" #: src/glossary.md @@ -19380,7 +21360,7 @@ msgstr "" #: src/glossary.md msgid "" "Concurrency in Rust: \n" -"See [Concurrency in Rust](concurrency.md)." +"See [Concurrency in Rust](concurrency/welcome.md)." msgstr "" #: src/glossary.md @@ -19648,8 +21628,8 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [`String` vs `str`](basic-syntax/" -"string-slices.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" #: src/glossary.md @@ -19744,7 +21724,7 @@ msgstr "" msgid "" "unsafe: \n" "The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe.html)." +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" #: src/glossary.md @@ -19839,9 +21819,9 @@ msgstr "" #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://docs.opentitan.org/doc/ug/" -"rust_for_c/): covers Rust from the perspective of developers who write " -"firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" #: src/other-resources.md @@ -19865,6 +21845,14 @@ msgid "" "and async/await are also covered." msgstr "" +#: src/other-resources.md +msgid "" +"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" +"testing/): a self-paced workshop that goes beyond Rust's built-in testing " +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." +msgstr "" + #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" @@ -19935,6 +21923,611 @@ msgid "" "directory for details, including the license terms." msgstr "" +#~ msgid "Scopes and Shadowing" +#~ msgstr "Kapsamlar (Scopes) ve Gölgeleme (Shadowing)" + +#~ msgid "Struct Lifetimes" +#~ msgstr "Yapıların Ömürleri" + +#~ msgid "`FromIterator`" +#~ msgstr "`FromIterator`" + +#~ msgid "Test Modules" +#~ msgstr "Test Modülleri" + +#~ msgid "Calling C with Bindgen" +#~ msgstr "Bindgen ile Rust Tarafından C'yi Kullanma" + +#~ msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" +#~ msgstr "2. Gün Öğleden Sonra (3 saat 15 dakika, aralar dahil)" + +#~ msgid "" +#~ "[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@DannyRavi]" +#~ "(https://github.com/DannyRavi), [@javad-jafari](https://github.com/javad-" +#~ "jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi]" +#~ "(https://github.com/moaminsharifi), [@hamidrezakp](https://github.com/" +#~ "hamidrezakp) and [@mehrad77](https://github.com/mehrad77)." +#~ msgstr "" +#~ "[Farsça](https://google.github.io/comprehensive-rust/fa/) yazanlar: " +#~ "[@DannyRavi](https://github.com/DannyRavi), [@javad-jafari](https://" +#~ "github.com/javad-jafari), [@Alix1383](https://github.com/alix1383), " +#~ "[@moaminsharifi](https://github.com/moaminsharifi), [@hamidrezakp]" +#~ "(https://github.com/hamidrezakp) ve [@mehrad77](https://github.com/" +#~ "mehrad77)." + +#~ msgid "Pattern matching: destructuring enums, structs, and arrays." +#~ msgstr "" +#~ "Desen eşleştirme: numaralandırmaların (enums), yapıların ve dizilerin " +#~ "çözümlenmesi (destructuring)." + +#~ msgid "\"Final x: {x}\"" +#~ msgstr "\"Son x: {x}\"" + +#~ msgid "\"elem: {elem}\"" +#~ msgstr "\"elem: {elem}\"" + +#~ msgid "\"{i}\"" +#~ msgstr "\"{i}\"" + +#~ msgid "\"elements searched: {elements_searched}\"" +#~ msgstr "\"aranan öğeler: {elements_searched}\"" + +#~ msgid "Blocks" +#~ msgstr "Bloklar" + +#~ msgid "\"y: {y}\"" +#~ msgstr "\"y: {y}\"" + +#~ msgid "" +#~ "You can shadow variables, both those from outer scopes and variables from " +#~ "the same scope:" +#~ msgstr "" +#~ "Hem dış kapsamlardaki (outer scopes) değişkenleri hem de aynı kapsamdaki " +#~ "değişkenleri gölgeleyebilirsiniz (shadow):" + +#~ msgid "\"before: {a}\"" +#~ msgstr "\"önce: {a}\"" + +#~ msgid "\"inner scope: {a}\"" +#~ msgstr "\"iç kapsam: {a}\"" + +#~ msgid "\"shadowed in inner scope: {a}\"" +#~ msgstr "\"iç kapsamda gölgelendi: {a}\"" + +#~ msgid "\"after: {a}\"" +#~ msgstr "\"sonra: {a}\"" + +#~ msgid "" +#~ "Show that a variable's scope is limited by adding a `b` in the inner " +#~ "block in the last example, and then trying to access it outside that " +#~ "block." +#~ msgstr "" +#~ "Son örnekte iç bloğa (inner block) bir `b` ekleyerek ve ardından bu " +#~ "bloğun dışından ona erişmeye çalışarak bir değişkenin kapsamının (scope) " +#~ "sınırlı olduğunu gösterin." + +#~ msgid "" +#~ "Shadowing is different from mutation, because after shadowing both " +#~ "variables' memory locations exist at the same time. Both are available " +#~ "under the same name, depending where you use it in the code." +#~ msgstr "" +#~ "Gölgeleme (shadowing) mutasyondan (mutation) farklıdır çünkü gölgeleme " +#~ "sonrasında her iki değişkenin de bellek konumları aynı anda mevcuttur. " +#~ "Her ikisi de kodda nerede kullandığınıza bağlı olarak aynı ad altında " +#~ "mevcuttur." + +#~ msgid "A shadowing variable can have a different type." +#~ msgstr "Bir gölgeleme (shadowing) değişkeni farklı bir türe sahip olabilir." + +#~ msgid "" +#~ "Shadowing looks obscure at first, but is convenient for holding on to " +#~ "values after `.unwrap()`." +#~ msgstr "" +#~ "Gölgelendirme ilk başta anlaşılmaz görünebilir, ancak `.unwrap()` " +#~ "sonrasındaki değerleri korumak için kullanışlıdır." + +#~ msgid "" +#~ "`unreachable!()` marks a bit of code as unreachable. If executed, it will " +#~ "panic." +#~ msgstr "" +#~ "`unreachable!()` kodun bir kısmını erişilemez (unreachable) olarak " +#~ "işaretler. Eğer yürütülürse, paniğe neden olur." + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 35 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "10 dakikalık aralar, bu oturum yaklaşık 2 saat 35 dakika sürmelidir. " +#~ "İçeriği:" + +#~ msgid "" +#~ "Try accessing an out-of-bounds array element. Array accesses are checked " +#~ "at runtime. Rust can usually optimize these checks away, and they can be " +#~ "avoided using unsafe Rust." +#~ msgstr "" +#~ "Sınırların dışında bir dizi öğesine erişmeyi deneyin. Dizi erişimleri " +#~ "çalışma zamanında (runtime) kontrol edilir. Rust genellikle bu " +#~ "kontrolleri optimize edebilir ve emniyetsiz Rust (unsafe Rust) " +#~ "kullanılarak bu kontrollerden kaçınılabilir." + +#~ msgid "" +#~ "When working with tuples and other structured values it's common to want " +#~ "to extract the inner values into local variables. This can be done " +#~ "manually by directly accessing the inner values:" +#~ msgstr "" +#~ "Demetler (tuples) ve diğer yapılandırılmış değerlerle (structured values) " +#~ "çalışırken, içteki değerleri yerel (local) değişkenlere çıkarmayı istemek " +#~ "yaygındır. Bu, doğrudan iç değerlere erişilerek elle yapılabilir:" + +#~ msgid "\"left: {left}, right: {right}\"" +#~ msgstr "\"sol: {left}, sağ: {right}\"" + +#~ msgid "//\n" +#~ msgstr "//\n" + +#~ msgid "\"matrix: {:#?}\"" +#~ msgstr "\"matrix: {:#?}\"" + +#~ msgid "\"transposed: {:#?}\"" +#~ msgstr "\"transposed: {:#?}\"" + +#~ msgid "Rust will statically forbid dangling references:" +#~ msgstr "" +#~ "Rust, boşa düşen referansları (dangling references) statik olarak " +#~ "yasaklayacaktır:" + +#~ msgid "" +#~ "Rust does not automatically create references for you - the `&` is always " +#~ "required." +#~ msgstr "" +#~ "Rust sizin için otomatik olarak referans oluşturmaz. `&` her zaman " +#~ "gereklidir." + +#~ msgid "" +#~ "It isn't super common that one would need a runtime evaluated constant, " +#~ "but it is helpful and safer than using a static." +#~ msgstr "" +#~ "Çalışma zamanında değerlendirilen (evaluate) bir sabite (constant) " +#~ "ihtiyaç duyulması çok yaygın bir durum değildir, ancak statik " +#~ "kullanmaktan daha yararlı ve daha emniyetlidir." + +#~ msgid "while-let" +#~ msgstr "while-let" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 3 hours and 15 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 15 dakika sürmelidir. " +#~ "İçeriği:" + +#~ msgid "\"{elem}\"" +#~ msgstr "\"{elem}\"" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 40 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 40 dakika sürmelidir. " +#~ "İçeriği:" + +#~ msgid "FromIterator" +#~ msgstr "FromIterator" + +#~ msgid "Writing Unsafe Functions" +#~ msgstr "Emniyetsiz (Unsafe) Fonksiyonlar Yazma" + +#~ msgid "Slices: `&[T]`" +#~ msgstr "Dilimler: `&[T]`" + +#~ msgid "`thiserror` and `anyhow`" +#~ msgstr "`thiserror` ve `anyhow`" + +#~ msgid "Control Flow" +#~ msgstr "Kontrol Akışı" + +#~ msgid "[Welcome](../welcome-day-1.md) (5 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-1.md) (5 dakika)" + +#~ msgid "[Hello, World](../hello-world.md) (15 minutes)" +#~ msgstr "[Merhaba, Dünya](../hello-world.md) (15 dakika)" + +#~ msgid "[Types and Values](../types-and-values.md) (40 minutes)" +#~ msgstr "[Türler ve Değerler](../types-and-values.md) (40 dakika)" + +#~ msgid "[Control Flow Basics](../control-flow-basics.md) (40 minutes)" +#~ msgstr "[Kontrol Akışı Temelleri](../control-flow-basics.md) (40 dakika)" + +#~ msgid "[Tuples and Arrays](../tuples-and-arrays.md) (35 minutes)" +#~ msgstr "[Demetler ve Diziler](../tuples-and-arrays.md) (35 dakika)" + +#~ msgid "[References](../references.md) (55 minutes)" +#~ msgstr "[Referanslar](../references.md) (55 dakika)" + +#~ msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" +#~ msgstr "[Kullanıcı Tanımlı Türler](../user-defined-types.md) (50 dakika)" + +#~ msgid "[Welcome](../welcome-day-2.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-2.md) (3 dakika)" + +#~ msgid "[Pattern Matching](../pattern-matching.md) (1 hour)" +#~ msgstr "[Desen Eşleştirme](../pattern-matching.md) (1 saat)" + +#~ msgid "[Methods and Traits](../methods-and-traits.md) (50 minutes)" +#~ msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" + +#~ msgid "Day 2 Afternoon (4 hours, including breaks)" +#~ msgstr "2. Gün Öğleden Sonra (4 saat, aralar dahil)" + +#~ msgid "[Generics](../generics.md) (40 minutes)" +#~ msgstr "[Jenerikler](../generics.md) (40 dakika)" + +#~ msgid "[Standard Library Types](../std-types.md) (1 hour and 20 minutes)" +#~ msgstr "[Standart Kütüphanedeki Türler](../std-types.md) (1 saat 20 dakika)" + +#~ msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" +#~ msgstr "" +#~ "[Standart Kütüphanedeki Özellikler](../std-traits.md) (1 saat 40 dakika)" + +#~ msgid "[Welcome](../welcome-day-3.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-3.md) (3 dakika)" + +#~ msgid "[Memory Management](../memory-management.md) (1 hour)" +#~ msgstr "[Bellek Yönetimi](../memory-management.md) (1 saat)" + +#~ msgid "[Smart Pointers](../smart-pointers.md) (55 minutes)" +#~ msgstr "[Akıllı Göstericiler](../smart-pointers.md) (55 dakika)" + +#~ msgid "[Borrowing](../borrowing.md) (55 minutes)" +#~ msgstr "[Ödünç Alma](../borrowing.md) (55 dakika)" + +#~ msgid "[Lifetimes](../lifetimes.md) (50 minutes)" +#~ msgstr "[Ömürler](../lifetimes.md) (50 dakika)" + +#~ msgid "[Welcome](../welcome-day-4.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-4.md) (3 dakika)" + +#~ msgid "[Iterators](../iterators.md) (45 minutes)" +#~ msgstr "[Adımlayıcılar](../iterators.md) (45 dakika)" + +#~ msgid "[Modules](../modules.md) (40 minutes)" +#~ msgstr "[Modüller](../modules.md) (40 dakika)" + +#~ msgid "[Testing](../testing.md) (45 minutes)" +#~ msgstr "[Test Etme](../testing.md) (45 dakika)" + +#~ msgid "[Error Handling](../error-handling.md) (55 minutes)" +#~ msgstr "[Hata İşleme](../error-handling.md) (55 dakika)" + +#~ msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" +#~ msgstr "[Emniyetsiz Rust](../unsafe-rust.md) (1 saat 5 dakika)" + +#~ msgid "Arrow-Left" +#~ msgstr "Yön Oku-Sol" + +#~ msgid "Arrow-Right" +#~ msgstr "Yön Oku-Sağ" + +#~ msgid "Ctrl + Enter" +#~ msgstr "Ctrl + Enter" + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "You can use " +#~ msgstr "Odak metin kutusundayken kodu yürütmek için " + +#~ msgid "In this session:" +#~ msgstr "Bu oturumda:" + +#~ msgid "[Welcome](./welcome-day-1.md) (5 minutes)" +#~ msgstr "[Hoş Geldiniz](./welcome-day-1.md) (5 dakika)" + +#~ msgid "[Hello, World](./hello-world.md) (15 minutes)" +#~ msgstr "[Merhaba, Dünya](./hello-world.md) (15 dakika)" + +#~ msgid "[Types and Values](./types-and-values.md) (40 minutes)" +#~ msgstr "[Türler ve Değerler](./types-and-values.md) (40 dakika)" + +#~ msgid "[Control Flow Basics](./control-flow-basics.md) (40 minutes)" +#~ msgstr "[Kontrol Akışı Temelleri](./control-flow-basics.md) (40 dakika)" + +#~ msgid "In this segment:" +#~ msgstr "Bu bölümde:" + +#~ msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" +#~ msgstr "[Rust Nedir?](./hello-world/what-is-rust.md) (10 dakika)" + +#~ msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" +#~ msgstr "[Rust'ın Faydaları](./hello-world/benefits.md) (3 dakika)" + +#~ msgid "[Playground](./hello-world/playground.md) (2 minutes)" +#~ msgstr "[Deneme Alanı](./hello-world/playground.md) (2 dakika)" + +#~ msgid "[Hello, World](./types-and-values/hello-world.md) (5 minutes)" +#~ msgstr "[Merhaba, Dünya](./types-and-values/hello-world.md) (5 dakika)" + +#~ msgid "[Variables](./types-and-values/variables.md) (5 minutes)" +#~ msgstr "[Değişkenler](./types-and-values/variables.md) (5 dakika)" + +#~ msgid "[Values](./types-and-values/values.md) (5 minutes)" +#~ msgstr "[Değerler](./types-and-values/values.md) (5 dakika)" + +#~ msgid "[Arithmetic](./types-and-values/arithmetic.md) (3 minutes)" +#~ msgstr "[Aritmetik](./types-and-values/arithmetic.md) (3 dakika)" + +#~ msgid "[Type Inference](./types-and-values/inference.md) (3 minutes)" +#~ msgstr "[Tür Çıkarımı](./types-and-values/inference.md) (3 dakika)" + +#~ msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (15 minutes)" +#~ msgstr "[Alıştırma: Fibonacci](./types-and-values/exercise.md) (15 dakika)" + +#~ msgid "[if Expressions](./control-flow-basics/if.md) (4 minutes)" +#~ msgstr "[if İfadeleri](./control-flow-basics/if.md) (4 dakika)" + +#~ msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" +#~ msgstr "[Döngüler](./control-flow-basics/loops.md) (5 dakika)" + +#~ msgid "" +#~ "[break and continue](./control-flow-basics/break-continue.md) (4 minutes)" +#~ msgstr "" +#~ "[break ve continue](./control-flow-basics/break-continue.md) (4 dakika)" + +#~ msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" +#~ msgstr "[Fonksiyonlar](./control-flow-basics/functions.md) (3 dakika)" + +#~ msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" +#~ msgstr "[Makrolar](./control-flow-basics/macros.md) (2 dakika)" + +#~ msgid "" +#~ "[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (15 " +#~ "minutes)" +#~ msgstr "" +#~ "[Alıştırma: Collatz Sekansı](./control-flow-basics/exercise.md) (15 " +#~ "dakika)" + +#~ msgid "1" +#~ msgstr "1" + +#~ msgid " greater than zero:" +#~ msgstr " sıfırdan büyük sayısı için:" + +#~ msgid "If _n" +#~ msgstr "If _n" + +#~ msgid "i" +#~ msgstr "i" + +#~ msgid "_." +#~ msgstr "_." + +#~ msgid "_ is even, then _n" +#~ msgstr "_ çifttir, o zaman _n" + +#~ msgid "i+1" +#~ msgstr "i+1" + +#~ msgid " = n" +#~ msgstr " = n" + +#~ msgid " / 2_." +#~ msgstr " / 2_." + +#~ msgid "_ is odd, then _n" +#~ msgstr "_ tektir, o zaman _n" + +#~ msgid " = 3 * n" +#~ msgstr " = 3 * n" + +#~ msgid " + 1_." +#~ msgstr " + 1_." + +#~ msgid "_ = 3:" +#~ msgstr "_ = 3:" + +#~ msgid "3 is odd, so _n" +#~ msgstr "3 tektir, yani _n" + +#~ msgid "2" +#~ msgstr "2" + +#~ msgid "_ = 3 * 3 + 1 = 10;" +#~ msgstr "_ = 3 * 3 + 1 = 10;" + +#~ msgid "10 is even, so _n" +#~ msgstr "10 çifttir, yani _n" + +#~ msgid "_ = 10 / 2 = 5;" +#~ msgstr "_ = 10 / 2 = 5;" + +#~ msgid "5 is odd, so _n" +#~ msgstr "5 tektir, yani _n" + +#~ msgid "_ = 3 * 5 + 1 = 16;" +#~ msgstr "_ = 3 * 5 + 1 = 16;" + +#~ msgid "16 is even, so _n" +#~ msgstr "16 çifttir, yani _n" + +#~ msgid "5" +#~ msgstr "5" + +#~ msgid "_ = 16 / 2 = 8;" +#~ msgstr "_ = 16 / 2 = 8;" + +#~ msgid "8 is even, so _n" +#~ msgstr "8 çifttir, yani _n" + +#~ msgid "_ = 8 / 2 = 4;" +#~ msgstr "_ = 8 / 2 = 4;" + +#~ msgid "4 is even, so _n" +#~ msgstr "4 çifttir, yani _n" + +#~ msgid "7" +#~ msgstr "7" + +#~ msgid "_ = 4 / 2 = 2;" +#~ msgstr "_ = 4 / 2 = 2;" + +#~ msgid "2 is even, so _n" +#~ msgstr "2 çifttir, yani _n" + +#~ msgid "_ = 1; and" +#~ msgstr "_ = 1; ve" + +#~ msgid "[Tuples and Arrays](./tuples-and-arrays.md) (35 minutes)" +#~ msgstr "[Demetler ve Diziler](./tuples-and-arrays.md) (35 dakika)" + +#~ msgid "[References](./references.md) (55 minutes)" +#~ msgstr "[Referanslar](../references.md) (55 dakika)" + +#~ msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" +#~ msgstr "[Kullanıcı Tanımlı Türler](./user-defined-types.md) (50 dakika)" + +#~ msgid "[Arrays](./tuples-and-arrays/arrays.md) (5 minutes)" +#~ msgstr "[Diziler](./tuples-and-arrays/arrays.md) (5 dakika)" + +#~ msgid "[Tuples](./tuples-and-arrays/tuples.md) (5 minutes)" +#~ msgstr "[Demetler](./tuples-and-arrays/tuples.md) (5 dakika)" + +#~ msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" +#~ msgstr "[Dizide Dolaşma](./tuples-and-arrays/iteration.md) (3 dakika)" + +#~ msgid "" +#~ "[Patterns and Destructuring](./tuples-and-arrays/destructuring.md) (5 " +#~ "minutes)" +#~ msgstr "" +#~ "[Desenler ve Çözümleme](./tuples-and-arrays/destructuring.md) (5 dakika)" + +#~ msgid "" +#~ "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (15 minutes)" +#~ msgstr "" +#~ "[Alıştırma: İç İçe Diziler](./tuples-and-arrays/exercise.md) (15 dakika)" + +#~ msgid "[Shared References](./references/shared.md) (10 minutes)" +#~ msgstr "[Paylaşılan Referanslar](./references/shared.md) (10 dakika)" + +#~ msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" +#~ msgstr "[Özel Referanslar](./references/exclusive.md) (10 dakika)" + +#~ msgid "[Slices: &\\[T\\]](./references/slices.md) (10 minutes)" +#~ msgstr "[Dilimler: &\\[T\\]](../references/slices.md) (10 dakika)" + +#~ msgid "[Strings](./references/strings.md) (10 minutes)" +#~ msgstr "[Dizgeler](./references/strings.md) (10 dakika)" + +#~ msgid "[Exercise: Geometry](./references/exercise.md) (15 minutes)" +#~ msgstr "[Alıştırma: Geometri](./references/exercise.md) (15 dakika)" + +#~ msgid "" +#~ "Question: What happens if you modify `a[3]` right before printing `s`?" +#~ msgstr "" +#~ "Soru: `a[3]`'ü `s`'yi yazdırmadan hemen önce değiştirirseniz (modify) ne " +#~ "olur?" + +#~ msgid "" +#~ "The question about modifying `a[3]` can spark an interesting discussion, " +#~ "but the answer is that for memory safety reasons you cannot do it through " +#~ "`a` at this point in the execution, but you can read the data from both " +#~ "`a` and `s` safely. It works before you created the slice, and again " +#~ "after the `println`, when the slice is no longer used." +#~ msgstr "" +#~ "`a[3]`'ün değiştirilmesiyle (modify) ilgili soru ilginç bir tartışmayı " +#~ "ateşleyebilir, ancak cevap şu ki, bellek emniyeti nedenleriyle yürütmenin " +#~ "(execution) bu noktasında bunu `a` aracılığıyla yapamazsınız, ancak " +#~ "verileri hem `a`'dan hem de `s`'den emniyetli bir şekilde " +#~ "okuyabilirsiniz. Dilim (slice) oluşturulmadan önce ve dilim " +#~ "kullanılmayacaksa`println`'den sonra `a[3]` değiştirilebilir." + +#~ msgid "`String` is an owned, heap-allocated buffer of UTF-8 bytes." +#~ msgstr "" +#~ "`String`, UTF-8 olarak kodlanmış baytların dinamik bellekten tahsis " +#~ "edildiği (heap-allocated) sahipli (owned) bir arabellektir (buffer)" + +#~ msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" +#~ msgstr "" +#~ "[İsimli Yapılar (Named Structs)](./user-defined-types/named-structs.md) " +#~ "(10 dakika)" + +#~ msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" +#~ msgstr "[Demet Yapıları](./user-defined-types/tuple-structs.md) (10 dakika)" + +#~ msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" +#~ msgstr "[Enum'lar](./user-defined-types/enums.md) (5 dakika)" + +#~ msgid "[Static](./user-defined-types/static.md) (5 minutes)" +#~ msgstr "[Static](./user-defined-types/static.md) (5 dakika)" + +#~ msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" +#~ msgstr "[Tür Eş İsimleri](./user-defined-types/aliases.md) (2 minutes)" + +#~ msgid "" +#~ "[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" +#~ msgstr "" +#~ "[Alıştırma: Asansör Olayları](./user-Definition-types/exercise.md) (15 " +#~ "dakika)" + +#~ msgid "[Methods and Traits](./methods-and-traits.md) (50 minutes)" +#~ msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" + +#~ msgid "[Traits](./methods-and-traits/traits.md) (15 minutes)" +#~ msgstr "[Özellikler](../methods-and-traits/traits.md) (15 dakika)" + +#~ msgid "Including 10 minute breaks, this session should take about 4 hours" +#~ msgstr "Bu oturum 10 dakikalık aralar dahil yaklaşık 4 saat sürmelidir" + +#~ msgid "This segment should take about 1 hour and 40 minutes" +#~ msgstr "Bu bölüm yaklaşık 1 saat 40 dakika sürmeli" + +#~ msgid "Niche Optimization" +#~ msgstr "Niche Optimizasyonu" + +#~ msgid "[Borrowing](./borrowing.md) (55 minutes)" +#~ msgstr "[Ödünç Alma](../borrowing.md) (55 dakika)" + +#~ msgid "[Lifetimes](./lifetimes.md) (50 minutes)" +#~ msgstr "[Ömürler](./lifetimes.md) (50 dakika)" + +#~ msgid "" +#~ "[Lifetime Annotations](./lifetimes/lifetime-annotations.md) (10 minutes)" +#~ msgstr "" +#~ "[Ömür için Ek Açıklamalar](./lifetimes/lifetime-annotations.md) (10 " +#~ "dakika)" + +#~ msgid "[Lifetime Elision](./lifetimes/lifetime-elision.md) (5 minutes)" +#~ msgstr "" +#~ "[Ömür Atlaması (Elision)](./lifetimes/lifetime-elision.md) (5 dakika)" + +#~ msgid "[Struct Lifetimes](./lifetimes/struct-lifetimes.md) (5 minutes)" +#~ msgstr "[Yapı Ömürleri](./lifetimes/struct-lifetimes.md) (5 dakika)" + +#~ msgid "[Exercise: Protobuf Parsing](./lifetimes/exercise.md) (30 minutes)" +#~ msgstr "" +#~ "[Alıştırma: Protobuf Ayrıştırma](./lifetimes/exercise.md) (30 dakika)" + +#~ msgid "b\"hello\"" +#~ msgstr "b\"merhaba\"" + +#~ msgid "Luhn Algorithm" +#~ msgstr "Luhn Algrotiması" + +#~ msgid "_Generated trait_:" +#~ msgstr "_Generated trait_:" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 55 " +#~ "minutes" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 55 dakika sürmeli" + +#~ msgid "Hard-code both functions to operate on 3 × 3 matrices." +#~ msgstr "" +#~ "Her iki işlevi de 3 × 3 matris üzerinde çalışacak şekilde sabit kodlayın." + +#~ msgid "// Undefined behavior if abs misbehaves.\n" +#~ msgstr "// Undefined behavior if abs misbehaves.\n" + #~ msgid "Static and Const" #~ msgstr "Static ve Const" @@ -20017,9 +22610,6 @@ msgstr "" #~ "karakter sınırında bitmiyor, bu nedenle program paniğe kapılıyor. Hata " #~ "mesajına bağlı olarak bunu uygun bir aralığa ayarlayın." -#~ msgid "Small Example" -#~ msgstr "Küçük Örnek" - #~ msgid "Why Rust?" #~ msgstr "Neden Rust?" @@ -20065,21 +22655,12 @@ msgstr "" #~ msgid "Enum Sizes" #~ msgstr "Enum Boyutları" -#~ msgid "Novel Control Flow" -#~ msgstr "Yeni Kontrol Akışları" - #~ msgid "if let expressions" #~ msgstr "if let İfadeleri" #~ msgid "while let expressions" #~ msgstr "while let İfadeleri" -#~ msgid "match expressions" -#~ msgstr "match ifadeleri" - -#~ msgid "Destructuring Structs" -#~ msgstr "Yapıların (Struct) Çözümlenmesi" - #~ msgid "Destructuring Arrays" #~ msgstr "Dizilerin Çözümlenmesi" @@ -20122,57 +22703,30 @@ msgstr "" #~ msgid "Field Shorthand Syntax" #~ msgstr "Alanlara İlk Değer Verme Kısaltması'nın Sözdizimi (Syntax)" -#~ msgid "Method Receiver" -#~ msgstr "Metot Alıcısı" - #~ msgid "Storing Books" #~ msgstr "Kitapların Saklanması" #~ msgid "Option and Result" #~ msgstr "Option ve Result" -#~ msgid "Vec" -#~ msgstr "Vec" - -#~ msgid "HashMap" -#~ msgstr "HashMap" - #~ msgid "Box" #~ msgstr "Box" #~ msgid "Recursive Data Types" #~ msgstr "Özyinelemeli Veri Türleri" -#~ msgid "Rc" -#~ msgstr "Rc" - #~ msgid "Iterators and Ownership" #~ msgstr "Adımlayıcılar (Iterators) ve Sahiplik" -#~ msgid "Strings and Iterators" -#~ msgstr "Dizeler (Stringler) ve Adımlayıcılar (Iterators)" - #~ msgid "Generic Methods" #~ msgstr "Jenerik Metotlar" -#~ msgid "Monomorphization" -#~ msgstr "Monomorfizasyon" - #~ msgid "Default Methods" #~ msgstr "Varsayılan Metotlar" -#~ msgid "impl Trait" -#~ msgstr "impl Trait" - #~ msgid "Important Traits" #~ msgstr "Önemli Özellikler (Traits)" -#~ msgid "Iterator" -#~ msgstr "Iterator" - -#~ msgid "From and Into" -#~ msgstr "From ve Into" - #~ msgid "Default" #~ msgstr "Default" @@ -20182,9 +22736,6 @@ msgstr "" #~ msgid "Closures: Fn, FnMut, FnOnce" #~ msgstr "Kapanışlar (Closures): Fn, FnMut, FnOnce" -#~ msgid "A Simple GUI Library" -#~ msgstr "Basit bir GUI Kütüphanesi" - #~ msgid "Points and Polygons" #~ msgstr "Noktalar ve Çokgenler" @@ -20221,9 +22772,6 @@ msgstr "" #~ msgid "zerocopy" #~ msgstr "zerocopy" -#~ msgid "aarch64-paging" -#~ msgstr "aarch64-paging" - #~ msgid "buddy_system_allocator" #~ msgstr "buddy_system_allocator" @@ -20233,27 +22781,6 @@ msgstr "" #~ msgid "spin" #~ msgstr "spin" -#~ msgid "Send and Sync" -#~ msgstr "Send ve Sync" - -#~ msgid "Send" -#~ msgstr "Send" - -#~ msgid "Sync" -#~ msgstr "Sync" - -#~ msgid "Arc" -#~ msgstr "Arc" - -#~ msgid "Mutex" -#~ msgstr "Mutex" - -#~ msgid "async/await" -#~ msgstr "async/await" - -#~ msgid "Pin" -#~ msgstr "Pin" - #~ msgid "Day 1 Morning" #~ msgstr "1. Gün Sabah" @@ -20295,8 +22822,8 @@ msgstr "" #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." #~ msgstr "" -#~ "3. Gün: Jenerikler, özellikler (traits), hata işleme, testler ve güvenli " -#~ "olmayan (unsafe) Rust." +#~ "3. Gün: Jenerikler, özellikler (traits), hata işleme, testler ve " +#~ "emniyetsiz (unsafe) Rust." #~ msgid "" #~ "```rust,editable\n" @@ -20487,7 +23014,8 @@ msgstr "" #~ msgid "" #~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" -#~ "(Güvenli) Rust'ta bellek sızıntılarının oluşması mümkündür. Bazı örnekler:" +#~ "(Emniyetli) Rust'ta bellek sızıntılarının oluşması mümkündür. Bazı " +#~ "örnekler:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." @@ -20770,9 +23298,6 @@ msgstr "" #~ msgid "control flow:" #~ msgstr "kontrol akışı:" -#~ msgid "enumeration:" -#~ msgstr "numaralandırma:" - #~ msgid "error handling:" #~ msgstr "hata işleme:" From cb538caef528905ef10aac6cb0316c45c31c8fd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:51:43 +0200 Subject: [PATCH 041/103] Bump the npm_and_yarn group across 1 directory with 2 updates (#2866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the npm_and_yarn group with 2 updates in the /tests directory: [tmp](https://github.com/raszi/node-tmp) and [@wdio/cli](https://github.com/webdriverio/webdriverio/tree/HEAD/packages/wdio-cli). Removes `tmp` Updates `@wdio/cli` from 9.5.3 to 9.19.2
Release notes

Sourced from @​wdio/cli's releases.

v9.19.2 (2025-08-24)

:bug: Bug Fix

  • wdio-junit-reporter
  • webdriverio
  • wdio-local-runner, wdio-types, wdio-xvfb

:nail_care: Polish

  • wdio-browserstack-service
    • #14704 Add chaining of multiple layers of overwritten command definitions (@​amaanbs)

Committers: 4

v9.19.1 (2025-08-12)

:nail_care: Polish

  • wdio-local-runner, wdio-types, wdio-xvfb

Committers: 1

v9.19.0 (2025-08-11)

:rocket: New Feature

:bug: Bug Fix

:nail_care: Polish

... (truncated)

Changelog

Sourced from @​wdio/cli's changelog.

v9.19.2 (2025-08-24)

:bug: Bug Fix

  • wdio-junit-reporter
  • webdriverio
  • wdio-local-runner, wdio-types, wdio-xvfb

:nail_care: Polish

  • wdio-browserstack-service
    • #14704 Add chaining of multiple layers of overwritten command definitions (@​amaanbs)

Committers: 4

v9.19.1 (2025-08-12)

:nail_care: Polish

  • wdio-local-runner, wdio-types, wdio-xvfb

Committers: 1

v9.19.0 (2025-08-11)

:rocket: New Feature

:bug: Bug Fix

:nail_care: Polish

  • wdio-browserstack-service

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/comprehensive-rust/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tests/package-lock.json | 1441 ++++++++++++++++++++++++++------------- tests/package.json | 2 +- 2 files changed, 965 insertions(+), 478 deletions(-) diff --git a/tests/package-lock.json b/tests/package-lock.json index d88b3c3b..694862a2 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -7,31 +7,33 @@ "name": "test", "devDependencies": { "@types/mocha": "^10.0.10", - "@wdio/cli": "^9.5.3", + "@wdio/cli": "^9.19.2", "@wdio/local-runner": "^9.5.3", "@wdio/mocha-framework": "^9.5.0", "@wdio/static-server-service": "^9.5.0" } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -462,246 +464,356 @@ } }, "node_modules/@inquirer/checkbox": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-3.0.1.tgz", - "integrity": "sha512-0hm2nrToWUdD6/UHnel/UKGdk1//ke5zGUpHIvk5ZWmaKezlGxZkOJXNSWsdxO/rEqTkbB3lNC2J6nBElV2aAQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.2.2.tgz", + "integrity": "sha512-E+KExNurKcUJJdxmjglTl141EwxWyAHplvsYJQgSwXf8qiNWkTxTuCCqmhFEmbIXd4zLaGMfQFJ6WrZ7fSeV3g==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/figures": "^1.0.13", + "@inquirer/type": "^3.0.8", "ansi-escapes": "^4.3.2", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/confirm": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-4.0.1.tgz", - "integrity": "sha512-46yL28o2NJ9doViqOy0VDcoTzng7rAb6yPQKU7VDLqkmbCaH4JqK4yk4XqlzNWy9PVC5pG1ZUXPBQv+VqnYs2w==", + "version": "5.1.16", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.16.tgz", + "integrity": "sha512-j1a5VstaK5KQy8Mu8cHmuQvN1Zc62TbLhjJxwHvKPPKEoowSF6h/0UdOpA9DNdWZ+9Inq73+puRq1df6OJ8Sag==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/core": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz", - "integrity": "sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.2.0.tgz", + "integrity": "sha512-NyDSjPqhSvpZEMZrLCYUquWNl+XC/moEcVFqS55IEYIYsY0a1cUCevSqk7ctOlnm/RaSBU5psFryNlxcmGrjaA==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "@types/mute-stream": "^0.0.4", - "@types/node": "^22.5.5", - "@types/wrap-ansi": "^3.0.0", + "@inquirer/figures": "^1.0.13", + "@inquirer/type": "^3.0.8", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", - "mute-stream": "^1.0.0", + "mute-stream": "^2.0.0", "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", "wrap-ansi": "^6.2.0", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" - } - }, - "node_modules/@inquirer/core/node_modules/@types/node": { - "version": "22.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", - "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", - "dev": true, - "dependencies": { - "undici-types": "~6.20.0" - } - }, - "node_modules/@inquirer/core/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@inquirer/core/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, - "node_modules/@inquirer/core/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "dev": true - }, "node_modules/@inquirer/editor": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-3.0.1.tgz", - "integrity": "sha512-VA96GPFaSOVudjKFraokEEmUQg/Lub6OXvbIEZU1SDCmBzRkHGhxoFAVaF30nyiB4m5cEbDgiI2QRacXZ2hw9Q==", + "version": "4.2.18", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.18.tgz", + "integrity": "sha512-yeQN3AXjCm7+Hmq5L6Dm2wEDeBRdAZuyZ4I7tWSSanbxDzqM0KqzoDbKM7p4ebllAYdoQuPJS6N71/3L281i6w==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", - "external-editor": "^3.1.0" + "@inquirer/core": "^10.2.0", + "@inquirer/external-editor": "^1.0.1", + "@inquirer/type": "^3.0.8" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/expand": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-3.0.1.tgz", - "integrity": "sha512-ToG8d6RIbnVpbdPdiN7BCxZGiHOTomOX94C2FaT5KOHupV40tKEDozp12res6cMIfRKrXLJyexAZhWVHgbALSQ==", + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.18.tgz", + "integrity": "sha512-xUjteYtavH7HwDMzq4Cn2X4Qsh5NozoDHCJTdoXg9HfZ4w3R6mxV1B9tL7DGJX2eq/zqtsFjhm0/RJIMGlh3ag==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.1.tgz", + "integrity": "sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^2.1.0", + "iconv-lite": "^0.6.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/@inquirer/figures": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.9.tgz", - "integrity": "sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.13.tgz", + "integrity": "sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@inquirer/input": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-3.0.1.tgz", - "integrity": "sha512-BDuPBmpvi8eMCxqC5iacloWqv+5tQSJlUafYWUe31ow1BVXjW2a5qe3dh4X/Z25Wp22RwvcaLCc2siHobEOfzg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.2.2.tgz", + "integrity": "sha512-hqOvBZj/MhQCpHUuD3MVq18SSoDNHy7wEnQ8mtvs71K8OPZVXJinOzcvQna33dNYLYE4LkA9BlhAhK6MJcsVbw==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/number": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-2.0.1.tgz", - "integrity": "sha512-QpR8jPhRjSmlr/mD2cw3IR8HRO7lSVOnqUvQa8scv1Lsr3xoAMMworcYW3J13z3ppjBFBD2ef1Ci6AE5Qn8goQ==", + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.18.tgz", + "integrity": "sha512-7exgBm52WXZRczsydCVftozFTrrwbG5ySE0GqUd2zLNSBXyIucs2Wnm7ZKLe/aUu6NUg9dg7Q80QIHCdZJiY4A==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/password": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-3.0.1.tgz", - "integrity": "sha512-haoeEPUisD1NeE2IanLOiFr4wcTXGWrBOyAyPZi1FfLJuXOzNmxCJPgUrGYKVh+Y8hfGJenIfz5Wb/DkE9KkMQ==", + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.18.tgz", + "integrity": "sha512-zXvzAGxPQTNk/SbT3carAD4Iqi6A2JS2qtcqQjsL22uvD+JfQzUrDEtPjLL7PLn8zlSNyPdY02IiQjzoL9TStA==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8", "ansi-escapes": "^4.3.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/prompts": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-6.0.1.tgz", - "integrity": "sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.8.4.tgz", + "integrity": "sha512-MuxVZ1en1g5oGamXV3DWP89GEkdD54alcfhHd7InUW5BifAdKQEK9SLFa/5hlWbvuhMPlobF0WAx7Okq988Jxg==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/checkbox": "^3.0.1", - "@inquirer/confirm": "^4.0.1", - "@inquirer/editor": "^3.0.1", - "@inquirer/expand": "^3.0.1", - "@inquirer/input": "^3.0.1", - "@inquirer/number": "^2.0.1", - "@inquirer/password": "^3.0.1", - "@inquirer/rawlist": "^3.0.1", - "@inquirer/search": "^2.0.1", - "@inquirer/select": "^3.0.1" + "@inquirer/checkbox": "^4.2.2", + "@inquirer/confirm": "^5.1.16", + "@inquirer/editor": "^4.2.18", + "@inquirer/expand": "^4.0.18", + "@inquirer/input": "^4.2.2", + "@inquirer/number": "^3.0.18", + "@inquirer/password": "^4.0.18", + "@inquirer/rawlist": "^4.1.6", + "@inquirer/search": "^3.1.1", + "@inquirer/select": "^4.3.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/rawlist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-3.0.1.tgz", - "integrity": "sha512-VgRtFIwZInUzTiPLSfDXK5jLrnpkuSOh1ctfaoygKAdPqjcjKYmGh6sCY1pb0aGnCGsmhUxoqLDUAU0ud+lGXQ==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.1.6.tgz", + "integrity": "sha512-KOZqa3QNr3f0pMnufzL7K+nweFFCCBs6LCXZzXDrVGTyssjLeudn5ySktZYv1XiSqobyHRYYK0c6QsOxJEhXKA==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/type": "^3.0.8", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/search": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-2.0.1.tgz", - "integrity": "sha512-r5hBKZk3g5MkIzLVoSgE4evypGqtOannnB3PKTG9NRZxyFRKcfzrdxXXPcoJQsxJPzvdSU2Rn7pB7lw0GCmGAg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.1.1.tgz", + "integrity": "sha512-TkMUY+A2p2EYVY3GCTItYGvqT6LiLzHBnqsU1rJbrpXUijFfM6zvUx0R4civofVwFCmJZcKqOVwwWAjplKkhxA==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/figures": "^1.0.13", + "@inquirer/type": "^3.0.8", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/select": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-3.0.1.tgz", - "integrity": "sha512-lUDGUxPhdWMkN/fHy1Lk7pF3nK1fh/gqeyWXmctefhxLYxlDsc7vsPBEpxrfVGDsVdyYJsiJoD4bJ1b623cV1Q==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.3.2.tgz", + "integrity": "sha512-nwous24r31M+WyDEHV+qckXkepvihxhnyIaod2MG7eCE6G0Zm/HUF6jgN8GXgf4U7AU6SLseKdanY195cwvU6w==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", + "@inquirer/core": "^10.2.0", + "@inquirer/figures": "^1.0.13", + "@inquirer/type": "^3.0.8", "ansi-escapes": "^4.3.2", "yoctocolors-cjs": "^2.1.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@inquirer/type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-2.0.0.tgz", - "integrity": "sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.8.tgz", + "integrity": "sha512-lg9Whz8onIHRthWaN1Q9EGLa/0LFJjyM8mEUbL1eTi6yMGvBf8gvyDLtxSXztQsxMvhxxNpJYrwa1YHdq+w4Jw==", "dev": true, - "dependencies": { - "mute-stream": "^1.0.0" - }, + "license": "MIT", "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/@isaacs/cliui": { @@ -750,45 +862,83 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "node_modules/@jest/diff-sequences": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", + "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==", "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "30.1.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.1.2.tgz", + "integrity": "sha512-HXy1qT/bfdjCv7iC336ExbqqYtZvljrV8odNdso7dWK9bSeHtLlvwWWC3YSybSPL03Gg5rug6WLCZAZFH72m0A==", + "dev": true, + "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3" + "@jest/get-type": "30.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.0.1.tgz", + "integrity": "sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-regex-util": "30.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", + "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", "dev": true, + "license": "MIT", "dependencies": { - "@sinclair/typebox": "^0.27.8" + "@sinclair/typebox": "^0.34.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.0.5.tgz", + "integrity": "sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", + "@jest/pattern": "30.0.1", + "@jest/schemas": "30.0.5", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/types/node_modules/ansi-styles": { @@ -796,6 +946,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -811,6 +962,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -827,6 +979,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -895,19 +1048,22 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true + "version": "0.34.41", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.41.tgz", + "integrity": "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==", + "dev": true, + "license": "MIT" }, "node_modules/@sindresorhus/merge-streams": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -925,13 +1081,15 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, + "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -941,6 +1099,7 @@ "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } @@ -951,15 +1110,6 @@ "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true }, - "node_modules/@types/mute-stream": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", - "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { "version": "20.17.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", @@ -985,7 +1135,8 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/which": { "version": "2.0.2", @@ -993,12 +1144,6 @@ "integrity": "sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==", "dev": true }, - "node_modules/@types/wrap-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", - "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", - "dev": true - }, "node_modules/@types/ws": { "version": "8.5.13", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", @@ -1013,6 +1158,7 @@ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, + "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } @@ -1021,7 +1167,8 @@ "version": "21.0.3", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/yauzl": { "version": "2.10.3", @@ -1060,34 +1207,31 @@ } }, "node_modules/@wdio/cli": { - "version": "9.5.3", - "resolved": "https://registry.npmjs.org/@wdio/cli/-/cli-9.5.3.tgz", - "integrity": "sha512-kwzc3kxAkCpTQlUDfTEdvc6i5rp3eF6BdRxPbigfE2xD4OgWZXZ/edvF8CUQaNmw8uDhL29NM7/tPG2YSh+2eg==", + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/@wdio/cli/-/cli-9.19.2.tgz", + "integrity": "sha512-GR011VfgW57tCycaTYzYD74eJnMebqWtVeHrBNLWgLTIl3bVMIkBGPEO7jjQJSZum3p1rxIJKoy+49Xc4YcY2g==", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "^20.1.1", "@vitest/snapshot": "^2.1.1", - "@wdio/config": "9.5.0", - "@wdio/globals": "9.5.3", - "@wdio/logger": "9.4.4", - "@wdio/protocols": "9.4.4", - "@wdio/types": "9.5.0", - "@wdio/utils": "9.5.0", + "@wdio/config": "9.19.2", + "@wdio/globals": "9.17.0", + "@wdio/logger": "9.18.0", + "@wdio/protocols": "9.16.2", + "@wdio/types": "9.19.2", + "@wdio/utils": "9.19.2", "async-exit-hook": "^2.0.1", - "chalk": "^5.2.0", + "chalk": "^5.4.1", "chokidar": "^4.0.0", - "dotenv": "^16.3.1", - "ejs": "^3.1.9", - "execa": "^9.2.0", + "create-wdio": "9.18.2", + "dotenv": "^17.2.0", "import-meta-resolve": "^4.0.0", - "inquirer": "^11.0.1", "lodash.flattendeep": "^4.4.0", "lodash.pickby": "^4.6.0", "lodash.union": "^4.6.0", "read-pkg-up": "^10.0.0", - "recursive-readdir": "^2.2.3", "tsx": "^4.7.2", - "webdriverio": "9.5.3", + "webdriverio": "9.19.2", "yargs": "^17.7.2" }, "bin": { @@ -1097,6 +1241,213 @@ "node": ">=18.20.0" } }, + "node_modules/@wdio/cli/node_modules/@wdio/config": { + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.19.2.tgz", + "integrity": "sha512-OVCzPQxav0QDk5rktQ6LYARZ5ueUuJXIqTXUpS3A9Jt6PF+ZUI5sbO/y+z+qHQXqDq+LkscmFsmkzgnoHzHcfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "9.18.0", + "@wdio/types": "9.19.2", + "@wdio/utils": "9.19.2", + "deepmerge-ts": "^7.0.3", + "glob": "^10.2.2", + "import-meta-resolve": "^4.0.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/@wdio/globals": { + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/@wdio/globals/-/globals-9.17.0.tgz", + "integrity": "sha512-i38o7wlipLllNrk2hzdDfAmk6nrqm3lR2MtAgWgtHbwznZAKkB84KpkNFfmUXw5Kg3iP1zKlSjwZpKqenuLc+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.20.0" + }, + "peerDependencies": { + "expect-webdriverio": "^5.3.4", + "webdriverio": "^9.0.0" + }, + "peerDependenciesMeta": { + "expect-webdriverio": { + "optional": false + }, + "webdriverio": { + "optional": false + } + } + }, + "node_modules/@wdio/cli/node_modules/@wdio/logger": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.18.0.tgz", + "integrity": "sha512-HdzDrRs+ywAqbXGKqe1i/bLtCv47plz4TvsHFH3j729OooT5VH38ctFn5aLXgECmiAKDkmH/A6kOq2Zh5DIxww==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.1.2", + "loglevel": "^1.6.0", + "loglevel-plugin-prefix": "^0.8.4", + "safe-regex2": "^5.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/@wdio/protocols": { + "version": "9.16.2", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.16.2.tgz", + "integrity": "sha512-h3k97/lzmyw5MowqceAuY3HX/wGJojXHkiPXA3WlhGPCaa2h4+GovV2nJtRvknCKsE7UHA1xB5SWeI8MzloBew==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/cli/node_modules/@wdio/repl": { + "version": "9.16.2", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.16.2.tgz", + "integrity": "sha512-FLTF0VL6+o5BSTCO7yLSXocm3kUnu31zYwzdsz4n9s5YWt83sCtzGZlZpt7TaTzb3jVUfxuHNQDTb8UMkCu0lQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/@wdio/types": { + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.19.2.tgz", + "integrity": "sha512-fBI7ljL+YcPXSXUhdk2+zVuz7IYP1aDMTq1eVmMme9GY0y67t0dCNPOt6xkCAEdL5dOcV6D2L1r6Cf/M2ifTvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/@wdio/utils": { + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.19.2.tgz", + "integrity": "sha512-caimJiTsxDUfXn/gRAzcYTO3RydSl7XzD+QpjfWZYJjzr8a2XfNnj+Vdmr8gG4BSkiVHirW9mFCZeQp2eTD7rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@puppeteer/browsers": "^2.2.0", + "@wdio/logger": "9.18.0", + "@wdio/types": "9.19.2", + "decamelize": "^6.0.0", + "deepmerge-ts": "^7.0.3", + "edgedriver": "^6.1.2", + "geckodriver": "^5.0.0", + "get-port": "^7.0.0", + "import-meta-resolve": "^4.0.0", + "locate-app": "^2.2.24", + "mitt": "^3.0.1", + "safaridriver": "^1.0.0", + "split2": "^4.2.0", + "wait-port": "^1.1.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/htmlfy": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/htmlfy/-/htmlfy-0.8.1.tgz", + "integrity": "sha512-xWROBw9+MEGwxpotll0h672KCaLrKKiCYzsyN8ZgL9cQbVumFnyvsk2JqiB9ELAV1GLj1GG/jxZUjV9OZZi/yQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/cli/node_modules/serialize-error": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-12.0.0.tgz", + "integrity": "sha512-ZYkZLAvKTKQXWuh5XpBw7CdbSzagarX39WyZ2H07CDLC5/KfsRGlIXV8d4+tfqX1M7916mRqR1QfNHSij+c9Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^4.31.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@wdio/cli/node_modules/webdriver": { + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.19.2.tgz", + "integrity": "sha512-kw6dSwNzimU8/CkGVlM36pqWHZ7BhCwV4/d8fu6rpIYGeQbPwcNc4M90TfJuzYMA7Au3NdrwT/EVQgVLQ9Ju8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0", + "@types/ws": "^8.5.3", + "@wdio/config": "9.19.2", + "@wdio/logger": "9.18.0", + "@wdio/protocols": "9.16.2", + "@wdio/types": "9.19.2", + "@wdio/utils": "9.19.2", + "deepmerge-ts": "^7.0.3", + "https-proxy-agent": "^7.0.6", + "undici": "^6.21.3", + "ws": "^8.8.0" + }, + "engines": { + "node": ">=18.20.0" + } + }, + "node_modules/@wdio/cli/node_modules/webdriverio": { + "version": "9.19.2", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.19.2.tgz", + "integrity": "sha512-xP/9odQ9tt2pEuMgo0Oobklhu1lObgL1KmejZeyxVStwnrSTbFmn1AAqPq5pfXizUsyv2PR5+id9frrarx/c4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.11.30", + "@types/sinonjs__fake-timers": "^8.1.5", + "@wdio/config": "9.19.2", + "@wdio/logger": "9.18.0", + "@wdio/protocols": "9.16.2", + "@wdio/repl": "9.16.2", + "@wdio/types": "9.19.2", + "@wdio/utils": "9.19.2", + "archiver": "^7.0.1", + "aria-query": "^5.3.0", + "cheerio": "^1.0.0-rc.12", + "css-shorthand-properties": "^1.1.1", + "css-value": "^0.0.1", + "grapheme-splitter": "^1.0.4", + "htmlfy": "^0.8.1", + "is-plain-obj": "^4.1.0", + "jszip": "^3.10.1", + "lodash.clonedeep": "^4.5.0", + "lodash.zip": "^4.2.0", + "query-selector-shadow-dom": "^1.0.1", + "resq": "^1.11.0", + "rgb2hex": "0.2.5", + "serialize-error": "^12.0.0", + "urlpattern-polyfill": "^10.0.0", + "webdriver": "9.19.2" + }, + "engines": { + "node": ">=18.20.0" + }, + "peerDependencies": { + "puppeteer-core": ">=22.x || <=24.x" + }, + "peerDependenciesMeta": { + "puppeteer-core": { + "optional": true + } + } + }, "node_modules/@wdio/config": { "version": "9.5.0", "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.5.0.tgz", @@ -1327,6 +1678,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -1337,6 +1689,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", @@ -1354,6 +1719,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1785,10 +2151,11 @@ } }, "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz", + "integrity": "sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==", + "dev": true, + "license": "MIT" }, "node_modules/cheerio": { "version": "1.0.0", @@ -1848,9 +2215,9 @@ } }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", "dev": true, "funding": [ { @@ -1858,6 +2225,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -1867,6 +2235,7 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", "dev": true, + "license": "ISC", "engines": { "node": ">= 12" } @@ -2017,7 +2386,8 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/content-disposition": { "version": "0.5.4", @@ -2086,6 +2456,72 @@ "node": ">= 14" } }, + "node_modules/create-wdio": { + "version": "9.18.2", + "resolved": "https://registry.npmjs.org/create-wdio/-/create-wdio-9.18.2.tgz", + "integrity": "sha512-atf81YJfyTNAJXsNu3qhpqF4OO43tHGTpr88duAc1Hk4a0uXJAPUYLnYxshOuMnfmeAxlWD+NqGU7orRiXEuJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^14.0.0", + "cross-spawn": "^7.0.3", + "ejs": "^3.1.10", + "execa": "^9.6.0", + "import-meta-resolve": "^4.1.0", + "inquirer": "^12.7.0", + "normalize-package-data": "^7.0.0", + "read-pkg-up": "^10.1.0", + "recursive-readdir": "^2.2.3", + "semver": "^7.6.3", + "type-fest": "^4.41.0", + "yargs": "^17.7.2" + }, + "bin": { + "create-wdio": "bin/wdio.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/create-wdio/node_modules/commander": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", + "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/create-wdio/node_modules/hosted-git-info": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.1.0.tgz", + "integrity": "sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/create-wdio/node_modules/normalize-package-data": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-7.0.1.tgz", + "integrity": "sha512-linxNAT6M0ebEYZOx2tO6vBEFsVgnPpv+AVjk0wJHfaUIbq31Jm3T6vvZaarnOeWDh8ShnwXuaAyM7WT3RzErA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^8.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -2199,6 +2635,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/deepmerge-ts": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.3.tgz", @@ -2250,15 +2696,6 @@ "node": ">=0.3.1" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -2315,10 +2752,11 @@ } }, "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.1.tgz", + "integrity": "sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -2384,17 +2822,18 @@ } }, "node_modules/edgedriver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-6.1.1.tgz", - "integrity": "sha512-/dM/PoBf22Xg3yypMWkmRQrBKEnSyNaZ7wHGCT9+qqT14izwtFT+QvdR89rjNkMfXwW+bSFoqOfbcvM+2Cyc7w==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-6.1.2.tgz", + "integrity": "sha512-UvFqd/IR81iPyWMcxXbUNi+xKWR7JjfoHjfuwjqsj9UHQKn80RpQmS0jf+U25IPi+gKVPcpOSKm0XkqgGMq4zQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@wdio/logger": "^9.1.3", "@zip.js/zip.js": "^2.7.53", "decamelize": "^6.0.0", "edge-paths": "^3.0.5", - "fast-xml-parser": "^4.5.0", + "fast-xml-parser": "^5.0.8", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.5", "node-fetch": "^3.3.2", @@ -2418,6 +2857,7 @@ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -2676,23 +3116,24 @@ } }, "node_modules/execa": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/execa/-/execa-9.5.2.tgz", - "integrity": "sha512-EHlpxMCpHWSAh1dgS6bVeoLAXGnJNdR93aabr4QCGbzOM73o5XmRfM/e5FUqsw3aagP8S8XEWUWFAxnRBnAF0Q==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.0.tgz", + "integrity": "sha512-jpWzZ1ZhwUmeWRhS7Qv3mhpOhLfwI+uAX4e5fOcXqwMR7EcJ0pj2kV1CVzHVMX/LphnKWD3LObjZCoJ71lKpHw==", "dev": true, + "license": "MIT", "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", - "cross-spawn": "^7.0.3", + "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", - "human-signals": "^8.0.0", + "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", - "pretty-ms": "^9.0.0", + "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", - "yoctocolors": "^2.0.0" + "yoctocolors": "^2.1.1" }, "engines": { "node": "^18.19.0 || >=20.5.0" @@ -2702,31 +3143,34 @@ } }, "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "version": "30.1.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.1.2.tgz", + "integrity": "sha512-xvHszRavo28ejws8FpemjhwswGj4w/BetHIL8cU49u4sGyXDw2+p3YbeDbj6xzlxi6kWTjIRSTJ+9sNXPnF0Zg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" + "@jest/expect-utils": "30.1.2", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.1.2", + "jest-message-util": "30.1.0", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/expect-webdriverio": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/expect-webdriverio/-/expect-webdriverio-5.0.5.tgz", - "integrity": "sha512-h04OGd7ZksVj8bgv3bYdjFpmJuKeCnyRrBmpMxYpMDmYSspxg9vsSr0kD5p9oOM16bX0ZXEVXr42RbI2hoLpTw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/expect-webdriverio/-/expect-webdriverio-5.4.2.tgz", + "integrity": "sha512-7bc5I2dU3onKJaRhBdxKh/C+W+ot7R+RcRMCLTSR7cbfHM9Shk8ocbNDVvjrxaBdA52kbZONVSyhexp7cq2xNA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/snapshot": "^2.0.5", - "expect": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "lodash.isequal": "^4.5.0" + "@vitest/snapshot": "^3.2.4", + "deep-eql": "^5.0.2", + "expect": "^30.0.0", + "jest-matcher-utils": "^30.0.0" }, "engines": { "node": ">=18 || >=20 || >=22" @@ -2748,6 +3192,51 @@ } } }, + "node_modules/expect-webdriverio/node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/expect-webdriverio/node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/expect-webdriverio/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/expect-webdriverio/node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/express": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", @@ -2809,20 +3298,6 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -2871,22 +3346,19 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", - "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" } ], + "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" @@ -2929,6 +3401,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", "dev": true, + "license": "MIT", "dependencies": { "is-unicode-supported": "^2.0.0" }, @@ -2944,6 +3417,7 @@ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } @@ -2953,6 +3427,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3191,6 +3666,7 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", "dev": true, + "license": "MIT", "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" @@ -3415,10 +3891,11 @@ } }, "node_modules/human-signals": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", - "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz", + "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18.0" } @@ -3489,22 +3966,30 @@ "dev": true }, "node_modules/inquirer": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-11.1.0.tgz", - "integrity": "sha512-CmLAZT65GG/v30c+D2Fk8+ceP6pxD6RL+hIUOWAltCmeyEqWYwqu9v76q03OvjyZ3AB0C1Ala2stn1z/rMqGEw==", + "version": "12.9.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.9.4.tgz", + "integrity": "sha512-5bV3LOgLtMAiJq1QpaUddfRrvaX59wiMYppS7z2jNRSQ64acI0yqx7WMxWhgymenSXOyD657g9tlsTjqGYM8sg==", "dev": true, + "license": "MIT", "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/prompts": "^6.0.1", - "@inquirer/type": "^2.0.0", - "@types/mute-stream": "^0.0.4", + "@inquirer/core": "^10.2.0", + "@inquirer/prompts": "^7.8.4", + "@inquirer/type": "^3.0.8", "ansi-escapes": "^4.3.2", - "mute-stream": "^1.0.0", - "run-async": "^3.0.0", - "rxjs": "^7.8.1" + "mute-stream": "^2.0.0", + "run-async": "^4.0.5", + "rxjs": "^7.8.2" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, "node_modules/ip-address": { @@ -3603,6 +4088,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3615,6 +4101,7 @@ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3653,15 +4140,15 @@ } }, "node_modules/jake": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", - "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "async": "^3.2.3", - "chalk": "^4.0.2", + "async": "^3.2.6", "filelist": "^1.0.4", - "minimatch": "^3.1.2" + "picocolors": "^1.1.1" }, "bin": { "jake": "bin/cli.js" @@ -3670,84 +4157,20 @@ "node": ">=10" } }, - "node_modules/jake/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jake/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/jake/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jake/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/jake/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "version": "30.1.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.1.2.tgz", + "integrity": "sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "pretty-format": "30.0.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-diff/node_modules/ansi-styles": { @@ -3755,6 +4178,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -3770,6 +4194,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3786,6 +4211,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3793,28 +4219,20 @@ "node": ">=8" } }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "version": "30.1.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.1.2.tgz", + "integrity": "sha512-7ai16hy4rSbDjvPTuUhuV8nyPBd6EX34HkBsBcBX2lENCuAQ0qKCPb/+lt8OSWUa9WWmGYLy41PrEzkwRwoGZQ==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "jest-diff": "30.1.2", + "pretty-format": "30.0.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { @@ -3822,6 +4240,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -3837,6 +4256,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3853,6 +4273,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3861,23 +4282,24 @@ } }, "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.1.0.tgz", + "integrity": "sha512-HizKDGG98cYkWmaLUHChq4iN+oCENohQLb7Z5guBPumYs+/etonmNFlg1Ps6yN9LTPyZn+M+b/9BbnHx3WTMDg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util/node_modules/ansi-styles": { @@ -3885,6 +4307,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -3900,6 +4323,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3916,6 +4340,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3923,21 +4348,47 @@ "node": ">=8" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "node_modules/jest-mock": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.0.5.tgz", + "integrity": "sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.0.5", "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "jest-util": "30.0.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-regex-util": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.0.1.tgz", + "integrity": "sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.0.5.tgz", + "integrity": "sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "30.0.5", + "@types/node": "*", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-util/node_modules/ansi-styles": { @@ -3945,6 +4396,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -3960,6 +4412,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3971,11 +4424,25 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/jest-util/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4184,12 +4651,6 @@ "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true - }, "node_modules/lodash.pickby": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.pickby/-/lodash.pickby-4.6.0.tgz", @@ -4354,6 +4815,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4419,6 +4881,13 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true, + "license": "MIT" + }, "node_modules/mocha": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", @@ -4675,12 +5144,13 @@ "dev": true }, "node_modules/mute-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", + "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", "dev": true, + "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/negotiator": { @@ -4766,6 +5236,7 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" @@ -4782,6 +5253,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -4844,15 +5316,6 @@ "wrappy": "1" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4963,6 +5426,7 @@ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -5087,17 +5551,18 @@ } }, "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", + "integrity": "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "@jest/schemas": "30.0.5", + "ansi-styles": "^5.2.0", + "react-is": "^18.3.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/pretty-ms": { @@ -5105,6 +5570,7 @@ "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", "dev": true, + "license": "MIT", "dependencies": { "parse-ms": "^4.0.0" }, @@ -5260,7 +5726,8 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/read-pkg": { "version": "8.1.0", @@ -5367,18 +5834,6 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "4.32.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.32.0.tgz", - "integrity": "sha512-rfgpoi08xagF3JSdtJlCwMq9DGNDE0IMh3Mkpc1wUypg9vPi786AiqeBBKcqvIkq42azsBM85N490fyZjeUftw==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/read-pkg-up/node_modules/yocto-queue": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", @@ -5391,18 +5846,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "4.32.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.32.0.tgz", - "integrity": "sha512-rfgpoi08xagF3JSdtJlCwMq9DGNDE0IMh3Mkpc1wUypg9vPi786AiqeBBKcqvIkq42azsBM85N490fyZjeUftw==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/readable-stream": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", @@ -5482,6 +5925,7 @@ "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, + "license": "MIT", "dependencies": { "minimatch": "^3.0.5" }, @@ -5490,10 +5934,11 @@ } }, "node_modules/recursive-readdir/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5504,6 +5949,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5538,6 +5984,16 @@ "fast-deep-equal": "^2.0.1" } }, + "node_modules/ret": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", + "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/rgb2hex": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.2.5.tgz", @@ -5545,19 +6001,21 @@ "dev": true }, "node_modules/run-async": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", - "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-4.0.6.tgz", + "integrity": "sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } @@ -5591,6 +6049,26 @@ } ] }, + "node_modules/safe-regex2": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.0.0.tgz", + "integrity": "sha512-YwJwe5a51WlK7KbOJREPdjNrpViQBI3p4T50lfwPuDhZnE3XGVTlGvi+aolc5+RvxDD6bnUmjVsU9n1eboLUYw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -5830,6 +6308,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5950,6 +6429,7 @@ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -5962,6 +6442,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -6108,6 +6589,7 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6128,10 +6610,17 @@ } }, "node_modules/strnum": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" }, "node_modules/supports-color": { "version": "8.1.1", @@ -6198,18 +6687,6 @@ "node": ">=14.0.0" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6258,12 +6735,13 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=10" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -6313,6 +6791,7 @@ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6573,6 +7052,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -6661,6 +7141,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -6670,6 +7151,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -6684,13 +7166,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6705,6 +7189,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6893,10 +7378,11 @@ } }, "node_modules/yoctocolors": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", - "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", + "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6905,10 +7391,11 @@ } }, "node_modules/yoctocolors-cjs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", - "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz", + "integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, diff --git a/tests/package.json b/tests/package.json index 75cc6fd2..e3293677 100644 --- a/tests/package.json +++ b/tests/package.json @@ -3,7 +3,7 @@ "type": "module", "devDependencies": { "@types/mocha": "^10.0.10", - "@wdio/cli": "^9.5.3", + "@wdio/cli": "^9.19.2", "@wdio/local-runner": "^9.5.3", "@wdio/mocha-framework": "^9.5.0", "@wdio/static-server-service": "^9.5.0" From edf89791594f9914ad6ab787f18a449b813011fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aliet=20Exp=C3=B3sito=20Garc=C3=ADa?= Date: Thu, 4 Sep 2025 16:42:26 -0400 Subject: [PATCH 042/103] es: add and improve Spanish translations in `Testing in Android` section (#2690) Fixes and improves the Spanish translations in the `Testing in Android` section (src/android/testing.md) --- po/es.po | 63 +++++++++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/po/es.po b/po/es.po index e0c903f3..07c0795e 100644 --- a/po/es.po +++ b/po/es.po @@ -13653,34 +13653,32 @@ msgid "" msgstr "" #: src/android/testing.md -#, fuzzy msgid "Testing in Android" -msgstr "Rust en Android" +msgstr "Pruebas en Android" #: src/android/testing.md msgid "" "Building on [Testing](../testing.md), we will now look at how unit tests " "work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" +"Basándonos en [Pruebas](../testing.md), ahora veremos cómo funcionan las pruebas " +"unitarias en AOSP. Usa el módulo `rust_test` para tus pruebas unitarias:" #: src/android/testing.md -#, fuzzy msgid "_testing/Android.bp_:" -msgstr "_hello_rust/Android.bp_:" +msgstr "_testing/Android.bp_:" #: src/android/testing.md -#, fuzzy msgid "\"libleftpad\"" -msgstr "\"libtextwrap\"" +msgstr "\"libleftpad\"" #: src/android/testing.md msgid "\"leftpad\"" msgstr "" #: src/android/testing.md -#, fuzzy msgid "\"libleftpad_test\"" -msgstr "\"libbirthday_bindgen_test\"" +msgstr "\"libleftpad_test\"" #: src/android/testing.md msgid "\"leftpad_test\"" @@ -13691,43 +13689,36 @@ msgid "\"general-tests\"" msgstr "\"general-tests\"" #: src/android/testing.md -#, fuzzy msgid "_testing/src/lib.rs_:" -msgstr "_hello_rust/src/lib.rs_:" +msgstr "_testing/src/lib.rs_:" #: src/android/testing.md -#, fuzzy msgid "//! Left-padding library.\n" -msgstr "//! Biblioteca de saludos.\n" +msgstr "//! Biblioteca de relleno a la izquierda.\n" #: src/android/testing.md msgid "/// Left-pad `s` to `width`.\n" -msgstr "" +msgstr "/// Rellena `s` a la izquierda hasta `width`.\n" #: src/android/testing.md -#, fuzzy msgid "\"{s:>width$}\"" -msgstr "\"|{:^width$}|\"" +msgstr "\"{s:>width$}\"" #: src/android/testing.md -#, fuzzy msgid "\" foo\"" -msgstr "\"foo\"" +msgstr "\" foo\"" #: src/android/testing.md -#, fuzzy msgid "\"foobar\"" -msgstr "\"foo\"" +msgstr "\"foobar\"" #: src/android/testing.md -#, fuzzy msgid "You can now run the test with" -msgstr "Ahora puedes generar automáticamente los enlaces:" +msgstr "Ahora puedes ejecutar la prueba con" #: src/android/testing.md -#, fuzzy msgid "The output looks like this:" -msgstr "El enfoque general es el siguiente:" +msgstr "La salida se ve así:" #: src/android/testing.md msgid "" @@ -13748,15 +13739,16 @@ msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" +"Observa que solo mencionas la raíz del crate de la biblioteca. Las pruebas se " +"encuentran de forma recursiva en módulos anidados." #: src/android/testing/googletest.md -#, fuzzy msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" -"[googletest](https://docs.rs/googletest): biblioteca completa de aserción de " -"pruebas en la tradición de GoogleTest para C++." +"El crate [GoogleTest](https://docs.rs/googletest/) permite realizar aserciones de " +"prueba flexibles utilizando _matchers_:" #: src/android/testing/googletest.md msgid "\"baz\"" @@ -13804,13 +13796,12 @@ msgid "" msgstr "" #: src/android/testing/googletest.md -#, fuzzy msgid "" "A particularly nice feature is that mismatches in multi-line strings are " "shown as a diff:" msgstr "" -"Una característica muy interesante es que las discrepancias en las cadenas " -"que contienen varias líneas se muestran como un diff:" +"Una característica especialmente útil es que las discrepancias en cadenas de " +"varias líneas se muestran como un diff:" #: src/android/testing/googletest.md msgid "" @@ -13855,7 +13846,6 @@ msgstr "" "podrás hacer simulaciones:" #: src/android/testing/mocking.md -#, fuzzy msgid "" "Mockall is the recommended mocking library in Android (AOSP). There are " "other [mocking libraries available on crates.io](https://crates.io/keywords/" @@ -13863,13 +13853,12 @@ msgid "" "libraries work in a similar fashion as Mockall, meaning that they make it " "easy to get a mock implementation of a given trait." msgstr "" -"Estos consejos son útiles para Android (AOSP), donde Mockall es la " -"biblioteca de simulaciones recomendada. Hay otras [bibliotecas de simulación " -"disponibles en crates.io](https://crates.io/keywords/mock), especialmente en " -"el área de servicios de simulación de HTTP. Las demás bibliotecas de " -"simulación funcionan de forma similar a Mockall, lo que significa que " -"facilitan la obtención de una implementación simulada de un trait " -"determinado." +"Mockall es la biblioteca de simulación recomendada en Android (AOSP). Hay " +"otras [bibliotecas de simulación disponibles en crates.io](https://crates.io/keywords/mock), " +"particularmente en el área de simulación de servicios HTTP. Las demás " +"bibliotecas de simulación funcionan de manera similar a Mockall, lo que " +"significa que facilitan la obtención de una implementación simulada de un " +"trait determinado." #: src/android/testing/mocking.md msgid "" From 86334bfd7a2f3263af664578890f979f7085d94b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 23:52:25 +0200 Subject: [PATCH 043/103] cargo: bump h2 from 0.3.26 to 0.3.27 in the cargo group across 1 directory (#2869) Bumps the cargo group with 1 update in the / directory: [h2](https://github.com/hyperium/h2). Updates `h2` from 0.3.26 to 0.3.27
Changelog

Sourced from h2's changelog.

0.3.27 (July 11, 2025)

  • Fix notifying wakers when detecting local stream errors.
Commits
  • f6237ac v0.3.27
  • f61332e refactor: change local reset counter to use type system more
  • 3f1a8e3 style: fix anonymous lifetime syntax
  • 778aa7e fix: notify_recv after send_reset() in reset_on_recv_stream_err() to ensure l...
  • be10b77 ci: pin more deps for MSRV job (#817)
  • c0d9feb ci: pin deps for MSRV
  • 5ccd9cf lints: fix unexpected cfgs warnings
  • e6e3e9c fix: return a WriteZero error if frames cannot be written (#783)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h2&package-manager=cargo&previous-version=0.3.26&new-version=0.3.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/comprehensive-rust/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d56efef..48aa346e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -885,9 +885,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" dependencies = [ "bytes", "fnv", @@ -1093,7 +1093,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.27", "http 0.2.11", "http-body 0.4.6", "httparse", From 2af48cff2eb225f5937853f8a3b5366e51c3666c Mon Sep 17 00:00:00 2001 From: QPham <93593303+quynhpha2hht@users.noreply.github.com> Date: Fri, 5 Sep 2025 06:32:34 +0700 Subject: [PATCH 044/103] vi: Translate Welcome Day 2 and Day 3 (#2448) Translate `Welcome to Day 2` and `Welcome to Day 3` to Vietnamese. --- po/vi.po | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/po/vi.po b/po/vi.po index b0a9da64..4bb314dd 100644 --- a/po/vi.po +++ b/po/vi.po @@ -4785,34 +4785,38 @@ msgstr "" #: src/welcome-day-2.md msgid "Welcome to Day 2" -msgstr "" +msgstr "Chào mừng tới Ngày 2" #: src/welcome-day-2.md msgid "" "Now that we have seen a fair amount of Rust, today will focus on Rust's type " "system:" msgstr "" +"Chúng ta đã có kiến thức tổng quan về Rust, hôm nay sẽ tập trung vào hệ " +"thống kiểu trong Rust:" #: src/welcome-day-2.md msgid "Pattern matching: extracting data from structures." -msgstr "" +msgstr "So khớp mẫu (Pattern matching): trích xuất dữ liệu từ các cấu trúc." #: src/welcome-day-2.md msgid "Methods: associating functions with types." -msgstr "" +msgstr "Phương thức (Methods): liên kết hàm với các kiểu dữ liệu." #: src/welcome-day-2.md msgid "Traits: behaviors shared by multiple types." -msgstr "" +msgstr "Traits: hành vi được chia sẻ bởi nhiều kiểu dữ liệu." #: src/welcome-day-2.md msgid "Generics: parameterizing types on other types." -msgstr "" +msgstr "Generics: tham số hóa các kiểu dữ liệu trên các kiểu khác nhau." #: src/welcome-day-2.md msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" +"Các kiểu thư viện chuẩn và traits: sơ bộ về thư viện chuẩn phong phú của " +"Rust." #: src/welcome-day-2.md src/welcome-day-4-afternoon.md msgid "" @@ -7113,21 +7117,24 @@ msgstr "" #: src/welcome-day-3.md msgid "Welcome to Day 3" -msgstr "" +msgstr "Chào mừng tới Ngày 3" #: src/welcome-day-3.md msgid "Today, we will cover:" -msgstr "" +msgstr "Chủ đề chúng ta sẽ học hôm nay là:" #: src/welcome-day-3.md msgid "" "Memory management, lifetimes, and the borrow checker: how Rust ensures " "memory safety." msgstr "" +"Quản lý bộ nhớ, vòng đời (lifetimes), và quá trình kiểm mượn (the borrow " +"checker): cách mà Rust đảm bảo được tính an toàn bộ nhớ." #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." msgstr "" +"Con trỏ thông minh (smart pointers): các kiểu con trỏ trong thư viện chuẩn." #: src/welcome-day-3.md msgid "" From 79324df571df5e4f50a56f6313e60dbd5f020639 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:04:50 +0200 Subject: [PATCH 045/103] docs: improve language in hello-world section (#2883) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/hello-world/what-is-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hello-world/what-is-rust.md b/src/hello-world/what-is-rust.md index 52909f98..aa1eb998 100644 --- a/src/hello-world/what-is-rust.md +++ b/src/hello-world/what-is-rust.md @@ -4,7 +4,7 @@ minutes: 10 # What is Rust? -Rust is a new programming language which had its [1.0 release in 2015][1]: +Rust is a new programming language that had its [1.0 release in 2015][1]: - Rust is a statically compiled language in a similar role as C++ - `rustc` uses LLVM as its backend. From b7aea9ce2250773a80e0c86a82f035cb54cbc015 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:05:45 +0200 Subject: [PATCH 046/103] docs: improve language in memory-management section (#2882) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/memory-management/approaches.md | 10 +++++----- src/memory-management/move.md | 2 +- src/memory-management/ownership.md | 2 +- src/memory-management/review.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/memory-management/approaches.md b/src/memory-management/approaches.md index 4a197dea..919e60d0 100644 --- a/src/memory-management/approaches.md +++ b/src/memory-management/approaches.md @@ -34,7 +34,7 @@ in context. - C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take advantage of language guarantees about calling destructors to ensure memory is - freed when a function returns. It is still quite easy to mis-use these tools + freed when a function returns. It is still quite easy to misuse these tools and create similar bugs to C. - Java, Go, and Python rely on the garbage collector to identify memory that is @@ -43,10 +43,10 @@ in context. has a runtime cost and is difficult to tune properly. Rust's ownership and borrowing model can, in many cases, get the performance of -C, with alloc and free operations precisely where they are required -- zero -cost. It also provides tools similar to C++'s smart pointers. When required, -other options such as reference counting are available, and there are even -crates available to support runtime garbage collection (not covered in this +C, with alloc and free operations precisely where they are required -- +zero-cost. It also provides tools similar to C++'s smart pointers. When +required, other options such as reference counting are available, and there are +even crates available to support runtime garbage collection (not covered in this class). diff --git a/src/memory-management/move.md b/src/memory-management/move.md index 1ba37d0b..1719bc91 100644 --- a/src/memory-management/move.md +++ b/src/memory-management/move.md @@ -164,7 +164,7 @@ Key points: 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`. -- Unlike Rust, `=` in C++ can run arbitrary code as determined by the type which +- Unlike Rust, `=` in C++ can run arbitrary code as determined by the type that is being copied or moved. [`std::move`]: https://en.cppreference.com/w/cpp/utility/move diff --git a/src/memory-management/ownership.md b/src/memory-management/ownership.md index 61ff4a8d..7aa13039 100644 --- a/src/memory-management/ownership.md +++ b/src/memory-management/ownership.md @@ -29,7 +29,7 @@ destructor can run here to free up resources.
-Students familiar with garbage-collection implementations will know that a +Students familiar with garbage collection implementations will know that a garbage collector starts with a set of "roots" to find all reachable memory. Rust's "single owner" principle is a similar idea. diff --git a/src/memory-management/review.md b/src/memory-management/review.md index 04c719a8..08f847e2 100644 --- a/src/memory-management/review.md +++ b/src/memory-management/review.md @@ -14,7 +14,7 @@ Programs allocate memory in two ways: - Heap: Storage of values outside of function calls. - Values have dynamic sizes determined at runtime. - - Slightly slower than the stack: some book-keeping needed. + - Slightly slower than the stack: some bookkeeping needed. - No guarantee of memory locality. ## Example From 3f479b920b531527c92866f5e72583bda8cc2cef Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:08:26 +0200 Subject: [PATCH 047/103] docs: improve language in modules section (#2880) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/modules/encapsulation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/encapsulation.md b/src/modules/encapsulation.md index b646038b..1adb4285 100644 --- a/src/modules/encapsulation.md +++ b/src/modules/encapsulation.md @@ -46,7 +46,7 @@ fn main() {
- This slide demonstrates how privacy in structs is module-based. Students - coming from object oriented languages may be used to types being the + coming from object-oriented languages may be used to types being the encapsulation boundary, so this demonstrates how Rust behaves differently while showing how we can still achieve encapsulation. From 118bf78365772dca5889279c85133174aeaa98d5 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:19:35 +0200 Subject: [PATCH 048/103] docs: improve language in running-the-course section (#2877) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/running-the-course/course-structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/running-the-course/course-structure.md b/src/running-the-course/course-structure.md index cb2a63aa..39f10250 100644 --- a/src/running-the-course/course-structure.md +++ b/src/running-the-course/course-structure.md @@ -5,7 +5,7 @@ ## Rust Fundamentals The first four days make up [Rust Fundamentals](../welcome-day-1.md). The days -are fast paced and we cover a lot of ground! +are fast-paced and we cover a lot of ground! {{%course outline Fundamentals}} From f72d5ce5856aff13464a7a778c743cf4933cd550 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:20:10 +0200 Subject: [PATCH 049/103] docs: improve language in methods-and-traits section (#2881) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/methods-and-traits/deriving.md | 2 +- src/methods-and-traits/exercise.md | 2 +- src/methods-and-traits/methods.md | 2 +- src/methods-and-traits/traits/associated-types.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/methods-and-traits/deriving.md b/src/methods-and-traits/deriving.md index 1c27e407..a577311a 100644 --- a/src/methods-and-traits/deriving.md +++ b/src/methods-and-traits/deriving.md @@ -30,7 +30,7 @@ fn main() { macros to add useful functionality. For example, `serde` can derive serialization support for a struct using `#[derive(Serialize)]`. -- Derivation is usually provided for traits that have a common boilerplate-y +- Derivation is usually provided for traits that have a common boilerplate implementation that is correct for most cases. For example, demonstrate how a manual `Clone` impl can be repetitive compared to deriving the trait: diff --git a/src/methods-and-traits/exercise.md b/src/methods-and-traits/exercise.md index 8b1f02a0..397359be 100644 --- a/src/methods-and-traits/exercise.md +++ b/src/methods-and-traits/exercise.md @@ -5,7 +5,7 @@ minutes: 15 # Exercise: Logger Trait Let's design a simple logging utility, using a trait `Logger` with a `log` -method. Code which might log its progress can then take an `&impl Logger`. In +method. Code that might log its progress can then take an `&impl Logger`. In testing, this might put messages in the test logfile, while in a production build it would send messages to a log server. diff --git a/src/methods-and-traits/methods.md b/src/methods-and-traits/methods.md index 9c8386ae..eed886ac 100644 --- a/src/methods-and-traits/methods.md +++ b/src/methods-and-traits/methods.md @@ -65,7 +65,7 @@ There are several common receivers for a method: transmitted. Complete ownership does not automatically mean mutability. - `mut self`: same as above, but the method can mutate the object. - No receiver: this becomes a static method on the struct. Typically used to - create constructors which are called `new` by convention. + create constructors that are called `new` by convention.
diff --git a/src/methods-and-traits/traits/associated-types.md b/src/methods-and-traits/traits/associated-types.md index beb00e78..e21cb76f 100644 --- a/src/methods-and-traits/traits/associated-types.md +++ b/src/methods-and-traits/traits/associated-types.md @@ -1,6 +1,6 @@ # Associated Types -Associated types are placeholder types which are supplied by the trait +Associated types are placeholder types that are supplied by the trait implementation. ```rust,editable From 6043672c2f2a4ede650825ff23d64b595c55934a Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:41:30 +0200 Subject: [PATCH 050/103] docs: improve language in user-defined-types section (#2873) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result. As a non-native speaker, it is hard for me to evaluate the finer details of this, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/user-defined-types/exercise.md | 3 +-- src/user-defined-types/tuple-structs.md | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/user-defined-types/exercise.md b/src/user-defined-types/exercise.md index 524d258b..5cb889d3 100644 --- a/src/user-defined-types/exercise.md +++ b/src/user-defined-types/exercise.md @@ -47,7 +47,6 @@ out of these structures. - If students ask about `#![allow(dead_code)]` at the top of the exercise, it's necessary because the only thing we do with the `Event` type is print it out. Due to a nuance of how the compiler checks for dead code this causes it to - think that the code is unused. They can ignore it for the purpose of this - exercise. + think the code is unused. They can ignore it for the purpose of this exercise.
diff --git a/src/user-defined-types/tuple-structs.md b/src/user-defined-types/tuple-structs.md index f2340bf1..f241c651 100644 --- a/src/user-defined-types/tuple-structs.md +++ b/src/user-defined-types/tuple-structs.md @@ -47,9 +47,10 @@ fn main() { ["Idiomatic Rust" module](../idiomatic/leveraging-the-type-system/newtype-pattern.md). - Demonstrate how to add a `f64` value to a `Newtons` type by accessing the single field in the newtype. - - Rust generally doesn’t like inexplicit things, like automatic unwrapping or - for instance using booleans as integers. - - Operator overloading is discussed on Day 3 (generics). + - Rust generally avoids implicit conversions, like automatic unwrapping or + using booleans as integers. + - Operator overloading is discussed on Day 2 + ([Standard Library Traits](../std-traits.md)). - When a tuple struct has zero fields, the `()` can be omitted. The result is a zero-sized type (ZST), of which there is only one value (the name of the type). From 93de441a6d7ef9643c96f8f83448212cdc203b2b Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:18:45 +0200 Subject: [PATCH 051/103] docs: improve language in generics section (#2884) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/generics/dyn-trait.md | 2 +- src/generics/generic-data.md | 2 +- src/generics/impl-trait.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generics/dyn-trait.md b/src/generics/dyn-trait.md index 129238d7..106c2e7c 100644 --- a/src/generics/dyn-trait.md +++ b/src/generics/dyn-trait.md @@ -60,7 +60,7 @@ fn main() { instance of the function for each different type that the generic is instantiated with. This means that calling a trait method from within a generic function still uses static dispatch, as the compiler has full type - information and can resolve which type's trait implementation to use. + information and can resolve that type's trait implementation to use. - When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual method table][vtable] (vtable). This means that there's a single diff --git a/src/generics/generic-data.md b/src/generics/generic-data.md index 8aa869d6..02969e2d 100644 --- a/src/generics/generic-data.md +++ b/src/generics/generic-data.md @@ -44,7 +44,7 @@ fn main() {
-- _Q:_ Why `L` is specified twice in `impl .. VerbosityFilter`? +- _Q:_ Why is `L` specified twice in `impl .. VerbosityFilter`? Isn't that redundant? - This is because it is a generic implementation section for generic type. They are independently generic. diff --git a/src/generics/impl-trait.md b/src/generics/impl-trait.md index 44323955..6c680c9e 100644 --- a/src/generics/impl-trait.md +++ b/src/generics/impl-trait.md @@ -30,7 +30,7 @@ fn main() {
-`impl Trait` allows you to work with types which you cannot name. The meaning of +`impl Trait` allows you to work with types that you cannot name. The meaning of `impl Trait` is a bit different in the different positions. - For a parameter, `impl Trait` is like an anonymous generic parameter with a From 513c450e7cd421d9adc3e3476ec0206b06fcdfb4 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:41:25 +0200 Subject: [PATCH 052/103] docs: improve language in closures section (#2888) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/closures/exercise.md | 4 ++-- src/closures/traits.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/closures/exercise.md b/src/closures/exercise.md index efb210b5..448ca213 100644 --- a/src/closures/exercise.md +++ b/src/closures/exercise.md @@ -4,8 +4,8 @@ minutes: 10 # Exercise: Log Filter -Building on the generic logger from this morning, implement a `Filter` which -uses a closure to filter log messages, sending those which pass the filtering +Building on the generic logger from this morning, implement a `Filter` that uses +a closure to filter log messages, sending those that pass the filtering predicate to an inner logger. ```rust,compile_fail,editable diff --git a/src/closures/traits.md b/src/closures/traits.md index 1cc391a4..1b7a9bc5 100644 --- a/src/closures/traits.md +++ b/src/closures/traits.md @@ -4,7 +4,7 @@ minutes: 10 # Closure traits -Closures or lambda expressions have types which cannot be named. However, they +Closures or lambda expressions have types that cannot be named. However, they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits: @@ -67,7 +67,7 @@ can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most flexibility for the caller. In contrast, when you have a closure, the most flexible you can have is `Fn` -(which can be passed to a consumer of any of the 3 closure traits), then +(which can be passed to a consumer of any of the three closure traits), then `FnMut`, and lastly `FnOnce`. The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g. From 041fa6b9c22a365875054a01730e623526d6174d Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:49:57 +0200 Subject: [PATCH 053/103] docs: improve language in control-flow-basics section (#2887) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/control-flow-basics/blocks-and-scopes.md | 5 ++--- src/control-flow-basics/break-continue.md | 2 +- src/control-flow-basics/break-continue/labels.md | 4 ++-- src/control-flow-basics/exercise.md | 2 +- src/control-flow-basics/loops/loop.md | 2 +- src/control-flow-basics/match.md | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/control-flow-basics/blocks-and-scopes.md b/src/control-flow-basics/blocks-and-scopes.md index 03587b3b..366c0be7 100644 --- a/src/control-flow-basics/blocks-and-scopes.md +++ b/src/control-flow-basics/blocks-and-scopes.md @@ -4,9 +4,8 @@ minutes: 5 # Blocks and Scopes -A block in Rust contains a sequence of expressions, enclosed by braces `{}`. -Each block has a value and a type, which are those of the last expression of the -block: +A block in Rust contains a sequence of expressions, enclosed by braces {}. The +final expression of a block determines the value and type of the whole block: ```rust,editable fn main() { diff --git a/src/control-flow-basics/break-continue.md b/src/control-flow-basics/break-continue.md index e5d79b7a..fbf629cc 100644 --- a/src/control-flow-basics/break-continue.md +++ b/src/control-flow-basics/break-continue.md @@ -30,7 +30,7 @@ fn main() {
-Note that `loop` is the only looping construct which can return a non-trivial +Note that `loop` is the only looping construct that can return a non-trivial value. This is because it's guaranteed to only return at a `break` statement (unlike `while` and `for` loops, which can also return when the condition fails). diff --git a/src/control-flow-basics/break-continue/labels.md b/src/control-flow-basics/break-continue/labels.md index 95d4e6c1..5646f439 100644 --- a/src/control-flow-basics/break-continue/labels.md +++ b/src/control-flow-basics/break-continue/labels.md @@ -1,7 +1,7 @@ # Labels -Both `continue` and `break` can optionally take a label argument which is used -to break out of nested loops: +Both `continue` and `break` can optionally take a label argument that is used to +break out of nested loops: ```rust,editable fn main() { diff --git a/src/control-flow-basics/exercise.md b/src/control-flow-basics/exercise.md index 812d4f98..8145fbe9 100644 --- a/src/control-flow-basics/exercise.md +++ b/src/control-flow-basics/exercise.md @@ -22,7 +22,7 @@ For example, beginning with _n1_ = 3: - 2 is even, so _n8_ = 1; and - the sequence terminates. -Write a function to calculate the length of the collatz sequence for a given +Write a function to calculate the length of the Collatz sequence for a given initial `n`. ```rust,editable,should_panic diff --git a/src/control-flow-basics/loops/loop.md b/src/control-flow-basics/loops/loop.md index b3b96950..9e98ccff 100644 --- a/src/control-flow-basics/loops/loop.md +++ b/src/control-flow-basics/loops/loop.md @@ -19,6 +19,6 @@ fn main() {
- The `loop` statement works like a `while true` loop. Use it for things like - servers which will serve connections forever. + servers that will serve connections forever.
diff --git a/src/control-flow-basics/match.md b/src/control-flow-basics/match.md index d1ab20c5..b8a58306 100644 --- a/src/control-flow-basics/match.md +++ b/src/control-flow-basics/match.md @@ -59,7 +59,7 @@ fn main() { ## More to Explore - To further motivate the usage of `match`, you can compare the examples to - their equivalents written with `if`. In the second case matching on a `bool` + their equivalents written with `if`. In the second case, matching on a `bool`, an `if {} else {}` block is pretty similar. But in the first example that checks multiple cases, a `match` expression can be more concise than `if {} else if {} else if {} else`. From afcc3a47c07bdcbb0345f29c2d5827f27a7c5615 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:51:21 +0200 Subject: [PATCH 054/103] docs: improve language in error-handling section (#2886) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/error-handling/panics.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/error-handling/panics.md b/src/error-handling/panics.md index 7f671dc0..5f493d84 100644 --- a/src/error-handling/panics.md +++ b/src/error-handling/panics.md @@ -4,9 +4,7 @@ minutes: 3 # Panics -Rust handles fatal errors with a "panic". - -Rust will trigger a panic if a fatal error happens at runtime: +In case of a fatal runtime error, Rust triggers a "panic": ```rust,editable,should_panic fn main() { @@ -17,8 +15,8 @@ fn main() { - Panics are for unrecoverable and unexpected errors. - Panics are symptoms of bugs in the program. - - Runtime failures like failed bounds checks can panic - - Assertions (such as `assert!`) panic on failure + - Runtime failures like failed bounds checks can panic. + - Assertions (such as `assert!`) panic on failure. - Purpose-specific panics can use the `panic!` macro. - A panic will "unwind" the stack, dropping values just as if the functions had returned. From 969668a55236bcdf508af97a9d410fea0397a6d4 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:55:15 +0200 Subject: [PATCH 055/103] docs: improve language in std-types section (#2876) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/std-types/exercise.md | 4 ++-- src/std-types/hashmap.md | 2 +- src/std-types/std.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/std-types/exercise.md b/src/std-types/exercise.md index efe03093..ad894f85 100644 --- a/src/std-types/exercise.md +++ b/src/std-types/exercise.md @@ -7,10 +7,10 @@ minutes: 20 In this exercise you will take a very simple data structure and make it generic. It uses a [`std::collections::HashMap`](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html) -to keep track of which values have been seen and how many times each one has +to keep track of what values have been seen and how many times each one has appeared. -The initial version of `Counter` is hard coded to only work for `u32` values. +The initial version of `Counter` is hardcoded to only work for `u32` values. Make the struct and its methods generic over the type of value being tracked, that way `Counter` can track any type of value. diff --git a/src/std-types/hashmap.md b/src/std-types/hashmap.md index 88ce026c..7a01c39b 100644 --- a/src/std-types/hashmap.md +++ b/src/std-types/hashmap.md @@ -65,7 +65,7 @@ fn main() { ]); ``` -- Alternatively HashMap can be built from any `Iterator` which yields key-value +- Alternatively HashMap can be built from any `Iterator` that yields key-value tuples. - This type has several "method-specific" return types, such as diff --git a/src/std-types/std.md b/src/std-types/std.md index e7b18f9e..66cf3911 100644 --- a/src/std-types/std.md +++ b/src/std-types/std.md @@ -4,7 +4,7 @@ minutes: 3 # Standard Library -Rust comes with a standard library which helps establish a set of common types +Rust comes with a standard library that helps establish a set of common types used by Rust libraries and programs. This way, two libraries can work together smoothly because they both use the same `String` type. @@ -13,6 +13,6 @@ and `std`. - `core` includes the most basic types and functions that don't depend on `libc`, allocator or even the presence of an operating system. -- `alloc` includes types which require a global heap allocator, such as `Vec`, +- `alloc` includes types that require a global heap allocator, such as `Vec`, `Box` and `Arc`. - Embedded Rust applications often only use `core`, and sometimes `alloc`. From 3fb6b7e1642b8b83ac32ff894cc7158d45d5c4d1 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:57:33 +0200 Subject: [PATCH 056/103] docs: improve language in types-and-values section (#2874) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/types-and-values/exercise.md | 6 +++--- src/types-and-values/hello-world.md | 2 +- src/types-and-values/values.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types-and-values/exercise.md b/src/types-and-values/exercise.md index 467353bc..ea47abd1 100644 --- a/src/types-and-values/exercise.md +++ b/src/types-and-values/exercise.md @@ -4,10 +4,10 @@ minutes: 15 # Exercise: Fibonacci -The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci number -is calculated recursively as the sum of the n-1'th and n-2'th Fibonacci numbers. +The Fibonacci sequence begins with `[0, 1]`. For `n > 1`, the next number is the +sum of the previous two. -Write a function `fib(n)` that calculates the n'th Fibonacci number. When will +Write a function `fib(n)` that calculates the nth Fibonacci number. When will this function panic? ```rust,editable,should_panic diff --git a/src/types-and-values/hello-world.md b/src/types-and-values/hello-world.md index b7c6ef74..9c9fc8bd 100644 --- a/src/types-and-values/hello-world.md +++ b/src/types-and-values/hello-world.md @@ -32,7 +32,7 @@ Key points: - Rust is very much like other languages in the C/C++/Java tradition. It is imperative and it doesn't try to reinvent things unless absolutely necessary. -- Rust is modern with full support for things like Unicode. +- Rust is modern with full support for Unicode. - Rust uses macros for situations where you want to have a variable number of arguments (no function [overloading](../control-flow-basics/functions.md)). diff --git a/src/types-and-values/values.md b/src/types-and-values/values.md index 71bef8e6..a5a662b6 100644 --- a/src/types-and-values/values.md +++ b/src/types-and-values/values.md @@ -24,7 +24,7 @@ The types have widths as follows:
-There are a few syntaxes which are not shown above: +There are a few syntaxes that are not shown above: - All underscores in numbers can be left out, they are for legibility only. So `1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written as From 9b4f56167ee2deee351f302fd3964df31dc55204 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 18:59:44 +0200 Subject: [PATCH 057/103] docs: improve language in cargo section (#2892) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- src/cargo.md | 2 +- src/cargo/code-samples.md | 2 +- src/cargo/running-locally.md | 2 +- src/cargo/rust-ecosystem.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo.md b/src/cargo.md index e9128cea..722cb1da 100644 --- a/src/cargo.md +++ b/src/cargo.md @@ -12,7 +12,7 @@ fits into this training. This will give you the Cargo build tool (`cargo`) and the Rust compiler (`rustc`). You will also get `rustup`, a command line utility that you can use -to install to different compiler versions. +to install different compiler versions. After installing Rust, you should configure your editor or IDE to work with Rust. Most editors do this by talking to [rust-analyzer], which provides diff --git a/src/cargo/code-samples.md b/src/cargo/code-samples.md index 02ab93ac..af6819fd 100644 --- a/src/cargo/code-samples.md +++ b/src/cargo/code-samples.md @@ -5,7 +5,7 @@ which can be executed through your browser. This makes the setup much easier and ensures a consistent experience for everyone. Installing Cargo is still encouraged: it will make it easier for you to do the -exercises. On the last day, we will do a larger exercise which shows you how to +exercises. On the last day, we will do a larger exercise that shows you how to work with dependencies and for that you need Cargo. The code blocks in this course are fully interactive: diff --git a/src/cargo/running-locally.md b/src/cargo/running-locally.md index 78898ad4..0c41f0c6 100644 --- a/src/cargo/running-locally.md +++ b/src/cargo/running-locally.md @@ -38,7 +38,7 @@ examples in this training: Hello, world! ``` -4. Replace the boiler-plate code in `src/main.rs` with your own code. For +4. Replace the boilerplate code in `src/main.rs` with your own code. For example, using the example on the previous page, make `src/main.rs` look like ```rust diff --git a/src/cargo/rust-ecosystem.md b/src/cargo/rust-ecosystem.md index e4de7658..5415ae6f 100644 --- a/src/cargo/rust-ecosystem.md +++ b/src/cargo/rust-ecosystem.md @@ -2,7 +2,7 @@ The Rust ecosystem consists of a number of tools, of which the main ones are: -- `rustc`: the Rust compiler which turns `.rs` files into binaries and other +- `rustc`: the Rust compiler that turns `.rs` files into binaries and other intermediate formats. - `cargo`: the Rust dependency manager and build tool. Cargo knows how to From 56a3b7c6d9b5b9c76950731b5450ffc9cd29d51c Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 19:02:15 +0200 Subject: [PATCH 058/103] docs: improve language in root files (#2894) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --- README.md | 22 +++++++++++----------- src/index.md | 2 +- src/welcome-day-1.md | 7 ++++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8152d972..2c38d930 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,14 @@ Read the course at **https://google.github.io/comprehensive-rust/**. ## Course Format and Target Audience -The course is used internally at Google when teaching Rust to experienced -software engineers. They typically have a background in C++ or Java. +The course is used internally at Google to teach Rust to experienced software +engineers, typically with a background in C++ or Java. -The course is taught in a classroom setting and we hope it will be useful for -others who want to teach Rust to their team. The course will be less useful for -self-study since you miss out on the discussions happening in the classroom. You -don't see the questions and answers and you don't see the compiler errors we -trigger when going through the code samples. We hope to improve on this via +The course is taught in a classroom setting, and we hope it will be useful for +others who want to teach Rust to their team. The course is less ideal for +self-study, since you would miss out on classroom discussions. You would not see +the questions and answers, nor the compiler errors we trigger when going through +the code samples. We hope to improve the self-study experience via [speaker notes](https://github.com/google/comprehensive-rust/issues/53) and by [publishing videos](https://github.com/google/comprehensive-rust/issues/52). @@ -44,7 +44,7 @@ Articles and blog posts from around the web which cover Comprehensive Rust: About how Microsoft, Google, and others are training people in Rust. - 2024-10-18: _[Rust Training at Scale | Rust Global @ RustConf 2024](https://youtu.be/7h5KyMqt2-Q?si=4M99HdWWxMaqN8Zr)_. - What Google learnt from teaching Comprehensive Rust for more than two years. + What Google learned from teaching Comprehensive Rust for more than two years. ## Setup @@ -57,7 +57,7 @@ The course is built using a few tools: - [mdbook-course](mdbook-course/) - [mdbook-linkcheck2](https://github.com/marxin/mdbook-linkcheck2) -First install Rust by following the instructions on https://rustup.rs/. Then +First, install Rust by following the instructions on https://rustup.rs/. Then clone this repository: ```shell @@ -93,8 +93,8 @@ Here are some of the commonly used commands you can run in the project. Run ## Contributing -We would like to receive your contributions. Please see -[CONTRIBUTING.md](CONTRIBUTING.md) for details. +We welcome contributions. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for +details. ## Contact diff --git a/src/index.md b/src/index.md index feecbd73..557e4a80 100644 --- a/src/index.md +++ b/src/index.md @@ -32,7 +32,7 @@ Building on this, you're invited to dive into one or more specialized topics: - [Android](android.md): a half-day course on using Rust for Android platform development (AOSP). This includes interoperability with C, C++, and Java. -- [Chromium](chromium.md): a half-day course on using Rust within Chromium based +- [Chromium](chromium.md): a half-day course on using Rust in Chromium-based browsers. This includes interoperability with C++ and how to include third-party crates in Chromium. - [Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal diff --git a/src/welcome-day-1.md b/src/welcome-day-1.md index 44e1becb..5c40e916 100644 --- a/src/welcome-day-1.md +++ b/src/welcome-day-1.md @@ -26,9 +26,10 @@ Please remind the students that: - They should ask questions when they get them, don't save them to the end. - The class is meant to be interactive and discussions are very much encouraged! - As an instructor, you should try to keep the discussions relevant, i.e., - keep the discussions related to how Rust does things vs some other language. - It can be hard to find the right balance, but err on the side of allowing - discussions since they engage people much more than one-way communication. + keep the discussions related to how Rust does things vs. some other + language. It can be hard to find the right balance, but err on the side of + allowing discussions since they engage people much more than one-way + communication. - The questions will likely mean that we talk about things ahead of the slides. - This is perfectly okay! Repetition is an important part of learning. Remember that the slides are just a support and you are free to skip them as From 27a5836a94c05a78402635b4d8887cc68b0c6c09 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 19:05:14 +0200 Subject: [PATCH 059/103] docs: improve language in Android section (#2890) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/android/aidl.md | 14 ++++++-------- src/android/aidl/birthday-service.md | 5 ++--- .../example-service/changing-definition.md | 4 ++-- src/android/aidl/example-service/server.md | 18 +++++++++--------- .../aidl/example-service/service-bindings.md | 2 +- src/android/aidl/example-service/service.md | 4 ++-- src/android/aidl/types/arrays.md | 2 +- src/android/build-rules.md | 10 +++++----- src/android/build-rules/binary.md | 6 +++--- src/android/interoperability.md | 4 ++-- src/android/interoperability/cpp.md | 3 +-- src/android/interoperability/with-c.md | 6 +++--- 12 files changed, 37 insertions(+), 41 deletions(-) diff --git a/src/android/aidl.md b/src/android/aidl.md index 2634e31e..68c767f8 100644 --- a/src/android/aidl.md +++ b/src/android/aidl.md @@ -1,18 +1,16 @@ # AIDL -The -[Android Interface Definition Language -(AIDL)](https://developer.android.com/guide/components/aidl) is supported in -Rust: +Rust supports the +[Android Interface Definition Language (AIDL)](https://developer.android.com/guide/components/aidl): -- Rust code can call existing AIDL servers, +- Rust code can call existing AIDL servers. - You can create new AIDL servers in Rust.
-- AIDL is what enables Android apps to interact with each other. +- AIDL enables Android apps to interact with each other. -- Since Rust is supported as a first-class citizen in this ecosystem, Rust - services can be called by any other process on the phone. +- Since Rust is a first-class citizen in this ecosystem, other processes on the + device can call Rust services.
diff --git a/src/android/aidl/birthday-service.md b/src/android/aidl/birthday-service.md index f9632898..11634990 100644 --- a/src/android/aidl/birthday-service.md +++ b/src/android/aidl/birthday-service.md @@ -1,5 +1,4 @@ # Birthday Service Tutorial -To illustrate how to use Rust with Binder, we're going to walk through the -process of creating a Binder interface. We're then going to both implement the -described service and write client code that talks to that service. +To illustrate using Rust with Binder, we will create a Binder interface. Then, +we'll implement the service and write a client that talks to it. diff --git a/src/android/aidl/example-service/changing-definition.md b/src/android/aidl/example-service/changing-definition.md index 27a85acc..a1c44fcc 100644 --- a/src/android/aidl/example-service/changing-definition.md +++ b/src/android/aidl/example-service/changing-definition.md @@ -1,7 +1,7 @@ # Changing API -Let us extend the API with more functionality: we want to let clients specify a -list of lines for the birthday card: +Let's extend the API: we'll let clients specify a list of lines for the birthday +card: ```java package com.example.birthdayservice; diff --git a/src/android/aidl/example-service/server.md b/src/android/aidl/example-service/server.md index bf0f6567..9b4202c3 100644 --- a/src/android/aidl/example-service/server.md +++ b/src/android/aidl/example-service/server.md @@ -16,21 +16,21 @@ _birthday_service/Android.bp_:
-The process for taking a user-defined service implementation (in this case the +The process for taking a user-defined service implementation (in this case, the `BirthdayService` type, which implements the `IBirthdayService`) and starting it -as a Binder service has multiple steps, and may appear more complicated than +as a Binder service has multiple steps. This may appear more complicated than students are used to if they've used Binder from C++ or another language. Explain to students why each step is necessary. 1. Create an instance of your service type (`BirthdayService`). -1. Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in - this case). This type is generated by Binder and provides the common Binder - functionality that would be provided by the `BnBinder` base class in C++. We - don't have inheritance in Rust, so instead we use composition, putting our - `BirthdayService` within the generated `BnBinderService`. -1. Call `add_service`, giving it a service identifier and your service object +2. Wrap the service object in the corresponding `Bn*` type (`BnBirthdayService` + in this case). This type is generated by Binder and provides common Binder + functionality, similar to the `BnBinder` base class in C++. Since Rust + doesn't have inheritance, we use composition, putting our `BirthdayService` + within the generated `BnBinderService`. +3. Call `add_service`, giving it a service identifier and your service object (the `BnBirthdayService` object in the example). -1. Call `join_thread_pool` to add the current thread to Binder's thread pool and +4. Call `join_thread_pool` to add the current thread to Binder's thread pool and start listening for connections.
diff --git a/src/android/aidl/example-service/service-bindings.md b/src/android/aidl/example-service/service-bindings.md index ce53aa66..fba405da 100644 --- a/src/android/aidl/example-service/service-bindings.md +++ b/src/android/aidl/example-service/service-bindings.md @@ -25,7 +25,7 @@ trait to talk to the service.
- Point out how the generated function signature, specifically the argument and - return types, correspond the interface definition. + return types, correspond to the interface definition. - `String` for an argument results in a different Rust type than `String` as a return type. diff --git a/src/android/aidl/example-service/service.md b/src/android/aidl/example-service/service.md index c99935d2..0b3b324c 100644 --- a/src/android/aidl/example-service/service.md +++ b/src/android/aidl/example-service/service.md @@ -25,7 +25,7 @@ _birthday_service/Android.bp_: each of the segments is necessary. - Note that `wishHappyBirthday` and other AIDL IPC methods take `&self` (instead of `&mut self`). - - This is necessary because binder responds to incoming requests on a thread + - This is necessary because Binder responds to incoming requests on a thread pool, allowing for multiple requests to be processed in parallel. This requires that the service methods only get a shared reference to `self`. - Any state that needs to be modified by the service will have to be put in @@ -33,6 +33,6 @@ _birthday_service/Android.bp_: - The correct approach for managing service state depends heavily on the details of your service. - TODO: What does the `binder::Interface` trait do? Are there methods to - override? Where source? + override? Where is the source?
diff --git a/src/android/aidl/types/arrays.md b/src/android/aidl/types/arrays.md index 9bd1d5b8..eacb221d 100644 --- a/src/android/aidl/types/arrays.md +++ b/src/android/aidl/types/arrays.md @@ -1,6 +1,6 @@ # Array Types -The array types (`T[]`, `byte[]`, and `List`) get translated to the +The array types (`T[]`, `byte[]`, and `List`) are translated to the appropriate Rust array type depending on how they are used in the function signature: diff --git a/src/android/build-rules.md b/src/android/build-rules.md index a6ea4ebc..eaf269c8 100644 --- a/src/android/build-rules.md +++ b/src/android/build-rules.md @@ -1,6 +1,6 @@ # Build Rules -The Android build system (Soong) supports Rust via a number of modules: +The Android build system (Soong) supports Rust through several modules: | Module Type | Description | | ----------------- | -------------------------------------------------------------------------------------------------- | @@ -17,13 +17,13 @@ We will look at `rust_binary` and `rust_library` next.
-Additional items speaker may mention: +Additional items the speaker may mention: -- Cargo is not optimized for multi-language repos, and also downloads packages - from the internet. +- Cargo is not optimized for multi-language repositories, and also downloads + packages from the internet. - For compliance and performance, Android must have crates in-tree. It must also - interop with C/C++/Java code. Soong fills that gap. + interoperate with C/C++/Java code. Soong fills that gap. - Soong has many similarities to [Bazel](https://bazel.build/), which is the open-source variant of Blaze (used in google3). diff --git a/src/android/build-rules/binary.md b/src/android/build-rules/binary.md index 7a139b7e..e328514d 100644 --- a/src/android/build-rules/binary.md +++ b/src/android/build-rules/binary.md @@ -1,6 +1,6 @@ # Rust Binaries -Let us start with a simple application. At the root of an AOSP checkout, create +Let's start with a simple application. At the root of an AOSP checkout, create the following files: _hello_rust/Android.bp_: @@ -33,7 +33,7 @@ Hello from Rust! that all modules have documentation. Try removing it and see what error you get. -- Stress that the Rust build rules look like the other Soong rules. This is on - purpose to make it as easy to use Rust as C++ or Java. +- Stress that the Rust build rules look like the other Soong rules. This is by + design, to make using Rust as easy as C++ or Java.
diff --git a/src/android/interoperability.md b/src/android/interoperability.md index 8c116d2a..09b3f0b7 100644 --- a/src/android/interoperability.md +++ b/src/android/interoperability.md @@ -6,8 +6,8 @@ that you can: - Call Rust functions from other languages. - Call functions written in other languages from Rust. -When you call functions in a foreign language we say that you're using a -_foreign function interface_, also known as FFI. +When you call functions in a foreign language, you're using a _foreign function +interface_, also known as FFI.
diff --git a/src/android/interoperability/cpp.md b/src/android/interoperability/cpp.md index 62a177c3..fc371be0 100644 --- a/src/android/interoperability/cpp.md +++ b/src/android/interoperability/cpp.md @@ -1,7 +1,6 @@ # With C++ -The [CXX crate][1] makes it possible to do safe interoperability between Rust -and C++. +The [CXX crate][1] enables safe interoperability between Rust and C++. The overall approach looks like this: diff --git a/src/android/interoperability/with-c.md b/src/android/interoperability/with-c.md index 9991420a..054c74a4 100644 --- a/src/android/interoperability/with-c.md +++ b/src/android/interoperability/with-c.md @@ -30,9 +30,9 @@ We will look at better options next. - The [`"C"` part][extern-abi] of the `extern` block tells Rust that `abs` can be called using the C [ABI] (application binary interface). -- The `safe fn abs` part tells that Rust that `abs` is a safe function. By - default, extern functions are considered unsafe, but since `abs(x)` is valid - for any `x`, we can declare it safe. +- The `safe fn abs` part tells Rust that `abs` is a safe function. By default, + extern functions are unsafe, but since `abs(x)` can't trigger undefined + behavior with any `x`, we can declare it safe.
From 2679581811ab156f425e0982a565dcb6a7090a60 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 19:09:29 +0200 Subject: [PATCH 060/103] docs: improve language in std-traits section (#2872) Co-authored-by: Dmitri Gribenko --- src/std-traits.md | 2 +- src/std-traits/operators.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/std-traits.md b/src/std-traits.md index 2cdb511d..fd769175 100644 --- a/src/std-traits.md +++ b/src/std-traits.md @@ -4,7 +4,7 @@
-As with the standard-library types, spend time reviewing the documentation for +As with the standard library types, spend time reviewing the documentation for each trait. This section is long. Take a break midway through. diff --git a/src/std-traits/operators.md b/src/std-traits/operators.md index 9cd45acd..8f3d5f9d 100644 --- a/src/std-traits/operators.md +++ b/src/std-traits/operators.md @@ -44,10 +44,10 @@ Discussion points: - You could implement `Add` for two different types, e.g. `impl Add<(i32, i32)> for Point` would add a tuple to a `Point`. -The `Not` trait (`!` operator) is notable because it does not "boolify" like the -same operator in C-family languages; instead, for integer types it negates each -bit of the number, which arithmetically is equivalent to subtracting it from -1: -`!5 == -6`. +The `Not` trait (`!` operator) is notable because it does not convert the +argument to `bool` like the same operator in C-family languages; instead, for +integer types it flips each bit of the number, which, arithmetically, is +equivalent to subtracting the argument from `-1`: `!5 == -6`.
From 7ebca876d229d6fc2992b31e3156e948e7b2fef0 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 19:11:58 +0200 Subject: [PATCH 061/103] docs: improve language in pattern-matching section (#2879) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/pattern-matching/destructuring-structs.md | 2 +- src/pattern-matching/exercise.md | 2 +- src/pattern-matching/infallible.md | 4 ++-- src/pattern-matching/let-control-flow.md | 2 +- src/pattern-matching/let-control-flow/while-let.md | 2 +- src/pattern-matching/match.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pattern-matching/destructuring-structs.md b/src/pattern-matching/destructuring-structs.md index f0071686..c5bba091 100644 --- a/src/pattern-matching/destructuring-structs.md +++ b/src/pattern-matching/destructuring-structs.md @@ -4,7 +4,7 @@ minutes: 4 # Structs -Like tuples, Struct can also be destructured by matching: +Like tuples, structs can also be destructured by matching: ```rust,editable {{#include ../../third_party/rust-by-example/destructuring-structs.rs}} diff --git a/src/pattern-matching/exercise.md b/src/pattern-matching/exercise.md index bbe30347..c084fba9 100644 --- a/src/pattern-matching/exercise.md +++ b/src/pattern-matching/exercise.md @@ -22,7 +22,7 @@ to `30`. We can represent the expression as a tree: ``` A bigger and more complex expression would be `(10 * 9) + ((3 - 4) * 5)`, which -evaluate to `85`. We represent this as a much bigger tree: +evaluates to `85`. We represent this as a much bigger tree: diff --git a/src/pattern-matching/infallible.md b/src/pattern-matching/infallible.md index 0624cea4..04d0d9d0 100644 --- a/src/pattern-matching/infallible.md +++ b/src/pattern-matching/infallible.md @@ -37,8 +37,8 @@ fn main() { - Patterns are type-specific, including irrefutable patterns. Try adding or removing an element to the tuple and look at the resulting compiler errors. -- Variable names are patterns that always match and which bind the matched value - into a new variable with that name. +- Variable names are patterns that always match and bind the matched value into + a new variable with that name. - `_` is a pattern that always matches any value, discarding the matched value. diff --git a/src/pattern-matching/let-control-flow.md b/src/pattern-matching/let-control-flow.md index dcf05060..1ea58acb 100644 --- a/src/pattern-matching/let-control-flow.md +++ b/src/pattern-matching/let-control-flow.md @@ -4,7 +4,7 @@ minutes: 10 # Let Control Flow -Rust has a few control flow constructs which differ from other languages. They +Rust has a few control flow constructs that differ from other languages. They are used for pattern matching: - `if let` expressions diff --git a/src/pattern-matching/let-control-flow/while-let.md b/src/pattern-matching/let-control-flow/while-let.md index ca58bb6e..92b047ef 100644 --- a/src/pattern-matching/let-control-flow/while-let.md +++ b/src/pattern-matching/let-control-flow/while-let.md @@ -2,7 +2,7 @@ Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-pattern-loops) -variant which repeatedly tests a value against a pattern: +variant that repeatedly tests a value against a pattern: ```rust,editable fn main() { diff --git a/src/pattern-matching/match.md b/src/pattern-matching/match.md index 01f24824..f4f986ea 100644 --- a/src/pattern-matching/match.md +++ b/src/pattern-matching/match.md @@ -35,7 +35,7 @@ Key Points: - You might point out how some specific characters are being used when in a pattern - `|` as an `or` - - `..` can expand as much as it needs to be + - `..` matches any number of items - `1..=5` represents an inclusive range - `_` is a wild card From 8fc529de84d6205b821a59300a1b12858685fd12 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 19:12:21 +0200 Subject: [PATCH 062/103] docs: improve language in references section (#2878) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/references/exclusive.md | 6 +++--- src/references/slices.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/references/exclusive.md b/src/references/exclusive.md index 291718c5..67b6d309 100644 --- a/src/references/exclusive.md +++ b/src/references/exclusive.md @@ -28,8 +28,8 @@ Key points: making an `&point.0` or changing `point.0` while `x_coord` is alive. - Be sure to note the difference between `let mut x_coord: &i32` and - `let x_coord: &mut i32`. The first one represents a shared reference which can - be bound to different values, while the second represents an exclusive - reference to a mutable value. + `let x_coord: &mut i32`. The first one is a shared reference that can be bound + to different values, while the second is an exclusive reference to a mutable + value.
diff --git a/src/references/slices.md b/src/references/slices.md index c82fe864..cdc5dc0f 100644 --- a/src/references/slices.md +++ b/src/references/slices.md @@ -45,9 +45,9 @@ fn main() { - You can't "grow" a slice once it's created: - You can't append elements of the slice, since it doesn't own the backing buffer. - - You can't grow a slice to point to a larger section of the backing buffer. - The slice loses information about the underlying buffer and so you can't - know how larger the slice can be grown. + - You can't grow a slice to point to a larger section of the backing buffer. A + slice does not have information about the length of the underlying buffer + and so you can't know how large the slice can be grown. - To get a larger slice you have to back to the original buffer and create a larger slice from there. From 16c960d69046f84509a9b0dca14b319e62ee9614 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 20:41:17 +0200 Subject: [PATCH 063/103] docs: improve language in borrowing section (#2893) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/borrowing/borrowck.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/borrowing/borrowck.md b/src/borrowing/borrowck.md index 3c964999..f2d06420 100644 --- a/src/borrowing/borrowck.md +++ b/src/borrowing/borrowck.md @@ -65,9 +65,9 @@ fn main() { ## More to Explore -- Technically multiple mutable references to a piece of data can exist at the +- Technically, multiple mutable references to a piece of data can exist at the same time via re-borrowing. This is what allows you to pass a mutable - reference into a function without invaliding the original reference. + reference into a function without invalidating the original reference. [This playground example][1] demonstrates that behavior. - Rust uses the exclusive reference constraint to ensure that data races do not occur in multi-threaded code, since only one thread can have mutable access to From d7dc934891c0966860054944b9a7faa6cec89b1f Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 20:43:01 +0200 Subject: [PATCH 064/103] docs: improve language in bare-metal section (#2891) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/bare-metal/aps/better-uart.md | 8 +++---- src/bare-metal/aps/entry-point.md | 22 +++++++++---------- src/bare-metal/aps/inline-assembly.md | 4 ++-- src/bare-metal/aps/logging.md | 2 +- src/bare-metal/aps/mmio.md | 2 +- src/bare-metal/aps/other-projects.md | 4 ++-- src/bare-metal/aps/safemmio/driver.md | 6 ++--- src/bare-metal/aps/safemmio/registers.md | 4 ++-- .../microcontrollers/board-support.md | 2 +- .../microcontrollers/embedded-hal.md | 4 ++-- src/bare-metal/microcontrollers/pacs.md | 9 ++++---- src/bare-metal/microcontrollers/probe-rs.md | 4 ++-- src/bare-metal/microcontrollers/type-state.md | 8 +++---- src/bare-metal/useful-crates.md | 2 +- .../useful-crates/buddy_system_allocator.md | 2 +- src/bare-metal/useful-crates/spin.md | 4 ++-- src/bare-metal/useful-crates/tinyvec.md | 6 ++--- 17 files changed, 46 insertions(+), 47 deletions(-) diff --git a/src/bare-metal/aps/better-uart.md b/src/bare-metal/aps/better-uart.md index f87fca7c..cd7fb742 100644 --- a/src/bare-metal/aps/better-uart.md +++ b/src/bare-metal/aps/better-uart.md @@ -1,8 +1,8 @@ # A better UART driver -The PL011 actually has [a bunch more registers][1], and adding offsets to -construct pointers to access them is error-prone and hard to read. Plus, some of -them are bit fields which would be nice to access in a structured way. +The PL011 actually has [more registers][1], and adding offsets to construct +pointers to access them is error-prone and hard to read. Additionally, some of +them are bit fields, which would be nice to access in a structured way. | Offset | Register name | Width | | ------ | ------------- | ----- | @@ -23,7 +23,7 @@ them are bit fields which would be nice to access in a structured way.
-- There are also some ID registers which have been omitted for brevity. +- There are also some ID registers that have been omitted for brevity.
diff --git a/src/bare-metal/aps/entry-point.md b/src/bare-metal/aps/entry-point.md index 1f90a62c..565eb3fb 100644 --- a/src/bare-metal/aps/entry-point.md +++ b/src/bare-metal/aps/entry-point.md @@ -1,6 +1,6 @@ # Getting Ready to Rust -Before we can start running Rust code, we need to do some initialisation. +Before we can start running Rust code, we need to do some initialization. ```armasm {{#include examples/src/entry.S:entry}} @@ -12,21 +12,21 @@ This code is in `src/bare-metal/aps/examples/src/entry.S`. It's not necessary to understand this in detail -- the takeaway is that typically some low-level setup is needed to meet Rust's expectations of the system. -- This is the same as it would be for C: initialising the processor state, +- This is the same as it would be for C: initializing the processor state, zeroing the BSS, and setting up the stack pointer. - The BSS (block starting symbol, for historical reasons) is the part of the - object file which containing statically allocated variables which are - initialised to zero. They are omitted from the image, to avoid wasting space + object file that contains statically allocated variables that are + initialized to zero. They are omitted from the image, to avoid wasting space on zeroes. The compiler assumes that the loader will take care of zeroing them. -- The BSS may already be zeroed, depending on how memory is initialised and the +- The BSS may already be zeroed, depending on how memory is initialized and the image is loaded, but we zero it to be sure. - We need to enable the MMU and cache before reading or writing any memory. If we don't: - Unaligned accesses will fault. We build the Rust code for the - `aarch64-unknown-none` target which sets `+strict-align` to prevent the - compiler generating unaligned accesses, so it should be fine in this case, - but this is not necessarily the case in general. + `aarch64-unknown-none` target that sets `+strict-align` to prevent the + compiler from generating unaligned accesses, so it should be fine in this + case, but this is not necessarily the case in general. - If it were running in a VM, this can lead to cache coherency issues. The problem is that the VM is accessing memory directly with the cache disabled, while the host has cacheable aliases to the same memory. Even if the host @@ -34,14 +34,14 @@ is needed to meet Rust's expectations of the system. fills, and then changes from one or the other will get lost when the cache is cleaned or the VM enables the cache. (Cache is keyed by physical address, not VA or IPA.) -- For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which +- For simplicity, we just use a hardcoded pagetable (see `idmap.S`) that identity maps the first 1 GiB of address space for devices, the next 1 GiB for DRAM, and another 1 GiB higher up for more devices. This matches the memory layout that QEMU uses. - We also set up the exception vector (`vbar_el1`), which we'll see more about later. - All examples this afternoon assume we will be running at exception level 1 - (EL1). If you need to run at a different exception level you'll need to modify - `entry.S` accordingly. + (EL1). If you need to run at a different exception level, you'll need to + modify `entry.S` accordingly.
diff --git a/src/bare-metal/aps/inline-assembly.md b/src/bare-metal/aps/inline-assembly.md index 273b9999..842ab5f8 100644 --- a/src/bare-metal/aps/inline-assembly.md +++ b/src/bare-metal/aps/inline-assembly.md @@ -16,7 +16,7 @@ for all these functions.) - PSCI is the Arm Power State Coordination Interface, a standard set of functions to manage system and CPU power states, among other things. It is implemented by EL3 firmware and hypervisors on many systems. -- The `0 => _` syntax means initialise the register to 0 before running the +- The `0 => _` syntax means initialize the register to 0 before running the inline assembly code, and ignore its contents afterwards. We need to use `inout` rather than `in` because the call could potentially clobber the contents of the registers. @@ -24,7 +24,7 @@ for all these functions.) because it is called from our entry point in `entry.S`. - Just `#[no_mangle]` would be sufficient but [RFC3325](https://rust-lang.github.io/rfcs/3325-unsafe-attributes.html) uses - this notation to draw reviewer attention to attributes which might cause + this notation to draw reviewer attention to attributes that might cause undefined behavior if used incorrectly. - `_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally used by the bootloader to pass things like a pointer to the device tree. diff --git a/src/bare-metal/aps/logging.md b/src/bare-metal/aps/logging.md index 933b8f0d..45c9bbcc 100644 --- a/src/bare-metal/aps/logging.md +++ b/src/bare-metal/aps/logging.md @@ -9,7 +9,7 @@ We can do this by implementing the `Log` trait.
-- The first unwrap in `log` will succeed because we initialise `LOGGER` before +- The first unwrap in `log` will succeed because we initialize `LOGGER` before calling `set_logger`. The second will succeed because `Uart::write_str` always returns `Ok`. diff --git a/src/bare-metal/aps/mmio.md b/src/bare-metal/aps/mmio.md index 72cc083f..14aa4606 100644 --- a/src/bare-metal/aps/mmio.md +++ b/src/bare-metal/aps/mmio.md @@ -28,7 +28,7 @@ unsafe { compiler may assume that the value read is the same as the value just written, and not bother actually reading memory. - Some existing crates for volatile access to hardware do hold references, but - this is unsound. Whenever a reference exist, the compiler may choose to + this is unsound. Whenever a reference exists, the compiler may choose to dereference it. - Use `&raw` to get struct field pointers from a pointer to the struct. - For compatibility with old versions of Rust you can use the [`addr_of!`] macro diff --git a/src/bare-metal/aps/other-projects.md b/src/bare-metal/aps/other-projects.md index 220e8bdf..596e292b 100644 --- a/src/bare-metal/aps/other-projects.md +++ b/src/bare-metal/aps/other-projects.md @@ -5,9 +5,9 @@ - Supports x86, aarch64 and RISC-V. - Relies on LinuxBoot rather than having many drivers itself. - [Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials) - - Initialisation, UART driver, simple bootloader, JTAG, exception levels, + - Initialization, UART driver, simple bootloader, JTAG, exception levels, exception handling, page tables. - - Some dodginess around cache maintenance and initialisation in Rust, not + - Some caveats around cache maintenance and initialization in Rust, not necessarily a good example to copy for production code. - [`cargo-call-stack`](https://crates.io/crates/cargo-call-stack) - Static analysis to determine maximum stack usage. diff --git a/src/bare-metal/aps/safemmio/driver.md b/src/bare-metal/aps/safemmio/driver.md index b7949eaa..d91bc206 100644 --- a/src/bare-metal/aps/safemmio/driver.md +++ b/src/bare-metal/aps/safemmio/driver.md @@ -17,14 +17,14 @@ Now let's use the new `Registers` struct in our driver. - These MMIO accesses are generally a wrapper around `read_volatile` and `write_volatile`, though on aarch64 they are instead implemented in assembly to work around a bug where the compiler can emit instructions that prevent - MMIO virtualisation. + MMIO virtualization. - The `field!` and `field_shared!` macros internally use `&raw mut` and `&raw const` to get pointers to individual fields without creating an intermediate reference, which would be unsound. - `field!` needs a mutable reference to a `UniqueMmioPointer`, and returns a - `UniqueMmioPointer` which allows reads with side effects and writes. + `UniqueMmioPointer` that allows reads with side effects and writes. - `field_shared!` works with a shared reference to either a `UniqueMmioPointer` - or a `SharedMmioPointer`. It returns a `SharedMmioPointer` which only allows + or a `SharedMmioPointer`. It returns a `SharedMmioPointer` that only allows pure reads.
diff --git a/src/bare-metal/aps/safemmio/registers.md b/src/bare-metal/aps/safemmio/registers.md index 6e89bd16..a25ade98 100644 --- a/src/bare-metal/aps/safemmio/registers.md +++ b/src/bare-metal/aps/safemmio/registers.md @@ -1,6 +1,6 @@ # safe-mmio -The [`safe-mmio`] crate provides types to wrap registers which can be read or +The [`safe-mmio`] crate provides types to wrap registers that can be read or written safely. | | Can't read | Read has no side-effects | Read has side-effects | @@ -23,7 +23,7 @@ written safely. operations; we recommend the `safe-mmio` crate. - The difference between `ReadPure` or `ReadOnly` (and likewise between `ReadPureWrite` and `ReadWrite`) is whether reading a register can have - side-effects which change the state of the device. E.g. reading the data + side-effects that change the state of the device, e.g., reading the data register pops a byte from the receive FIFO. `ReadPure` means that reads have no side-effects, they are purely reading data. diff --git a/src/bare-metal/microcontrollers/board-support.md b/src/bare-metal/microcontrollers/board-support.md index f99745ef..f09c4006 100644 --- a/src/bare-metal/microcontrollers/board-support.md +++ b/src/bare-metal/microcontrollers/board-support.md @@ -12,7 +12,7 @@ for convenience.
- In this case the board support crate is just providing more useful names, and - a bit of initialisation. + a bit of initialization. - The crate may also include drivers for some on-board devices outside of the microcontroller itself. - `microbit-v2` includes a simple driver for the LED matrix. diff --git a/src/bare-metal/microcontrollers/embedded-hal.md b/src/bare-metal/microcontrollers/embedded-hal.md index 70a2fe85..d62341af 100644 --- a/src/bare-metal/microcontrollers/embedded-hal.md +++ b/src/bare-metal/microcontrollers/embedded-hal.md @@ -16,8 +16,8 @@ accelerometer driver might need an I2C or SPI device instance.
-- The traits cover using the peripherals but not initialising or configuring - them, as initialisation and configuration is usually highly platform-specific. +- The traits cover using the peripherals but not initializing or configuring + them, as initialization and configuration is usually highly platform-specific. - There are implementations for many microcontrollers, as well as other platforms such as Linux on Raspberry Pi. - [`embedded-hal-async`] provides async versions of the traits. diff --git a/src/bare-metal/microcontrollers/pacs.md b/src/bare-metal/microcontrollers/pacs.md index 2ecb30f2..b39d7e3c 100644 --- a/src/bare-metal/microcontrollers/pacs.md +++ b/src/bare-metal/microcontrollers/pacs.md @@ -11,12 +11,11 @@ wrappers for memory-mapped peripherals from
- SVD (System View Description) files are XML files typically provided by - silicon vendors which describe the memory map of the device. - - They are organised by peripheral, register, field and value, with names, + silicon vendors that describe the memory map of the device. + - They are organized by peripheral, register, field and value, with names, descriptions, addresses and so on. - - SVD files are often buggy and incomplete, so there are various projects - which patch the mistakes, add missing details, and publish the generated - crates. + - SVD files are often buggy and incomplete, so there are various projects that + patch the mistakes, add missing details, and publish the generated crates. - `cortex-m-rt` provides the vector table, among other things. - If you `cargo install cargo-binutils` then you can run `cargo objdump --bin pac -- -d --no-show-raw-insn` to see the resulting diff --git a/src/bare-metal/microcontrollers/probe-rs.md b/src/bare-metal/microcontrollers/probe-rs.md index 1d995350..3ab2e9a8 100644 --- a/src/bare-metal/microcontrollers/probe-rs.md +++ b/src/bare-metal/microcontrollers/probe-rs.md @@ -21,7 +21,7 @@ in your project directory. a range from SEGGER. - The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin Serial Wire Debug. -- probe-rs is a library which you can integrate into your own tools if you want +- probe-rs is a library that you can integrate into your own tools if you want to. - The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) @@ -29,6 +29,6 @@ in your project directory. microcontroller. - cargo-embed is a binary built using the probe-rs library. - RTT (Real Time Transfers) is a mechanism to transfer data between the debug - host and the target through a number of ringbuffers. + host and the target through a number of ring buffers.
diff --git a/src/bare-metal/microcontrollers/type-state.md b/src/bare-metal/microcontrollers/type-state.md index 0ed4edf0..e77397cd 100644 --- a/src/bare-metal/microcontrollers/type-state.md +++ b/src/bare-metal/microcontrollers/type-state.md @@ -7,12 +7,12 @@
- Pins don't implement `Copy` or `Clone`, so only one instance of each can - exist. Once a pin is moved out of the port struct nobody else can take it. + exist. Once a pin is moved out of the port struct, nobody else can take it. - Changing the configuration of a pin consumes the old pin instance, so you - can’t keep use the old instance afterwards. -- The type of a value indicates the state that it is in: e.g. in this case, the + can't use the old instance afterwards. +- The type of a value indicates the state it is in: e.g., in this case, the configuration state of a GPIO pin. This encodes the state machine into the - type system, and ensures that you don't try to use a pin in a certain way + type system and ensures that you don't try to use a pin in a certain way without properly configuring it first. Illegal state transitions are caught at compile time. - You can call `is_high` on an input pin and `set_high` on an output pin, but diff --git a/src/bare-metal/useful-crates.md b/src/bare-metal/useful-crates.md index 0df0fe56..e214f039 100644 --- a/src/bare-metal/useful-crates.md +++ b/src/bare-metal/useful-crates.md @@ -1,4 +1,4 @@ # Useful crates -We'll look at a few crates which solve some common problems in bare-metal +We'll look at a few crates that solve some common problems in bare-metal programming. diff --git a/src/bare-metal/useful-crates/buddy_system_allocator.md b/src/bare-metal/useful-crates/buddy_system_allocator.md index 8dcd117a..8e96e427 100644 --- a/src/bare-metal/useful-crates/buddy_system_allocator.md +++ b/src/bare-metal/useful-crates/buddy_system_allocator.md @@ -1,6 +1,6 @@ # `buddy_system_allocator` -[`buddy_system_allocator`][1] is a crate implementing a basic buddy system +[`buddy_system_allocator`][1] is a crate that implements a basic buddy system allocator. It can be used both to implement [`GlobalAlloc`][3] (using [`LockedHeap`][2]) so you can use the standard `alloc` crate (as we saw [before][4]), or for allocating other address space (using diff --git a/src/bare-metal/useful-crates/spin.md b/src/bare-metal/useful-crates/spin.md index 13fc863f..2b456d8a 100644 --- a/src/bare-metal/useful-crates/spin.md +++ b/src/bare-metal/useful-crates/spin.md @@ -25,8 +25,8 @@ fn main() { - Be careful to avoid deadlock if you take locks in interrupt handlers. - `spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, - `Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation. -- The [`once_cell`][2] crate also has some useful types for late initialisation + `Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialization. +- The [`once_cell`][2] crate also has some useful types for late initialization with a slightly different approach to `spin::once::Once`. - The Rust Playground includes `spin`, so this example will run fine inline. diff --git a/src/bare-metal/useful-crates/tinyvec.md b/src/bare-metal/useful-crates/tinyvec.md index 6e74e657..015c8c60 100644 --- a/src/bare-metal/useful-crates/tinyvec.md +++ b/src/bare-metal/useful-crates/tinyvec.md @@ -1,8 +1,8 @@ # `tinyvec` -Sometimes you want something which can be resized like a `Vec`, but without heap +Sometimes you want something that can be resized like a `Vec`, but without heap allocation. [`tinyvec`][1] provides this: a vector backed by an array or slice, -which could be statically allocated or on the stack, which keeps track of how +which could be statically allocated or on the stack, that keeps track of how many elements are used and panics if you try to use more than are allocated. @@ -23,7 +23,7 @@ fn main() {
- `tinyvec` requires that the element type implement `Default` for - initialisation. + initialization. - The Rust Playground includes `tinyvec`, so this example will run fine inline.
From a37ef402a9caf91302025fe9124d61713d019eaa Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 20:53:23 +0200 Subject: [PATCH 065/103] docs: improve language in chromium section (#2889) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/chromium/cargo.md | 4 ++-- src/chromium/setup.md | 2 +- src/chromium/testing.md | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chromium/cargo.md b/src/chromium/cargo.md index 793b7d9b..0c9e1ec9 100644 --- a/src/chromium/cargo.md +++ b/src/chromium/cargo.md @@ -60,8 +60,8 @@ may offer an advantage"): - Perhaps surprisingly, Rust is becoming increasingly popular in the industry for writing command line tools. The breadth and ergonomics of libraries is - comparable to Python, while being more robust (thanks to the rich - typesystem) and running faster (as a compiled, rather than interpreted + comparable to Python, while being more robust (thanks to the rich type + system) and running faster (as a compiled, rather than interpreted language). - Participating in the Rust ecosystem requires using standard Rust tools like Cargo. Libraries that want to get external contributions, and want to be diff --git a/src/chromium/setup.md b/src/chromium/setup.md index 19215ef4..8a3bc0a9 100644 --- a/src/chromium/setup.md +++ b/src/chromium/setup.md @@ -22,7 +22,7 @@ It's also recommended that you have Visual Studio code installed. # About the exercises -This part of the course has a series of exercises which build on each other. +This part of the course has a series of exercises that build on each other. We'll be doing them spread throughout the course instead of just at the end. If you don't have time to complete a certain part, don't worry: you can catch up in the next slot. diff --git a/src/chromium/testing.md b/src/chromium/testing.md index a57e236d..8cb0c32c 100644 --- a/src/chromium/testing.md +++ b/src/chromium/testing.md @@ -44,9 +44,9 @@ used: the C++ and the Rust implementation (parameterizing the tests so they enable or disable Rust using a `ScopedFeatureList`). -- Hypothetical/WIP PNG integration may need to implement memory-safe - implementation of pixel transformations that are provided by `libpng` but - missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such - functionality may benefit from separate tests authored in Rust. +- Hypothetical/WIP PNG integration may need memory-safe implementations of pixel + transformations that are provided by `libpng` but missing in the `png` crate - + e.g. RGBA => BGRA, or gamma correction. Such functionality may benefit from + separate tests authored in Rust.
From 085b5347352828475dd843dd091cd259281ef041 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 20:53:55 +0200 Subject: [PATCH 066/103] docs: improve language in tuples-and-arrays section (#2875) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/tuples-and-arrays/arrays.md | 3 ++- src/tuples-and-arrays/exercise.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tuples-and-arrays/arrays.md b/src/tuples-and-arrays/arrays.md index 7ed57288..82633ab3 100644 --- a/src/tuples-and-arrays/arrays.md +++ b/src/tuples-and-arrays/arrays.md @@ -67,7 +67,8 @@ fn main() { - Arrays are not heap-allocated. They are regular values with a fixed size known at compile time, meaning they go on the stack. This can be different from what - students expect if they come from a garbage collected language, where arrays + students expect if they come from a garbage-collected language, where arrays may be heap allocated by default.
+s> diff --git a/src/tuples-and-arrays/exercise.md b/src/tuples-and-arrays/exercise.md index f519c2b8..9d82fc4c 100644 --- a/src/tuples-and-arrays/exercise.md +++ b/src/tuples-and-arrays/exercise.md @@ -12,8 +12,8 @@ let array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; What is the type of this variable? -Use an array such as the above to write a function `transpose` which will -transpose a matrix (turn rows into columns): +Use an array such as the above to write a function `transpose` that transposes a +matrix (turns rows into columns): From ad9440d20c36e13a833fc277107e9635942ac26a Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 20:57:53 +0200 Subject: [PATCH 067/103] Add a GEMINI.md file with instructions for the CLI (#2895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve been playing with the `gemini` CLI tool recently (https://google-gemini.github.io/gemini-cli/) and learned that it will read instructions from it’s own kind of README. So I asked it to generate one and use it as a basis for this file. I took the liberty to expand the style guide a little at the same time to incorporate that instructions I gave Gemini while generating the [many language fixing PRs][1]. [1]: https://github.com/google/comprehensive-rust/pulls?q=author%3Amgeisler+%22improve+language%22 --------- Co-authored-by: Dmitri Gribenko --- GEMINI.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ STYLE.md | 38 ++++++++++++++++++-------- 2 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 GEMINI.md diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 00000000..2d19288d --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,79 @@ +# Project Overview + +This repository contains the source code for Comprehensive Rust, a family of +courses on Rust developed by Google, starting with Rust foundations, and +including deep dives into specialized topics like Android, Chromium, bare-metal +development, and concurrency. The project is a Rust workspace that leverages +`mdbook` to generate a course website. + +## Key Technologies + +- **Rust:** The primary programming language for the course subject, custom + tools, and examples. +- **mdbook:** A command-line tool to create books from Markdown files, used for + generating the course website. +- **Custom mdbook Preprocessors:** `mdbook-course` and `mdbook-exerciser` are + Rust binaries that extend `mdbook`'s functionality, for example, to extract + exercise starter code. +- **`cargo xtask`:** A custom binary within the workspace used for project + automation, simplifying common development tasks. + +# Building and Running + +The project uses `cargo xtask` for project-specific automation, like builds, +tests, and managing translations. + +## Setup + +1. **Install Rust:** Follow the instructions on + [https://rustup.rs/](https://rustup.rs/). +2. **Clone Repository:** + ```bash + git clone https://github.com/google/comprehensive-rust/ + cd comprehensive-rust + ``` +3. **Install Project Tools:** + ```bash + cargo xtask install-tools + ``` + +## Commands + +All commands are run using `cargo xtask`. Run `cargo xtask --help` for a full +list of options. + +- **Serve the Course Locally:** Starts a web server to view the course content. + ```bash + cargo xtask serve [--language ] [--output ] + ``` + (e.g., `cargo xtask serve -l da` for the Danish translation) + +- **Build the Course:** Creates a static version of the course in the `book/` + directory. + ```bash + cargo xtask build [--language ] [--output ] + ``` + +- **Run Rust Snippet Tests:** Tests all Rust code snippets included in the + course material. + ```bash + cargo xtask rust-tests + ``` + +- **Run Web Driver Tests:** Executes web driver tests located in the `tests/` + directory. + ```bash + cargo xtask web-tests [--dir ] + ``` + +# Development Conventions + +- **Project Automation:** `cargo xtask` is the primary interface for common + development tasks. +- **Course Content:** Markdown files in the `src/` directory, structured + according to `src/SUMMARY.md`. +- **Code Formatting:** `dprint fmt` is used to format all source files according + to `rustfmt.toml` and `dprint.json`. +- **Contributions:** Refer to `CONTRIBUTING.md` for guidelines on contributing + to the project. +- **Style:** Refer to `STYLE.md` for style guidelines. diff --git a/STYLE.md b/STYLE.md index c405a199..58e91b85 100644 --- a/STYLE.md +++ b/STYLE.md @@ -28,9 +28,10 @@ notes (see below). ### Rust Code -When showing Rust code, please use the same spacing as `rustfmt`: `3 * x` +When showing Rust code inline, please use the same spacing as `rustfmt`: `3 * x` instead of `3*x`. However, feel free to remove newlines when it can make the -code more compact and easier to understand, e.g., you can use +code more compact and easier to understand, e.g., you can define a struct on one +line if it is not the focus of your example: @@ -40,9 +41,21 @@ struct Person { name: String } -if the `Person` struct is not important for your example. Please use this -sparingly: enclose the code block in `` and -`` to suppress warnings about the formatting. +Enclose the code block in `` and +`` to suppress the automatic formatting. Please use +this sparingly. + +### Language and Tone + +The courses are written in American English, so write "initialize", not +"initialise". + +Use an informal, friendly, and concise tone. Remember that the courses are meant +to be taught by an experienced programmer to other experienced programmers. We +expect familiarity with programming, typically in a statically typed language +like Java or C++. We don't explain common concepts known from that family of +languages, but we cannot assume familiarity with things like functional +programming. ## Speaker Notes @@ -50,15 +63,18 @@ We have extended `mdbook` with support for speaker notes: content added between `
...
` tags is rendered in a special box that can be collapsed or removed entirely from the slide. +- Unlike the main content, the speaker notes don't have to fit on a single + slide. + - The speaker notes should expand on the topic of the slide. Use them to provide interesting background information for both the instructor and for students who look at the material outside of a class. Remember that many more people will read the course by themselves, so make the notes complete and useful even when there is no Rust expert around. -- Avoid using speaker notes as a script for the instructor. When teaching the - course, instructors will only have time to glance at the notes so it is not - useful to include full paragraphs which the instructor should read out loud. +- Speaker notes are not a script for the instructor. When teaching the course, + instructors only have a short time to glance at the notes. Don't include full + paragraphs for the instructor to read out loud. ### More to Explore @@ -100,6 +116,6 @@ When translating the course, please take the following into account: and `**strong emphasis**` like in the original. - If you find mistakes or things that sound awkward in the original English - text, please submit PRs to fix them! Fixing typos in the translation is great, - but we want everybody to benefit from the fixes and that is why we need the - fix to be made in the English text too. + text, please submit PRs to fix them in the English text! Fixing typos in the + translation is great, but we want everybody to benefit from the fixes and that + is why we need the fix to be made in the English text too. From 93c5f28b92c180d6e9e3ae99bae585f115f3f61c Mon Sep 17 00:00:00 2001 From: David E Worth Date: Sun, 7 Sep 2025 13:35:08 -0600 Subject: [PATCH 068/103] fix(docs): remove stray/trailing s> (#2897) It looks like changes from the last commit (`085b534`) to the `
...
` block had a stray `s>` included. --- src/tuples-and-arrays/arrays.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tuples-and-arrays/arrays.md b/src/tuples-and-arrays/arrays.md index 82633ab3..82132c4b 100644 --- a/src/tuples-and-arrays/arrays.md +++ b/src/tuples-and-arrays/arrays.md @@ -71,4 +71,3 @@ fn main() { may be heap allocated by default.
-s> From 508979a4515fee9f52d0492b01e20c1b58e3306c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Wed, 10 Sep 2025 00:35:18 +0300 Subject: [PATCH 069/103] tr: day 2 afternoon translation with GEMINI :) (#2816) I had Google Gemini do this Turkish translation again. I gave Gemini my previous translations and the part I wanted it to translate as two separate PO files. As a prompt, I told it to stick to my terminology and methodology. Then, I went through the output that Gemini produced one by one. I estimated that I corrected a small percentage of the entire translation, around 5-10% (for this pr). NOTE: I opened this branch in this PR via "Enes1313:tr-translation-of-day-2-morning" . This PR can be reviewed when the PR for #2809 is finished. Part of #500 --- po/tr.po | 2737 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 2301 insertions(+), 436 deletions(-) diff --git a/po/tr.po b/po/tr.po index 08ec8894..2b2b207c 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2025-07-06T18:27:10+03:00\n" -"PO-Revision-Date: 2025-07-06 17:14+0300\n" +"POT-Creation-Date: 2025-09-05T21:05:34+03:00\n" +"PO-Revision-Date: 2025-07-19 00:57+0300\n" "Last-Translator: akerem@protonmail.com\n" "Language-Team: Turkish \n" "Language: tr\n" @@ -105,7 +105,7 @@ msgstr "Alıştırma: Fibonacci" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md src/closures/solution.md +#: src/generics/solution.md src/closures/solution.md src/std-types/solution.md #: src/std-traits/solution.md src/memory-management/solution.md #: src/smart-pointers/solution.md src/borrowing/solution.md #: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md @@ -280,11 +280,11 @@ msgstr "Değerleri Eşleştirmek" #: src/SUMMARY.md src/pattern-matching.md msgid "Destructuring Structs" -msgstr "Yapıların (Struct) Çözümlenmesi" +msgstr "Yapıların Çözümlenmesi (Destructuring Structs)" #: src/SUMMARY.md src/pattern-matching.md msgid "Destructuring Enums" -msgstr "Enum'ların (Struct) Çözümlenmesi" +msgstr "Enum'ların Çözümlenmesi (Destructuring)" #: src/SUMMARY.md src/pattern-matching.md #: src/pattern-matching/let-control-flow.md @@ -334,7 +334,7 @@ msgstr "İlişkili Türler" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/deriving.md msgid "Deriving" -msgstr "Türetme" +msgstr "Türetme (Deriving)" #: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" @@ -377,6 +377,27 @@ msgstr "Alıştırma: Genelleştirilmiş (Generic) `min`" msgid "Day 2: Afternoon" msgstr "Gün 2: Öğleden Sonra" +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/closures.md +msgid "Closures" +msgstr "Çevreleyiciler (Closures)" + +#: src/SUMMARY.md src/closures.md src/closures/syntax.md +msgid "Closure Syntax" +msgstr "Çevreleyici Sözdizimi (Closure Syntax)" + +#: src/SUMMARY.md src/closures.md src/closures/capturing.md +msgid "Capturing" +msgstr "Yakalama (Capturing)" + +#: src/SUMMARY.md src/closures.md +msgid "Closure Traits" +msgstr "Çevreleyici Özellikler (Closure Traits)" + +#: src/SUMMARY.md src/closures.md src/closures/exercise.md +msgid "Exercise: Log Filter" +msgstr "Alıştırma: Kaydedici (Log) Filtresi" + #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" @@ -415,27 +436,6 @@ msgstr "`HashMap`" msgid "Exercise: Counter" msgstr "Alıştırma: Sayıcı" -#: src/SUMMARY.md src/running-the-course/course-structure.md -#: src/welcome-day-2-afternoon.md src/closures.md -msgid "Closures" -msgstr "Çevreleyiciler (Closures)" - -#: src/SUMMARY.md src/closures.md src/closures/syntax.md -msgid "Closure Syntax" -msgstr "Çevreleyici Sözdizimi (Closure Syntax)" - -#: src/SUMMARY.md src/closures.md src/closures/capturing.md -msgid "Capturing" -msgstr "Yakalama (Capturing)" - -#: src/SUMMARY.md src/closures.md -msgid "Closure Traits" -msgstr "Çevreleyici Özellikler (Closure Traits)" - -#: src/SUMMARY.md src/closures.md src/closures/exercise.md -msgid "Exercise: Log Filter" -msgstr "Alıştırma: Kaydedici (Log) Filtresi" - #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" @@ -456,7 +456,7 @@ msgstr "`From` ve `Into`" #: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md msgid "Casting" -msgstr "Tür Çevirimi" +msgstr "Tür Dönüştürme (Casting)" #: src/SUMMARY.md src/std-traits/read-and-write.md msgid "`Read` and `Write`" @@ -676,6 +676,7 @@ msgstr "Gün 4: Öğleden Sonra" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4-afternoon.md src/error-handling.md +#: src/idiomatic/welcome.md msgid "Error Handling" msgstr "Hata İşleme" @@ -699,7 +700,7 @@ msgstr "`Error` Özelliği (Trait)" msgid "`thiserror`" msgstr "`thiserror`" -#: src/SUMMARY.md src/error-handling/anyhow.md +#: src/SUMMARY.md src/error-handling/anyhow.md src/idiomatic/welcome.md msgid "`anyhow`" msgstr "`anyhow`" @@ -756,7 +757,8 @@ msgstr "Alıştırma: FFI Sarmalayıcı" msgid "Android" msgstr "Android" -#: src/SUMMARY.md src/android/setup.md src/chromium/setup.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/android/setup.md src/chromium/setup.md msgid "Setup" msgstr "Kurulum (Setup)" @@ -849,6 +851,8 @@ msgid "Logging" msgstr "Kayıt Tutma (Logging)" #: src/SUMMARY.md src/android/interoperability.md +#: src/unsafe-deep-dive/motivations.md +#: src/unsafe-deep-dive/motivations/interop.md msgid "Interoperability" msgstr "Birlikte Çalışabilirlik (Interoperability)" @@ -1411,6 +1415,83 @@ msgstr "İptal (Cancellation)" msgid "Broadcast Chat Application" msgstr "Yayımlamalı Sohbet Uygulaması" +#: src/SUMMARY.md src/running-the-course/course-structure.md +msgid "Idiomatic Rust" +msgstr "" + +#: src/SUMMARY.md src/idiomatic/welcome.md +#: src/idiomatic/leveraging-the-type-system.md +msgid "Leveraging the Type System" +msgstr "" + +#: src/SUMMARY.md src/idiomatic/leveraging-the-type-system.md +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +#, fuzzy +msgid "Newtype Pattern" +msgstr "Tür Durum Deseni" + +#: src/SUMMARY.md +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "Semantic Confusion" +msgstr "" + +#: src/SUMMARY.md +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "Parse, Don't Validate" +msgstr "" + +#: src/SUMMARY.md +#, fuzzy +msgid "Is It Encapsulated?" +msgstr "Kapsülleme (Encapsulation)" + +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/unsafe-deep-dive/motivations.md +#, fuzzy +msgid "Motivations" +msgstr "Motivasyon" + +#: src/SUMMARY.md src/unsafe-deep-dive/motivations.md +#: src/unsafe-deep-dive/motivations/data-structures.md +#, fuzzy +msgid "Data Structures" +msgstr "Veri Yapılarında Ömürler" + +#: src/SUMMARY.md src/unsafe-deep-dive/motivations.md +#: src/unsafe-deep-dive/motivations/performance.md +msgid "Performance" +msgstr "" + +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/unsafe-deep-dive/foundations.md +#, fuzzy +msgid "Foundations" +msgstr "Fonksiyonlar" + +#: src/SUMMARY.md src/unsafe-deep-dive/foundations.md +#, fuzzy +msgid "What is unsafe?" +msgstr "Rust Nedir?" + +#: src/SUMMARY.md src/unsafe-deep-dive/foundations.md +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "When is unsafe used?" +msgstr "" + +#: src/SUMMARY.md src/unsafe-deep-dive/foundations.md +#, fuzzy +msgid "Data structures are safe" +msgstr "Default, yapı güncelleme sözdizimi (struct update syntax)" + +#: src/SUMMARY.md src/unsafe-deep-dive/foundations.md +msgid "Actions might not be" +msgstr "" + +#: src/SUMMARY.md src/unsafe-deep-dive/foundations.md +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Less powerful than it seems" +msgstr "" + #: src/SUMMARY.md msgid "Final Words" msgstr "Son sözler" @@ -1772,7 +1853,7 @@ msgstr "1. Gün Sabah (2 saat 10 dakika, aralar dahil)" #: src/welcome-day-2-afternoon.md src/welcome-day-3.md #: src/welcome-day-3-afternoon.md src/welcome-day-4.md #: src/welcome-day-4-afternoon.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/concurrency/welcome-async.md src/idiomatic/welcome.md msgid "Segment" msgstr "Bölüm" @@ -1781,7 +1862,7 @@ msgstr "Bölüm" #: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md #: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md #: src/methods-and-traits.md src/generics.md src/welcome-day-2-afternoon.md -#: src/std-types.md src/closures.md src/std-traits.md src/welcome-day-3.md +#: src/closures.md src/std-types.md src/std-traits.md src/welcome-day-3.md #: src/memory-management.md src/smart-pointers.md #: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md #: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md @@ -1791,18 +1872,22 @@ msgstr "Bölüm" #: src/concurrency/shared-state.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md -#: src/concurrency/async-exercises.md +#: src/concurrency/async-exercises.md src/idiomatic/welcome.md +#: src/idiomatic/leveraging-the-type-system.md +#: src/unsafe-deep-dive/motivations.md src/unsafe-deep-dive/foundations.md msgid "Duration" msgstr "Süre" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/references.md src/user-defined-types.md src/pattern-matching.md -#: src/generics.md src/std-types.md src/closures.md src/std-traits.md +#: src/generics.md src/closures.md src/std-types.md src/std-traits.md #: src/memory-management.md src/smart-pointers.md src/lifetimes.md #: src/iterators.md src/modules.md src/testing.md src/error-handling.md #: src/unsafe-rust.md src/concurrency/shared-state.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/idiomatic/leveraging-the-type-system.md +#: src/unsafe-deep-dive/motivations.md msgid "5 minutes" msgstr "5 dakika" @@ -1850,7 +1935,7 @@ msgstr "2. Gün Sabah (2 saat 45 dakika, aralar dahil)" #: src/running-the-course/course-structure.md src/hello-world.md #: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md #: src/references.md src/welcome-day-2.md src/methods-and-traits.md -#: src/std-types.md src/closures.md src/welcome-day-3.md src/borrowing.md +#: src/closures.md src/std-types.md src/welcome-day-3.md src/borrowing.md #: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md #: src/error-handling.md msgid "3 minutes" @@ -2031,6 +2116,7 @@ msgstr "Sabah (3 saat 20 dakika, aralar dahil)" #: src/error-handling.md src/concurrency/welcome.md #: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md #: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +#: src/idiomatic/leveraging-the-type-system.md msgid "20 minutes" msgstr "20 dakika" @@ -2047,6 +2133,56 @@ msgstr "1 saat 10 dakika" msgid "Afternoon (3 hours and 30 minutes, including breaks)" msgstr "Öğleden Sonra (3 saat 30 dakika, aralar dahil)" +#: src/running-the-course/course-structure.md +#, fuzzy +msgid "" +"The [Idiomatic Rust](../idiomatic/welcome.md) deep dive is a 2-day class on " +"Rust idioms and patterns." +msgstr "" +"[Rust'ta Eşzamanlılık](../concurrency/welcome.md) ayrıntılı incelemesi, " +"klasik ve aynı zamanda `async`/`await` eşzamanlılığı üzerine tam günlük bir " +"derstir." + +#: src/running-the-course/course-structure.md +msgid "" +"You should be familiar with the material in [Rust Fundamentals](../welcome-" +"day-1.md) before starting this course." +msgstr "" + +#: src/running-the-course/course-structure.md +msgid "course outline Idiomatic Rust" +msgstr "" + +#: src/running-the-course/course-structure.md +msgid "Unsafe (Work in Progress)" +msgstr "" + +#: src/running-the-course/course-structure.md +msgid "" +"The [Unsafe](../unsafe-deep-dive/welcome.md) deep dive is a two-day class on " +"the _unsafe_ Rust language. It covers the fundamentals of Rust's safety " +"guarantees, the motivation for `unsafe`, review process for `unsafe` code, " +"FFI basics, and building data structures that the borrow checker would " +"normally reject." +msgstr "" + +#: src/running-the-course/course-structure.md +#, fuzzy +msgid "Day 1 Morning (1 hour, including breaks)" +msgstr "2. Gün Öğleden Sonra (4 saat, aralar dahil)" + +#: src/running-the-course/course-structure.md src/hello-world.md +#: src/control-flow-basics.md src/user-defined-types.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/unsafe-deep-dive/foundations.md +msgid "2 minutes" +msgstr "2 dakika" + +#: src/running-the-course/course-structure.md src/idiomatic/welcome.md +#, fuzzy +msgid "25 minutes" +msgstr "5 dakika" + #: src/running-the-course/course-structure.md msgid "Format" msgstr "Format" @@ -2323,16 +2459,8 @@ msgstr "" "adında farklı bir IDE de mevcuttur." #: src/cargo.md -msgid "" -"On Debian/Ubuntu, you can also install Cargo, the Rust source and the [Rust " -"formatter](https://github.com/rust-lang/rustfmt) via `apt`. However, this " -"gets you an outdated Rust version and may lead to unexpected behavior. The " -"command would be:" +msgid "On Debian/Ubuntu, you can install `rustup` via `apt`:" msgstr "" -"Debian/Ubuntu'da ayrıca `apt` aracılığıyla Cargo'yu, Rust kaynak kodunu ve " -"[Rust biçimlendiricisini (formatter)](https://github.com/rust-lang/rustfmt) " -"kurabilirsiniz. Ancak bu size eski bir Rust sürümü verir ve beklenmeyen " -"davranışlara yol açabilir. Komut şu şekilde olacaktır:" #: src/cargo.md msgid "" @@ -2731,7 +2859,7 @@ msgstr "" #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md #: src/welcome-day-4.md src/concurrency/welcome.md -#: src/concurrency/welcome-async.md +#: src/concurrency/welcome-async.md src/idiomatic/welcome.md msgid "Schedule" msgstr "Zamanlama (Schedule)" @@ -2820,7 +2948,7 @@ msgstr "Bu bölüm yaklaşık 15 dakika sürmelidir. İçeriği:" #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/closures.md src/std-traits.md src/memory-management.md +#: src/closures.md src/std-types.md src/std-traits.md src/memory-management.md #: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md #: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md #: src/concurrency/threads.md src/concurrency/channels.md @@ -2828,25 +2956,22 @@ msgstr "Bu bölüm yaklaşık 15 dakika sürmelidir. İçeriği:" #: src/concurrency/sync-exercises.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md #: src/concurrency/async-exercises.md +#: src/idiomatic/leveraging-the-type-system.md +#: src/unsafe-deep-dive/motivations.md src/unsafe-deep-dive/foundations.md msgid "Slide" msgstr "Slayt" #: src/hello-world.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md -#: src/std-types.md src/closures.md src/memory-management.md +#: src/closures.md src/std-types.md src/memory-management.md #: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md #: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md #: src/concurrency/shared-state.md src/concurrency/async.md #: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/unsafe-deep-dive/foundations.md msgid "10 minutes" msgstr "10 dakika" -#: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md -#: src/memory-management.md src/concurrency/channels.md -#: src/concurrency/send-sync.md -msgid "2 minutes" -msgstr "2 dakika" - #: src/hello-world/what-is-rust.md msgid "" "Rust is a new programming language which had its [1.0 release in 2015]" @@ -3398,8 +3523,8 @@ msgid "" "Functions will be covered in more detail later." msgstr "" "İlk defa `main` dışında bir fonksiyon görüyoruz, ancak anlamı açık: üç " -"tamsayı alır ve bir tamsayı döndürür. Fonksiyonlar daha sonra daha detaylı " -"olarak ele alınacaktır." +"tamsayı alır ve bir tamsayı geri döndürür. Fonksiyonlar daha sonra daha " +"detaylı olarak ele alınacaktır." #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." @@ -3898,10 +4023,10 @@ msgid "" "statement (unlike `while` and `for` loops, which can also return when the " "condition fails)." msgstr "" -"`loop`'un önemsiz olmayan (non-trivial) bir değer döndüren tek döngüsel yapı " -"olduğunu unutmayın. Bunun nedeni, en az bir `break` ifadesinde sonlanmasının " -"garantili olmasıdır (koşul başarısız olduğunda da sonlanabilen `while` ve " -"`for` döngülerinin aksine)." +"`loop`'un önemsiz olmayan (non-trivial) bir değer geri döndüren tek döngüsel " +"yapı olduğunu unutmayın. Bunun nedeni, en az bir `break` ifadesinde " +"sonlanmasının garantili olmasıdır (koşul başarısız olduğunda da sonlanabilen " +"`while` ve `for` döngülerinin aksine)." #: src/control-flow-basics/break-continue/labels.md msgid "" @@ -3925,7 +4050,7 @@ msgid "" "programming languages), then a return type." msgstr "" "Bildirim (declaration) parametrelerinin ardından bir tür (bazı programlama " -"dillerinin tersi) ve ardından bir dönüş türü gelir." +"dillerinin tersi) ve ardından bir geri dönüş türü gelir." #: src/control-flow-basics/functions.md msgid "" @@ -3946,9 +4071,9 @@ msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " "compiler will infer this if the return type is omitted." msgstr "" -"Bazı fonksiyonların dönüş değeri (return value) yoktur ve 'birim türü (unit " -"type)', `()` döndürürler. Eğer dönüş türü yazılmazsa, derleyici birim türünü " -"çıkarım (infer) yapacaktır." +"Bazı fonksiyonların geri dönüş değeri (return value) yoktur ve 'birim türü " +"(unit type)', `()` geri döndürürler. Eğer geri dönüş türü yazılmazsa, " +"derleyici birim türünü çıkarım (infer) yapacaktır." #: src/control-flow-basics/functions.md msgid "" @@ -4266,6 +4391,14 @@ msgstr "" "`#` eklemek, örneğin `{a:#?}`, okunması daha kolay olabilecek \"güzel " "yazdırma (pretty printing)\" biçimini (format) çağırır." +#: src/tuples-and-arrays/arrays.md +msgid "" +"Arrays are not heap-allocated. They are regular values with a fixed size " +"known at compile time, meaning they go on the stack. This can be different " +"from what students expect if they come from a garbage collected language, " +"where arrays may be heap allocated by default." +msgstr "" + #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." msgstr "Diziler gibi, demetlerin (tuple) de sabit bir uzunluğu vardır." @@ -4898,6 +5031,13 @@ msgstr "" "(mutable) referans kullanarak döngü de dönmemizdir; bu da `for` döngüsünün " "her elemana değiştirilebilir (mutable) referanslar vermesini sağlar." +#: src/references/solution.md +msgid "" +"It is also possible to take slice references here, e.g., `fn " +"magnitude(vector: &[f64]) -> f64`. This makes the function more general, at " +"the cost of a runtime length check." +msgstr "" + #: src/user-defined-types.md src/std-types.md src/std-traits.md #: src/memory-management.md msgid "This segment should take about 1 hour. It contains:" @@ -5060,6 +5200,12 @@ msgstr "" "her kullanımda yeniden doğrulamanız gerekmiyor: `PhoneNumber(String)` veya " "`OddNumber(u32)`." +#: src/user-defined-types/tuple-structs.md +msgid "" +"The newtype pattern is covered extensively in the [\"Idiomatic Rust\" module]" +"(../idiomatic/leveraging-the-type-system/newtype-pattern.md)." +msgstr "" + #: src/user-defined-types/tuple-structs.md msgid "" "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " @@ -5745,11 +5891,13 @@ msgstr "" "etmek istediğimizde önemli ve gereklidir." #: src/pattern-matching/match.md +#, fuzzy msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"match arm is selected. Failing the `if` condition inside of that block won't " -"result in other arms of the original `match` expression being considered." +"Match guards are different from `if` expressions after the `=>`. An `if` " +"expression is evaluated after the match arm is selected. Failing the `if` " +"condition inside of that block won't result in other arms of the original " +"`match` expression being considered. In the following example, the wildcard " +"pattern `_ =>` is never even attempted." msgstr "" "Bunlar, eşleşme kolunun (match arm) içindeki ayrı bir `if` ifadesiyle aynı " "değildir. Dal (branch) bloğunun içindeki bir `if` ifadesi (`=>`'dan sonra), " @@ -5757,6 +5905,14 @@ msgstr "" "başarısız olması, orijinal `match` ifadesinin diğer kollarının dikkate " "alınmasıyla sonuçlanmaz." +#: src/pattern-matching/match.md +msgid "\"Uppercase\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Bug: this is never printed\"" +msgstr "" + #: src/pattern-matching/match.md msgid "" "The condition defined in the guard applies to every expression in a pattern " @@ -5878,9 +6034,10 @@ msgstr "" "değerler özel (exclusive) referanslar haline gelir." #: src/pattern-matching/destructuring-structs.md +#, fuzzy msgid "" "The distinction between a capture and a constant expression can be hard to " -"spot. Try changing the `2` in the second arm to a variable, and see that it " +"spot. Try changing the `2` in the first arm to a variable, and see that it " "subtly doesn't work. Change it to a `const` and see it working again." msgstr "" "Bir yakalanan(capture) değer ile bir sabit (constant) ifade arasındaki " @@ -5932,7 +6089,7 @@ msgid "" "a `match`." msgstr "" "`if`/`else` ifadesi, daha sonra bir `match` ile açılan (unpacked) bir enum " -"döndürüyor." +"geri döndürüyor." #: src/pattern-matching/destructuring-enums.md msgid "" @@ -6057,9 +6214,9 @@ msgid "" "all items." msgstr "" "Burada [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." -"String.html#method.pop) dize boşalana kadar `Some(c)` döndürür, ardından " -"`None` döndürür. `while let` tüm öğeler arasında adımlamaya (iterating) " -"devam etmemizi sağlar." +"String.html#method.pop) dize boşalana kadar `Some(c)` geri döndürür, " +"ardından `None` geri döndürür. `while let` tüm öğeler arasında adımlamaya " +"(iterating) devam etmemizi sağlar." #: src/pattern-matching/let-control-flow/while-let.md msgid "" @@ -6099,7 +6256,7 @@ msgid "" "let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " "- anything but falling off the end of the block)." msgstr "" -"Bir deseni eşleştirip fonksiyondan geri dönmenin yaygın durumu için [`let " +"Bir deseni eşleştirip fonksiyondan geri döndürmenin yaygın durumu için [`let " "else`](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) " "kullanın. \"else\" durumu farklı olmalıdır (diverge) (`return`, `break` veya " "`panic` - bloğun sonundan çıkmak dışında her şey)." @@ -6132,9 +6289,10 @@ msgid "" "where you try to get a value out of a `Result`, returning an error if the " "`Result` was `Err`." msgstr "" -"Bu erken dönüş tabanlı kontrol akışı (early return-based control flow), Rust " -"hata işleme (error handling) kodunda yaygındır; burada bir `Result`'tan bir " -"değer almaya çalışırsınız ve `Result` `Err` ise bir hata döndürürsünüz." +"Bu erken geri döndürme tabanlı kontrol akışı (early return-based control " +"flow), Rust hata işleme (error handling) kodunda yaygındır; burada bir " +"`Result`'tan bir değer almaya çalışırsınız ve `Result` `Err` ise bir hata " +"geri döndürürsünüz." #: src/pattern-matching/let-control-flow/let-else.md msgid "" @@ -6405,7 +6563,7 @@ msgstr "" #: src/methods-and-traits/traits.md msgid "/// Return a sentence from this pet.\n" -msgstr "/// Bu evcil hayvandan bir cümle döndürün.\n" +msgstr "/// Bu evcil hayvandan bir cümle geri döndürün.\n" #: src/methods-and-traits/traits.md msgid "/// Print a string to the terminal greeting this pet.\n" @@ -6634,11 +6792,12 @@ msgstr "" "üzerindeki mesajları yoksayacak bir `VerbosityFilter` türü yazmaktır." #: src/methods-and-traits/exercise.md +#, fuzzy msgid "" "This is a common pattern: a struct wrapping a trait implementation and " "implementing that same trait, adding behavior in the process. In the " -"\"Generics\" segment this afternoon, we will see how to make the wrapper " -"generic over the wrapped type." +"\"Generics\" segment, we will see how to make the wrapper generic over the " +"wrapped type." msgstr "" "Bu yaygın bir desendir: bir özellik gerçekleştirmesini (trait " "implementation) saran ve aynı özelliği gerçekleştiren, süreçte davranış " @@ -6735,8 +6894,8 @@ msgid "" "Rust infers a type for T based on the types of the arguments and return " "value." msgstr "" -"Rust, argümanların ve dönüş değerinin türlerine dayanarak T için bir tür " -"çıkarır (infers)." +"Rust, argümanların ve geri dönüş değerinin türlerine dayanarak T için bir " +"tür çıkarır (infers)." #: src/generics/generic-functions.md msgid "" @@ -6758,9 +6917,9 @@ msgstr "" "Bu, C++ şablonlarına (templates) benzer, ancak Rust, genelleştirilmiş " "(generic) fonksiyonu kısmen de olsa anında derler, bu nedenle bu fonksiyon " "kısıtlamalarla (constraints) eşleşen tüm türler için geçerli olmalıdır. " -"Örneğin, `cond` yanlışsa `left + right` döndürmek için `pick`'i değiştirmeyi " -"deneyin. Yalnızca tamsayılarla `pick` örneği kullanılsa bile, Rust bunu yine " -"de geçersiz kabul eder. C++ bunu yapmanıza izin verirdi." +"Örneğin, `cond` yanlışsa `left + right` geri döndürmek için `pick`'i " +"değiştirmeyi deneyin. Yalnızca tamsayılarla `pick` örneği kullanılsa bile, " +"Rust bunu yine de geçersiz kabul eder. C++ bunu yapmanıza izin verirdi." #: src/generics/generic-functions.md msgid "" @@ -6838,7 +6997,7 @@ msgid "" msgstr "" "Belirli alan türü (concrete field type) üzerinde soyutlama yapmak için " "genelleştirmeleri (generics) kullanabilirsiniz. Önceki bölümün alıştırmasına " -"dönersek:" +"geri dönersek:" #: src/generics/generic-data.md msgid "" @@ -7006,10 +7165,10 @@ msgid "" ">()`." msgstr "" "Geri dönüş konumunda (return position) çıkarım (inference) yapmak zordur. " -"`impl Foo` döndüren bir fonksiyon, döndürdüğü belirli olan türü kaynakta " -"yazmadan seçer. `collect() -> B` gibi genelleştirilmiş bir tür döndüren " -"bir fonksiyon, `B`'yi sağlayan herhangi bir türü geri döndürebilir ve " -"çağıranın, `let x: Vec<_> = foo.collect()` veya tür belirteciyle (turbo " +"`impl Foo` geri döndüren bir fonksiyon, geri döndürdüğü belirli olan türü " +"kaynakta yazmadan seçer. `collect() -> B` gibi genelleştirilmiş bir tür " +"döndüren bir fonksiyon, `B`'yi sağlayan herhangi bir türü geri döndürebilir " +"ve çağıranın, `let x: Vec<_> = foo.collect()` veya tür belirteciyle (turbo " "balığı / turbofish) ile `foo.collect::>()` gibi birini seçmesi " "gerekebilir." @@ -7183,6 +7342,336 @@ msgstr "" "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 50 dakika sürmelidir. " "İçeriği:" +#: src/closures.md src/concurrency/threads.md src/concurrency/shared-state.md +msgid "This segment should take about 30 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 30 dakika sürmelidir. İçeriği:" + +#: src/closures/syntax.md +msgid "Closures are created with vertical bars: `|..| ..`." +msgstr "Çevreleyiciler (closures) dikey çubuklarla oluşturulur: `|..| ..`." + +#: src/closures/syntax.md +msgid "// Argument and return type can be inferred for lightweight syntax:\n" +msgstr "" +"// Hafif sözdizimi (lightweight syntax) için, argüman ve geri dönüş türü " +"çıkarımı yapılabilir:\n" + +#: src/closures/syntax.md +msgid "// Or we can specify types and bracket the body to be fully explicit:\n" +msgstr "" +"// Veya türleri belirtebilir ve tamamen açık (fully explicit) olmak için " +"gövdeyi parantez içine alabiliriz:\n" + +#: src/closures/syntax.md +msgid "" +"The arguments go between the `|..|`. The body can be surrounded by `{ .. }`, " +"but if it is a single expression these can be omitted." +msgstr "" +"Argümanlar `|..|` arasına girer. Gövde `{ .. }` içine alınır., ancak tek bir " +"ifade (expression) ise bunlar atlanabilir." + +#: src/closures/syntax.md +msgid "" +"Argument types are optional, and are inferred if not given. The return type " +"is also optional, but can only be written if using `{ .. }` around the body." +msgstr "" +"Argüman türleri isteğe bağlıdır ve eğer verilmezse türler çıkarım " +"(inference) yapılır. Geri dönüş türü (return type) de isteğe bağlıdır, ancak " +"yalnızca gövdenin etrafında `{ .. }` varsa yazılabilir." + +#: src/closures/syntax.md +msgid "" +"The examples can both be written as mere nested functions instead -- they do " +"not capture any variables from their lexical environment. We will see " +"captures next." +msgstr "" +"Örneklerin her ikisi de bunun yerine sadece iç içe fonksiyonlar olarak " +"yazılabilir -- çünkü bulundukları sözcüksel ortamdan (lexical environment) " +"herhangi bir değişkeni yakalamazlar. Yakalamayı (capturing) bir sonraki " +"adımda göreceğiz." + +#: src/closures/syntax.md +msgid "" +"The ability to store functions in variables doesn't just apply to closures, " +"regular functions can be put in variables and then invoked the same way that " +"closures can: [Example in the playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=817cbeeefc49f3d0d180a3d6d54c8bda)." +msgstr "" +"Fonksiyonları değişkenlerde saklama yeteneği sadece çevreleyicilere " +"(closures) özgü değildir, düzenli (regular) fonksiyonlar da değişkenlere " +"konulabilir ve ardından çevreleyicilerle aynı şekilde çağrılabilir: [Deneme " +"alanında (playground) örnek](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=817cbeeefc49f3d0d180a3d6d54c8bda)." + +#: src/closures/syntax.md +msgid "" +"The linked example also demonstrates that closures that don't capture " +"anything can also coerce to a regular function pointer." +msgstr "" +"Bağlantısı verilen örnek ayrıca hiçbir şey yakalamayan (capture) " +"çevreleyicilerin (closures) de düzenli bir fonksiyon göstericisine (regular " +"function pointer) dönüştürülebileceğini (coerce) göstermektedir." + +#: src/closures/capturing.md +msgid "" +"A closure can capture variables from the environment where it was defined." +msgstr "" +"Bir çevreleyici (closure), tanımlandığı ortamdan değişkenleri yakalayabilir " +"(capture)." + +#: src/closures/capturing.md +msgid "" +"By default, a closure captures values by reference. Here `max_value` is " +"captured by `clamp`, but still available to `main` for printing. Try making " +"`max_value` mutable, changing it, and printing the clamped values again. Why " +"doesn't this work?" +msgstr "" +"Varsayılan olarak, bir çevreleyici (closure) değerleri referans yoluyla " +"yakalar. Burada `max_value`, `clamp` tarafından yakalanır, ancak yazdırma " +"için `main`'de hala kullanılabilir. `max_value` değişkenini değiştirilebilir " +"(mutable) yapmayı, değiştirmeyi ve değerleri tekrar yazdırmayı deneyin. Bu " +"neden işe yaramıyor?" + +#: src/closures/capturing.md +msgid "" +"If a closure mutates values, it will capture them by mutable reference. Try " +"adding `max_value += 1` to `clamp`." +msgstr "" +"Bir çevreleyici (closure) değerleri değiştirirse, onları değiştirilebilir " +"(mutable) referans yoluyla yakalar. `clamp`'e `max_value += 1` eklemeyi " +"deneyin." + +#: src/closures/capturing.md +msgid "" +"You can force a closure to move values instead of referencing them with the " +"`move` keyword. This can help with lifetimes, for example if the closure " +"must outlive the captured values (more on lifetimes later)." +msgstr "" +"Bir çevreleyiciyi (closure), `move` anahtar kelimesiyle değerleri referans " +"almak yerine taşımaya (move) zorlayabilirsiniz. Bu, ömürlerle (lifetimes) " +"ilgili yardımcı olabilir, örneğin çevreleyici yakalanan değerlerden daha " +"uzun yaşamalıysa (ömürler hakkında daha sonra daha fazla bilgi)." + +#: src/closures/capturing.md +msgid "" +"This looks like `move |v| ..`. Try adding this keyword and see if `main` can " +"still access `max_value` after defining `clamp`." +msgstr "" +"Bu, `move |v| ..` gibi görünüyor. Bu anahtar kelimeyi eklemeyi deneyin ve " +"`clamp`'i tanımladıktan sonra `main`'in hala `max_value`'e erişip " +"erişemediğini görün." + +#: src/closures/capturing.md +msgid "" +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." +msgstr "" +"Varsayılan olarak, çevreleyiciler (closures) dış kapsamdan (outer scope) her " +"değişkeni, yapabildikleri en az talepkar erişim biçimiyle yakalarlar " +"(mümkünse paylaşılan (shared) referansla, sonra özel (exclusive) referansla, " +"sonra taşıma (move) ile). `move` anahtar kelimesi, değerle yakalamayı " +"(move)zorlar." + +#: src/closures/traits.md +msgid "Closure traits" +msgstr "Çevreleyici özellikleri (Closure traits)" + +#: src/closures/traits.md +msgid "" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +msgstr "" +"Çevreleyicilerin (closures) veya lambda ifadelerinin isimlendirilemeyen " +"türleri vardır. Ancak, özel [`Fn`](https://doc.rust-lang.org/std/ops/trait." +"Fn.html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html) ve " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) " +"özelliklerini (traits) gerçekleştirirler (implement):" + +#: src/closures/traits.md +msgid "" +"The special types `fn(..) -> T` refer to function pointers - either the " +"address of a function, or a closure that captures nothing." +msgstr "" +"Özel `fn(..) -> T` türleri, fonksiyon göstericilerine (function pointers) " +"referans verir - ya bir fonksiyonun adresi ya da hiçbir şey yakalamayan " +"(capture) bir çevreleyici (closure)." + +#: src/closures/traits.md +msgid "\"Calling {func_name}({input}): {}\"" +msgstr "\"Çağrılıyor {func_name}({input}): {}\"" + +#: src/closures/traits.md +msgid "\"-itis\"" +msgstr "\"sendromu\"" + +#: src/closures/traits.md +msgid "\"{x}{suffix}\"" +msgstr "\"{x} {suffix}\"" + +#: src/closures/traits.md +msgid "\"add_suffix\"" +msgstr "\"add_suffix\"" + +#: src/closures/traits.md +msgid "\"senior\"" +msgstr "\"son sınıf\"" + +#: src/closures/traits.md +#, fuzzy +msgid "\"appendix\"" +msgstr "\"apandis\"" + +#: src/closures/traits.md +msgid "\"/\"" +msgstr "\"/\"" + +#: src/closures/traits.md +msgid "\"accumulate\"" +msgstr "\"accumulate\"" + +#: src/closures/traits.md +msgid "\"red\"" +msgstr "\"kırmızı\"" + +#: src/closures/traits.md +msgid "\"green\"" +msgstr "\"yeşil\"" + +#: src/closures/traits.md +msgid "\"blue\"" +msgstr "\"mavi\"" + +#: src/closures/traits.md +msgid "\"take_and_reverse\"" +msgstr "\"take_and_reverse\"" + +#: src/closures/traits.md +msgid "\"reversed: \"" +msgstr "\"ters çevrilmiş: \"" + +#: src/closures/traits.md +msgid "" +"An `Fn` (e.g. `add_suffix`) neither consumes nor mutates captured values. It " +"can be called needing only a shared reference to the closure, which means " +"the closure can be executed repeatedly and even concurrently." +msgstr "" +"Bir `Fn` (ör. `add_suffix`) yakalanan değerleri (captured values) ne tüketir " +"ne de değiştirir. Sadece çevreleyiciye (closure) paylaşılan bir referans " +"(shared reference) gerektirerek çağrılabilir, bu da çevreleyicinin tekrar " +"tekrar ve hatta eş zamanlı olarak (concurrently) yürütülebileceği anlamına " +"gelir." + +#: src/closures/traits.md +msgid "" +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." +msgstr "" +"Bir `FnMut` (ör. `accumulate`) yakalanan değerleri (captured values) " +"değiştirebilir. Çevreleyici (closure) nesnesine özel (exclusive) referans " +"yoluyla erişilir, bu nedenle tekrar tekrar çağrılabilir ancak eş zamanlı " +"olarak (concurrently) çağrılamaz." + +#: src/closures/traits.md +msgid "" +"If you have an `FnOnce` (e.g. `take_and_reverse`), you may only call it " +"once. Doing so consumes the closure and any values captured by move." +msgstr "" +"Eğer bir `FnOnce`'ınız varsa (ör. `take_and_reverse`), onu yalnızca bir kez " +"çağırabilirsiniz. Bunu yapmak, çevreleyiciyi (closure) ve taşıma (move) ile " +"yakalanan tüm değerleri tüketir." + +#: src/closures/traits.md +msgid "" +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +msgstr "" +"`FnMut`, `FnOnce`'ın bir alt türüdür. `Fn`, `FnMut` ve `FnOnce`'ın bir alt " +"türüdür. Yani, `FnOnce`'ın istendiği her yerde bir `FnMut` kullanabilirsiniz " +"ve `FnMut` veya `FnOnce`'ın istendiği her yerde bir `Fn` kullanabilirsiniz." + +#: src/closures/traits.md +msgid "" +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." +msgstr "" +"Bir çevreleyici (closure) alan bir fonksiyon tanımladığınızda, " +"yapabiliyorsanız `FnOnce` (yani onu bir kez çağırırsınız), değilse `FnMut` " +"ve son olarak `Fn` almalısınız. Bu, çağırana (caller) en fazla esnekliği " +"sağlar." + +#: src/closures/traits.md +msgid "" +"In contrast, when you have a closure, the most flexible you can have is `Fn` " +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." +msgstr "" +"Buna karşılık, bir çevreleyiciniz (closure) olduğunda, sahip olabileceğiniz " +"en esnek olan `Fn`'dir (3 çevreleyici özelliğinin (trait) herhangi birinin " +"tüketicisine geçirilebilir), sonra `FnMut` ve son olarak `FnOnce`." + +#: src/closures/traits.md +msgid "" +"The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g. " +"`take_and_reverse`), depending on what the closure captures. Function " +"pointers (references to `fn` items) implement `Copy` and `Fn`." +msgstr "" +"Derleyici ayrıca, çevreleyicinin (closure) ne yakaladığına bağlı olarak " +"`Copy` (ör. `add_suffix` için) ve `Clone` (ör. `take_and_reverse`) çıkarımı " +"yapar (infers). Fonksiyon göstericileri (`fn` öğelerine referanslar) " +"`Copy`'yi ve `Fn`'yi gerçekleştirir (implement)." + +#: src/closures/exercise.md +msgid "" +"Building on the generic logger from this morning, implement a `Filter` which " +"uses a closure to filter log messages, sending those which pass the " +"filtering predicate to an inner logger." +msgstr "" +"Bu sabahki genel kaydediciden (logger) yola çıkarak, kayıt mesajlarını " +"filtrelemek için bir çevreleyici (closure) kullanan bir `Filter` " +"gerçekleştirin (implement), filtreleme koşulunu geçenleri bir iç kaydediciye " +"(logger) gönderin." + +#: src/closures/exercise.md +msgid "// TODO: Define and implement `Filter`.\n" +msgstr "// TODO: `Filter`'ı tanımlayın ve gerçekleştirin (implement).\n" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes\"" +msgstr "\"berbat\"" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes, something went wrong\"" +msgstr "\"berbat, bir şeyler ters gitti\"" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"uhoh\"" +msgstr "\"eyvah\"" + +#: src/closures/solution.md +msgid "/// Only log messages matching a filtering predicate.\n" +msgstr "" +"/// Yalnızca bir filtreleme koşuluyla eşleşen günlük mesajlarını kaydet.\n" + +#: src/closures/solution.md +msgid "" +"Note that the `P: Fn(u8, &str) -> bool` bound on the first `Filter` impl " +"block isn't strictly necessary, but it helps with type inference when " +"calling `new`. Demonstrate removing it and showing how the compiler now " +"needs type annotations for the closure passed to `new`." +msgstr "" +"İlk `Filter` impl bloğundaki `P: Fn(u8, &str) -> bool` sınırının kesinlikle " +"gerekli olmadığını, ancak `new` çağrılırken tür çıkarımına (type inference) " +"yardımcı olduğunu unutmayın. Onu kaldırmayı gösterin ve derleyicinin şimdi " +"`new`'e geçirilen çevreleyici (closure) için tür ek açıklamalarına (type " +"annotations) nasıl ihtiyaç duyduğunu gösterin." + #: src/std-types.md src/std-types/option.md msgid "Option" msgstr "Option" @@ -7208,6 +7697,9 @@ msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" +"Bu bölümdeki slaytların her biri için, dokümantasyon sayfalarını gözden " +"geçirerek biraz zaman ayırın ve daha yaygın metotlardan bazılarını öne " +"çıkarın." #: src/std-types/std.md msgid "" @@ -7215,45 +7707,61 @@ msgid "" "types used by Rust libraries and programs. This way, two libraries can work " "together smoothly because they both use the same `String` type." msgstr "" +"Rust, Rust kütüphaneleri ve programları tarafından kullanılan bir dizi ortak " +"türün oluşturulmasına yardımcı olan bir standart kütüphane ile birlikte " +"gelir. Bu şekilde, her hangi iki kütüphane aynı `String` türünü kullandığı " +"için sorunsuzca birlikte çalışabilir." #: src/std-types/std.md msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." msgstr "" +"Aslında Rust, Standart Kütüphanenin birkaç katmanını içerir: `core`, `alloc` " +"ve `std`." #: src/std-types/std.md msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." msgstr "" +"`core`, `libc`'ye, tahsis ediciye (allocator) ve hatta bir işletim " +"sisteminin varlığına bağlı olmayan en temel türleri ve fonksiyonları içerir." #: src/std-types/std.md msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." msgstr "" +"`alloc`, `Vec`, `Box` ve `Arc` gibi global bir dinamik bellek tahsis " +"edicisini (heap allocator) gerektiren türleri içerir." #: src/std-types/std.md msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" +"Gömülü Rust uygulamaları genellikle sadece `core` ve bazen de `alloc` " +"kullanır." #: src/std-types/docs.md msgid "Rust comes with extensive documentation. For example:" -msgstr "" +msgstr "Rust, kapsamlı bir dokümantasyonla birlikte gelir. Örneğin:" #: src/std-types/docs.md msgid "" "All of the details about [loops](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." msgstr "" +"[Döngüler](https://doc.rust-lang.org/stable/reference/expressions/loop-expr." +"html) hakkındaki tüm ayrıntılar." #: src/std-types/docs.md msgid "" "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." msgstr "" +"[`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html) gibi ilkel " +"türler (primitive types)." #: src/std-types/docs.md msgid "" @@ -7261,14 +7769,19 @@ msgid "" "option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" "std/collections/struct.BinaryHeap.html)." msgstr "" +"[`Option`](https://doc.rust-lang.org/stable/std/option/enum.Option.html) " +"veya [`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct." +"BinaryHeap.html) gibi standart kütüphane türleri." #: src/std-types/docs.md msgid "Use `rustup doc --std` or to view the documentation." msgstr "" +"Dokümantasyonu görüntülemek için `rustup doc --std` veya " +"kullanın." #: src/std-types/docs.md msgid "In fact, you can document your own code:" -msgstr "" +msgstr "Aslında, kendi kodunuzu belgeleyebilirsiniz:" #: src/std-types/docs.md msgid "" @@ -7277,6 +7790,9 @@ msgid "" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" +"/// İlk argümanın ikinci argümana bölünüp bölünemeyeceğini belirle.\n" +"///\n" +"/// İkinci argüman sıfır ise, sonuç yanlıştır.\n" #: src/std-types/docs.md msgid "" @@ -7285,24 +7801,36 @@ msgid "" "(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " "idiomatic to document all public items in an API using this pattern." msgstr "" +"İçerikler Markdown olarak işlenir. Yayınlanan tüm Rust kütüphane kasaları " +"(crates), [rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) " +"aracı kullanılarak [`docs.rs`](https://docs.rs) adresinde otomatik olarak " +"belgelenir. Bir API'deki tüm genel (public) öğeleri bu deseni kullanarak " +"belgelemek, tercih edilen yaklaşımdır (idiomatic)." #: src/std-types/docs.md msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" msgstr "" +"Bir öğeyi, öğenin içinden (bir modülün içi gibi) belgelemek için \"iç " +"doküman yorumları (inner doc comments)\" olarak adlandırılan `//!` veya `/" +"*! .. */` kullanın:" #: src/std-types/docs.md msgid "" "//! This module contains functionality relating to divisibility of " "integers.\n" msgstr "" +"//! Bu modül, tamsayıların bölünebilirliği ile ilgili fonksiyonellik " +"içerir.\n" #: src/std-types/docs.md msgid "" "Show students the generated docs for the `rand` crate at ." msgstr "" +"Öğrencilere adresindeki `rand` kasası (crate) için " +"oluşturulmuş belgeleri gösterin." #: src/std-types/option.md msgid "" @@ -7310,44 +7838,57 @@ msgid "" "type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" "stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" +"Daha önce `Option`'nin bazı kullanımlarını görmüştük. Ya `T` türünde bir " +"değer saklar ya da hiçbir şey saklamaz. Örneğin, [`String::find`](https://" +"doc.rust-lang.org/stable/std/string/struct.String.html#method.find) bir " +"`Option` geri döndürür." #: src/std-types/option.md msgid "\"Löwe 老虎 Léopard Gepardi\"" -msgstr "" +msgstr "\"Löwe 老虎 Léopard Gepardi\"" #: src/std-types/option.md msgid "'é'" -msgstr "" +msgstr "'é'" #: src/std-types/option.md msgid "'Z'" -msgstr "" +msgstr "'Z'" #: src/std-types/option.md msgid "\"Character not found\"" -msgstr "" +msgstr "\"Karakter bulunamadı\"" #: src/std-types/option.md msgid "`Option` is widely used, not just in the standard library." msgstr "" +"`Option` sadece standart kütüphanede kullanılır gibi bir şey yoktur, yaygın " +"olarak kullanılır." #: src/std-types/option.md msgid "" "`unwrap` will return the value in an `Option`, or panic. `expect` is similar " "but takes an error message." msgstr "" +"`unwrap`, bir `Option` içindeki değeri geri döndürür veya paniğe (panic) " +"neden olur. `expect` benzerdir ancak bir hata mesajı (error message) alır." #: src/std-types/option.md msgid "" "You can panic on None, but you can't \"accidentally\" forget to check for " "None." msgstr "" +"None durumunda panik alabilirsiniz, ancak None'ı kontrol etmeyi " +"\"yanlışlıkla\" unutamazsınız." #: src/std-types/option.md msgid "" "It's common to `unwrap`/`expect` all over the place when hacking something " "together, but production code typically handles `None` in a nicer fashion." msgstr "" +"Bir şeyler üzerinde çalışırken her yerde `unwrap`/`expect` kullanmak " +"yaygındır, ancak üretim (production) kodu genellikle `None`'ı daha şık bir " +"şekilde ele alır." #: src/std-types/option.md msgid "" @@ -7357,6 +7898,12 @@ msgid "" "uses NULL to represent the `None` variant, and thus can be stored in the " "same memory as `&T`." msgstr "" +"\"Niş/oyuk optimizasyonu (niche optimization)\", T'nin geçerli bir değeri " +"olmayan bir gösterimi (representation) varsa, `Option`'nin genellikle " +"bellekte `T` ile aynı boyuta sahip olduğu anlamına gelir. Örneğin, bir " +"referans NULL olamaz, bu nedenle `Option<&T>` `None` varyantını temsil etmek " +"için otomatik olarak NULL kullanır ve bu sayede `&T` ile aynı bellekte " +"saklanabilir." #: src/std-types/result.md msgid "" @@ -7364,22 +7911,26 @@ msgid "" "operation, each with a different enum variant. It is generic: `Result` " "where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" +"`Result`, `Option`'a benzer, ancak her biri farklı bir enum varyantına sahip " +"bir işlemin başarısını veya başarısızlığını belirtir. Genelleştirilmiştir " +"(generic): `Result`; burada `T`, `Ok` varyantında kullanılır ve `E`, " +"`Err` varyantında görünür." #: src/std-types/result.md src/error-handling/result.md msgid "\"diary.txt\"" -msgstr "" +msgstr "\"günlük.txt\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Dear diary: {contents} ({bytes} bytes)\"" -msgstr "" +msgstr "\"Sevgili günlük: {contents} ({bytes} bayt)\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Could not read file content\"" -msgstr "" +msgstr "\"Dosya içeriği okunamadı\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" -msgstr "" +msgstr "\"Günlük açılamadı: {err}\"" #: src/std-types/result.md msgid "" @@ -7388,6 +7939,11 @@ msgid "" "case where an error should never happen, `unwrap()` or `expect()` can be " "called, and this is a signal of the developer intent too." msgstr "" +"`Option`'da olduğu gibi, başarılı değer `Result`'ın içinde yer alır ve " +"geliştiriciyi onu açıkça (explicitly) çıkarmaya zorlar. Bu, hata kontrolünü " +"teşvik eder. Bir hatanın asla olmaması gereken durumlarda, `unwrap()` veya " +"`expect()` çağrılabilir ve bu aynı zamanda geliştiricinin niyetinin de bir " +"işaretidir." #: src/std-types/result.md msgid "" @@ -7395,18 +7951,25 @@ msgid "" "is worth mentioning. It contains a lot of convenience methods and functions " "that help functional-style programming." msgstr "" +"`Result` dokümantasyonunu okumanız tavsiye edilir. Kurs sırasında değil, ama " +"bahsetmeye değer. Fonksiyonel tarzda programlamaya yardımcı olan birçok " +"kullanışlı metot ve fonksiyon içerir." #: src/std-types/result.md msgid "" "`Result` is the standard type to implement error handling as we will see on " "Day 4." msgstr "" +"`Result`, 4. Günde göreceğimiz gibi hata işlemeyi (error handling) " +"gerçekleştirmek (implement) için standart türdür." #: src/std-types/string.md msgid "" "[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is a " "growable UTF-8 encoded string:" msgstr "" +"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) türü, " +"büyüyebilir, UTF-8 olarak kodlanmış bir dizedir (string):" #: src/std-types/string.md src/std-traits/comparisons.md #: src/std-traits/read-and-write.md src/memory-management/review.md @@ -7416,23 +7979,23 @@ msgstr "\"Merhaba\"" #: src/std-types/string.md msgid "\"s1: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"s1: uzunluk = {}, kapasite = {}\"" #: src/std-types/string.md msgid "'!'" -msgstr "" +msgstr "'!'" #: src/std-types/string.md msgid "\"s2: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"s2: uzunluk = {}, kapasite = {}\"" #: src/std-types/string.md msgid "\"🇨🇭\"" -msgstr "" +msgstr "\"🇹🇷\"" #: src/std-types/string.md msgid "\"s3: len = {}, number of chars = {}\"" -msgstr "" +msgstr "\"s3: uzunluk = {}, karakter sayısı = {}\"" #: src/std-types/string.md msgid "" @@ -7440,18 +8003,26 @@ msgid "" "string/struct.String.html#deref-methods-str), which means that you can call " "all `str` methods on a `String`." msgstr "" +"`String`, [`Deref`](https://doc.rust-lang.org/std/string/" +"struct.String.html#deref-methods-str) özelliğini gerçekleştirir (implement), " +"bu da bir `String` üzerinde tüm `str` metotlarını çağırabileceğiniz anlamına " +"gelir." #: src/std-types/string.md msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." msgstr "" +"`String::new` yeni bir boş dize geri döndürür, dizeye ne kadar veri eklemek " +"istediğinizi bildiğinizde `String::with_capacity` kullanın." #: src/std-types/string.md msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." msgstr "" +"`String::len`, `String`'in bayt cinsinden boyutunu geri döndürür (bu, " +"karakter cinsinden uzunluğundan farklı olabilir)." #: src/std-types/string.md msgid "" @@ -7460,34 +8031,48 @@ msgid "" "to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" +"`String::chars`, gerçek karakterler üzerinde bir adımlayıcı (iterator) geri " +"döndürür. [yazıbirim (grapheme) kümeleri](https://docs.rs/unicode-" +"segmentation/latest/unicode_segmentation/struct.Graphemes.html) nedeniyle " +"bir `char`'ın bir insanın \"karakter\" olarak kabul edeceği şeyden farklı " +"olabileceğini unutmayın." #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" +"İnsanlar dizelerden (strings) bahsettiğinde, ya `&str` ya da `String`'den " +"bahsediyor olabilirler." #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" +"Bir tür `Deref`'yi gerçekleştirdiğinde (implement), derleyici " +"`T`'den metotları şeffaf bir şekilde çağırmanıza izin verir." #: src/std-types/string.md msgid "" "We haven't discussed the `Deref` trait yet, so at this point this mostly " "explains the structure of the sidebar in the documentation." msgstr "" +"`Deref` özelliğini (trait) henüz tartışmadık, bu yüzden bu noktada bu " +"çoğunlukla dokümantasyondaki kenar çubuğunun yapısını (neden String türünün " +"altında str metodlarının da görüldüğünü) açıklar." #: src/std-types/string.md msgid "" "`String` implements `Deref` which transparently gives it " "access to `str`'s methods." msgstr "" +"`String`, `Deref` özelliğini gerçekleştirir (implement) ve bu " +"ona şeffaf bir şekilde `str`'nin metotlarına erişim sağlar." #: src/std-types/string.md msgid "Write and compare `let s3 = s1.deref();` and `let s3 = &*s1;`." -msgstr "" +msgstr "`let s3 = s1.deref();` ve `let s3 = &*s1;` yazıp karşılaştırın." #: src/std-types/string.md msgid "" @@ -7495,22 +8080,29 @@ msgid "" "operations you see supported on vectors are also supported on `String`, but " "with some extra guarantees." msgstr "" +"`String`, bir bayt vektörü etrafında bir sarmalayıcı (wrapper) olarak " +"gerçekleştirilmiştir (implement), vektörlerde desteklenen birçok işlem " +"`String`'de de desteklenir, ancak bazı ek garantilerle." #: src/std-types/string.md msgid "Compare the different ways to index a `String`:" -msgstr "" +msgstr "Bir `String`'e erimenin farklı yollarını karşılaştırın:" #: src/std-types/string.md msgid "" "To a character by using `s3.chars().nth(i).unwrap()` where `i` is in-bound, " "out-of-bounds." msgstr "" +"`i`'nin sınırlar içinde veya dışında olduğu `s3.chars().nth(i).unwrap()` " +"kullanarak bir karaktere erişmek." #: src/std-types/string.md msgid "" "To a substring by using `s3[0..4]`, where that slice is on character " "boundaries or not." msgstr "" +"Bu dilimin (slice) karakter sınırlarına denk gelip gelmediği durumlarda " +"`s3[0..4]` kullanarak bir alt dizeye erişmek." #: src/std-types/string.md msgid "" @@ -7520,36 +8112,45 @@ msgid "" "`Display`, so anything that can be formatted can also be converted to a " "string." msgstr "" +"Birçok tür, [`to_string`](https://doc.rust-lang.org/std/string/trait." +"ToString.html#tymethod.to_string) metodu ile bir dizeye dönüştürülebilir. Bu " +"özellik (trait), `Display`'i gerçekleştiren (implement) tüm türler için " +"otomatik olarak gerçekleştirilir, bu nedenle biçimlendirilebilen (format) " +"her şey bir dizeye de dönüştürülebilir." #: src/std-types/vec.md msgid "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) is the standard " "resizable heap-allocated buffer:" msgstr "" +"[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html), standart yeniden " +"boyutlandırılabilir dinamik bellekten tahsis edilen arabellektir (heap-" +"allocated buffer):" #: src/std-types/vec.md msgid "\"v1: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"v1: uzunluk = {}, kapasite = {}\"" #: src/std-types/vec.md msgid "\"v2: len = {}, capacity = {}\"" -msgstr "" +msgstr "\"v2: uzunluk = {}, kapasite = {}\"" #: src/std-types/vec.md msgid "// Canonical macro to initialize a vector with elements.\n" msgstr "" +"// Bir vektörü elemanlarla ilklendirmek (initialize) için standart makro.\n" #: src/std-types/vec.md msgid "// Retain only the even elements.\n" -msgstr "" +msgstr "// Sadece çift elemanları tut.\n" #: src/std-types/vec.md msgid "\"{v3:?}\"" -msgstr "" +msgstr "\"{v3:?}\"" #: src/std-types/vec.md msgid "// Remove consecutive duplicates.\n" -msgstr "" +msgstr "// Ardışık kopyaları sil.\n" #: src/std-types/vec.md msgid "" @@ -7557,6 +8158,9 @@ msgid "" "struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " "methods on a `Vec`." msgstr "" +"`Vec`, [`Deref`](https://doc.rust-lang.org/std/vec/struct.Vec." +"html#deref-methods-%5BT%5D) özelliğini gerçekleştirir (implement), bu da bir " +"`Vec` üzerinde dilim (slice) metotlarını çağırabileceğiniz anlamına gelir." #: src/std-types/vec.md msgid "" @@ -7564,6 +8168,10 @@ msgid "" "it contains is stored on the heap. This means the amount of data doesn't " "need to be known at compile time. It can grow or shrink at runtime." msgstr "" +"`Vec`, `String` ve `HashMap` ile birlikte bir koleksiyon türüdür. İçerdiği " +"veriler dinamik bellekte (heap) saklanır. Bu, veri miktarının derleme " +"zamanında bilinmesi gerekmediği anlamına gelir. Çalışma zamanında " +"büyüyebilir veya küçülebilir." #: src/std-types/vec.md msgid "" @@ -7571,12 +8179,18 @@ msgid "" "explicitly. As always with Rust type inference, the `T` was established " "during the first `push` call." msgstr "" +"`Vec`'nin de genelleştirilmiş (generic) bir tür olduğuna, ancak `T`'yi " +"açıkça belirtmek zorunda olmadığınıza dikkat edin. Rust tür çıkarımında " +"(type inference) her zaman olduğu gibi, `T` ilk `push` çağrısı sırasında " +"belirlenmiştir." #: src/std-types/vec.md msgid "" "`vec![...]` is a canonical macro to use instead of `Vec::new()` and it " "supports adding initial elements to the vector." msgstr "" +"`vec![...]`, `Vec::new()` yerine kullanılacak standart bir makrodur ve " +"vektöre başlangıç elemanları eklemeyi destekler." #: src/std-types/vec.md msgid "" @@ -7584,57 +8198,59 @@ msgid "" "Alternatively, using `get` will return an `Option`. The `pop` function will " "remove the last element." msgstr "" - -#: src/std-types/vec.md -msgid "" -"Slices are covered on day 3. For now, students only need to know that a " -"value of type `Vec` gives access to all of the documented slice methods, too." -msgstr "" +"Vektörün elemanlarına erişmek için `[` `]` kullanırsınız, ancak sınırlar " +"dışındaysa paniğe (panic) neden olurlar. Alternatif olarak, `get` kullanmak " +"bir `Option` geri döndürür. `pop` fonksiyonu son elemanı siler." #: src/std-types/hashmap.md msgid "Standard hash map with protection against HashDoS attacks:" msgstr "" +"HashDoS saldırılarına karşı korumalı standart özet haritası (hash map):" #: src/std-types/hashmap.md msgid "\"Adventures of Huckleberry Finn\"" -msgstr "" +msgstr "\"Fadiş\"" #: src/std-types/hashmap.md msgid "\"Grimms' Fairy Tales\"" -msgstr "" +msgstr "\"Dede Korkut Hikayeleri\"" #: src/std-types/hashmap.md msgid "\"Pride and Prejudice\"" -msgstr "" +msgstr "\"Aşk-ı Memnu\"" #: src/std-types/hashmap.md msgid "\"Les Misérables\"" -msgstr "" +msgstr "\"İnce Mehmed\"" #: src/std-types/hashmap.md msgid "\"We know about {} books, but not Les Misérables.\"" -msgstr "" +msgstr "\"{} kitap hakkında bilgimiz var, ama İnce Mehmed hakkında yok.\"" #: src/std-types/hashmap.md msgid "\"Alice's Adventure in Wonderland\"" -msgstr "" +msgstr "\"Keloğlan Masalları \"" #: src/std-types/hashmap.md msgid "\"{book}: {count} pages\"" -msgstr "" +msgstr "\"{book}: {count} sayfa\"" #: src/std-types/hashmap.md msgid "\"{book} is unknown.\"" -msgstr "" +msgstr "\"{book} bilinmiyor.\"" #: src/std-types/hashmap.md msgid "// Use the .entry() method to insert a value if nothing is found.\n" msgstr "" +"// Eğer bir şey bulunmazsa bir değer eklemek için .entry() metodunu " +"kullanın.\n" #: src/std-types/hashmap.md msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." msgstr "" +"`HashMap`, başlangıç (prelude) kısmında tanımlı değildir ve kapsama (scope) " +"alınması gerekir." #: src/std-types/hashmap.md msgid "" @@ -7642,18 +8258,21 @@ msgid "" "hashmap and if not return an alternative value. The second line will insert " "the alternative value in the hashmap if the book is not found." msgstr "" +"Aşağıdaki kod satırlarını deneyin. İlk satır bir kitabın hash haritasında " +"olup olmadığına bakar ve yoksa alternatif bir değer geri döndürür. İkinci " +"satır, kitap bulunmazsa alternatif değeri hash haritasına ekler." #: src/std-types/hashmap.md msgid "\"Harry Potter and the Sorcerer's Stone\"" -msgstr "" +msgstr "\"Osmanlı Cadısı\"" #: src/std-types/hashmap.md msgid "\"The Hunger Games\"" -msgstr "" +msgstr "\"Gri Gökyüzü \"" #: src/std-types/hashmap.md msgid "Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." -msgstr "" +msgstr "`vec!`'in aksine, maalesef standart bir `hashmap!` makrosu yoktur." #: src/std-types/hashmap.md msgid "" @@ -7662,12 +8281,19 @@ msgid "" "From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " "us to easily initialize a hash map from a literal array:" msgstr "" +"Ancak, Rust 1.56'dan beri, HashMap [`From<[(K, V); N]>`](https://doc.rust-" +"lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K,+V);" +"+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) özelliğini (trait) " +"gerçekleştirir (implement), bu da bir özet haritasını (hash map) bir " +"değişmez (literal) diziden kolayca ilklendirmemize (initialize) olanak tanır:" #: src/std-types/hashmap.md msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." msgstr "" +"Alternatif olarak HashMap, anahtar-değer (key-value) demetleri (tuple) " +"üreten herhangi bir `Iterator`'dan oluşturulabilir." #: src/std-types/hashmap.md msgid "" @@ -7676,6 +8302,10 @@ msgid "" "Rust docs. Show students the docs for this type, and the helpful link back " "to the `keys` method." msgstr "" +"Bu tür, `std::collections::hash_map::Keys` gibi birkaç \"metoda özgü\" geri " +"dönüş türüne sahiptir. Bu türler genellikle Rust belgelerindeki aramalarda " +"görünür. Öğrencilere bu türün belgelerini ve `keys` metoduna geri dönen " +"yardımcı bağlantıyı gösterin." #: src/std-types/exercise.md msgid "" @@ -7684,6 +8314,10 @@ msgid "" "stable/std/collections/struct.HashMap.html) to keep track of which values " "have been seen and how many times each one has appeared." msgstr "" +"Bu alıştırmada çok basit bir veri yapısı alıp onu genelleştirilmiş (generic) " +"hale getireceksiniz. Hangi değerlerin görüldüğünü ve her birinin kaç kez " +"göründüğünü takip etmek için bir [`std::collections::HashMap`](https://doc." +"rust-lang.org/stable/std/collections/struct.HashMap.html) kullanır." #: src/std-types/exercise.md msgid "" @@ -7691,6 +8325,10 @@ msgid "" "values. Make the struct and its methods generic over the type of value being " "tracked, that way `Counter` can track any type of value." msgstr "" +"`Counter`'ın ilk sürümü sadece `u32` değerleri için çalışacak şekilde sabit " +"kodlanmıştır. Yapıyı ve metotlarını, izlenen değerin türü üzerinde " +"genelleştirme (generic) yapın, bu şekilde `Counter` her tür değeri " +"izleyebilir." #: src/std-types/exercise.md msgid "" @@ -7698,281 +8336,43 @@ msgid "" "stable/std/collections/struct.HashMap.html#method.entry) method to halve the " "number of hash lookups required to implement the `count` method." msgstr "" +"Eğer erken bitirirseniz, `count` metodunu gerçekleştirmek (implement) için " +"gereken özet (hash) arama sayısını yarıya indirmek için [`entry`](https://" +"doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.entry) " +"metodunu kullanmayı deneyin." #: src/std-types/exercise.md src/std-types/solution.md msgid "" "/// Counter counts the number of times each value of type T has been seen.\n" -msgstr "" +msgstr "/// Counter, T türündeki her bir değerin kaç kez görüldüğünü sayar.\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Create a new Counter.\n" -msgstr "" +msgstr "/// Yeni bir Counter oluştur.\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Count an occurrence of the given value.\n" -msgstr "" +msgstr "/// Verilen değerin bir tekrarını say.\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Return the number of times the given value has been seen.\n" -msgstr "" +msgstr "/// Verilen değerin kaç kez görüldüğünü geri döndür.\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"saw {} values equal to {}\"" -msgstr "" +msgstr "\"{} değer {}`e eşit görüldü\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"apple\"" -msgstr "" +msgstr "\"elma\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"orange\"" -msgstr "" +msgstr "\"portakal\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"got {} apples\"" -msgstr "" - -#: src/closures.md src/concurrency/threads.md src/concurrency/shared-state.md -msgid "This segment should take about 30 minutes. It contains:" -msgstr "Bu bölüm yaklaşık 30 dakika sürmelidir. İçeriği:" - -#: src/closures/syntax.md -msgid "Closures are created with vertical bars: `|..| ..`." -msgstr "" - -#: src/closures/syntax.md -msgid "// Argument and return type can be inferred for lightweight syntax:\n" -msgstr "" - -#: src/closures/syntax.md -msgid "// Or we can specify types and bracket the body to be fully explicit:\n" -msgstr "" - -#: src/closures/syntax.md -msgid "" -"The arguments go between the `|..|`. The body can be surrounded by `{ .. }`, " -"but if it is a single expression these can be omitted." -msgstr "" - -#: src/closures/syntax.md -msgid "" -"Argument types are optional, and are inferred if not given. The return type " -"is also optional, but can only be written if using `{ .. }` around the body." -msgstr "" - -#: src/closures/syntax.md -msgid "" -"The examples can both be written as mere nested functions instead -- they do " -"not capture any variables from their lexical environment. We will see " -"captures next." -msgstr "" - -#: src/closures/syntax.md -msgid "" -"The ability to store functions in variables doesn't just apply to closures, " -"regular functions can be put in variables and then invoked the same way that " -"closures can: [Example in the playground](https://play.rust-lang.org/?" -"version=stable&mode=debug&edition=2024&gist=817cbeeefc49f3d0d180a3d6d54c8bda)." -msgstr "" - -#: src/closures/syntax.md -msgid "" -"The linked example also demonstrates that closures that don't capture " -"anything can also coerce to a regular function pointer." -msgstr "" - -#: src/closures/capturing.md -msgid "" -"A closure can capture variables from the environment where it was defined." -msgstr "" - -#: src/closures/capturing.md -msgid "" -"By default, a closure captures values by reference. Here `max_value` is " -"captured by `clamp`, but still available to `main` for printing. Try making " -"`max_value` mutable, changing it, and printing the clamped values again. Why " -"doesn't this work?" -msgstr "" - -#: src/closures/capturing.md -msgid "" -"If a closure mutates values, it will capture them by mutable reference. Try " -"adding `max_value += 1` to `clamp`." -msgstr "" - -#: src/closures/capturing.md -msgid "" -"You can force a closure to move values instead of referencing them with the " -"`move` keyword. This can help with lifetimes, for example if the closure " -"must outlive the captured values (more on lifetimes later)." -msgstr "" - -#: src/closures/capturing.md -msgid "" -"This looks like `move |v| ..`. Try adding this keyword and see if `main` can " -"still access `max_value` after defining `clamp`." -msgstr "" - -#: src/closures/capturing.md -msgid "" -"By default, closures will capture each variable from an outer scope by the " -"least demanding form of access they can (by shared reference if possible, " -"then exclusive reference, then by move). The `move` keyword forces capture " -"by value." -msgstr "" - -#: src/closures/traits.md -msgid "Closure traits" -msgstr "Çevreleyici özellikler (Closures traits)" - -#: src/closures/traits.md -msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" -msgstr "" - -#: src/closures/traits.md -msgid "" -"The special types `fn(..) -> T` refer to function pointers - either the " -"address of a function, or a closure that captures nothing." -msgstr "" - -#: src/closures/traits.md -msgid "\"Calling {func_name}({input}): {}\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"-itis\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"{x}{suffix}\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"add_suffix\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"senior\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"appenix\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"/\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"accumulate\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"red\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"green\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"blue\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"take_and_reverse\"" -msgstr "" - -#: src/closures/traits.md -msgid "\"reversed: \"" -msgstr "" - -#: src/closures/traits.md -msgid "" -"An `Fn` (e.g. `add_suffix`) neither consumes nor mutates captured values. It " -"can be called needing only a shared reference to the closure, which means " -"the closure can be executed repeatedly and even concurrently." -msgstr "" - -#: src/closures/traits.md -msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " -"object is accessed via exclusive reference, so it can be called repeatedly " -"but not concurrently." -msgstr "" - -#: src/closures/traits.md -msgid "" -"If you have an `FnOnce` (e.g. `take_and_reverse`), you may only call it " -"once. Doing so consumes the closure and any values captured by move." -msgstr "" - -#: src/closures/traits.md -msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." -msgstr "" - -#: src/closures/traits.md -msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." -msgstr "" - -#: src/closures/traits.md -msgid "" -"In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(which can be passed to a consumer of any of the 3 closure traits), then " -"`FnMut`, and lastly `FnOnce`." -msgstr "" - -#: src/closures/traits.md -msgid "" -"The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g. " -"`take_and_reverse`), depending on what the closure captures. Function " -"pointers (references to `fn` items) implement `Copy` and `Fn`." -msgstr "" - -#: src/closures/exercise.md -msgid "" -"Building on the generic logger from this morning, implement a `Filter` which " -"uses a closure to filter log messages, sending those which pass the " -"filtering predicate to an inner logger." -msgstr "" - -#: src/closures/exercise.md -msgid "// TODO: Define and implement `Filter`.\n" -msgstr "" - -#: src/closures/exercise.md src/closures/solution.md -msgid "\"yikes\"" -msgstr "" - -#: src/closures/exercise.md src/closures/solution.md -msgid "\"yikes, something went wrong\"" -msgstr "" - -#: src/closures/exercise.md src/closures/solution.md -msgid "\"uhoh\"" -msgstr "" - -#: src/closures/solution.md -msgid "/// Only log messages matching a filtering predicate.\n" -msgstr "" - -#: src/closures/solution.md -msgid "" -"Note that the `P: Fn(u8, &str) -> bool` bound on the first `Filter` impl " -"block isn't strictly necessary, but it helps with type inference when " -"calling `new`. Demonstrate removing it and showing how the compiler now " -"needs type annotations for the closure passed to `new`." -msgstr "" +msgstr "\"{} elma alındı\"" #: src/std-traits.md msgid "From and Into" @@ -7984,33 +8384,40 @@ msgstr "Read ve Write" #: src/std-traits.md msgid "Default, struct update syntax" -msgstr "Varsayılan, yapı (struct) güncelleme sözdizimi" +msgstr "Default, yapı güncelleme sözdizimi (struct update syntax)" #: src/std-traits.md msgid "" "As with the standard-library types, spend time reviewing the documentation " "for each trait." msgstr "" +"Standart kütüphane türlerinde olduğu gibi, her bir özellik (trait) için de " +"dokümantasyonu gözden geçirmeye zaman ayırın." #: src/std-traits.md msgid "This section is long. Take a break midway through." -msgstr "" +msgstr "Bu bölüm uzun. Ortasında bir mola verin." #: src/std-traits/comparisons.md msgid "" "These traits support comparisons between values. All traits can be derived " "for types containing fields that implement these traits." msgstr "" +"Bu özellikler (traits), değerler arasında karşılaştırmaları destekler. Tüm " +"özellikler, bu özellikleri gerçekleştiren (implement) alanlar içeren türler " +"için türetilebilir." #: src/std-traits/comparisons.md msgid "`PartialEq` and `Eq`" -msgstr "" +msgstr "`PartialEq` ve `Eq`" #: src/std-traits/comparisons.md msgid "" "`PartialEq` is a partial equivalence relation, with required method `eq` and " "provided method `ne`. The `==` and `!=` operators will call these methods." msgstr "" +"`PartialEq`, gerekli metot `eq` ve sağlanan metot `ne` ile kısmi bir denklik " +"ilişkisidir. `==` ve `!=` operatörleri bu metotları çağırır." #: src/std-traits/comparisons.md msgid "" @@ -8018,32 +8425,42 @@ msgid "" "and implies `PartialEq`. Functions that require full equivalence will use " "`Eq` as a trait bound." msgstr "" +"`Eq` tam bir denklik ilişkisidir (yansımalı, simetrik ve geçişme) " +"(reflexive, symmetric, and transitive) ve `PartialEq` özelliğini kapsar " +"(imply). Tam denklik gerektiren fonksiyonlar, bir özellik sınırı (trait " +"bound) olarak `Eq` kullanır." #: src/std-traits/comparisons.md msgid "`PartialOrd` and `Ord`" -msgstr "" +msgstr "`PartialOrd` ve `Ord`" #: src/std-traits/comparisons.md msgid "" "`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " "used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" +"`PartialOrd`, `partial_cmp` metoduyla kısmi bir sıralama tanımlar. `<`, " +"`<=`, `>=` ve `>` operatörlerini gerçekleştirmek (implement) için kullanılır." #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." -msgstr "" +msgstr "`Ord`, `cmp`'nin `Ordering` geri döndürdüğü tam bir sıralamadır." #: src/std-traits/comparisons.md msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" msgstr "" +"`PartialEq` farklı türler arasında gerçekleştirilebilir (implement), ancak " +"`Eq` yansımalı (reflexive) olduğu için gerçekleştirilemez:" #: src/std-traits/comparisons.md msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." msgstr "" +"Pratikte bu özellikleri (traits) türetmek (derive) yaygındır, ancak onları " +"gerçekleştirmek (implement) yaygın değildir." #: src/std-traits/comparisons.md msgid "" @@ -8052,25 +8469,34 @@ msgid "" "references to two different things can compare as equal if the values " "pointed to are the same:" msgstr "" +"Rust'ta referansları karşılaştırırken, gösterdikleri şeylerin değerini " +"karşılaştırır, referansların kendilerini DEĞİL. Bu, gösterilen değerler " +"aynıysa, iki farklı şeye yapılan referansların eşit olarak " +"karşılaştırılabileceği anlamına gelir:" #: src/std-traits/operators.md msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." "rust-lang.org/std/ops/index.html):" msgstr "" +"Operatör yüklemesi (overloading), [`std::ops`](https://doc.rust-lang.org/std/" +"ops/index.html)'deki özellikler (traits) aracılığıyla gerçekleştirilir " +"(implement):" #: src/std-traits/operators.md msgid "\"{p1:?} + {p2:?} = {:?}\"" -msgstr "" +msgstr "\"{p1:?} + {p2:?} = {:?}\"" #: src/std-traits/operators.md src/memory-management/drop.md msgid "Discussion points:" -msgstr "" +msgstr "Tartışma noktaları:" #: src/std-traits/operators.md msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" +"`&Point` için `Add`'i gerçekleştirebilirsiniz (implement). Bu hangi " +"durumlarda kullanışlıdır?" #: src/std-traits/operators.md msgid "" @@ -8078,12 +8504,17 @@ msgid "" "the operator is not `Copy`, you should consider overloading the operator for " "`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" +"Cevap: `Add:add`, `self`'i tüketir. Operatörü yüklediğiniz `T` türü `Copy` " +"değilse, operatörü `&T` için de yüklemey yapmayı (overloading) " +"düşünmelisiniz. Bu, çağrı yerleride (call site) gereksiz klonlamayı önler." #: src/std-traits/operators.md msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" +"`Output` neden bir ilişkili türdür (associated type)? Metodun bir tür " +"parametresi yapılabilir miydi?" #: src/std-traits/operators.md msgid "" @@ -8091,12 +8522,17 @@ msgid "" "associated types (like `Output`) are controlled by the implementer of a " "trait." msgstr "" +"Kısa cevap: Fonksiyon tür parametreleri çağıran (caller) tarafından kontrol " +"edilir, ancak ilişkili türler (`Output` gibi) bir özelliğin (trait) " +"gerçekleştiricisi (implementer) tarafından kontrol edilir." #: src/std-traits/operators.md msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." msgstr "" +"İki farklı tür için `Add` gerçekleştirebilirsiniz (implement), örn. `impl " +"Add<(i32, i32)> for Point`, bu bir `Point`'e bir demet (tuple) eklerdi." #: src/std-traits/operators.md msgid "" @@ -8105,6 +8541,10 @@ msgid "" "negates each bit of the number, which arithmetically is equivalent to " "subtracting it from -1: `!5 == -6`." msgstr "" +"`Not` özelliği (`!` operatörü), C ailesi dillerindeki aynı operatör gibi " +"\"boole'laştırmadığı\" için dikkat çekicidir; bunun yerine, tamsayı türleri " +"için sayının her bitini olumsuzlar, bu da aritmetik olarak onu -1'den " +"çıkarmaya eşdeğerdir: `!5 == -6`." #: src/std-traits/from-and-into.md msgid "" @@ -8113,10 +8553,14 @@ msgid "" "facilitate type conversions. Unlike `as`, these traits correspond to " "lossless, infallible conversions." msgstr "" +"Türler, tür dönüşümlerini kolaylaştırmak için [`From`](https://doc.rust-lang." +"org/std/convert/trait.From.html) ve [`Into`](https://doc.rust-lang.org/std/" +"convert/trait.Into.html) özelliklerini gerçekleştirir (implement). `as`'in " +"aksine, bu özellikler (traits) kayıpsız, hatasız dönüşümlere karşılık gelir." #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" -msgstr "" +msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" @@ -8124,12 +8568,17 @@ msgid "" "automatically implemented when [`From`](https://doc.rust-lang.org/std/" "convert/trait.From.html) is implemented:" msgstr "" +"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) " +"gerçekleştirildiğinde (implement) [`Into`](https://doc.rust-lang.org/std/" +"convert/trait.Into.html) otomatik olarak gerçekleştirilir:" #: src/std-traits/from-and-into.md msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." msgstr "" +"Bu yüzden sadece `From`'u gerçekleştirmek (implement) yaygındır, çünkü " +"türünüz `Into` gerçekleştirmesini de alacaktır." #: src/std-traits/from-and-into.md msgid "" @@ -8138,24 +8587,31 @@ msgid "" "Your function will accept types that implement `From` and those that _only_ " "implement `Into`." msgstr "" +"\"Bir `String`'e dönüştürülebilen herhangi bir şey\" gibi bir fonksiyon " +"argümanı girdi türü bildirirken, kural tam tersidir, `Into` kullanmalısınız. " +"Fonksiyonunuz `From`'u gerçekleştiren (implement) türleri ve _sadece_ " +"`Into`'yu gerçekleştirenleri kabul edecektir." #: src/std-traits/casting.md msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." msgstr "" +"Rust'ta _örtük (implicit)_ tür dönüşümleri yoktur, ancak `as` ile açık " +"(explicit) tür dönüştürmelerini (casts) destekler. Bunlar genellikle " +"tanımlandıkları yerlerde C semantiğini takip eder." #: src/std-traits/casting.md msgid "\"as u16: {}\"" -msgstr "" +msgstr "\"u16 olarak: {}\"" #: src/std-traits/casting.md msgid "\"as i16: {}\"" -msgstr "" +msgstr "\"i16 olarak: {}\"" #: src/std-traits/casting.md msgid "\"as u8: {}\"" -msgstr "" +msgstr "\"u8 olarak: {}\"" #: src/std-traits/casting.md msgid "" @@ -8163,6 +8619,10 @@ msgid "" "platforms. This might not match your intuition for changing sign or casting " "to a smaller type -- check the docs, and comment for clarity." msgstr "" +"`as`'in sonuçları Rust'ta _her zaman_ tanımlıdır ve platformlar arasında " +"tutarlıdır. Bu, işaret (sign) değiştirme veya daha küçük bir türe dönüştürme " +"(cast) konusundaki sezginizle uyuşmayabilir -- belgeleri kontrol edin ve " +"açıklık için yorum yapın." #: src/std-traits/casting.md msgid "" @@ -8173,6 +8633,12 @@ msgid "" "selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " "was in the high bits)." msgstr "" +"`as` ile dönüştürme (cast), yanlış kullanılması kolay olan nispeten keskin " +"bir araçtır ve gelecekteki bakım çalışmaları (maintenance work) kullanılan " +"türleri veya türlerdeki değer aralıklarını değiştirdikçe ince hataların " +"kaynağı olabilir. Tür dnüştürmesi en iyi, niyetin koşulsuz olarak kesmeyi " +"belirtmek olduğu durumlarda kullanılır (örneğin, yüksek bitlerde ne olursa " +"olsun bir `u64`'ün alt 32 bitini `as u32` ile seçmek)." #: src/std-traits/casting.md msgid "" @@ -8181,10 +8647,15 @@ msgid "" "casts, `TryFrom` and `TryInto` are available when you want to handle casts " "that fit differently from those that don't." msgstr "" +"Hatasız tür dönüştürmeleri (cast) için (örneğin `u32`'den `u64`'e), " +"dönüşümün gerçekten hatasız olduğunu doğrulamak için `as` yerine `From` veya " +"`Into` kullanmayı tercih edin. Hatalı olabilecek dönüştürmeler (cast) için, " +"uyan ve uymayan dnüştürmeleri (cast) ele almak istediğinizde `TryFrom` ve " +"`TryInto` mevcuttur." #: src/std-traits/casting.md msgid "Consider taking a break after this slide." -msgstr "" +msgstr "Bu slayttan sonra bir mola vermeyi düşünün." #: src/std-traits/casting.md msgid "" @@ -8192,10 +8663,15 @@ msgid "" "be lost is generally discouraged, or at least deserves an explanatory " "comment." msgstr "" +"`as`, C++'daki bir statik dönüştürmeye (static cast) benzer. Veri kaybı " +"olabilecek durumlarda `as` kullanımı genellikle önerilmez veya en azından " +"açıklayıcı bir yorumu hak eder." #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" +"Bu, tamsayıları bir indeks olarak kullanmak üzere `usize`'a dönüştürürken " +"yaygındır." #: src/std-traits/read-and-write.md msgid "" @@ -8203,36 +8679,41 @@ msgid "" "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " "abstract over `u8` sources:" msgstr "" +"[`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) ve [`BufRead`]" +"(https://doc.rust-lang.org/std/io/trait.BufRead.html) kullanarak, `u8` " +"kaynakları üzerinde soyutlama yapabilirsiniz:" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" -msgstr "" +msgstr "b\"foo\\nbar\\nbaz\\n\"" #: src/std-traits/read-and-write.md msgid "\"lines in slice: {}\"" -msgstr "" +msgstr "\"dilimdeki (slice) satırlar: {}\"" #: src/std-traits/read-and-write.md msgid "\"lines in file: {}\"" -msgstr "" +msgstr "\"dosyadaki satırlar: {}\"" #: src/std-traits/read-and-write.md msgid "" "Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " "you abstract over `u8` sinks:" msgstr "" +"Benzer şekilde, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) " +"`u8` alıcıları (sinks) üzerinde soyutlama yapmanızı sağlar:" #: src/std-traits/read-and-write.md msgid "\"\\n\"" -msgstr "" +msgstr "\"\\n\"" #: src/std-traits/read-and-write.md msgid "\"Logged: {buffer:?}\"" -msgstr "" +msgstr "\"Kaydedildi: {buffer:?}\"" #: src/std-traits/default.md msgid "The `Default` Trait" -msgstr "" +msgstr "`Default` Özelliği (Trait)" #: src/std-traits/default.md msgid "" @@ -8240,46 +8721,58 @@ msgid "" "trait produces a default value for a type." msgstr "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -"özelliği (trait) bir tür için varsayılan bir değer üretir." +"özelliği (trait), bir tür için varsayılan bir değer üretir." #: src/std-traits/default.md msgid "\"John Smith\"" -msgstr "" +msgstr "\"Evliya Çelebi\"" #: src/std-traits/default.md msgid "\"Y is set!\"" -msgstr "" +msgstr "\"Y ayarlandı!\"" #: src/std-traits/default.md msgid "" "It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" +"Doğrudan gerçekleştirilebilir (implement) veya `#[derive(Default)]` " +"aracılığıyla türetilebilir." #: src/std-traits/default.md msgid "" "A derived implementation will produce a value where all fields are set to " "their default values." msgstr "" +"Türetilmiş bir gerçekleştirme (implementation), tüm alanların varsayılan " +"değerlerine ayarlandığı bir değer üretecektir." #: src/std-traits/default.md msgid "This means all types in the struct must implement `Default` too." msgstr "" +"Bu, yapıdaki (struct) tüm türlerin de `Default`'u gerçekleştirmesi " +"(implement) gerektiği anlamına gelir." #: src/std-traits/default.md msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." msgstr "" +"Standart Rust türleri genellikle `Default`'u makul değerlerle (ör. `0`, " +"`\"\"`, vb.) gerçekleştirir (implement)." #: src/std-traits/default.md msgid "The partial struct initialization works nicely with default." msgstr "" +"Kısmi yapı ilklendirmesi (partial struct initialization), default özelliği " +"ile güzel çalışır." #: src/std-traits/default.md msgid "" "The Rust standard library is aware that types can implement `Default` and " "provides convenience methods that use it." msgstr "" +"Rust standart kütüphanesi, türlerin `Default`'u gerçekleştirebileceğinin " +"(implement) farkındadır ve onu kullanan kullanışlı metotlar sağlar." #: src/std-traits/default.md msgid "" @@ -8287,6 +8780,9 @@ msgid "" "book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" "with-struct-update-syntax)." msgstr "" +"`..` sözdizimine [yapı güncelleme sözdizimi (struct update syntax)](https://" +"doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-" +"other-instances-with-struct-update-syntax) denir." #: src/std-traits/exercise.md msgid "" @@ -8295,24 +8791,31 @@ msgid "" "implement the missing bits. Only rotate ASCII alphabetic characters, to " "ensure the result is still valid UTF-8." msgstr "" +"Bu örnekte, klasik [\"ROT13\" şifresini](https://en.wikipedia.org/wiki/" +"ROT13) gerçekleştireceksiniz (implement). Bu kodu deneme alanına " +"(playground) kopyalayın ve eksik kısımları gerçekleştirin. Sonucun hala " +"geçerli UTF-8 olduğundan emin olmak için yalnızca ASCII alfabetik " +"karakterleri döndürün." #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" -msgstr "" +msgstr "// `RotDecoder` için `Read` özelliğini (trait) gerçekleştirin.\n" #: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"Gb trg gb gur bgure fvqr!\"" -msgstr "" +msgstr "\"B gnensn ineznx tnlrfvlyr!\"" #: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"To get to the other side!\"" -msgstr "" +msgstr "\"O tarafa varmak gayesiyle!\"" #: src/std-traits/exercise.md msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" msgstr "" +"Her biri 13 karakter kaydırma (ROT13) yapan iki adet RotDecoder örneğini " +"ardı ardına (biri diğerinin çıktısını okuyarak) çalıştırırsan ne olur?" #: src/welcome-day-3.md msgid "Welcome to Day 3" @@ -11925,6 +12428,7 @@ msgstr "" #: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md #: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md #: src/bare-metal/aps/logging/using.md +#: src/unsafe-deep-dive/motivations/interop.md msgid "\"C\"" msgstr "" @@ -12283,6 +12787,13 @@ msgstr "" msgid "\"files: {:#?}\"" msgstr "" +#: src/unsafe-rust/exercise.md +msgid "" +"FFI binding code is typically generated by tools like [bindgen](https://" +"github.com/rust-lang/rust-bindgen), rather than being written manually as we " +"are doing here. However, bindgen can't run in an online playground." +msgstr "" + #: src/unsafe-rust/solution.md msgid "\"Invalid path: {err}\"" msgstr "" @@ -12518,7 +13029,7 @@ msgstr "" msgid "We will look at `rust_binary` and `rust_library` next." msgstr "" -#: src/android/build-rules.md +#: src/android/build-rules.md src/idiomatic/leveraging-the-type-system.md msgid "Additional items speaker may mention:" msgstr "" @@ -12869,12 +13380,6 @@ msgstr "" msgid "\"com.example.birthdayservice-rust\"" msgstr "" -#: src/android/aidl/example-service/service.md -#: src/android/aidl/example-service/server.md -#: src/android/aidl/example-service/client.md -msgid "\"libbinder_rs\"" -msgstr "" - #: src/android/aidl/example-service/service.md msgid "" "Point out the path to the generated `IBirthdayService` trait, and explain " @@ -17135,7 +17640,7 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs are broken " "out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" "can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" "crates.io/crates/rand_core) respectively." @@ -19302,6 +19807,7 @@ msgid "" msgstr "" #: src/concurrency/channels.md src/concurrency/async-control-flow.md +#: src/unsafe-deep-dive/motivations.md msgid "This segment should take about 20 minutes. It contains:" msgstr "Bu bölüm yaklaşık 20 dakika sürmelidir. İçeriği:" @@ -20214,11 +20720,11 @@ msgid "// Function has not begun yet.\n" msgstr "" #: src/concurrency/async/state-machine.md -msgid "// Waitig for first `.await` to complete.\n" +msgid "// Waiting for first `.await` to complete.\n" msgstr "" #: src/concurrency/async/state-machine.md -msgid "// Waitig for second `.await` to complete.\n" +msgid "// Waiting for second `.await` to complete.\n" msgstr "" #: src/concurrency/async/state-machine.md @@ -20295,6 +20801,7 @@ msgid "" msgstr "" #: src/concurrency/async/state-machine.md +#: src/unsafe-deep-dive/foundations/less-powerful.md msgid "\"{n}\"" msgstr "\"{n}\"" @@ -20312,12 +20819,6 @@ msgid "" "github.com/hyperium/tonic) for gRPC." msgstr "" -#: src/concurrency/async/runtimes.md -msgid "" -"[async-std](https://async.rs/): aims to be a \"std for async\", and includes " -"a basic runtime in `async::task`." -msgstr "" - #: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" msgstr "" @@ -21059,8 +21560,8 @@ msgid "" "[dependencies]\n" "futures-util = { version = \"0.3.31\", features = [\"sink\"] }\n" "http = \"1.3.1\"\n" -"tokio = { version = \"1.45.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.11.4\", features = [\"client\", " +"tokio = { version = \"1.47.1\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.12.1\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -21246,6 +21747,1360 @@ msgstr "" msgid "\"From server: {}\"" msgstr "" +#: src/idiomatic/welcome.md +#, fuzzy +msgid "Welcome to Idiomatic Rust" +msgstr "Comprehensive Rust'a Hoş Geldiniz 🦀" + +#: src/idiomatic/welcome.md +msgid "" +"[Rust Fundamentals](../welcome-day-1.md) introduced Rust syntax and core " +"concepts. We now want to go one step further: how do you use Rust " +"_effectively_ in your projects? What does _idiomatic_ Rust look like?" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"This course is opinionated: we will nudge you towards some patterns, and " +"away from others. Nonetheless, we do recognize that some projects may have " +"different needs. We always provide the necessary information to help you " +"make informed decisions within the context and constraints of your own " +"projects." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "⚠️ This course is under **active development**." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"The material may change frequently and there might be errors that have not " +"yet been spotted. Nonetheless, we encourage you to browse through and " +"provide early feedback!" +msgstr "" + +#: src/idiomatic/welcome.md +#, fuzzy +msgid "" +"Including 10 minute breaks, this session should take about 25 minutes. It " +"contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 45 dakika sürmelidir. " +"İçeriği:" + +#: src/idiomatic/welcome.md +msgid "" +"The course will cover the topics listed below. Each topic may be covered in " +"one or more slides, depending on its complexity and relevance." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Foundations of API design" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Golden rule: prioritize clarity and readability at the callsite. People will " +"spend much more time reading the call sites than declarations of the " +"functions being called." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Make your API predictable" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Follow naming conventions (case conventions, prefer vocabulary precedented " +"in the standard library - e.g., methods should be called \"push\" not " +"\"push_back\", \"is_empty\" not \"empty\" etc.)" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Know the vocabulary types and traits in the standard library, and use them " +"in your APIs. If something feels like a basic type/algorithm, check in the " +"standard library first." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Use well-established API design patterns that we will discuss later in this " +"class (e.g., newtype, owned/view type pairs, error handling)" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Write meaningful and effective doc comments (e.g., don't merely repeat the " +"method name with spaces instead of underscores, don't repeat the same " +"information just to fill out every markdown tag, provide usage examples)" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Leveraging the type system" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Short recap on enums, structs and type aliases" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Newtype pattern and encapsulation: parse, don't validate" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Extension traits: avoid the newtype pattern when you want to provide " +"additional behaviour" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"RAII, scope guards and drop bombs: using `Drop` to clean up resources, " +"trigger actions or enforce invariants" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"\"Token\" types: force users to prove they've performed a specific action" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"The typestate pattern: enforce correct state transitions at compile-time" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Using the borrow checker to enforce invariants that have nothing to do with " +"memory ownership" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "OwnedFd/BorrowedFd in the standard library" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "[Branded types](https://plv.mpi-sws.org/rustbelt/ghostcell/paper.pdf)" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Don't fight the borrow checker" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"\"Owned\" types and \"view\" types: `&str` and `String`, `Path` and " +"`PathBuf`, etc." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Don't hide ownership requirements: avoid hidden `.clone()`, learn to love " +"`Cow`" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Split types along ownership boundaries" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Structure your ownership hierarchy like a tree" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Strategies to manage circular dependencies: reference counting, using " +"indexes instead of references" +msgstr "" + +#: src/idiomatic/welcome.md +#, fuzzy +msgid "Interior mutability (Cell, RefCell)" +msgstr "İç Değişebilirlik (Interior Mutability)" + +#: src/idiomatic/welcome.md +msgid "Working with lifetime parameters on user-defined data types" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Polymorphism in Rust" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "A quick refresher on traits and generic functions" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Rust has no inheritance: what are the implications?" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Using enums for polymorphism" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Using traits for polymorphism" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Using composition" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "How do I pick the most appropriate pattern?" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Working with generics" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Generic type parameter in a function or trait object as an argument?" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Trait bounds don't have to refer to the generic parameter" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Type parameters in traits: should it be a generic parameter or an associated " +"type?" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Macros: a valuable tool to DRY up code when traits are not enough (or too " +"complex)" +msgstr "" + +#: src/idiomatic/welcome.md +msgid "What is the purpose of errors? Recovery vs. reporting." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Result vs. Option" +msgstr "" + +#: src/idiomatic/welcome.md +#, fuzzy +msgid "Designing good errors:" +msgstr "Kütüphane Tasarlama" + +#: src/idiomatic/welcome.md +msgid "Determine the error scope." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Capture additional context as the error flows upwards, crossing scope " +"boundaries." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Leverage the `Error` trait to keep track of the full error chain." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "Leverage `thiserror` to reduce boilerplate when defining error types." +msgstr "" + +#: src/idiomatic/welcome.md +msgid "" +"Distinguish fatal errors from recoverable errors using `Result, FatalError>`." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Rust's type system is _expressive_: you can use types and traits to build " +"abstractions that make your code harder to misuse." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"In some cases, you can go as far as enforcing correctness at _compile-time_, " +"with no runtime overhead." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Types and traits can model concepts and constraints from your business " +"domain. With careful design, you can improve the clarity and maintainability " +"of the entire codebase." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Rust's type system borrows a lot of ideas from functional programming " +"languages." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"For example, Rust's enums are known as \"algebraic data types\" in languages " +"like Haskell and OCaml. You can take inspiration from learning material " +"geared towards functional languages when looking for guidance on how to " +"design with types. [\"Domain Modeling Made Functional\"](https://pragprog." +"com/titles/swdddf/domain-modeling-made-functional/) is a great resource on " +"the topic, with examples written in F#." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Despite Rust's functional roots, not all functional design patterns can be " +"easily translated to Rust." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"For example, you must have a solid grasp on a broad selection of advanced " +"topics to design APIs that leverage higher-order functions and higher-kinded " +"types in Rust." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Evaluate, on a case-by-case basis, whether a more imperative approach may be " +"easier to implement. Consider using in-place mutation, relying on Rust's " +"borrow-checker and type system to control what can be mutated, and where." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"The same caution should be applied to object-oriented design patterns. Rust " +"doesn't support inheritance, and object decomposition should take into " +"account the constraints introduced by the borrow checker." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +msgid "" +"Mention that type-level programming can be often used to create \"zero-cost " +"abstractions\", although the label can be misleading: the impact on compile " +"times and code complexity may be significant." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system.md +#: src/unsafe-deep-dive/foundations.md +#, fuzzy +msgid "This segment should take about 25 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 15 dakika sürmelidir. İçeriği:" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "A _newtype_ is a wrapper around an existing type, often a primitive:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "/// A unique user identifier, implemented as a newtype around `u64`.\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "" +"Unlike type aliases, newtypes aren't interchangeable with the wrapped type:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "// 🛠️❌\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "" +"The Rust compiler won't let you use methods or operators defined on the " +"underlying type either:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "" +"Students should have encountered the newtype pattern in the \"Fundamentals\" " +"course, when they learned about [tuple structs](../../user-defined-types/" +"tuple-structs.md)." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "Run the example to show students the error message from the compiler." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "" +"Modify the example to use a typealias instead of a newtype, such as `type " +"MessageId = u64`. The modified example should compile, thus highlighting the " +"differences between the two approaches." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern.md +msgid "" +"Stress that newtypes, out of the box, have no behaviour attached to them. " +"You need to be intentional about which methods and operators you are willing " +"to forward from the underlying type. In our `UserId` example, it is " +"reasonable to allow comparisons between `UserId`s, but it wouldn't make " +"sense to allow arithmetic operations like addition or subtraction." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"When a function takes multiple arguments of the same type, call sites are " +"unclear:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "// [...]\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "\"password\"" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "\"username\"" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"// In another part of the codebase, we swap arguments by mistake.\n" +"// Bug (best case), security vulnerability (worst case)\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "The newtype pattern can prevent this class of errors at compile time:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"Run both examples to show students the successful compilation for the " +"original example, and the compiler error returned by the modified example." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"Stress the _semantic_ angle. The newtype pattern should be leveraged to use " +"distinct types for distinct concepts, thus ruling out this class of errors " +"entirely." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"Nonetheless, note that there are legitimate scenarios where a function may " +"take multiple arguments of the same type. In those scenarios, if correctness " +"is of paramount importance, consider using a struct with named fields as " +"input:" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"// No need to check the definition of the `login` function to spot the " +"issue.\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md +msgid "" +"Users are forced, at the callsite, to assign values to each field, thus " +"increasing the likelihood of spotting bugs." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "The newtype pattern can be leveraged to enforce _invariants_." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "// Other validation checks...\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "" +"The newtype pattern, combined with Rust's module and visibility system, can " +"be used to _guarantee_ that instances of a given type satisfy a set of " +"invariants." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "" +"In the example above, the raw `String` stored inside the `Username` struct " +"can't be accessed directly from other modules or crates, since it's not " +"marked as `pub` or `pub(in ...)`. Consumers of the `Username` type are " +"forced to use the `new` method to create instances. In turn, `new` performs " +"validation, thus ensuring that all instances of `Username` satisfy those " +"checks." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "" +"The `as_str` method allows consumers to access the raw string representation " +"(e.g., to store it in a database). However, consumers can't modify the " +"underlying value since `&str`, the returned type, restricts them to read-" +"only access." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "Type-level invariants have second-order benefits." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md +msgid "" +"The input is validated once, at the boundary, and the rest of the program " +"can rely on the invariants being upheld. We can avoid redundant validation " +"and \"defensive programming\" checks throughout the program, reducing noise " +"and improving performance." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "Is It Truly Encapsulated?" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "" +"You must evaluate _the entire API surface_ exposed by a newtype to determine " +"if invariants are indeed bullet-proof. It is crucial to consider all " +"possible interactions, including trait implementations, that may allow users " +"to bypass validation checks." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "// Validation checks...\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "// ‼️\n" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "" +"`DerefMut` allows users to get a mutable reference to the wrapped value." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "" +"The mutable reference can be used to modify the underlying data in ways that " +"may violate the invariants enforced by `Username::new`!" +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "" +"When auditing the API surface of a newtype, you can narrow down the review " +"scope to methods and traits that provide mutable access to the underlying " +"data." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "Remind students of privacy boundaries." +msgstr "" + +#: src/idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md +msgid "" +"In particular, functions and methods defined in the same module of the " +"newtype can access its underlying data directly. If possible, move the " +"newtype definition to its own separate module to reduce the scope of the " +"audit." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +#, fuzzy +msgid "Welcome to Unsafe Rust" +msgstr "1. Gün'e Hoş Geldiniz" + +#: src/unsafe-deep-dive/welcome.md +msgid "IMPORTANT: THIS MODULE IS IN AN EARLY STAGE OF DEVELOPMENT" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"Please do not consider this module of Comprehensive Rust to be complete. " +"With that in mind, your feedback, comments, and especially your concerns, " +"are very welcome." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"To comment on this module's development, please use the [GitHub issue " +"tracker](https://github.com/google/comprehensive-rust/issues)." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"The `unsafe` keyword is easy to type, but hard to master. When used " +"appropriately, it forms a useful and indeed essential part of the Rust " +"programming language." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"By the end of this deep dive, you'll know how to work with `unsafe` code, " +"review others' changes that include the `unsafe` keyword, and produce your " +"own." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +#, fuzzy +msgid "What you'll learn:" +msgstr "Ne görüyorsunuz:" + +#: src/unsafe-deep-dive/welcome.md +msgid "What the terms undefined behavior, soundness, and safety mean" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "Why the `unsafe` keyword exists in the Rust language" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "How to write your own code using `unsafe` safely" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "How to review `unsafe` code" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "Links to other sections of the course" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "The `unsafe` keyword has treatment in:" +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"_Rust Fundamentals_, the main module of Comprehensive Rust, includes a " +"session on [Unsafe Rust](../unsafe-rust.html) in its last day." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"_Rust in Chromium_ discusses how to [interoperate with C++](../chromium/" +"interoperability-with-cpp.md). Consult that material if you are looking into " +"FFI." +msgstr "" + +#: src/unsafe-deep-dive/welcome.md +msgid "" +"_Bare Metal Rust_ uses unsafe heavily to interact with the underlying host, " +"among other things." +msgstr "" + +#: src/unsafe-deep-dive/setup.md +msgid "Setting Up" +msgstr "" + +#: src/unsafe-deep-dive/setup.md +#, fuzzy +msgid "Local Rust installation" +msgstr "Kurulum" + +#: src/unsafe-deep-dive/setup.md +msgid "" +"You should have a Rust compiler installed that supports the 2024 edition of " +"the language, which is any version of rustc higher than 1.84." +msgstr "" + +#: src/unsafe-deep-dive/setup.md +msgid "(Optional) Create a local instance of the course" +msgstr "" + +#: src/unsafe-deep-dive/setup.md +msgid "" +"```console\n" +"$ git clone --depth=1 https://github.com/google/comprehensive-rust.git\n" +"Cloning into 'comprehensive-rust'...\n" +"...\n" +"$ cd comprehensive-rust\n" +"$ cargo install-tools\n" +"...\n" +"$ cargo serve # then open http://127.0.0.1:3000/ in a browser\n" +"```" +msgstr "" + +#: src/unsafe-deep-dive/setup.md +msgid "" +"Ask everyone to confirm that everyone is able to execute `rustc` with a " +"version older that 1.87." +msgstr "" + +#: src/unsafe-deep-dive/setup.md +msgid "" +"For those people who do not, tell them that we'll resolve that in the break." +msgstr "" + +#: src/unsafe-deep-dive/motivations.md +msgid "We know that writing code without the guarantees that Rust provides ..." +msgstr "" + +#: src/unsafe-deep-dive/motivations.md +msgid "" +"“Use-after-free (UAF), integer overflows, and out of bounds (OOB) reads/" +"writes comprise 90% of vulnerabilities with OOB being the most common.”" +msgstr "" + +#: src/unsafe-deep-dive/motivations.md +msgid "" +"\\--— **Jeff Vander Stoep and Chong Zang**, Google. \"[Queue the Hardening " +"Enhancements](https://security.googleblog.com/2019/05/queue-hardening-" +"enhancements.html)\"" +msgstr "" + +#: src/unsafe-deep-dive/motivations.md +msgid "... so why is `unsafe` part of the language?" +msgstr "" + +#: src/unsafe-deep-dive/motivations.md +#, fuzzy +msgid "1 minute" +msgstr "15 dakika" + +#: src/unsafe-deep-dive/motivations.md +msgid "" +"The `unsafe` keyword exists because there is no compiler technology " +"available today that makes it obsolete. Compilers cannot verify everything." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"TODO: Refactor this content into multiple slides as this slide is intended " +"as an introduction to the motivations only, rather than to be an elaborate " +"discussion of the whole problem." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Language interoperability allows you to:" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Call functions written in other languages from Rust" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Write functions in Rust that are callable from other languages" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "However, this requires unsafe." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "\"{a:?}\"" +msgstr "\"{:?}\"" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"The Rust compiler can't enforce any safety guarantees for programs that it " +"hasn't compiled, so it delegates that responsibility to you through the " +"unsafe keyword." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"The code example we're seeing shows how to call the random function provided " +"by libc within Rust. libc is available to scripts in the Rust Playground." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "This uses Rust's _foreign function interface_." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"This isn't the only style of interoperability, however it is the method " +"that's needed if you want to work between Rust and some other language in a " +"zero cost way. Another important strategy is message passing." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Message passing avoids unsafe, but serialization, allocation, data transfer " +"and parsing all take energy and time." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Answers to questions" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"_Where does \"random\" come from?_ \n" +"libc is dynamically linked to Rust programs by default, allowing our code to " +"rely on its symbols, including `random`, being available to our program." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"_What is the \"safe\" keyword?_ \n" +"It allows callers to call the function without needing to wrap that call in " +"`unsafe`. The [`safe` function qualifier](https://doc.rust-lang.org/stable/" +"edition-guide/rust-2024/unsafe-extern.html) was introduced in the 2024 " +"edition of Rust and can only be used within `extern` blocks. It was " +"introduced because `unsafe` became a mandatory qualifier for `extern` blocks " +"in that edition." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"_What is the [`std::ffi::c_long`](https://doc.rust-lang.org/std/ffi/type." +"c_long.html) type?_ \n" +"According to the C standard, an integer that's at least 32 bits wide. On " +"today's systems, It's an `i32` on Windows and an `i64` on Linux." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "Consideration: type safety" +msgstr "entegrasyon testi:" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Modify the code example to remove the need for type casting later. Discuss " +"the potential UB - long's width is defined by the target." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Changes from the original:" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"It's also possible to completely ignore the intended type and create " +"undefined behavior in multiple ways. The code below produces output most of " +"the time, but generally results in a stack overflow. It may also produce " +"illegal `char` values. Although `char` is represented in 4 bytes (32 bits), " +"[not all bit patterns are permitted as a `char`](https://doc.rust-lang.org/" +"std/primitive.char.html#validity-and-layout)." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Stress that the Rust compiler will trust that the wrapper is telling the " +"truth." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Attempting to print a `[char; 2]` from randomly generated input will often " +"produce strange output, including:" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Mention that type safety is generally not a large concern in practice. Tools " +"that produce wrappers automatically, i.e. bindgen, are excellent at reading " +"header files and producing values of the correct type." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Consideration: Ownership and lifetime management" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"While libc's `random` function doesn't use pointers, many do. This creates " +"many more possibilities for unsoundness." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "both sides might attempt to free the memory (double free)" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "both sides can attempt to write to the data" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"For example, some C libraries expose functions that write to static buffers " +"that are re-used between calls." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"/// Create a formatted time based on time `t`, including trailing newline.\n" +" /// Read `man 3 ctime` details.\n" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "\"now (1): {}\"" +msgstr "\"u16 olarak: {}\"" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "\"future: {}\"" +msgstr "\"beş: {}\"" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "\"now (2): {}\"" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "_Aside:_ Lifetimes in the `format_timestamp()` function" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Neither `'a`, nor `'static`, correctly describe the lifetime of the string " +"that's returned. Rust treats it as an immutable reference, but subsequent " +"calls to `ctime` will overwrite the static buffer that the string occupies." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "Consideration: Representation mismatch" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Different programming languages have made different design decisions and " +"this can create impedance mismatches between different domains." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "" +"Consider string handling. C++ defines `std::string`, which has an " +"incompatible memory layout with Rust's `String` type. `String` also requires " +"text to be encoded as UTF-8, whereas `std::string` does not. In C, text is " +"represented by a null-terminated sequence of bytes (`char*`)." +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "b\"Hello, C\\0\"" +msgstr "\"Merhaba \"" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "b\"Hello, Rust\"" +msgstr "\"Rust dilinden merhaba!\"" + +#: src/unsafe-deep-dive/motivations/interop.md +msgid "\"{c}\"" +msgstr "" + +#: src/unsafe-deep-dive/motivations/interop.md +#, fuzzy +msgid "\"{rust}\"" +msgstr "\"rust\"" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "Some families of data structures are impossible to create in safe Rust." +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "graphs" +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "bit twiddling" +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "self-referential types" +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +#, fuzzy +msgid "intrusive data structures" +msgstr "Veri Yapılarında Ömürler" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "" +"Graphs: General-purpose graphs cannot be created as they may need to " +"represent cycles. Cycles are impossible for the type system to reason about." +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "" +"Bit twiddling: Overloading bits with multiple meanings. Examples include " +"using the NaN bits in `f64` for some other purpose or the higher-order bits " +"of pointers on `x86_64` platforms. This is somewhat common when writing " +"language interpreters to keep representations within the word size the " +"target platform." +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "Self-referential types are too hard for the borrow checker to verify." +msgstr "" + +#: src/unsafe-deep-dive/motivations/data-structures.md +msgid "" +"Intrusive data structures: store structural metadata (like pointers to other " +"elements) inside the elements themselves, which requires careful handling of " +"aliasing." +msgstr "" + +#: src/unsafe-deep-dive/motivations/performance.md +msgid "TODO: Stub for now" +msgstr "" + +#: src/unsafe-deep-dive/motivations/performance.md +msgid "" +"It's easy to think of performance as the main reason for unsafe, but high " +"performance code makes up the minority of unsafe blocks." +msgstr "" + +#: src/unsafe-deep-dive/foundations.md +msgid "Some fundamental concepts and terms." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "What is “unsafety”?" +msgstr "Rust Nedir?" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Unsafe Rust is a superset of Safe Rust." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Let's create a list of things that are enabled by the `unsafe` keyword." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Definitions from authoritative docs:" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "From the [unsafe keyword's documentation]():" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Code or interfaces whose memory safety cannot be verified by the type system." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "..." +msgstr "// ...\n" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Here are the abilities Unsafe Rust has in addition to Safe Rust:" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Dereference raw pointers" +msgstr "Ham Göstericilerinin İçeriği (Dereferencing)" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Implement unsafe traits" +msgstr "Emniyetsiz Özelliklerin (Unsafe Traits) Gerçekleştirilmesi" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Call unsafe functions" +msgstr "Emniyetsiz (Unsafe) Fonksiyonları Çağırma" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Mutate statics (including external ones)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Access fields of unions" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "From the [reference](https://doc.rust-lang.org/reference/unsafety.html)" +msgstr "" +"[Rust Referansına](https://doc.rust-lang.org/reference/type-layout.html) " +"bakın." + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"The following language level features cannot be used in the safe subset of " +"Rust:" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Dereferencing a raw pointer." +msgstr "Ham Göstericilerinin İçeriği (Dereferencing)" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Reading or writing a mutable or external static variable." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Accessing a field of a union, other than to assign to it." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Calling an unsafe function (including an intrinsic or foreign function)." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Calling a safe function marked with a target_feature from a function that " +"does not have a target_feature attribute enabling the same features (see " +"attributes.codegen.target_feature.safety-restrictions)." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Implementing an unsafe trait." +msgstr "Emniyetsiz Özelliklerin (Unsafe Traits) Gerçekleştirilmesi" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Declaring an extern block." +msgstr "\"Sonraki bloktan çıkılıyor\"" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Applying an unsafe attribute to an item." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +#, fuzzy +msgid "Group exercise" +msgstr "Alıştırmalar hakkında" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"You may have a group of learners who are not familiar with each other yet. " +"This is a way for you to gather some data about their confidence levels and " +"the psychological safety that they're feeling." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Part 1: Informal definition" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Use this to gauge the confidence level of the group. If they are uncertain, " +"then tailor the next section to be more directed." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Ask the class: **By raising your hand, indicate if you would feel " +"comfortable defining unsafe?**" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "If anyone's feeling confident, allow them to try to explain." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Part 2: Evidence gathering" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Ask the class to spend 3-5 minutes." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Find a use of the unsafe keyword. What contract/invariant/pre-condition is " +"being established or satisfied?" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Write down terms that need to be defined (unsafe, memory safety, soundness, " +"undefined behavior)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Part 3: Write a working definition" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Part 4: Remarks" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "Mention that we'll be reviewing our definition at the end of the day." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Note: Avoid detailed discussion about precise semantics of memory safety" +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"It's possible that the group will slide into a discussion about the precise " +"semantics of what memory safety actually is and how define pointer validity. " +"This isn't a productive line of discussion. It can undermine confidence in " +"less experienced learners." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Perhaps refer people who wish to discuss this to the discussion within the " +"official [documentation for pointer types](https://doc.rust-lang.org/std/ptr/" +"index.html#safety) (excerpt below) as a place for further research." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "" +"Many functions in [this module](https://doc.rust-lang.org/std/ptr/index." +"html) take raw pointers as arguments and read from or write to them. For " +"this to be safe, these pointers must be _valid_ for the given access." +msgstr "" + +#: src/unsafe-deep-dive/foundations/what-is-unsafe.md +msgid "The precise rules for validity are not determined yet." +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "" +"The unsafe keyword indicates that the programmer is responsible for " +"upholding Rust's safety guarantees." +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "The keyword has two roles:" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "define pre-conditions that must be satisfied" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "" +"assert to the compiler (= promise) that those defined pre-conditions are " +"satisfied" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +#, fuzzy +msgid "Further references" +msgstr "Paylaşılan (Shared) Referanslar" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +#, fuzzy +msgid "" +"[The unsafe keyword chapter of the Rust Reference](https://doc.rust-lang.org/" +"reference/unsafe-keyword.html)" +msgstr "" +"[Rust Referansına](https://doc.rust-lang.org/reference/type-layout.html) " +"bakın." + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "Places where pre-conditions can be defined (Role 1)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "" +"[unsafe functions](https://doc.rust-lang.org/reference/unsafe-keyword." +"html#unsafe-functions-unsafe-fn) (`unsafe fn foo() { ... }`). Example: " +"`get_unchecked` method on slices, which requires callers to verify that the " +"index is in-bounds." +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +#, fuzzy +msgid "" +"unsafe traits (`unsafe trait`). Examples: [`Send`](https://doc.rust-lang.org/" +"std/marker/trait.Send.html) and [`Sync`](https://doc.rust-lang.org/std/" +"marker/trait.Sync.html) marker traits in the standard library." +msgstr "" +"[`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) ve [`BufRead`]" +"(https://doc.rust-lang.org/std/io/trait.BufRead.html) kullanarak, `u8` " +"kaynakları üzerinde soyutlama yapabilirsiniz:" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "Places where pre-conditions must be satisfied (Role 2)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "unsafe blocks (`unafe { ... }`)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +#, fuzzy +msgid "implementing unsafe traits (`unsafe impl`)" +msgstr "Emniyetsiz Özelliklerin (Unsafe Traits) Gerçekleştirilmesi" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "access external items (`unsafe extern`)" +msgstr "" + +#: src/unsafe-deep-dive/foundations/when-is-unsafe-used.md +msgid "" +"adding [unsafe attributes](https://doc.rust-lang.org/reference/attributes." +"html) o an item. Examples: [`export_name`](https://doc.rust-lang.org/" +"reference/abi.html#the-export_name-attribute), [`link_section`](https://doc." +"rust-lang.org/reference/abi.html#the-link_section-attribute) and " +"[`no_mangle`](https://doc.rust-lang.org/reference/abi.html#the-no_mangle-" +"attribute). Usage: `#[unsafe(no_mangle)]`" +msgstr "" + +#: src/unsafe-deep-dive/foundations/data-structures-are-safe.md +msgid "Data structures are safe ..." +msgstr "" + +#: src/unsafe-deep-dive/foundations/data-structures-are-safe.md +msgid "Data structures are inert. They cannot do any harm by themselves." +msgstr "" + +#: src/unsafe-deep-dive/foundations/data-structures-are-safe.md +msgid "Safe Rust code can create raw pointers:" +msgstr "" + +#: src/unsafe-deep-dive/foundations/data-structures-are-safe.md +#: src/unsafe-deep-dive/foundations/actions-might-not-be.md +msgid "\"{safe:p}\"" +msgstr "" + +#: src/unsafe-deep-dive/foundations/data-structures-are-safe.md +msgid "" +"Consider a raw pointer to an integer, i.e., the value `safe` is the raw " +"pointer type `*const i64`. Raw pointers can be out-of-bounds, misaligned, or " +"be null. But the unsafe keyword is not required when creating them." +msgstr "" + +#: src/unsafe-deep-dive/foundations/actions-might-not-be.md +msgid "... but actions on them might not be" +msgstr "" + +#: src/unsafe-deep-dive/foundations/actions-might-not-be.md +msgid "Modify the example to de-reference `safe` without an `unsafe` block." +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "The `unsafe` keyword does not allow you to break Rust." +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "b\"RUST\"" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Suggested outline" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Request that someone explains what `std::mem::transmute` does" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Discuss why it doesn't compile" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Fix the code" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Expected compiler output" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Suggested change" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "Notes on less familiar Rust" +msgstr "" + +#: src/unsafe-deep-dive/foundations/less-powerful.md +msgid "" +"the `b` prefix on a string literal marks it as byte slice (`&[u8]`) rather " +"than a string slice (`&str`)" +msgstr "" + #: src/thanks.md msgid "" "_Thank you for taking Comprehensive Rust 🦀!_ We hope you enjoyed it and " @@ -21778,6 +23633,12 @@ msgid "" "book which describes the Rust grammar and memory model." msgstr "" +#: src/other-resources.md +msgid "" +"[Rust API Guidelines](https://rust-lang.github.io/api-guidelines/): " +"recommendations on how to design APIs." +msgstr "" + #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" msgstr "" @@ -21923,6 +23784,26 @@ msgid "" "directory for details, including the license terms." msgstr "" +#~ msgid "" +#~ "On Debian/Ubuntu, you can also install Cargo, the Rust source and the " +#~ "[Rust formatter](https://github.com/rust-lang/rustfmt) via `apt`. " +#~ "However, this gets you an outdated Rust version and may lead to " +#~ "unexpected behavior. The command would be:" +#~ msgstr "" +#~ "Debian/Ubuntu'da ayrıca `apt` aracılığıyla Cargo'yu, Rust kaynak kodunu " +#~ "ve [Rust biçimlendiricisini (formatter)](https://github.com/rust-lang/" +#~ "rustfmt) kurabilirsiniz. Ancak bu size eski bir Rust sürümü verir ve " +#~ "beklenmeyen davranışlara yol açabilir. Komut şu şekilde olacaktır:" + +#~ msgid "" +#~ "Slices are covered on day 3. For now, students only need to know that a " +#~ "value of type `Vec` gives access to all of the documented slice methods, " +#~ "too." +#~ msgstr "" +#~ "Dilimler (slices) 3. günde ele alınacak. Şimdilik, öğrencilerin sadece " +#~ "`Vec` türündeki bir değerin, belgelenmiş tüm dilim (slice) metotlarına da " +#~ "erişim sağladığını bilmeleri yeterlidir." + #~ msgid "Scopes and Shadowing" #~ msgstr "Kapsamlar (Scopes) ve Gölgeleme (Shadowing)" @@ -22156,9 +24037,6 @@ msgstr "" #~ msgid "[Methods and Traits](../methods-and-traits.md) (50 minutes)" #~ msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" -#~ msgid "Day 2 Afternoon (4 hours, including breaks)" -#~ msgstr "2. Gün Öğleden Sonra (4 saat, aralar dahil)" - #~ msgid "[Generics](../generics.md) (40 minutes)" #~ msgstr "[Jenerikler](../generics.md) (40 dakika)" @@ -23130,13 +25008,6 @@ msgstr "" #~ "}\n" #~ "```" -#~ msgid "" -#~ "See the [Rust Reference](https://doc.rust-lang.org/reference/type-layout." -#~ "html)." -#~ msgstr "" -#~ "[Rust Referansına](https://doc.rust-lang.org/reference/type-layout.html) " -#~ "bakın." - #~ msgid "Day 1: Afternoon Exercises" #~ msgstr "Gün 1: Öğleden Sonra Alıştırmaları" @@ -23266,9 +25137,6 @@ msgstr "" #~ msgid "Day 2 Morning Exercises" #~ msgstr "2. Gün Sabah Alıştırmaları" -#~ msgid "Designing a Library" -#~ msgstr "Kütüphane Tasarlama" - #~ msgid "([back to exercise](health-statistics.md))" #~ msgstr "([egzersize geri dön](health-statistics.md))" @@ -23307,9 +25175,6 @@ msgstr "" #~ msgid "generics:" #~ msgstr "jenerikler:" -#~ msgid "integration test:" -#~ msgstr "entegrasyon testi:" - #~ msgid "main function:" #~ msgstr "main fonksiyonu:" From 30710e4a78cf4169b56a4853099c098797078e5b Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Tue, 9 Sep 2025 23:42:23 +0200 Subject: [PATCH 070/103] Fix spelling of UTF-8 and UTF-16 (#2900) This should always be written with a hyphen in running text. --- src/chromium.md | 2 +- src/chromium/interoperability-with-cpp.md | 2 +- src/exercises/chromium/bringing-it-together.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chromium.md b/src/chromium.md index 442db003..840f59d3 100644 --- a/src/chromium.md +++ b/src/chromium.md @@ -9,6 +9,6 @@ Rust is supported for third-party libraries in Chromium, with first-party glue code to connect between Rust and existing Chromium C++ code. > Today, we'll call into Rust to do something silly with strings. If you've got -> a corner of the code where you're displaying a UTF8 string to the user, feel +> a corner of the code where you're displaying a UTF-8 string to the user, feel > free to follow this recipe in your part of the codebase instead of the exact > part we talk about. diff --git a/src/chromium/interoperability-with-cpp.md b/src/chromium/interoperability-with-cpp.md index 7940b096..210a327c 100644 --- a/src/chromium/interoperability-with-cpp.md +++ b/src/chromium/interoperability-with-cpp.md @@ -40,7 +40,7 @@ following benefits: memory-safety risks. - `rust::String` and `CxxString` types understand and maintain differences in string representation across the languages (e.g. `rust::String::lossy` can - build a Rust string from non-UTF8 input and `rust::String::c_str` can + build a Rust string from non-UTF-8 input and `rust::String::c_str` can NUL-terminate a string).
diff --git a/src/exercises/chromium/bringing-it-together.md b/src/exercises/chromium/bringing-it-together.md index 128f5bce..3cd2fac3 100644 --- a/src/exercises/chromium/bringing-it-together.md +++ b/src/exercises/chromium/bringing-it-together.md @@ -33,8 +33,8 @@ should have created Chrome for pixies!
Students will likely need some hints here. Hints include: -- UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, and - will probably decide that it's better to do the conversion on the C++ side +- UTF-16 vs UTF-8. Students should be aware that Rust strings are always UTF-8, + and will probably decide that it's better to do the conversion on the C++ side using `base::UTF16ToUTF8` and back again. - If students decide to do the conversion on the Rust side, they'll need to consider [`String::from_utf16`][1], consider error handling, and consider From 4731acf53ffd8aa9067cb9425717f193c69eb391 Mon Sep 17 00:00:00 2001 From: Luciefer <31387342+lucienfer@users.noreply.github.com> Date: Wed, 10 Sep 2025 12:36:47 +0100 Subject: [PATCH 071/103] ci: use pinned nightly `rustfmt` to make unstable features take effect (#2896) ## What does this PR do? This PR extends the existing `format` job in `.github/workflows/build.yml` to **check Rust formatting with nightly `rustfmt`**: **Closes #2794** --- .github/workflows/build.yml | 8 +++++--- CONTRIBUTING.md | 10 ++++++++++ dprint.json | 2 +- rustfmt.toml | 1 + xtask/src/main.rs | 37 ++++++++++++++++++++++++++++++------- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed3f0699..ef8b79f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ env: jobs: format: runs-on: ubuntu-latest + env: + NIGHTLY_VERSION: nightly-2025-09-01 steps: - name: Checkout uses: actions/checkout@v5 @@ -22,10 +24,10 @@ jobs: sudo apt update sudo apt install gettext yapf3 - - name: Install nightly rustfmt + - name: Install pinned nightly for rustfmt run: | - rustup default nightly - rustup component add rustfmt + rustup toolchain install --profile minimal "$NIGHTLY_VERSION" + rustup component add rustfmt --toolchain "$NIGHTLY_VERSION" - name: Check formatting uses: dprint/check@v2.3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ff29521..c10f9692 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,6 +53,16 @@ this: Run `dprint fmt` to automatically format all files. +**Note:** To make sure you have the correct version of `rustfmt` installed, +please run: + +```bash +cargo xtask install-tools +``` + +This will install the pinned nightly toolchain and add the `rustfmt` component, +so your local formatting will match the CI. + ### Linux Install `dprint` using their diff --git a/dprint.json b/dprint.json index d47cd41c..1e0a7723 100644 --- a/dprint.json +++ b/dprint.json @@ -9,7 +9,7 @@ "command": "yapf3", "exts": ["py"] }, { - "command": "rustup run stable rustfmt --edition 2024", + "command": "rustup run nightly-2025-09-01 rustfmt --edition 2024", "exts": ["rs"] }] }, diff --git a/rustfmt.toml b/rustfmt.toml index 131d9d6b..22543387 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,4 +1,5 @@ # Please use a nightly rustfmt for these settings. +unstable_features = true imports_granularity = "module" wrap_comments = true diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f46eabd9..98d5dabd 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -21,9 +21,9 @@ use anyhow::{Ok, Result, anyhow}; use clap::{Parser, Subcommand}; +use std::env; use std::path::{Path, PathBuf}; -use std::process::Stdio; -use std::{env, process::Command}; +use std::process::{Command, Stdio}; fn main() -> Result<()> { if let Err(e) = execute_task() { @@ -49,7 +49,8 @@ enum Task { InstallTools, /// Runs the web driver tests in the tests directory. WebTests { - /// Optional 'book html' directory - if set, will also refresh the list of slides used by slide size test. + /// Optional 'book html' directory - if set, will also refresh the list + /// of slides used by slide size test. #[arg(short, long)] dir: Option, }, @@ -61,7 +62,8 @@ enum Task { #[arg(short, long)] language: Option, - /// Directory to place the build. If not provided, defaults to the book/ directory (or the book/xx directory if a language is provided). + /// Directory to place the build. If not provided, defaults to the book/ + /// directory (or the book/xx directory if a language is provided). #[arg(short, long)] output: Option, }, @@ -71,7 +73,8 @@ enum Task { #[arg(short, long)] language: Option, - /// Directory to place the build. If not provided, defaults to the book/ directory (or the book/xx directory if a language is provided). + /// Directory to place the build. If not provided, defaults to the book/ + /// directory (or the book/xx directory if a language is provided). #[arg(short, long)] output: Option, }, @@ -91,6 +94,25 @@ fn execute_task() -> Result<()> { fn install_tools() -> Result<()> { println!("Installing project tools..."); + + const PINNED_NIGHTLY: &str = "nightly-2025-09-01"; + + let rustup_steps = [ + ["toolchain", "install", "--profile", "minimal", PINNED_NIGHTLY], + ["component", "add", "rustfmt", "--toolchain", PINNED_NIGHTLY], + ]; + + for args in rustup_steps { + let status = std::process::Command::new("rustup").args(args).status()?; + if !status.success() { + return Err(anyhow!( + "Command 'rustup {}' failed with status {:?}", + args.join(" "), + status.code() + )); + } + } + let path_to_mdbook_exerciser = Path::new(env!("CARGO_WORKSPACE_DIR")).join("mdbook-exerciser"); let path_to_mdbook_course = @@ -286,8 +308,9 @@ fn build(language: Option, output_arg: Option) -> Result<()> { } fn get_output_dir(language: Option, output_arg: Option) -> PathBuf { - // If the 'output' arg is specified by the caller, use that, otherwise output to the 'book/' directory - // (or the 'book/xx' directory if a language was specified). + // If the 'output' arg is specified by the caller, use that, otherwise output to + // the 'book/' directory (or the 'book/xx' directory if a language was + // specified). if let Some(d) = output_arg { d } else { From 1a5d9949ad1799898499c9fa63de1bbdb50787fe Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 11 Sep 2025 11:36:45 +0200 Subject: [PATCH 072/103] Fix blocks-and-scopes.md after code review (#2901) Thanks to @fw-immunant and @qwandor for the comments in #2887. --- src/control-flow-basics/blocks-and-scopes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/control-flow-basics/blocks-and-scopes.md b/src/control-flow-basics/blocks-and-scopes.md index 366c0be7..70893723 100644 --- a/src/control-flow-basics/blocks-and-scopes.md +++ b/src/control-flow-basics/blocks-and-scopes.md @@ -4,8 +4,9 @@ minutes: 5 # Blocks and Scopes -A block in Rust contains a sequence of expressions, enclosed by braces {}. The -final expression of a block determines the value and type of the whole block: +- A block in Rust contains a sequence of expressions, enclosed by braces `{}`. +- The final expression of a block determines the value and type of the whole + block. ```rust,editable fn main() { From a9497bdc619139d9d1d4a81a285304f2160327bf Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Mon, 15 Sep 2025 14:25:15 +0200 Subject: [PATCH 073/103] Update mdbook to version 0.4.52 (#2870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The most significant change for users is that the search index is downloaded on demand. For us as a project, it’s good to see the server used by `mdbook serve` change from `warp` to `asum`: the former hadn’t been updated in a while, leading us to have old dependencies in our `Cargo.lock`. I also ran `cargo update` to further unify the versions of our dependencies. This shrunk `cargo tree --duplicates` a little more. --------- Co-authored-by: Michael Kerscher --- Cargo.lock | 1700 ++++++++++++++++------------------- mdbook-course/Cargo.toml | 2 +- mdbook-exerciser/Cargo.toml | 2 +- tests/wdio.conf.ts | 13 +- xtask/src/main.rs | 2 +- 5 files changed, 803 insertions(+), 916 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48aa346e..cdfd4ba1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,24 +4,24 @@ version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -35,13 +35,13 @@ dependencies = [ [[package]] name = "ammonia" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" +checksum = "d6b346764dd0814805de8abf899fe03065bcee69bb1a4771c785817e39f3978f" dependencies = [ - "html5ever 0.27.0", + "cssparser", + "html5ever", "maplit", - "once_cell", "tendril", "url", ] @@ -71,50 +71,52 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] @@ -124,37 +126,94 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" [[package]] -name = "autocfg" -version = "1.1.0" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" +dependencies = [ + "axum-core", + "base64", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] name = "base64" -version = "0.21.5" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" - -[[package]] -name = "base64" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -164,9 +223,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "block-buffer" @@ -183,9 +242,9 @@ version = "0.1.0" [[package]] name = "bstr" -version = "1.8.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "regex-automata", @@ -203,9 +262,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byteorder" @@ -215,52 +274,53 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "590f9024a68a8c40351881787f1934dc11afd69090f5edb6831464694d836ea3" dependencies = [ + "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "chat-async" version = "0.1.0" dependencies = [ "futures-util", - "http 1.3.1", + "http", "tokio", "tokio-websockets", ] [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-link", ] [[package]] name = "clap" -version = "4.5.46" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57" +checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931" dependencies = [ "clap_builder", "clap_derive", @@ -268,9 +328,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.46" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41" +checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6" dependencies = [ "anstream", "anstyle", @@ -281,18 +341,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.4" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" +checksum = "4d9501bd3f5f09f7bbee01da9a511073ed30a80cd7a509f1214bb74eadea71ad" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.45" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ "heck", "proc-macro2", @@ -302,9 +362,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "codespan-reporting" @@ -319,9 +379,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "control-flow-basics" @@ -339,50 +399,43 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -419,9 +472,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.158" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741" +checksum = "84aa1f8258b77022835f4ce5bd3b5aa418b969494bd7c3cb142c88424eb4c715" dependencies = [ "cc", "cxxbridge-cmd", @@ -433,12 +486,13 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.158" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7" +checksum = "d4e2aa0ea9f398b72f329197cfad624fcb16b2538d3ffb0f71f51cd19fa2a512" dependencies = [ "cc", "codespan-reporting", + "indexmap", "proc-macro2", "quote", "scratch", @@ -447,12 +501,13 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.158" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279" +checksum = "902e9553c7db1cc00baee88d6a531792d3e1aaab06ed6d1dcd606647891ea693" dependencies = [ "clap", "codespan-reporting", + "indexmap", "proc-macro2", "quote", "syn", @@ -460,16 +515,17 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.158" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4" +checksum = "35b2b0b4d405850b0048447786b70c2502c84e4d5c4c757416abc0500336edfc" [[package]] name = "cxxbridge-macro" -version = "1.0.158" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8" +checksum = "fd2a8fe0dfa4a2207b80ca9492c0d5dc8752b66f5631d93b23065f40f6a943d3" dependencies = [ + "indexmap", "proc-macro2", "quote", "rustversion", @@ -477,10 +533,45 @@ dependencies = [ ] [[package]] -name = "data-encoding" -version = "2.5.0" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "demo" @@ -490,6 +581,37 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + [[package]] name = "derive_more" version = "2.0.1" @@ -539,15 +661,15 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dtoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" [[package]] name = "dtoa-short" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ "dtoa", ] @@ -558,12 +680,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2972feb8dffe7bc8c5463b1dacda1b0dfbed3710e50f977d965429692d74cd8" -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - [[package]] name = "elasticlunr-rs" version = "3.0.2" @@ -578,18 +694,18 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -597,9 +713,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -610,31 +726,31 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.1" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -642,7 +758,7 @@ name = "error-handling" version = "0.1.0" dependencies = [ "anyhow", - "thiserror 2.0.16", + "thiserror", ] [[package]] @@ -652,16 +768,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "filetime" -version = "0.2.23" +name = "find-msvc-tools" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.52.0", -] +checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650" [[package]] name = "fnv" @@ -671,9 +781,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "foreign-types" @@ -692,18 +802,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "fsevent-sys" @@ -726,9 +836,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -820,38 +930,38 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.3+wasi-0.2.4", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" dependencies = [ "aho-corasick", "bstr", @@ -885,35 +995,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.27" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http 0.2.11", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "h2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 1.3.1", + "http", "indexmap", "slab", "tokio", @@ -923,48 +1014,25 @@ dependencies = [ [[package]] name = "handlebars" -version = "6.2.0" +version = "6.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4ccde012831f9a071a637b0d4e31df31c0f6c525784b35ae76a9ac6bc1e315" +checksum = "759e2d5aea3287cb1190c8ec394f42866cb5bf74fcbf213f354e3c856ea26098" dependencies = [ + "derive_builder", "log", "num-order", "pest", "pest_derive", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "headers" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" -dependencies = [ - "base64 0.21.5", - "bytes", - "headers-core", - "http 0.2.11", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http 0.2.11", -] +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" [[package]] name = "heck" @@ -974,9 +1042,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -984,20 +1052,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "html5ever" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" -dependencies = [ - "log", - "mac", - "markup5ever 0.12.1", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "html5ever" version = "0.35.0" @@ -1005,21 +1059,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" dependencies = [ "log", - "markup5ever 0.35.0", + "markup5ever", "match_token", ] -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.3.1" @@ -1033,38 +1076,33 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 0.2.11", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.3.1", + "http", ] [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.3.1", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + [[package]] name = "httparse" version = "1.10.1" @@ -1079,49 +1117,28 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "hyper" -version = "0.14.28" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", "futures-core", - "futures-util", - "h2 0.3.27", - "http 0.2.11", - "http-body 0.4.6", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.10", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2 0.4.3", - "http 1.3.1", - "http-body 1.0.0", - "httparse", - "itoa", - "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -1129,13 +1146,12 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", - "http 1.3.1", - "hyper 1.6.0", + "http", + "hyper", "hyper-util", "rustls", "rustls-pki-types", @@ -1152,7 +1168,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -1162,23 +1178,23 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.13" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c293b6b3d21eca78250dc7dbebd6b9210ec5530e038cbfe0661b5c47ab06e8" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" dependencies = [ - "base64 0.22.0", + "base64", "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", - "http-body 1.0.0", - "hyper 1.6.0", + "http", + "http-body", + "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2 0.5.10", + "socket2", "system-configuration", "tokio", "tower-service", @@ -1188,14 +1204,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1211,21 +1228,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -1234,31 +1252,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -1266,72 +1264,65 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] [[package]] -name = "icu_provider_macros" -version = "1.5.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1340,9 +1331,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -1350,9 +1341,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.21" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" dependencies = [ "crossbeam-deque", "globset", @@ -1366,9 +1357,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" dependencies = [ "equivalent", "hashbrown", @@ -1380,7 +1371,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "inotify-sys", "libc", ] @@ -1396,20 +1387,20 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "cfg-if", "libc", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" @@ -1423,39 +1414,60 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi", - "rustix 0.38.41", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.59.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "iterators" version = "0.1.0" [[package]] -name = "itertools" -version = "0.11.0" +name = "itoa" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jiff" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" dependencies = [ - "either", + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", ] [[package]] -name = "itoa" -version = "1.0.10" +name = "jiff-static" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738" dependencies = [ "once_cell", "wasm-bindgen", @@ -1463,9 +1475,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.0.8" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" dependencies = [ "kqueue-sys", "libc", @@ -1489,49 +1501,43 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "lifetimes" version = "0.1.0" dependencies = [ - "thiserror 2.0.16", + "thiserror", ] [[package]] name = "link-cplusplus" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +checksum = "8c349c75e1ab4a03bd6b33fe6cbd3c479c5dd443e44ad732664d72cb0e755475" dependencies = [ "cc", ] [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "linux-raw-sys" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -1539,9 +1545,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "mac" @@ -1555,20 +1561,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "markup5ever" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" -dependencies = [ - "log", - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", - "tendril", -] - [[package]] name = "markup5ever" version = "0.35.0" @@ -1591,6 +1583,12 @@ dependencies = [ "syn", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "matter" version = "0.1.0-alpha4" @@ -1603,17 +1601,18 @@ dependencies = [ [[package]] name = "mdbook" -version = "0.4.51" +version = "0.4.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a87e65420ab45ca9c1b8cdf698f95b710cc826d373fa550f0f7fad82beac9328" +checksum = "93c284d2855916af7c5919cf9ad897cfc77d3c2db6f55429c7cfb769182030ec" dependencies = [ "ammonia", "anyhow", + "axum", "chrono", "clap", "clap_complete", "elasticlunr-rs", - "env_logger 0.11.1", + "env_logger 0.11.8", "futures-util", "handlebars", "hex", @@ -1634,8 +1633,8 @@ dependencies = [ "tokio", "toml", "topological-sort", + "tower-http", "walkdir", - "warp", ] [[package]] @@ -1668,18 +1667,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memory-management" @@ -1697,9 +1687,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1707,24 +1697,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ - "hermit-abi", "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -1759,11 +1748,10 @@ version = "0.1.0" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1777,27 +1765,26 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "normpath" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "notify" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ - "bitflags 2.8.0", - "filetime", + "bitflags 2.9.4", "fsevent-sys", "inotify", "kqueue", @@ -1806,7 +1793,7 @@ dependencies = [ "mio", "notify-types", "walkdir", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1844,46 +1831,52 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "object" -version = "0.32.1" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "opener" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771b9704f8cd8b424ec747a320b30b47517a6966ba2c7da90047c16f4a962223" +checksum = "cb9024962ab91e00c89d2a14352a8d0fc1a64346bf96f1839b45c09149564e47" dependencies = [ "bstr", "normpath", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "openssl" -version = "0.10.72" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "cfg-if", "foreign-types", "libc", @@ -1905,15 +1898,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.107" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", @@ -1923,9 +1916,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -1933,22 +1926,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pattern-matching" @@ -1956,26 +1949,26 @@ version = "0.1.0" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.7.5" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" dependencies = [ "memchr", - "thiserror 1.0.69", + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bb056d9e8ea77922845ec74a1c4e8fb17e7c218cc4fc11a15c5d25e189aa40bc" dependencies = [ "pest", "pest_generator", @@ -1983,9 +1976,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "87e404e638f781eb3202dc82db6760c8ae8a1eeef7fb3fa8264b2ef280504966" dependencies = [ "pest", "pest_meta", @@ -1996,20 +1989,19 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "edd1101f170f5903fde0914f899bb503d9ff5271d7ba76bbb70bea63690cc0d5" dependencies = [ - "once_cell", "pest", "sha2", ] [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -2017,9 +2009,9 @@ dependencies = [ [[package]] name = "phf_codegen" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", "phf_shared", @@ -2027,19 +2019,19 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", - "rand", + "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -2050,38 +2042,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2091,15 +2063,42 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +dependencies = [ + "zerovec", +] [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -2109,26 +2108,25 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", - "itertools", "predicates-core", ] [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -2140,15 +2138,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "log", ] [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -2159,7 +2157,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "memchr", "pulldown-cmark-escape", "unicase", @@ -2171,16 +2169,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "memchr", "unicase", ] [[package]] name = "pulldown-cmark-escape" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b" +checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" [[package]] name = "quote" @@ -2191,25 +2189,39 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ "rand_chacha", - "rand_core", + "rand_core 0.9.3", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.3", ] [[package]] @@ -2217,17 +2229,23 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.3.3", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.4", ] [[package]] @@ -2248,9 +2266,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", @@ -2259,9 +2277,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "reqwest" @@ -2269,17 +2287,17 @@ version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ - "base64 0.22.0", + "base64", "bytes", "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2 0.4.3", - "http 1.3.1", - "http-body 1.0.0", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-rustls", "hyper-tls", "hyper-util", @@ -2307,13 +2325,13 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.11", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -2321,41 +2339,28 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustix" -version = "0.38.41" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustix" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" -dependencies = [ - "bitflags 2.8.0", - "errno", - "libc", - "linux-raw-sys 0.9.3", - "windows-sys 0.59.0", + "linux-raw-sys", + "windows-sys 0.60.2", ] [[package]] name = "rustls" -version = "0.23.7" +version = "0.23.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" +checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" dependencies = [ "once_cell", "rustls-pki-types", @@ -2364,15 +2369,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.5", -] - [[package]] name = "rustls-pki-types" version = "1.12.0" @@ -2384,9 +2380,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ "ring", "rustls-pki-types", @@ -2395,15 +2391,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2416,19 +2412,13 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -2444,7 +2434,7 @@ dependencies = [ "cssparser", "ego-tree", "getopts", - "html5ever 0.35.0", + "html5ever", "precomputed-hash", "selectors", "tendril", @@ -2452,17 +2442,17 @@ dependencies = [ [[package]] name = "scratch" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +checksum = "d68f2ec51b097e4c1a75b681a8bec621909b5e91f15bb7b840c4f2f7b01148b2" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.4", "core-foundation", "core-foundation-sys", "libc", @@ -2471,9 +2461,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2485,7 +2475,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5685b6ae43bfcf7d2e7dfcfb5d8e8f61b46442c902531e41a32a9a8bf0ee0fb6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "cssparser", "derive_more", "fxhash", @@ -2530,6 +2520,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2557,9 +2557,9 @@ dependencies = [ [[package]] name = "servo_arc" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae65c4249478a2647db249fb43e23cec56a2c8974a427e7bd8cb5a1d0964921a" +checksum = "204ea332803bd95a0b60388590d59cf6468ec9becf626e2451f1d26a1d972de4" dependencies = [ "stable_deref_trait", ] @@ -2577,15 +2577,15 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -2600,9 +2600,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -2615,39 +2615,26 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smart-pointers" version = "0.1.0" -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "socket2" version = "0.6.0" @@ -2708,9 +2695,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -2720,9 +2707,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -2736,23 +2723,23 @@ dependencies = [ "reqwest", "scraper", "tempfile", - "thiserror 2.0.16", + "thiserror", ] [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -2765,7 +2752,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "core-foundation", "system-configuration-sys", ] @@ -2787,10 +2774,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.3", "once_cell", - "rustix 1.0.3", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.60.2", ] [[package]] @@ -2806,60 +2793,40 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" dependencies = [ - "rustix 0.38.41", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.60.2", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "testing" version = "0.1.0" -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.16", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "thiserror-impl", ] [[package]] @@ -2875,9 +2842,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -2898,7 +2865,7 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "slab", - "socket2 0.6.0", + "socket2", "tokio-macros", "windows-sys 0.59.0", ] @@ -2926,31 +2893,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", "tokio", ] [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", @@ -2960,9 +2915,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", @@ -2977,12 +2932,12 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5190767f03b86528ab9f4f6a9158072a6d0ef240d9a9591772eb411f315920f4" dependencies = [ - "base64 0.22.0", + "base64", "bytes", "fastrand", "futures-core", "futures-sink", - "http 1.3.1", + "http", "httparse", "sha1_smol", "simdutf8", @@ -3018,6 +2973,7 @@ dependencies = [ "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3026,16 +2982,26 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.4", "bytes", + "futures-core", "futures-util", - "http 1.3.1", - "http-body 1.0.0", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", "iri-string", + "mime", + "mime_guess", + "percent-encoding", "pin-project-lite", + "tokio", + "tokio-util", "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3052,9 +3018,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -3063,9 +3029,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] @@ -3078,20 +3044,18 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" dependencies = [ - "byteorder", "bytes", "data-encoding", - "http 0.2.11", + "http", "httparse", "log", - "rand", + "rand 0.9.2", "sha1", - "thiserror 1.0.69", - "url", + "thiserror", "utf-8", ] @@ -3101,9 +3065,9 @@ version = "0.1.0" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "types-and-values" @@ -3111,24 +3075,21 @@ version = "0.1.0" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-width" @@ -3157,13 +3118,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -3176,12 +3138,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -3190,9 +3146,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vcpkg" @@ -3202,15 +3158,15 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3226,67 +3182,38 @@ dependencies = [ ] [[package]] -name = "warp" -version = "0.3.6" +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "headers", - "http 0.2.11", - "hyper 0.14.28", - "log", - "mime", - "mime_guess", - "percent-encoding", - "pin-project", - "rustls-pemfile", - "scoped-tls", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tokio-util", - "tower-service", - "tracing", -] +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.14.3+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb" dependencies = [ "bumpalo", "log", @@ -3298,21 +3225,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "0ca85039a9b469b38336411d6d6ced91f3fc87109a2a27b0c197663f5144dffe" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3320,9 +3248,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa" dependencies = [ "proc-macro2", "quote", @@ -3333,18 +3261,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "77e4b637749ff0d92b8fad63aa1f7cff3cbe125fd49c175cd6345e7272638b12" dependencies = [ "js-sys", "wasm-bindgen", @@ -3362,90 +3290,85 @@ dependencies = [ "string_cache_codegen", ] -[[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.6" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" dependencies = [ - "winapi", + "windows-sys 0.60.2", ] -[[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.51.1" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-targets 0.48.5", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-registry" -version = "0.4.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ + "windows-link", "windows-result", "windows-strings", - "windows-targets 0.53.0", ] [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link", ] -[[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" @@ -3465,18 +3388,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 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", + "windows-targets 0.53.3", ] [[package]] @@ -3497,10 +3414,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ + "windows-link", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -3511,12 +3429,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] -[[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.6" @@ -3529,12 +3441,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" -[[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.6" @@ -3547,12 +3453,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" -[[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.6" @@ -3577,12 +3477,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" -[[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.6" @@ -3595,12 +3489,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" -[[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.6" @@ -3613,12 +3501,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" -[[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.6" @@ -3631,12 +3513,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" -[[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.6" @@ -3650,25 +3526,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] -name = "wit-bindgen-rt" -version = "0.33.0" +name = "wit-bindgen" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.8.0", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "xtask" @@ -3680,9 +3547,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -3692,9 +3559,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -3731,18 +3598,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -3757,10 +3624,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] -name = "zerovec" -version = "0.10.4" +name = "zerotrie" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" dependencies = [ "yoke", "zerofrom", @@ -3769,9 +3647,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/mdbook-course/Cargo.toml b/mdbook-course/Cargo.toml index bb9ac7ac..4ec7aece 100644 --- a/mdbook-course/Cargo.toml +++ b/mdbook-course/Cargo.toml @@ -14,7 +14,7 @@ clap = "4.5.46" lazy_static = "1.5" log = "0.4.27" matter = "0.1.0-alpha4" -mdbook = "0.4.51" +mdbook = "0.4.52" pretty_env_logger = "0.5.0" regex = "1.11" serde = "1.0.219" diff --git a/mdbook-exerciser/Cargo.toml b/mdbook-exerciser/Cargo.toml index 017ff675..20adfa90 100644 --- a/mdbook-exerciser/Cargo.toml +++ b/mdbook-exerciser/Cargo.toml @@ -10,6 +10,6 @@ description = "A tool for extracting starter code for exercises from Markdown fi [dependencies] anyhow = "1.0.99" log = "0.4.27" -mdbook = "0.4.51" +mdbook = "0.4.52" pretty_env_logger = "0.5.0" pulldown-cmark = { version = "0.13.0", default-features = false } diff --git a/tests/wdio.conf.ts b/tests/wdio.conf.ts index 649ad2e6..6a7347f7 100644 --- a/tests/wdio.conf.ts +++ b/tests/wdio.conf.ts @@ -55,8 +55,17 @@ export const config: WebdriverIO.Config = { // capabilities for local browser web tests browserName: "chrome", "goog:chromeOptions": { - // comment this to see the evaluation - args: ["headless", "disable-gpu"], + // In Github CI this variable is set to true + args: env.CI + ? // In CI, we use additional flags for stability. + [ + "--headless", + "--disable-gpu", + "--no-sandbox", + "--disable-dev-shm-usage", + ] + : // For local runs, you can comment out the line below to see the browser + ["--headless"], }, }, ], diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 98d5dabd..1b45f736 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -121,7 +121,7 @@ fn install_tools() -> Result<()> { let install_args = vec![ // The --locked flag is important for reproducible builds. It also // avoids breakage due to skews between mdbook and mdbook-svgbob. - vec!["mdbook", "--locked", "--version", "0.4.51"], + vec!["mdbook", "--locked", "--version", "0.4.52"], vec!["mdbook-svgbob", "--locked", "--version", "0.2.2"], vec!["mdbook-pandoc", "--locked", "--version", "0.10.4"], vec!["mdbook-i18n-helpers", "--locked", "--version", "0.3.6"], From 63e50a8058ac8781f2b0cd517134f24e2eb74924 Mon Sep 17 00:00:00 2001 From: Glen De Cauwsemaecker Date: Wed, 17 Sep 2025 09:09:37 +0200 Subject: [PATCH 074/103] add typestate pattern chapter for idiomatic rust (#2821) --- src/SUMMARY.md | 8 + .../typestate-pattern.md | 75 ++++++++ .../typestate-pattern/typestate-advanced.md | 94 ++++++++++ .../typestate-pattern/typestate-example.md | 101 +++++++++++ .../typestate-pattern/typestate-generics.md | 52 ++++++ .../typestate-pattern/typestate-generics.rs | 164 ++++++++++++++++++ .../typestate-generics/complete.md | 89 ++++++++++ .../typestate-generics/property.md | 49 ++++++ .../typestate-generics/root.md | 40 +++++ .../typestate-generics/struct.md | 43 +++++ 10 files changed, 715 insertions(+) create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.rs create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/complete.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/property.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/root.md create mode 100644 src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/struct.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 8b67ecaf..dfd360ed 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -437,6 +437,14 @@ - [Semantic Confusion](idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md) - [Parse, Don't Validate](idiomatic/leveraging-the-type-system/newtype-pattern/parse-don-t-validate.md) - [Is It Encapsulated?](idiomatic/leveraging-the-type-system/newtype-pattern/is-it-encapsulated.md) + - [Typestate Pattern](idiomatic/leveraging-the-type-system/typestate-pattern.md) + - [Typestate Pattern Example](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md) + - [Beyond Simple Typestate](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md) + - [Typestate Pattern with Generics](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md) + - [Serializer: implement Root](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/root.md) + - [Serializer: implement Struct](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/struct.md) + - [Serializer: implement Property](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/property.md) + - [Serializer: Complete implementation](idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/complete.md) --- diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern.md new file mode 100644 index 00000000..0e20d912 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern.md @@ -0,0 +1,75 @@ +--- +minutes: 30 +--- + +## Typestate Pattern: Problem + +How can we ensure that only valid operations are allowed on a value based on its +current state? + +```rust,editable +use std::fmt::Write as _; + +#[derive(Default)] +struct Serializer { + output: String, +} + +impl Serializer { + fn serialize_struct_start(&mut self, name: &str) { + let _ = writeln!(&mut self.output, "{name} {{"); + } + + fn serialize_struct_field(&mut self, key: &str, value: &str) { + let _ = writeln!(&mut self.output, " {key}={value};"); + } + + fn serialize_struct_end(&mut self) { + self.output.push_str("}\n"); + } + + fn finish(self) -> String { + self.output + } +} + +fn main() { + let mut serializer = Serializer::default(); + serializer.serialize_struct_start("User"); + serializer.serialize_struct_field("id", "42"); + serializer.serialize_struct_field("name", "Alice"); + + // serializer.serialize_struct_end(); // ← Oops! Forgotten + + println!("{}", serializer.finish()); +} +``` + +
+ +- This `Serializer` is meant to write a structured value. + +- However, in this example we forgot to call `serialize_struct_end()` before + `finish()`. As a result, the serialized output is incomplete or syntactically + incorrect. + +- One approach to fix this would be to track internal state manually, and return + a `Result` from methods like `serialize_struct_field()` or `finish()` if the + current state is invalid. + +- But this has downsides: + + - It is easy to get wrong as an implementer. Rust’s type system cannot help + enforce the correctness of our state transitions. + + - It also adds unnecessary burden on the user, who must handle `Result` values + for operations that are misused in source code rather than at runtime. + +- A better solution is to model the valid state transitions directly in the type + system. + + In the next slide, we will apply the **typestate pattern** to enforce correct + usage at compile time and make it impossible to call incompatible methods or + forget to do a required action. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md new file mode 100644 index 00000000..805d22a5 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md @@ -0,0 +1,94 @@ +## Beyond Simple Typestate + +How do we manage increasingly complex configuration flows with many possible +states and transitions, while still preventing incompatible operations? + +```rust +struct Serializer {/* [...] */} +struct SerializeStruct {/* [...] */} +struct SerializeStructProperty {/* [...] */} +struct SerializeList {/* [...] */} + +impl Serializer { + // TODO, implement: + // + // fn serialize_struct(self, name: &str) -> SerializeStruct + // fn finish(self) -> String +} + +impl SerializeStruct { + // TODO, implement: + // + // fn serialize_property(mut self, name: &str) -> SerializeStructProperty + + // TODO, + // How should we finish this struct? This depends on where it appears: + // - At the root level: return `Serializer` + // - As a property inside another struct: return `SerializeStruct` + // - As a value inside a list: return `SerializeList` + // + // fn finish(self) -> ??? +} + +impl SerializeStructProperty { + // TODO, implement: + // + // fn serialize_string(self, value: &str) -> SerializeStruct + // fn serialize_struct(self, name: &str) -> SerializeStruct + // fn serialize_list(self) -> SerializeList + // fn finish(self) -> SerializeStruct +} + +impl SerializeList { + // TODO, implement: + // + // fn serialize_string(mut self, value: &str) -> Self + // fn serialize_struct(mut self, value: &str) -> SerializeStruct + // fn serialize_list(mut self) -> SerializeList + + // TODO: + // Like `SerializeStruct::finish`, the return type depends on nesting. + // + // fn finish(mut self) -> ??? +} +``` + +Diagram of valid transitions: + +```bob + +-----------+ +---------+------------+-----+ + | | | | | | + V | V | V | + + | +serializer --> structure --> property --> list +-+ + + | | ^ | ^ + V | | | | + | +-----------+ | + String | | + +--------------------------+ +``` + +
+ +- Building on our previous serializer, we now want to support **nested + structures** and **lists**. + +- However, this introduces both **duplication** and **structural complexity**. + +- Even more critically, we now hit a **type system limitation**: we cannot + cleanly express what `finish()` should return without duplicating variants for + every nesting context (e.g. root, struct, list). + +- From the diagram of valid transitions, we can observe: + - The transitions are recursive + - The return types depend on _where_ a substructure or list appears + - Each context requires a return path to its parent + +- With only concrete types, this becomes unmanageable. Our current approach + leads to an explosion of types and manual wiring. + +- In the next chapter, we’ll see how **generics** let us model recursive flows + with less boilerplate, while still enforcing valid operations at compile time. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md new file mode 100644 index 00000000..b0c252f1 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md @@ -0,0 +1,101 @@ +## Typestate Pattern: Example + +The typestate pattern encodes part of a value’s runtime state into its type. +This allows us to prevent invalid or inapplicable operations at compile time. + +```rust,editable +use std::fmt::Write as _; + +#[derive(Default)] +struct Serializer { + output: String, +} + +struct SerializeStruct { + serializer: Serializer, +} + +impl Serializer { + fn serialize_struct(mut self, name: &str) -> SerializeStruct { + writeln!(&mut self.output, "{name} {{").unwrap(); + SerializeStruct { serializer: self } + } + + fn finish(self) -> String { + self.output + } +} + +impl SerializeStruct { + fn serialize_field(mut self, key: &str, value: &str) -> Self { + writeln!(&mut self.serializer.output, " {key}={value};").unwrap(); + self + } + + fn finish_struct(mut self) -> Serializer { + self.serializer.output.push_str("}\n"); + self.serializer + } +} + +fn main() { + let serializer = Serializer::default() + .serialize_struct("User") + .serialize_field("id", "42") + .serialize_field("name", "Alice") + .finish_struct(); + + println!("{}", serializer.finish()); +} +``` + +`Serializer` usage flowchart: + +```bob ++------------+ serialize struct +-----------------+ +| Serializer | ------------------> | SerializeStruct | <------+ ++------------+ +-----------------+ | + | + | ^ | | | + | | finish struct | | serialize field | + | +-----------------------------+ +------------------+ + | + +---> finish +``` + +
+ +- This example is inspired by Serde’s + [`Serializer` trait](https://docs.rs/serde/latest/serde/ser/trait.Serializer.html). + Serde uses typestates internally to ensure serialization follows a valid + structure. For more, see: + +- The key idea behind typestate is that state transitions happen by consuming a + value and producing a new one. At each step, only operations valid for that + state are available. + +- In this example: + + - We begin with a `Serializer`, which only allows us to start serializing a + struct. + + - Once we call `.serialize_struct(...)`, ownership moves into a + `SerializeStruct` value. From that point on, we can only call methods + related to serializing struct fields. + + - The original `Serializer` is no longer accessible — preventing us from + mixing modes (such as starting another _struct_ mid-struct) or calling + `finish()` too early. + + - Only after calling `.finish_struct()` do we receive the `Serializer` back. + At that point, the output can be finalized or reused. + +- If we forget to call `finish_struct()` and drop the `SerializeStruct` early, + the `Serializer` is also dropped. This ensures incomplete output cannot leak + into the system. + +- By contrast, if we had implemented everything on `Serializer` directly — as + seen on the previous slide, nothing would stop someone from skipping important + steps or mixing serialization flows. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md new file mode 100644 index 00000000..401550b5 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md @@ -0,0 +1,52 @@ +## Typestate Pattern with Generics + +By combining typestate modeling with generics, we can express a wider range of +valid states and transitions without duplicating logic. This approach is +especially useful when the number of states grows or when multiple states share +behavior but differ in structure. + +```rust +{{#include typestate-generics.rs:Serializer-def}} + +{{#include typestate-generics.rs:Root-def}} +{{#include typestate-generics.rs:Struct-def}} +{{#include typestate-generics.rs:Property-def}} +{{#include typestate-generics.rs:List-def}} +``` + +We now have all the tools needed to implement the methods for the `Serializer` +and its state type definitions. This ensures that our API only permits valid +transitions, as illustrated in the following diagram: + +Diagram of valid transitions: + +```bob + +-----------+ +---------+------------+-----+ + | | | | | | + V | V | V | + + | +serializer --> structure --> property --> list +-+ + + | | ^ | ^ + V | | | | + | +-----------+ | + String | | + +--------------------------+ +``` + +
+ +- By leveraging generics to track the parent context, we can construct + arbitrarily nested serializers that enforce valid transitions between struct, + list, and property states. + +- This enables us to build a recursive structure while maintaining strict + control over which methods are accessible in each state. + +- Methods common to all states can be defined for any `S` in `Serializer`. + +- Marker types (e.g., `List`) introduce no memory or runtime overhead, as + they contain no data other than a possible Zero-Sized Type. Their only role is + to enforce correct API usage through the type system. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.rs b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.rs new file mode 100644 index 00000000..25587c35 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.rs @@ -0,0 +1,164 @@ +// ANCHOR: Complete +use std::fmt::Write as _; + +// ANCHOR: Serializer-def +struct Serializer { + // [...] + indent: usize, + buffer: String, + state: S, +} +// ANCHOR_END: Serializer-def + +// ANCHOR: Root-def +struct Root; +// ANCHOR_END: Root-def + +// ANCHOR: Struct-def +struct Struct(S); +// ANCHOR_END: Struct-def + +// ANCHOR: List-def +struct List(S); +// ANCHOR_END: List-def + +// ANCHOR: Property-def +struct Property(S); +// ANCHOR_END: Property-def + +// ANCHOR: Root-impl +impl Serializer { + fn new() -> Self { + // [...] + Self { indent: 0, buffer: String::new(), state: Root } + } + + fn serialize_struct(mut self, name: &str) -> Serializer> { + // [...] + writeln!(self.buffer, "{name} {{").unwrap(); + Serializer { + indent: self.indent + 1, + buffer: self.buffer, + state: Struct(self.state), + } + } + + fn finish(self) -> String { + // [...] + self.buffer + } +} +// ANCHOR_END: Root-impl + +// ANCHOR: Struct-impl +impl Serializer> { + fn serialize_property(mut self, name: &str) -> Serializer>> { + // [...] + write!(self.buffer, "{}{name}: ", " ".repeat(self.indent * 2)).unwrap(); + Serializer { + indent: self.indent, + buffer: self.buffer, + state: Property(self.state), + } + } + + fn finish_struct(mut self) -> Serializer { + // [...] + self.indent -= 1; + writeln!(self.buffer, "{}}}", " ".repeat(self.indent * 2)).unwrap(); + Serializer { indent: self.indent, buffer: self.buffer, state: self.state.0 } + } +} +// ANCHOR_END: Struct-impl + +// ANCHOR: Property-impl +impl Serializer>> { + fn serialize_struct(mut self, name: &str) -> Serializer>> { + // [...] + writeln!(self.buffer, "{name} {{").unwrap(); + Serializer { + indent: self.indent + 1, + buffer: self.buffer, + state: Struct(self.state.0), + } + } + + fn serialize_list(mut self) -> Serializer>> { + // [...] + writeln!(self.buffer, "[").unwrap(); + Serializer { + indent: self.indent + 1, + buffer: self.buffer, + state: List(self.state.0), + } + } + + fn serialize_string(mut self, value: &str) -> Serializer> { + // [...] + writeln!(self.buffer, "{value},").unwrap(); + Serializer { indent: self.indent, buffer: self.buffer, state: self.state.0 } + } +} +// ANCHOR_END: Property-impl + +// ANCHOR: List-impl +impl Serializer> { + fn serialize_struct(mut self, name: &str) -> Serializer>> { + // [...] + writeln!(self.buffer, "{}{name} {{", " ".repeat(self.indent * 2)).unwrap(); + Serializer { + indent: self.indent + 1, + buffer: self.buffer, + state: Struct(self.state), + } + } + + fn serialize_string(mut self, value: &str) -> Self { + // [...] + writeln!(self.buffer, "{}{value},", " ".repeat(self.indent * 2)).unwrap(); + self + } + + fn finish_list(mut self) -> Serializer { + // [...] + self.indent -= 1; + writeln!(self.buffer, "{}]", " ".repeat(self.indent * 2)).unwrap(); + Serializer { indent: self.indent, buffer: self.buffer, state: self.state.0 } + } +} +// ANCHOR_END: List-impl + +// ANCHOR: main +fn main() { + #[rustfmt::skip] + let serializer = Serializer::new() + .serialize_struct("Foo") + .serialize_property("bar") + .serialize_struct("Bar") + .serialize_property("baz") + .serialize_list() + .serialize_string("abc") + .serialize_struct("Baz") + .serialize_property("partial") + .serialize_string("def") + .serialize_property("empty") + .serialize_struct("Empty") + .finish_struct() + .finish_struct() + .finish_list() + .finish_struct() + .finish_struct(); + + let output = serializer.finish(); + + println!("{output}"); + + // These will all fail at compile time: + + // Serializer::new().serialize_list(); + // Serializer::new().serialize_string("foo"); + // Serializer::new().serialize_struct("Foo").serialize_string("bar"); + // Serializer::new().serialize_struct("Foo").serialize_list(); + // Serializer::new().serialize_property("foo"); +} +// ANCHOR_END: main diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/complete.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/complete.md new file mode 100644 index 00000000..066a7cc1 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/complete.md @@ -0,0 +1,89 @@ +## Serializer: complete implementation + +Looking back at our original desired flow: + +```bob + +-----------+ +---------+------------+-----+ + | | | | | | + V | V | V | + + | +serializer --> structure --> property --> list +-+ + + | | ^ | ^ + V | | | | + | +-----------+ | + String | | + +--------------------------+ +``` + +We can now see this reflected directly in the types of our serializer: + +```bob + +------+ + finish | | + serialize struct V | + struct ++---------------------+ --------------> +-----------------------------+ <---------------+ +| Serializer [ Root ] | | Serializer [ Struct [ S ] ] | | ++---------------------+ <-------------- +-----------------------------+ <-----------+ | + finish struct | | + | | serialize | | | + | +----------+ property V serialize | | + | | string or | | +finish | | +-------------------------------+ struct | | + V | | Serializer [ Property [ S ] ] | ------------+ | + finish | +-------------------------------+ | + +--------+ struct | | + | String | | serialize | | + +--------+ | list V | + | finish | + | +---------------------------+ list | + +------> | Serializer [ List [ S ] ] | ----------------+ + +---------------------------+ + serialize + list or string ^ + | or finish list | + +-------------------+ +``` + +The code for the full implementation of the `Serializer` and all its states can +be found in +[this Rust playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=c9cbb831cd05fe9db4ce42713c83ca16). + +
+ +- This pattern isn't a silver bullet. It still allows issues like: + - Empty or invalid property names (which can be fixed using + [the newtype pattern](../../newtype-pattern.md)) + - Duplicate property names (which could be tracked in `Struct` and handled + via `Result`) + +- If validation failures occur, we can also change method signatures to return a + `Result`, allowing recovery: + + ```rust,compile_fail + struct PropertySerializeError { + kind: PropertyError, + serializer: Serializer>, + } + + impl Serializer> { + fn serialize_property( + self, + name: &str, + ) -> Result>>, PropertySerializeError> { + /* ... */ + } + } + ``` + +- While this API is powerful, it’s not always ergonomic. Production serializers + typically favor simpler APIs and reserve the typestate pattern for enforcing + critical invariants. + +- One excellent real-world example is + [`rustls::ClientConfig`](https://docs.rs/rustls/latest/rustls/client/struct.ClientConfig.html#method.builder), + which uses typestate with generics to guide the user through safe and correct + configuration steps. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/property.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/property.md new file mode 100644 index 00000000..31da577a --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/property.md @@ -0,0 +1,49 @@ +## Serializer: implement Property + +```rust +# use std::fmt::Write as _; +{{#include ../typestate-generics.rs:Serializer-def}} + +{{#include ../typestate-generics.rs:Struct-def}} +{{#include ../typestate-generics.rs:Property-def}} +{{#include ../typestate-generics.rs:List-def}} + +{{#include ../typestate-generics.rs:Property-impl}} +``` + +With the addition of the Property state methods, our diagram is now nearly +complete: + +```bob + +------+ + finish | | + serialize struct V | + struct ++---------------------+ --------------> +-----------------------------+ +| Serializer [ Root ] | | Serializer [ Struct [ S ] ] | ++---------------------+ <-------------- +-----------------------------+ <-----------+ + finish struct | + | serialize | | + | property V serialize | + | string or | +finish | +-------------------------------+ struct | + V | Serializer [ Property [ S ] ] | ------------+ + +-------------------------------+ + +--------+ + | String | serialize | + +--------+ list V + + +---------------------------+ + | Serializer [ List [ S ] ] | + +---------------------------+ +``` + +
+ +- A property can be defined as a `String`, `Struct`, or `List`, enabling + the representation of nested structures. + +- This concludes the step-by-step implementation. The full implementation, + including support for `List`, is shown in the next slide. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/root.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/root.md new file mode 100644 index 00000000..de1b9087 --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/root.md @@ -0,0 +1,40 @@ +## Serializer: implement Root + +```rust +# use std::fmt::Write as _; +{{#include ../typestate-generics.rs:Serializer-def}} + +{{#include ../typestate-generics.rs:Root-def}} +{{#include ../typestate-generics.rs:Struct-def}} + +{{#include ../typestate-generics.rs:Root-impl}} +``` + +Referring back to our original diagram of valid transitions, we can visualize +the beginning of our implementation as follows: + +```bob + serialize + struct ++---------------------+ --------------> +--------------------------------+ +| Serializer [ Root ] | | Serializer [ Struct [ Root ] ] | ++---------------------+ <-------------- +--------------------------------+ + finish struct + | + | + | +finish | + V + + +--------+ + | String | + +--------+ +``` + +
+ +- At the "root" of our `Serializer`, the only construct allowed is a `Struct`. + +- The `Serializer` can only be finalized into a `String` from this root level. + +
diff --git a/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/struct.md b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/struct.md new file mode 100644 index 00000000..7931c50f --- /dev/null +++ b/src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics/struct.md @@ -0,0 +1,43 @@ +## Serializer: implement Struct + +```rust +# use std::fmt::Write as _; +{{#include ../typestate-generics.rs:Serializer-def}} + +{{#include ../typestate-generics.rs:Struct-def}} +{{#include ../typestate-generics.rs:Property-def}} + +{{#include ../typestate-generics.rs:Struct-impl}} +``` + +The diagram can now be expanded as follows: + +```bob + +------+ + finish | | + serialize struct V | + struct ++---------------------+ --------------> +-----------------------------+ +| Serializer [ Root ] | | Serializer [ Struct [ S ] ] | ++---------------------+ <-------------- +-----------------------------+ + finish struct + | serialize | + | property V + | +finish | +------------------------------------------+ + V | Serializer [ Property [ Struct [ S ] ] ] | + +------------------------------------------+ + +--------+ + | String | + +--------+ +``` + +
+ +- A `Struct` can only contain a `Property`; + +- Finishing a `Struct` returns control back to its parent, which in our previous + slide was assumed the `Root`, but in reality however it can be also something + else such as `Struct` in case of nested "structs". + +
From 2955c03231b36e6396356ca00dd250bbe93a8caf Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 18:14:25 +0200 Subject: [PATCH 075/103] Consistently use `**Note:**` instead of `**Note**:` (#2902) I think the former is slightly nicer: I see `:` as belonging to the poor-mans heading we create with the bold text. --- src/chromium/adding-third-party-crates/checking-in.md | 2 +- src/chromium/interoperability-with-cpp/example-bindings.md | 2 +- src/exercises/chromium/build-rules.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chromium/adding-third-party-crates/checking-in.md b/src/chromium/adding-third-party-crates/checking-in.md index 481938e2..be92dbe4 100644 --- a/src/chromium/adding-third-party-crates/checking-in.md +++ b/src/chromium/adding-third-party-crates/checking-in.md @@ -11,7 +11,7 @@ Please also add an `OWNERS` file in the latter location. You should land all this, along with your `Cargo.toml` and `gnrt_config.toml` changes, into the Chromium repo. -**Important**: you need to use `git add -f` because otherwise `.gitignore` files +**Important:** you need to use `git add -f` because otherwise `.gitignore` files may result in some files being skipped. As you do so, you might find presubmit checks fail because of non-inclusive diff --git a/src/chromium/interoperability-with-cpp/example-bindings.md b/src/chromium/interoperability-with-cpp/example-bindings.md index 006eb9b6..6d657d30 100644 --- a/src/chromium/interoperability-with-cpp/example-bindings.md +++ b/src/chromium/interoperability-with-cpp/example-bindings.md @@ -20,7 +20,7 @@ Point out: - Calls from C++ to Rust, and Rust types (in the top part) - Calls from Rust to C++, and C++ types (in the bottom part) -**Common misconception**: It _looks_ like a C++ header is being parsed by Rust, +**Common misconception:** It _looks_ like a C++ header is being parsed by Rust, but this is misleading. This header is never interpreted by Rust, but simply `#include`d in the generated C++ code for the benefit of C++ compilers. diff --git a/src/exercises/chromium/build-rules.md b/src/exercises/chromium/build-rules.md index 1266c28f..8200f510 100644 --- a/src/exercises/chromium/build-rules.md +++ b/src/exercises/chromium/build-rules.md @@ -11,7 +11,7 @@ pub extern "C" fn hello_from_rust() { } ``` -**Important**: note that `no_mangle` here is considered a type of unsafety by +**Important:** note that `no_mangle` here is considered a type of unsafety by the Rust compiler, so you'll need to allow unsafe code in your `gn` target. Add this new Rust target as a dependency of `//ui/base:base`. Declare this From 81ad6772d15b0ee8b1306ae66452c7826326c42f Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 21:03:40 +0200 Subject: [PATCH 076/103] Fix the use of `minutes` frontmatter (#2903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file was inconsistent with the other files in our course. I don’t actually know if both work, but if not, we should consider erroring out to ensure consistency going forward. --- src/generics/generic-traits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generics/generic-traits.md b/src/generics/generic-traits.md index d28d9fb0..c35e6894 100644 --- a/src/generics/generic-traits.md +++ b/src/generics/generic-traits.md @@ -1,5 +1,5 @@ --- -Minutes: 5 +minutes: 5 --- # Generic Traits From f7cbb633052dcdbf75b2db3fbd679136dfe064d3 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 21:04:07 +0200 Subject: [PATCH 077/103] Remove unnecessary and duplicate paragraph (#2913) This doesn't belong in a slide, and we already say the same thing at the top of the slide. --- src/user-defined-types/const.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/user-defined-types/const.md b/src/user-defined-types/const.md index d7d1b4be..0a85fc3d 100644 --- a/src/user-defined-types/const.md +++ b/src/user-defined-types/const.md @@ -4,8 +4,8 @@ minutes: 10 # `const` -Constants are evaluated at compile time and their values are inlined wherever -they are used: +Constants are evaluated at compile time and their values are [inlined][1] +wherever they are used: @@ -31,8 +31,6 @@ fn main() { } ``` -According to the [Rust RFC Book][1] these are inlined upon use. - Only functions marked `const` can be called at compile time to generate `const` values. `const` functions can however be called at runtime. From 766d8df9be1668eb631f8ce36c70dc10b9cb81be Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 21:04:35 +0200 Subject: [PATCH 078/103] Add The Little Book of Rust Macros (#2911) I found this recently when reading about hygiene in Rust macros and really liked it. --- src/other-resources.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/other-resources.md b/src/other-resources.md index ec241d5d..e1dd2a13 100644 --- a/src/other-resources.md +++ b/src/other-resources.md @@ -63,6 +63,8 @@ A small selection of other guides and tutorial for Rust: Lists](https://rust-unofficial.github.io/too-many-lists/): in-depth exploration of Rust's memory management rules, through implementing a few different types of list structures. +- [The Little Book of Rust Macros](https://danielkeep.github.io/tlborm/): covers + many details on Rust macros with practical examples. Please see the [Little Book of Rust Books](https://lborb.github.io/book/) for even more Rust books. From 6ab9858cbe30cd33195ce3b48391934aec8c2846 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 23:08:56 +0200 Subject: [PATCH 079/103] Add speaker notes to instructor-focused slides (#2899) Following the style guide, these notes provide additional context for instructors and self-learners. The notes focus on practical tips for running the course and highlighting key information for students. --- src/running-the-course.md | 26 ++++++++++++++++++++ src/running-the-course/keyboard-shortcuts.md | 12 +++++++++ src/running-the-course/translations.md | 12 +++++++++ 3 files changed, 50 insertions(+) diff --git a/src/running-the-course.md b/src/running-the-course.md index 8b08bcb2..b5788434 100644 --- a/src/running-the-course.md +++ b/src/running-the-course.md @@ -55,3 +55,29 @@ better. Your students are also very welcome to [send us feedback][2]! [1]: https://github.com/google/comprehensive-rust/discussions/86 [2]: https://github.com/google/comprehensive-rust/discussions/100 [3]: https://github.com/google/comprehensive-rust#building + +
+ +### Instructor Preparation + +- **Go through all the material:** Before teaching the course, make sure you + have gone through all the slides and exercises yourself. This will help you + anticipate questions and potential difficulties. +- **Prepare for live coding:** The course involves a lot of live coding. + Practice the examples and exercises beforehand to ensure you can type them out + smoothly during the class. Have the solutions ready in case you get stuck. +- **Familiarize yourself with `mdbook`:** The course is presented using + `mdbook`. Knowing how to navigate, search, and use its features will make the + presentation smoother. + +### Creating a Good Learning Environment + +- **Encourage questions:** Reiterate that there are no "stupid" questions. A + welcoming atmosphere for questions is crucial for learning. +- **Manage time effectively:** Keep an eye on the schedule, but be flexible. + It's more important that students understand the concepts than sticking + rigidly to the timeline. +- **Facilitate group work:** During exercises, encourage students to work + together. This can help them learn from each other and feel less stuck. + +
diff --git a/src/running-the-course/keyboard-shortcuts.md b/src/running-the-course/keyboard-shortcuts.md index 2e213206..ff7c4c61 100644 --- a/src/running-the-course/keyboard-shortcuts.md +++ b/src/running-the-course/keyboard-shortcuts.md @@ -6,3 +6,15 @@ There are several useful keyboard shortcuts in mdBook: - Arrow-Right: Navigate to the next page. - Ctrl + Enter: Execute the code sample that has focus. - s: Activate the search bar. + +
+ +- Mention that these shortcuts are standard for `mdbook` and can be useful when + navigating any `mdbook`-generated site. +- You can demonstrate each shortcut live to the students. +- The s key for search is particularly useful for quickly finding + topics that have been discussed earlier. +- Ctrl + Enter will be super important for you since you'll do a lot + of live coding. + +
diff --git a/src/running-the-course/translations.md b/src/running-the-course/translations.md index 82649be5..4346cb53 100644 --- a/src/running-the-course/translations.md +++ b/src/running-the-course/translations.md @@ -97,3 +97,15 @@ get going. Translations are coordinated on the [issue tracker]. [synced-translation-report]: https://google.github.io/comprehensive-rust/synced-translation-report.html [our instructions]: https://github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md [issue tracker]: https://github.com/google/comprehensive-rust/issues/282 + +
+ +- This is a good opportunity to thank the volunteers who have contributed to the + translations. +- If there are students in the class who speak any of the listed languages, you + can encourage them to check out the translated versions and even contribute if + they find any issues. +- Highlight that the project is open source and contributions are welcome, not + just for translations but for the course content itself. + +
From 19116d263f2f14006aa792c5a0591d0506dd7578 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 23:09:32 +0200 Subject: [PATCH 080/103] Add speaker notes to Fibonacci exercise (#2898) The speaker notes should prompt a deeper discussion around the exercise by calling out the non-obvious integer overflow pitfall and encourage instructors to explore alternative implementations with students, moving beyond a surface-level recursive solution. --- src/types-and-values/exercise.md | 12 ++++++++++++ src/types-and-values/solution.md | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/types-and-values/exercise.md b/src/types-and-values/exercise.md index ea47abd1..32dafbe3 100644 --- a/src/types-and-values/exercise.md +++ b/src/types-and-values/exercise.md @@ -23,3 +23,15 @@ this function panic? {{#include exercise.rs:main}} ``` + +
+ +- This exercise is a classic introduction to recursion. +- Encourage students to think about the base cases and the recursive step. +- The question "When will this function panic?" is a hint to think about integer + overflow. The Fibonacci sequence grows quickly! +- Students might come up with an iterative solution as well, which is a great + opportunity to discuss the trade-offs between recursion and iteration (e.g., + performance, stack overflow for deep recursion). + +
diff --git a/src/types-and-values/solution.md b/src/types-and-values/solution.md index b4a4c92c..3cf30cf4 100644 --- a/src/types-and-values/solution.md +++ b/src/types-and-values/solution.md @@ -3,3 +3,21 @@ ```rust,editable {{#include exercise.rs:solution}} ``` + +
+ +- Walk through the solution step-by-step. +- Explain the recursive calls and how they lead to the final result. +- Discuss the integer overflow issue. With `u32`, the function will panic for + `n` around 47. You can demonstrate this by changing the input to `main`. +- Show an iterative solution as an alternative and compare its performance and + memory usage with the recursive one. An iterative solution will be much more + efficient. + +## More to Explore + +For a more advanced discussion, you can introduce memoization or dynamic +programming to optimize the recursive Fibonacci calculation, although this is +beyond the scope of the current topic. + +
From d6be949511bb69e050dd92cd23479eed37ab01af Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 18 Sep 2025 23:26:12 +0200 Subject: [PATCH 081/103] Give Gemini details on our Markdown conventions (#2905) This should help it produce more consistent slides. For example, it will now know not to add sub-headings to slides. The initial version of this was generated by Gemini itself, and I then tweaked it by adding some more constraints. --- GEMINI.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/GEMINI.md b/GEMINI.md index 2d19288d..2ca3c24b 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -72,8 +72,70 @@ list of options. development tasks. - **Course Content:** Markdown files in the `src/` directory, structured according to `src/SUMMARY.md`. -- **Code Formatting:** `dprint fmt` is used to format all source files according - to `rustfmt.toml` and `dprint.json`. - **Contributions:** Refer to `CONTRIBUTING.md` for guidelines on contributing to the project. - **Style:** Refer to `STYLE.md` for style guidelines. + +## Markdown Conventions + +- **Headings:** + - **H1 (`#`):** Used for the main title of each page. Each slide has exactly + one title. + - **H2 (`##`):** Used for major sections. Slides do not use H2 headings to + save vertical space; more slides are created instead. + - **H3 (`###`):** Used for sub-sections, but not on slides. + +- **Emphasis:** + - **Bold (`**...**`):** Used to highlight key terms, commands, and for notes + (e.g., `**Note:**`). The colon (`:`) is included inside the bold text for + notes. + - **Italic (`_..._`):** Used for general emphasis, titles of external + articles, and for terms being defined. + +- **Code:** + - **Inline Code (`` `...` ``):** Used for code snippets, file names, commands, + type names, and language keywords. Rust fragments are formatted as `rustfmt` + would. + - **Code Blocks (`` ```...``` ``):** Fenced code blocks are used for + multi-line code examples, annotated with a language identifier (e.g., + `rust`, `c`, `ignore`). + - **Interactive Code Blocks:** Rust examples are made interactive with + `editable`. Examples that fail to compile are marked with `compile_fail` or + `should_panic`. + - **Diagrams:** The `bob` language identifier is used in code blocks to + generate ASCII art diagrams. + - **Formatting Control:** The `#[rustfmt::skip]` attribute is used to prevent + `rustfmt` from formatting specific code blocks, though it is used rarely. + +- **Lists:** + - **Bulleted Lists:** Unordered lists are the primary way to lay out key + points on slides. + - **Glossary Format:** The glossary uses a specific format with a colon and + backslash (`:\`) after each term to create a hard line break for visual + formatting. + +- **Other Markdown Elements:** + - **Block Quotes (`> ...`):** Used sparingly for important notes, warnings, or + supplementary information to draw attention. + - **Links:** Both standard (`[text](url)`) and reference-style + (`[text][label]`) links are used. + - **Tables:** Markdown tables are used to present structured data. + - **Horizontal Rules (`---`):** Not used on slides. + +- **HTML Tags:** + - **`
`:** Used for collapsible "speaker notes". + - **``:** Used to denote keyboard keys. + - **`