diff --git a/po/pt-BR.po b/po/pt-BR.po
index 5d611083cf7..83b4a941906 100644
--- a/po/pt-BR.po
+++ b/po/pt-BR.po
@@ -5,12 +5,11 @@ msgstr ""
"PO-Revision-Date: 2023-08-25 09:32-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
-"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 3.3.2\n"
#: src/SUMMARY.md:4 src/index.md:1
msgid "Welcome to Comprehensive Rust 🦀"
@@ -1414,22 +1413,6 @@ msgstr ""
"prontas para uso. Você pode então copiar/colar os exemplos para `src/main."
"rs` para experimentá-los:"
-#: src/running-the-course/course-structure.md:54
-msgid ""
-"```shell\n"
-"cargo init concurrency\n"
-"cd concurrency\n"
-"cargo add tokio --features full\n"
-"cargo run\n"
-"```"
-msgstr ""
-"```shell\n"
-"cargo init concurrency\n"
-"cd concurrency\n"
-"cargo add tokio —features full\n"
-"cargo run\n"
-"```"
-
#: src/running-the-course/course-structure.md:61
msgid "Format"
msgstr "Formato"
@@ -1618,16 +1601,6 @@ msgstr ""
"Entretanto, isto lhe fornece uma versão desatualizada do Rust e pode levar a "
"comportamentos inesperados. O comando seria:"
-#: src/cargo.md:18
-msgid ""
-"```shell\n"
-"sudo apt install cargo rust-src rustfmt\n"
-"```"
-msgstr ""
-"```shell\n"
-"sudo apt install cargo rust-src rustfmt\n"
-"```"
-
#: src/cargo.md:22
msgid ""
"We suggest using [VS Code](https://code.visualstudio.com/) to edit the code "
@@ -1868,27 +1841,17 @@ msgstr ""
msgid "The code blocks in this course are fully interactive:"
msgstr "Os blocos de código neste curso são totalmente interativos:"
-#: src/cargo/code-samples.md:13
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(\"Edit me!\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust, editable\n"
-"fn main() {\n"
-" println!(\"Edite-me!\");\n"
-"}\n"
-"```"
+#: src/cargo/code-samples.md:15 src/cargo/running-locally.md:45
+msgid "\"Edit me!\""
+msgstr "\"Edite-me!\""
#: src/cargo/code-samples.md:19
msgid "You can use "
msgstr "Você pode usar "
#: src/cargo/code-samples.md:19
-msgid " to execute the code when focus is in the text box."
-msgstr " para executar o código quando o foco estiver na caixa de texto."
+msgid "to execute the code when focus is in the text box."
+msgstr "para executar o código quando o foco estiver na caixa de texto."
#: src/cargo/code-samples.md:24
msgid ""
@@ -1934,22 +1897,6 @@ msgstr ""
"fornecer o `rustc` e o `cargo` funcionando. Quando este curso foi escrito, "
"as últimas versões estáveis do Rust são:"
-#: src/cargo/running-locally.md:8
-msgid ""
-"```shell\n"
-"% rustc --version\n"
-"rustc 1.69.0 (84c898d65 2023-04-16)\n"
-"% cargo --version\n"
-"cargo 1.69.0 (6e9a83356 2023-04-12)\n"
-"```"
-msgstr ""
-"```shell\n"
-"% rustc —version\n"
-"rustc 1.69.0 (84c898d65 2023-04-16)\n"
-"% cargo —version\n"
-"cargo 1.69.0 (6e9a83356 2023-04-12)\n"
-"```"
-
#: src/cargo/running-locally.md:15
msgid ""
"You can use any later version too since Rust maintains backwards "
@@ -1979,18 +1926,6 @@ msgstr ""
"Use `cargo new exercise` para criar um novo diretório `exercise/` para o seu "
"código:"
-#: src/cargo/running-locally.md:24
-msgid ""
-"```shell\n"
-"$ cargo new exercise\n"
-" Created binary (application) `exercise` package\n"
-"```"
-msgstr ""
-"```shell\n"
-"$ cargo new exercise\n"
-" Created binary (application) `exercise` package\n"
-"```"
-
#: src/cargo/running-locally.md:29
msgid ""
"Navigate into `exercise/` and use `cargo run` to build and run your binary:"
@@ -1998,26 +1933,6 @@ msgstr ""
"Navegue até `exercise/` e use `cargo run` para compilar e executar seu "
"binário:"
-#: src/cargo/running-locally.md:31
-msgid ""
-"```shell\n"
-"$ cd exercise\n"
-"$ cargo run\n"
-" Compiling exercise v0.1.0 (/home/mgeisler/tmp/exercise)\n"
-" Finished dev [unoptimized + debuginfo] target(s) in 0.75s\n"
-" Running `target/debug/exercise`\n"
-"Hello, world!\n"
-"```"
-msgstr ""
-"```shell\n"
-"$ cd exercise\n"
-"$ cargo run\n"
-" Compiling exercise v0.1.0 (/home/mgeisler/tmp/exercise)\n"
-" Finished dev [unoptimized + debuginfo] target(s) in 0.75s\n"
-" Running `target/debug/exercise`\n"
-"Hello, world!\n"
-"```"
-
#: src/cargo/running-locally.md:40
msgid ""
"Replace the boiler-plate code in `src/main.rs` with your own code. For "
@@ -2026,42 +1941,10 @@ msgstr ""
"Substitua o código gerado em `src/main.rs` pelo seu próprio código. Por "
"exemplo, usando o exemplo da página anterior, faça `src/main.rs` parecer como"
-#: src/cargo/running-locally.md:43
-msgid ""
-"```rust\n"
-"fn main() {\n"
-" println!(\"Edit me!\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust\n"
-"fn main() {\n"
-" println!(\"Edit me!\");\n"
-"}\n"
-"```"
-
#: src/cargo/running-locally.md:49
msgid "Use `cargo run` to build and run your updated binary:"
msgstr "Use `cargo run` para compilar e executar seu binário atualizado:"
-#: src/cargo/running-locally.md:51
-msgid ""
-"```shell\n"
-"$ cargo run\n"
-" Compiling exercise v0.1.0 (/home/mgeisler/tmp/exercise)\n"
-" Finished dev [unoptimized + debuginfo] target(s) in 0.24s\n"
-" Running `target/debug/exercise`\n"
-"Edit me!\n"
-"```"
-msgstr ""
-"```shell\n"
-"$ cargo run\n"
-" Compiling exercise v0.1.0 (/home/mgeisler/tmp/exercise)\n"
-" Finished dev [unoptimized + debuginfo] target(s) in 0.24s\n"
-" Running `target/debug/exercise`\n"
-"Edit me!\n"
-"```"
-
#: src/cargo/running-locally.md:59
msgid ""
"Use `cargo check` to quickly check your project for errors, use `cargo "
@@ -2305,19 +2188,9 @@ msgstr ""
"Vamos pular para o programa em Rust mais simples possível, o clássico \"Olá "
"Mundo\":"
-#: src/hello-world.md:6
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(\"Hello 🌍!\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(\"Olá, 🌍!\");\n"
-"}\n"
-"```"
+#: src/hello-world.md:8
+msgid "\"Hello 🌍!\""
+msgstr "\"Olá, 🌍!\""
#: src/hello-world.md:12
msgid "What you see:"
@@ -2405,39 +2278,33 @@ msgstr ""
msgid "Here is a small example program in Rust:"
msgstr "Aqui está um pequeno programa de exemplo em Rust:"
-#: src/hello-world/small-example.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() { // Program entry point\n"
-" let mut x: i32 = 6; // Mutable variable binding\n"
-" print!(\"{x}\"); // Macro for printing, like printf\n"
-" while x != 1 { // No parenthesis around expression\n"
-" if x % 2 == 0 { // Math like in other languages\n"
-" x = x / 2;\n"
-" } else {\n"
-" x = 3 * x + 1;\n"
-" }\n"
-" print!(\" -> {x}\");\n"
-" }\n"
-" println!();\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() { // Ponto de entrada do programa\n"
-" let mut x: i32 = 6; // Atribuição de uma variável mutável\n"
-" print!(\"{x}\"); // Macro para escrever na tela, como printf\n"
-" while x != 1 { // Sem parênteses ao redor de expressões\n"
-" if x % 2 == 0 { // Matemática como em outras linguagens\n"
-" x = x / 2;\n"
-" } else {\n"
-" x = 3 * x + 1;\n"
-" }\n"
-" print!(\" -> {x}\");\n"
-" }\n"
-" println!();\n"
-"}\n"
-"```"
+#: src/hello-world/small-example.md:6
+msgid "// Program entry point\n"
+msgstr "// Ponto de entrada do programa\n"
+
+#: src/hello-world/small-example.md:7
+msgid "// Mutable variable binding\n"
+msgstr "// Atribuição de uma variável mutável\n"
+
+#: src/hello-world/small-example.md:8 src/traits/impl-trait.md:15
+msgid "\"{x}\""
+msgstr "\"{x}\""
+
+#: src/hello-world/small-example.md:8
+msgid "// Macro for printing, like printf\n"
+msgstr "// Macro para escrever na tela, como printf\n"
+
+#: src/hello-world/small-example.md:9
+msgid "// No parenthesis around expression\n"
+msgstr "// Sem parênteses ao redor de expressões\n"
+
+#: src/hello-world/small-example.md:10
+msgid "// Math like in other languages\n"
+msgstr "// Matemática como em outras linguagens\n"
+
+#: src/hello-world/small-example.md:15
+msgid "\" -> {x}\""
+msgstr "\" -> {x}\""
#: src/hello-world/small-example.md:23
msgid ""
@@ -2968,41 +2835,27 @@ msgstr ""
"escape desabilitados: `r\"\\n\" == \"\\\\n\"`. Você pode embutir aspas "
"duplas utilizando uma quantidade igual de `#` em Ambos os lados das aspas:"
-#: src/basic-syntax/scalar-types.md:27
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(r#\"link\"#);\n"
-" println!(\"link\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(r#\"link\"#);\n"
-" println!(\"link\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/scalar-types.md:29
+msgid "r#\"link\"#"
+msgstr "r#\"link\"#"
+
+#: src/basic-syntax/scalar-types.md:30
+msgid "\"link\""
+msgstr "\"link\""
#: src/basic-syntax/scalar-types.md:34
msgid "Byte strings allow you to create a `&[u8]` value directly:"
msgstr "Strings de byte permitem que você crie um valor `&[u8]` diretamente:"
-#: src/basic-syntax/scalar-types.md:36
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(\"{:?}\", b\"abc\");\n"
-" println!(\"{:?}\", &[97, 98, 99]);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" println!(\"{:?}\", b\"abc\");\n"
-" println!(\"{:?}\", &[97, 98, 99]);\n"
-"}\n"
-"```"
+#: src/basic-syntax/scalar-types.md:38 src/basic-syntax/scalar-types.md:39
+#: src/control-flow/if-let-expressions.md:30 src/async/control-flow/join.md:30
+#: src/exercises/day-1/solutions-morning.md:99
+msgid "\"{:?}\""
+msgstr "\"{:?}\""
+
+#: src/basic-syntax/scalar-types.md:38
+msgid "b\"abc\""
+msgstr "b\"abc\""
#: src/basic-syntax/scalar-types.md:43
msgid ""
@@ -3042,45 +2895,21 @@ msgstr "`()`, `('x',)`, `('x', 1.2)`, ..."
msgid "Array assignment and access:"
msgstr "Atribuição e acesso a matrizes:"
-#: src/basic-syntax/compound-types.md:10
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut a: [i8; 10] = [42; 10];\n"
-" a[5] = 0;\n"
-" println!(\"a: {:?}\", a);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut a: [i8; 10] = [42; 10];\n"
-" a[5] = 0;\n"
-" println!(\"a: {:?}\", a);\n"
-"}\n"
-"```"
+#: src/basic-syntax/compound-types.md:14
+msgid "\"a: {:?}\""
+msgstr "\"a: {:?}\""
#: src/basic-syntax/compound-types.md:18
msgid "Tuple assignment and access:"
msgstr "Atribuição e acesso a tuplas:"
-#: src/basic-syntax/compound-types.md:20
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let t: (i8, bool) = (7, true);\n"
-" println!(\"1st index: {}\", t.0);\n"
-" println!(\"2nd index: {}\", t.1);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let t: (i8, bool) = (7, true);\n"
-" println!(\"1º índice: {}\", t.0);\n"
-" println!(\"2º índice: {}\", t.1);\n"
-"}\n"
-"```"
+#: src/basic-syntax/compound-types.md:23
+msgid "\"1st index: {}\""
+msgstr "\"1º índice: {}\""
+
+#: src/basic-syntax/compound-types.md:24
+msgid "\"2nd index: {}\""
+msgstr "\"2º índice: {}\""
#: src/basic-syntax/compound-types.md:32
msgid "Arrays:"
@@ -3167,17 +2996,12 @@ msgstr ""
msgid "Like C++, Rust has references:"
msgstr "Como C++, o Rust tem referências:"
-#: src/basic-syntax/references.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut x: i32 = 10;\n"
-" let ref_x: &mut i32 = &mut x;\n"
-" *ref_x = 20;\n"
-" println!(\"x: {x}\");\n"
-"}\n"
-"```"
-msgstr ""
+#: src/basic-syntax/references.md:10 src/basic-syntax/variables.md:9
+#: src/ownership/copy-clone.md:9 src/control-flow/blocks.md:22
+#: src/control-flow/while-let-expressions.md:12
+#: src/control-flow/for-expressions.md:12 src/control-flow/break-continue.md:15
+msgid "\"x: {x}\""
+msgstr "\"x: {x}\""
#: src/basic-syntax/references.md:14
msgid "Some notes:"
@@ -3223,18 +3047,8 @@ msgstr ""
msgid "Rust will statically forbid dangling references:"
msgstr "Rust estaticamente proibirá referências pendentes:"
-#: src/basic-syntax/references-dangling.md:5
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let ref_x: &i32;\n"
-" {\n"
-" let x: i32 = 10;\n"
-" ref_x = &x;\n"
-" }\n"
-" println!(\"ref_x: {ref_x}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/references-dangling.md:12
+msgid "\"ref_x: {ref_x}\""
msgstr ""
#: src/basic-syntax/references-dangling.md:16
@@ -3257,29 +3071,13 @@ msgstr "Falaremos mais sobre empréstimos quando chegarmos à _ownership_."
msgid "A slice gives you a view into a larger collection:"
msgstr "Uma _slice_ (fatia) oferece uma visão de uma coleção maior:"
-#: src/basic-syntax/slices.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut a: [i32; 6] = [10, 20, 30, 40, 50, 60];\n"
-" println!(\"a: {a:?}\");\n"
-"\n"
-" let s: &[i32] = &a[2..4];\n"
-"\n"
-" println!(\"s: {s:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut a: [i32; 6] = [10, 20, 30, 40, 50, 60];\n"
-" println!(\"a: {a:?}\");\n"
-"\n"
-" let s: &[i32] = &a[2..4];\n"
-"\n"
-" println!(\"s: {s:?}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/slices.md:8
+msgid "\"a: {a:?}\""
+msgstr "\"a: {a:?}\""
+
+#: src/basic-syntax/slices.md:12
+msgid "\"s: {s:?}\""
+msgstr "\"s: {s:?}\""
#: src/basic-syntax/slices.md:16
msgid "Slices borrow data from the sliced type."
@@ -3368,37 +3166,28 @@ msgstr "`String` vs `str`"
msgid "We can now understand the two string types in Rust:"
msgstr "Agora podemos entender os dois tipos de strings em Rust:"
-#: src/basic-syntax/string-slices.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1: &str = \"World\";\n"
-" println!(\"s1: {s1}\");\n"
-"\n"
-" let mut s2: String = String::from(\"Hello \");\n"
-" println!(\"s2: {s2}\");\n"
-" s2.push_str(s1);\n"
-" println!(\"s2: {s2}\");\n"
-" \n"
-" let s3: &str = &s2[6..];\n"
-" println!(\"s3: {s3}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1: &str = \"Mundo\";\n"
-" println!(\"s1: {s1}\");\n"
-"\n"
-" let mut s2: String = String::from(\"Olá \");\n"
-" println!(\"s2: {s2}\");\n"
-" s2.push_str(s1);\n"
-" println!(\"s2: {s2}\");\n"
-" \n"
-" let s3: &str = &s2[6..];\n"
-" println!(\"s3: {s3}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/string-slices.md:7 src/traits/read-write.md:36
+#: src/testing/test-modules.md:12
+msgid "\"World\""
+msgstr "\"Mundo\""
+
+#: src/basic-syntax/string-slices.md:8
+msgid "\"s1: {s1}\""
+msgstr "\"s1: {s1}\""
+
+#: src/basic-syntax/string-slices.md:10 src/memory-management/scope-based.md:16
+#: src/memory-management/garbage-collection.md:15
+msgid "\"Hello \""
+msgstr "\"Olá \""
+
+#: src/basic-syntax/string-slices.md:11 src/basic-syntax/string-slices.md:13
+#: src/ownership/move-semantics.md:9
+msgid "\"s2: {s2}\""
+msgstr "\"s2: {s2}\""
+
+#: src/basic-syntax/string-slices.md:16
+msgid "\"s3: {s3}\""
+msgstr "\"s3: {s3}\""
#: src/basic-syntax/string-slices.md:20
msgid "Rust terminology:"
@@ -3479,63 +3268,39 @@ msgstr ""
"Uma versão em Rust da famosa pergunta de entrevistas [FizzBuzz](https://en."
"wikipedia.org/wiki/Fizz_buzz):"
-#: src/basic-syntax/functions.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" print_fizzbuzz_to(20);\n"
-"}\n"
-"\n"
-"fn is_divisible(n: u32, divisor: u32) -> bool {\n"
-" if divisor == 0 {\n"
-" return false;\n"
-" }\n"
-" n % divisor == 0\n"
-"}\n"
-"\n"
-"fn fizzbuzz(n: u32) -> String {\n"
-" let fizz = if is_divisible(n, 3) { \"fizz\" } else { \"\" };\n"
-" let buzz = if is_divisible(n, 5) { \"buzz\" } else { \"\" };\n"
-" if fizz.is_empty() && buzz.is_empty() {\n"
-" return format!(\"{n}\");\n"
-" }\n"
-" format!(\"{fizz}{buzz}\")\n"
-"}\n"
-"\n"
-"fn print_fizzbuzz_to(n: u32) {\n"
-" for i in 1..=n {\n"
-" println!(\"{}\", fizzbuzz(i));\n"
-" }\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" imprimir_fizzbuzz_para(20);\n"
-"}\n"
-"\n"
-"fn eh_divisivel(n: u32, divisor: u32) -> bool {\n"
-" if divisor == 0 {\n"
-" return false;\n"
-" }\n"
-" n % divisor == 0\n"
-"}\n"
-"\n"
-"fn fizzbuzz(n: u32) -> String {\n"
-" let fizz = if eh_divisivel(n, 3) { \"fizz\" } else { \"\" };\n"
-" let buzz = if eh_divisivel(n, 5) { \"buzz\" } else { \"\" };\n"
-" if fizz.is_empty() && buzz.is_empty() {\n"
-" return format!(\"{n}\");\n"
-" }\n"
-" format!(\"{fizz}{buzz}\")\n"
-"}\n"
-"\n"
-"fn imprimir_fizzbuzz_para(n: u32) {\n"
-" for i in 1..=n {\n"
-" println!(\"{}\", fizzbuzz(i));\n"
-" }\n"
-"}\n"
-"```"
+#: src/basic-syntax/functions.md:18
+msgid "\"fizz\""
+msgstr "\"fizz\""
+
+#: src/basic-syntax/functions.md:18 src/basic-syntax/functions.md:19
+#: src/exercises/day-2/luhn.md:40 src/testing/unit-tests.md:15
+#: src/exercises/day-2/solutions-afternoon.md:65
+#: src/exercises/day-3/solutions-morning.md:112
+#: src/exercises/day-3/solutions-morning.md:114
+#: src/exercises/day-3/solutions-morning.md:118
+#: src/exercises/day-3/solutions-morning.md:136
+#: src/exercises/day-3/solutions-morning.md:140
+msgid "\"\""
+msgstr "\"\""
+
+#: src/basic-syntax/functions.md:19
+msgid "\"buzz\""
+msgstr "\"buzz\""
+
+#: src/basic-syntax/functions.md:21
+msgid "\"{n}\""
+msgstr "\"{n}\""
+
+#: src/basic-syntax/functions.md:23
+msgid "\"{fizz}{buzz}\""
+msgstr "\"{fizz}{buzz}\""
+
+#: src/basic-syntax/functions.md:28 src/traits/trait-objects.md:79
+#: src/traits/trait-objects.md:80 src/testing/test-modules.md:12
+#: src/android/build-rules/library.md:44 src/async/pitfalls/cancellation.md:59
+#: src/exercises/day-3/solutions-morning.md:158
+msgid "\"{}\""
+msgstr "\"{}\""
#: src/basic-syntax/functions.md:35
msgid ""
@@ -3584,33 +3349,24 @@ msgstr ""
"Todos os itens da linguagem podem ser documentados com a sintaxe especial "
"`///`."
-#: src/basic-syntax/rustdoc.md:5
+#: src/basic-syntax/rustdoc.md:6
msgid ""
-"```rust,editable\n"
"/// Determine whether the first argument is divisible by the second "
"argument.\n"
"///\n"
"/// If the second argument is zero, the result is false.\n"
-"fn is_divisible_by(lhs: u32, rhs: u32) -> bool {\n"
-" if rhs == 0 {\n"
-" return false; // Corner case, early return\n"
-" }\n"
-" lhs % rhs == 0 // The last expression in a block is the return "
-"value\n"
-"}\n"
-"```"
msgstr ""
-"```rust,editable\n"
"/// Determine se o primeiro argumento é divisível pelo segundo argumento.\n"
"///\n"
"/// Se o segundo argumento for zero, o resultado é falso.\n"
-"fn divisivel_por(lhs: u32, rhs: u32) -> bool {\n"
-" if rhs == 0 {\n"
-" return false; // Caso excepcional, retorne antes\n"
-" }\n"
-" lhs % rhs == 0 // A última expressão do bloco é o valor de retorno\n"
-"}\n"
-"```"
+
+#: src/basic-syntax/rustdoc.md:11
+msgid "// Corner case, early return\n"
+msgstr "// Caso excepcional, retorne antes\n"
+
+#: src/basic-syntax/rustdoc.md:13
+msgid "// The last expression in a block is the return value\n"
+msgstr "// A última expressão do bloco é o valor de retorno\n"
#: src/basic-syntax/rustdoc.md:17
msgid ""
@@ -3667,55 +3423,13 @@ msgstr ""
"Métodos são funções associadas a um tipo específico. O primeiro argumento "
"(`self`) de um método é uma instância do tipo ao qual está associado:"
-#: src/basic-syntax/methods.md:6
-msgid ""
-"```rust,editable\n"
-"struct Rectangle {\n"
-" width: u32,\n"
-" height: u32,\n"
-"}\n"
-"\n"
-"impl Rectangle {\n"
-" fn area(&self) -> u32 {\n"
-" self.width * self.height\n"
-" }\n"
-"\n"
-" fn inc_width(&mut self, delta: u32) {\n"
-" self.width += delta;\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let mut rect = Rectangle { width: 10, height: 5 };\n"
-" println!(\"old area: {}\", rect.area());\n"
-" rect.inc_width(5);\n"
-" println!(\"new area: {}\", rect.area());\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"struct Retangulo {\n"
-" largura: u32,\n"
-" altura: u32,\n"
-"}\n"
-"\n"
-"impl Retangulo {\n"
-" fn area(&self) -> u32 {\n"
-" self.largura * self.altura\n"
-" }\n"
-"\n"
-" fn aum_largura(&mut self, delta: u32) {\n"
-" self.largura += delta;\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let mut ret = Retangulo { largura: 10, altura: 5 };\n"
-" println!(\"area antiga: {}\", ret.area());\n"
-" ret.aum_largura(5);\n"
-" println!(\"nova area: {}\", ret.area());\n"
-"}\n"
-"```"
+#: src/basic-syntax/methods.md:24
+msgid "\"old area: {}\""
+msgstr "\"area antiga: {}\""
+
+#: src/basic-syntax/methods.md:26
+msgid "\"new area: {}\""
+msgstr "\"nova area: {}\""
#: src/basic-syntax/methods.md:30
msgid ""
@@ -3731,21 +3445,6 @@ msgstr ""
"Adicione um método estático chamado `Retangulo::new` e o chame a partir de "
"`main`:"
-#: src/basic-syntax/methods.md:36
-#, fuzzy
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn new(width: u32, height: u32) -> Rectangle {\n"
-" Rectangle { width, height }\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn new(largura: u32, altura: u32) -> Retangulo {\n"
-" Retangulo { largura, altura }\n"
-"}\n"
-"```"
-
#: src/basic-syntax/methods.md:42
#, fuzzy
msgid ""
@@ -3805,29 +3504,21 @@ msgstr "Às vezes macros são utilizadas como alternativa."
msgid "However, function parameters can be generic:"
msgstr "No entanto, os parâmetros da função podem ser tipos genéricos:"
-#: src/basic-syntax/functions-interlude.md:14
-msgid ""
-"```rust,editable\n"
-"fn pick_one(a: T, b: T) -> T {\n"
-" if std::process::id() % 2 == 0 { a } else { b }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"coin toss: {}\", pick_one(\"heads\", \"tails\"));\n"
-" println!(\"cash prize: {}\", pick_one(500, 1000));\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn escolha_um(a: T, b: T) -> T {\n"
-" if std::process::id() % 2 == 0 { a } else { b }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"lance da moeda: {}\", escolha_um(\"cara\", \"coroa\"));\n"
-" println!(\"prêmio em dinheiro: {}\", escolha_um(500, 1000));\n"
-"}\n"
-"```"
+#: src/basic-syntax/functions-interlude.md:20
+msgid "\"coin toss: {}\""
+msgstr "\"lance da moeda: {}\""
+
+#: src/basic-syntax/functions-interlude.md:20
+msgid "\"heads\""
+msgstr "\"cara\""
+
+#: src/basic-syntax/functions-interlude.md:20
+msgid "\"tails\""
+msgstr "\"coroa\""
+
+#: src/basic-syntax/functions-interlude.md:21
+msgid "\"cash prize: {}\""
+msgstr "\"prêmio em dinheiro: {}\""
#: src/basic-syntax/functions-interlude.md:27
msgid ""
@@ -3901,33 +3592,9 @@ msgstr ""
"([ao contrário de C++](https://en.cppreference.com/w/cpp/language/"
"implicit_conversion)). Você pode ver isso em um programa como este:"
-#: src/exercises/day-1/implicit-conversions.md:6
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn multiply(x: i16, y: i16) -> i16 {\n"
-" x * y\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let x: i8 = 15;\n"
-" let y: i16 = 1000;\n"
-"\n"
-" println!(\"{x} * {y} = {}\", multiply(x, y));\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn multiplicar(x: i16, y: i16) -> i16 {\n"
-" x * y\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let x: i8 = 15;\n"
-" let y: i16 = 1000;\n"
-"\n"
-" println!(\"{x} * {y} = {}\", multiplicar(x, y));\n"
-"}\n"
-"```"
+#: src/exercises/day-1/implicit-conversions.md:15
+msgid "\"{x} * {y} = {}\""
+msgstr "\"{x} * {y} = {}\""
#: src/exercises/day-1/implicit-conversions.md:19
msgid ""
@@ -4001,16 +3668,6 @@ msgstr "Matrizes (_Arrays_) e _Loops_ (Laços) `for`"
msgid "We saw that an array can be declared like this:"
msgstr "Vimos que uma matriz pode ser declarada assim:"
-#: src/exercises/day-1/for-loops.md:5
-msgid ""
-"```rust\n"
-"let array = [10, 20, 30];\n"
-"```"
-msgstr ""
-"```rust\n"
-"let matriz = [10, 20, 30];\n"
-"```"
-
#: src/exercises/day-1/for-loops.md:9
msgid ""
"You can print such an array by asking for its debug representation with `{:?}"
@@ -4019,21 +3676,9 @@ msgstr ""
"Você pode imprimir tal matriz solicitando sua representação de depuração com "
"`{:?}`:"
-#: src/exercises/day-1/for-loops.md:11
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let array = [10, 20, 30];\n"
-" println!(\"array: {array:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let matriz = [10, 20, 30];\n"
-" println!(\"matriz: {matriz:?}\");\n"
-"}\n"
-"```"
+#: src/exercises/day-1/for-loops.md:14
+msgid "\"array: {array:?}\""
+msgstr "\"matriz: {matriz:?}\""
#: src/exercises/day-1/for-loops.md:18
msgid ""
@@ -4043,41 +3688,21 @@ msgstr ""
"Rust permite iterar em coisas como matrizes e _ranges_ (faixas ou "
"intervalos) usando a palavra-chave `for`:"
-#: src/exercises/day-1/for-loops.md:21
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let array = [10, 20, 30];\n"
-" print!(\"Iterating over array:\");\n"
-" for n in &array {\n"
-" print!(\" {n}\");\n"
-" }\n"
-" println!();\n"
-"\n"
-" print!(\"Iterating over range:\");\n"
-" for i in 0..3 {\n"
-" print!(\" {}\", array[i]);\n"
-" }\n"
-" println!();\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let matriz = [10, 20, 30];\n"
-" print!(\"Iterando sobre a matriz:\");\n"
-" for n in &matriz {\n"
-" print!(\" {n}\");\n"
-" }\n"
-" println!();\n"
-"\n"
-" print!(\"Iterando sobre um range:\");\n"
-" for i in 0..3 {\n"
-" print!(\" {}\", matriz[i]);\n"
-" }\n"
-" println!();\n"
-"}\n"
-"```"
+#: src/exercises/day-1/for-loops.md:24
+msgid "\"Iterating over array:\""
+msgstr "\"Iterando sobre a matriz:\""
+
+#: src/exercises/day-1/for-loops.md:26
+msgid "\" {n}\""
+msgstr "\" {n}\""
+
+#: src/exercises/day-1/for-loops.md:30
+msgid "\"Iterating over range:\""
+msgstr "\"Iterando sobre um range:\""
+
+#: src/exercises/day-1/for-loops.md:32
+msgid "\" {}\""
+msgstr "\" {}\""
#: src/exercises/day-1/for-loops.md:38
msgid ""
@@ -4110,70 +3735,35 @@ msgstr ""
"Copie o código abaixo para e implemente as "
"funções:"
-#: src/exercises/day-1/for-loops.md:52
-msgid ""
-"```rust,should_panic\n"
-"// TODO: remove this when you're done with your implementation.\n"
-"#![allow(unused_variables, dead_code)]\n"
-"\n"
-"fn transpose(matrix: [[i32; 3]; 3]) -> [[i32; 3]; 3] {\n"
-" unimplemented!()\n"
-"}\n"
-"\n"
-"fn pretty_print(matrix: &[[i32; 3]; 3]) {\n"
-" unimplemented!()\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let matrix = [\n"
-" [101, 102, 103], // <-- the comment makes rustfmt add a newline\n"
-" [201, 202, 203],\n"
-" [301, 302, 303],\n"
-" ];\n"
-"\n"
-" println!(\"matrix:\");\n"
-" pretty_print(&matrix);\n"
-"\n"
-" let transposed = transpose(matrix);\n"
-" println!(\"transposed:\");\n"
-" pretty_print(&transposed);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,should_panic\n"
-"// TODO: remova isto quando você terminar sua implementação .\n"
-"#![allow(unused_variables, dead_code)]\n"
-"\n"
-"fn transpose(matriz: [[i32; 3]; 3]) -> [[i32; 3]; 3] {\n"
-" unimplemented!()\n"
-"}\n"
-"\n"
-"fn pretty_print(matriz: &[[i32; 3]; 3]) {\n"
-" unimplemented!()\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let matriz = [\n"
-" [101, 102, 103], // <-- o comentário faz com que o rustfmt adicione "
-"uma nova linha\n"
-" [201, 202, 203],\n"
-" [301, 302, 303],\n"
-" ];\n"
-"\n"
-" println!(\"matriz:\");\n"
-" pretty_print(&matriz);\n"
-"\n"
-" let transposed = transpose(matriz);\n"
-" println!(\"transposta:\");\n"
-" pretty_print(&transposed);\n"
-"}\n"
-"```"
-
-#: src/exercises/day-1/for-loops.md:80
-msgid "Bonus Question"
-msgstr "Pergunta Bônus"
-
-#: src/exercises/day-1/for-loops.md:82
+#: src/exercises/day-1/for-loops.md:53
+#: src/exercises/day-2/health-statistics.md:14
+#: src/exercises/day-2/points-polygons.md:8 src/exercises/day-2/luhn.md:26
+#: src/exercises/day-2/strings-iterators.md:13
+#: src/exercises/day-3/simple-gui.md:19
+#: src/exercises/day-3/safe-ffi-wrapper.md:49
+msgid "// TODO: remove this when you're done with your implementation.\n"
+msgstr "// TODO: remova isto quando você terminar sua implementação .\n"
+
+#: src/exercises/day-1/for-loops.md:66
+#: src/exercises/day-1/solutions-morning.md:65
+msgid "// <-- the comment makes rustfmt add a newline\n"
+msgstr "// <-- o comentário faz com que o rustfmt adicione uma nova linha\n"
+
+#: src/exercises/day-1/for-loops.md:71
+#: src/exercises/day-1/solutions-morning.md:70
+msgid "\"matrix:\""
+msgstr "\"matriz:\""
+
+#: src/exercises/day-1/for-loops.md:75
+#: src/exercises/day-1/solutions-morning.md:74
+msgid "\"transposed:\""
+msgstr "\"transposta:\""
+
+#: src/exercises/day-1/for-loops.md:80
+msgid "Bonus Question"
+msgstr "Pergunta Bônus"
+
+#: src/exercises/day-1/for-loops.md:82
msgid ""
"Could you use `&[i32]` slices instead of hard-coded 3 × 3 matrices for your "
"argument and return types? Something like `&[&[i32]]` for a two-dimensional "
@@ -4227,7 +3817,7 @@ msgid ""
"`[i32; 3]` is also a copy type."
msgstr ""
"Uma cópia implícita da matriz teria ocorrido. Como `i32` é um tipo de cópia "
-"(*copy type*), então `[i32; 3]` também é um tipo de cópia."
+"(_copy type_), então `[i32; 3]` também é um tipo de cópia."
#: src/basic-syntax/variables.md:3
msgid ""
@@ -4237,16 +3827,10 @@ msgstr ""
"Rust fornece segurança de tipo por meio de tipagem estática. Variáveis são "
"imutáveis por padrão:"
-#: src/basic-syntax/variables.md:6
+#: src/basic-syntax/variables.md:10
msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let x: i32 = 10;\n"
-" println!(\"x: {x}\");\n"
-" // x = 20;\n"
+"// x = 20;\n"
" // println!(\"x: {x}\");\n"
-"}\n"
-"```"
msgstr ""
#: src/basic-syntax/variables.md:17
@@ -4261,45 +3845,17 @@ msgstr ""
msgid "Rust will look at how the variable is _used_ to determine the type:"
msgstr "Rust verá como a variável é _usada_ para determinar o tipo:"
-#: src/basic-syntax/type-inference.md:5
-msgid ""
-"```rust,editable\n"
-"fn takes_u32(x: u32) {\n"
-" println!(\"u32: {x}\");\n"
-"}\n"
-"\n"
-"fn takes_i8(y: i8) {\n"
-" println!(\"i8: {y}\");\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let x = 10;\n"
-" let y = 20;\n"
-"\n"
-" takes_u32(x);\n"
-" takes_i8(y);\n"
-" // takes_u32(y);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn recebe_u32(x: u32) {\n"
-" println!(\"u32: {x}\");\n"
-"}\n"
-"\n"
-"fn recebe_i8(y: i8) {\n"
-" println!(\"i8: {y}\");\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let x = 10;\n"
-" let y = 20;\n"
-"\n"
-" recebe_u32(x);\n"
-" recebe_i8(y);\n"
-" // recebe_u32(y);\n"
-"}\n"
-"```"
+#: src/basic-syntax/type-inference.md:7
+msgid "\"u32: {x}\""
+msgstr "\"u32: {x}\""
+
+#: src/basic-syntax/type-inference.md:11
+msgid "\"i8: {y}\""
+msgstr "\"i8: {y}\""
+
+#: src/basic-syntax/type-inference.md:20
+msgid "// takes_u32(y);\n"
+msgstr "// recebe_u32(y);\n"
#: src/basic-syntax/type-inference.md:26
msgid ""
@@ -4333,31 +3889,15 @@ msgstr ""
"contêiner genérico sem que o código especifique explicitamente o tipo "
"contido, usando `_` como _placeholder_:"
-#: src/basic-syntax/type-inference.md:34
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut v = Vec::new();\n"
-" v.push((10, false));\n"
-" v.push((20, true));\n"
-" println!(\"v: {v:?}\");\n"
-"\n"
-" let vv = v.iter().collect::>();\n"
-" println!(\"vv: {vv:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust, editable\n"
-"fn main() {\n"
-" let mut v = Vec::new();\n"
-" v.push((10, false));\n"
-" v.push((20, true));\n"
-" println!(\"v: {v:?}\");\n"
-"\n"
-" let vv = v.iter().collect::>();\n"
-" println!(\"vv: {vv:?}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/type-inference.md:39 src/concurrency/shared_state/arc.md:21
+#: src/concurrency/shared_state/example.md:17
+#: src/concurrency/shared_state/example.md:45
+msgid "\"v: {v:?}\""
+msgstr "\"v: {v:?}\""
+
+#: src/basic-syntax/type-inference.md:42
+msgid "\"vv: {vv:?}\""
+msgstr "\"vv: {vv:?}\""
#: src/basic-syntax/type-inference.md:46
msgid ""
@@ -4399,45 +3939,17 @@ msgstr ""
"Constantes são avaliadas em tempo de compilação e seus valores são "
"incorporados onde quer que sejam usados:"
-#: src/basic-syntax/static-and-const.md:11
-msgid ""
-"```rust,editable\n"
-"const DIGEST_SIZE: usize = 3;\n"
-"const ZERO: Option = Some(42);\n"
-"\n"
-"fn compute_digest(text: &str) -> [u8; DIGEST_SIZE] {\n"
-" let mut digest = [ZERO.unwrap_or(0); DIGEST_SIZE];\n"
-" for (idx, &b) in text.as_bytes().iter().enumerate() {\n"
-" digest[idx % DIGEST_SIZE] = digest[idx % DIGEST_SIZE]."
-"wrapping_add(b);\n"
-" }\n"
-" digest\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let digest = compute_digest(\"Hello\");\n"
-" println!(\"Digest: {digest:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"const TAMANHO_RESUMO: usize = 3;\n"
-"const ZERO: Option = Some(42);\n"
-"\n"
-"fn computar_resumo(texto: &str) -> [u8; TAMANHO_RESUMO] {\n"
-" let mut resumo = [ZERO.unwrap_or(0); TAMANHO_RESUMO];\n"
-" for (idx, &b) in texto.as_bytes().iter().enumerate() {\n"
-" resumo[idx % TAMANHO_RESUMO] = resumo[idx % TAMANHO_RESUMO]."
-"wrapping_add(b);\n"
-" }\n"
-" resumo\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let resumo = computar_resumo(\"Olá\");\n"
-" println!(\"Resumo: {resumo:?}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/static-and-const.md:24 src/memory-management/stack.md:8
+#: src/memory-management/stack.md:36 src/std/string.md:8
+#: src/traits/read-write.md:35 src/testing/unit-tests.md:20
+#: src/testing/unit-tests.md:25 src/testing/test-modules.md:12
+#: src/concurrency/scoped-threads.md:9 src/concurrency/scoped-threads.md:26
+msgid "\"Hello\""
+msgstr "\"Olá\""
+
+#: src/basic-syntax/static-and-const.md:25
+msgid "\"Digest: {digest:?}\""
+msgstr "\"Resumo: {resumo:?}\""
#: src/basic-syntax/static-and-const.md:29
msgid ""
@@ -4469,23 +3981,13 @@ msgstr ""
"Variáveis estáticas permanecerão válidas durante toda a execução do programa "
"e, portanto, não serão movidas:"
-#: src/basic-syntax/static-and-const.md:37
-msgid ""
-"```rust,editable\n"
-"static BANNER: &str = \"Welcome to RustOS 3.14\";\n"
-"\n"
-"fn main() {\n"
-" println!(\"{BANNER}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"static BANNER: &str = \"Bem-vindo ao RustOS 3.14\";\n"
-"\n"
-"fn main() {\n"
-" println!(\"{BANNER}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/static-and-const.md:38
+msgid "\"Welcome to RustOS 3.14\""
+msgstr "\"Bem-vindo ao RustOS 3.14\""
+
+#: src/basic-syntax/static-and-const.md:41
+msgid "\"{BANNER}\""
+msgstr "\"{BANNER}\""
#: src/basic-syntax/static-and-const.md:45
msgid ""
@@ -4624,41 +4126,26 @@ msgstr ""
"Você pode sobrepor (_shadow_) variáveis, tanto aquelas de escopos externos "
"quanto variáveis do mesmo escopo:"
-#: src/basic-syntax/scopes-shadowing.md:6
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let a = 10;\n"
-" println!(\"before: {a}\");\n"
-"\n"
-" {\n"
-" let a = \"hello\";\n"
-" println!(\"inner scope: {a}\");\n"
-"\n"
-" let a = true;\n"
-" println!(\"shadowed in inner scope: {a}\");\n"
-" }\n"
-"\n"
-" println!(\"after: {a}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let a = 10;\n"
-" println!(\"antes: {a}\");\n"
-"\n"
-" {\n"
-" let a = \"olá\";\n"
-" println!(\"escopo interno: {a}\");\n"
-"\n"
-" let a = true;\n"
-" println!(\"sobreposto no escopo interno: {a}\");\n"
-" }\n"
-"\n"
-" println!(\"depois: {a}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/scopes-shadowing.md:9
+msgid "\"before: {a}\""
+msgstr "\"antes: {a}\""
+
+#: src/basic-syntax/scopes-shadowing.md:12 src/traits/from-into.md:7
+#: src/traits/from-into.md:19
+msgid "\"hello\""
+msgstr "\"olá\""
+
+#: src/basic-syntax/scopes-shadowing.md:13
+msgid "\"inner scope: {a}\""
+msgstr "\"escopo interno: {a}\""
+
+#: src/basic-syntax/scopes-shadowing.md:16
+msgid "\"shadowed in inner scope: {a}\""
+msgstr "\"sobreposto no escopo interno: {a}\""
+
+#: src/basic-syntax/scopes-shadowing.md:19
+msgid "\"after: {a}\""
+msgstr "\"depois: {a}\""
#: src/basic-syntax/scopes-shadowing.md:25
msgid ""
@@ -4693,25 +4180,9 @@ msgstr ""
"reutilizar locais de memória ao sobrepor uma variável imutável em um escopo, "
"mesmo que o tipo não seja alterado."
-#: src/basic-syntax/scopes-shadowing.md:30
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let a = 1;\n"
-" let b = &a;\n"
-" let a = a + 1;\n"
-" println!(\"{a} {b}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let a = 1;\n"
-" let b = &a;\n"
-" let a = a + 1;\n"
-" println!(\"{a} {b}\");\n"
-"}\n"
-"```"
+#: src/basic-syntax/scopes-shadowing.md:35 src/testing/test-modules.md:8
+msgid "\"{a} {b}\""
+msgstr "\"{a} {b}\""
#: src/memory-management.md:3
msgid "Traditionally, languages have fallen into two broad categories:"
@@ -4805,50 +4276,6 @@ msgstr ""
"A criação de uma `String` coloca metadados de tamanho fixo na pilha e dados "
"dinamicamente dimensionados - a string propriamente dita - no _heap_:"
-#: src/memory-management/stack.md:6
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1 = String::from(\"Hello\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1 = String::from(\"Hello\");\n"
-"}\n"
-"```"
-
-#: src/memory-management/stack.md:12
-msgid ""
-"```bob\n"
-" Stack Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+----+----+ :\n"
-": | ptr | o---+---+-----+-->| H | e | l | l | o | :\n"
-": | len | 5 | : : +----+----+----+----+----+ :\n"
-": | capacity | 5 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-msgstr ""
-"```bob\n"
-" Pilha Heap\n"
-".- - - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - -.\n"
-": : : :\n"
-": : : :\n"
-": +------------+-------+ : : +----+----+----+----+----+ :\n"
-": | ptr | o---+----+-----+-->| H | e | l | l | o | :\n"
-": | tamanho | 5 | : : +----+----+----+----+----+ :\n"
-": | capacidade | 5 | : : :\n"
-": +------------+-------+ : : :\n"
-": : `- - - - - - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - - -'\n"
-"```"
-
#: src/memory-management/stack.md:28
msgid ""
"Mention that a `String` is backed by a `Vec`, so it has a capacity and "
@@ -4879,42 +4306,30 @@ msgstr ""
"Podemos inspecionar o layout da memória com código inseguro (`unsafe`). No "
"entanto, você deve apontar que isso é legitimamente inseguro!"
-#: src/memory-management/stack.md:34
+#: src/memory-management/stack.md:37 src/control-flow/if-let-expressions.md:34
+#: src/testing/unit-tests.md:7 src/exercises/day-2/solutions-afternoon.md:27
+msgid "' '"
+msgstr "' '"
+
+#: src/memory-management/stack.md:38
+msgid "\"world\""
+msgstr "\"mundo\""
+
+#: src/memory-management/stack.md:39
msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut s1 = String::from(\"Hello\");\n"
-" s1.push(' ');\n"
-" s1.push_str(\"world\");\n"
-" // DON'T DO THIS AT HOME! For educational purposes only.\n"
+"// DON'T DO THIS AT HOME! For educational purposes only.\n"
" // String provides no guarantees about its layout, so this could lead "
"to\n"
" // undefined behavior.\n"
-" unsafe {\n"
-" let (ptr, capacity, len): (usize, usize, usize) = std::mem::"
-"transmute(s1);\n"
-" println!(\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\");\n"
-" }\n"
-"}\n"
-"```"
msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut s1 = String::from(\"Olá\");\n"
-" s1.push(' ');\n"
-" s1.push_str(\"mundo\");\n"
-" // NÃO FAÇA ISSO EM CASA! Somente com propósito educacional.\n"
+"// NÃO FAÇA ISSO EM CASA! Somente com propósito educacional.\n"
" // String não fornece nenhuma garantia sobre o seu layout, então isso "
"pode causar\n"
" // um comportamento indefinido.\n"
-" unsafe {\n"
-" let (ptr, capacity, len): (usize, usize, usize) = std::mem::"
-"transmute(s1);\n"
-" println!(\"Ponteiro = {ptr:#x}, tamanho = {len}, capacidade = "
-"{capacity}\");\n"
-" }\n"
-"}\n"
-"```"
+
+#: src/memory-management/stack.md:44
+msgid "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\""
+msgstr "\"Ponteiro = {ptr:#x}, tamanho = {len}, capacidade = {capacity}\""
#: src/memory-management/manual.md:3
msgid "You allocate and deallocate heap memory yourself."
@@ -4936,27 +4351,15 @@ msgstr "Exemplo em C"
msgid "You must call `free` on every pointer you allocate with `malloc`:"
msgstr "Você deve chamar `free` em cada ponteiro que alocar com `malloc`:"
-#: src/memory-management/manual.md:11
+#: src/memory-management/manual.md:14
msgid ""
-"```c\n"
-"void foo(size_t n) {\n"
-" int* int_array = malloc(n * sizeof(int));\n"
-" //\n"
+"//\n"
" // ... lots of code\n"
" //\n"
-" free(int_array);\n"
-"}\n"
-"```"
msgstr ""
-"```c\n"
-"void foo(size_t n) {\n"
-" int* int_matriz = (int*)malloc(n * sizeof(int));\n"
-" //\n"
+"//\n"
" // ... várias linhas de código\n"
" //\n"
-" free(int_matriz);\n"
-"}\n"
-"```"
#: src/memory-management/manual.md:21
msgid ""
@@ -5000,20 +4403,6 @@ msgstr ""
msgid "C++ Example"
msgstr "Exemplo em C++"
-#: src/memory-management/scope-based.md:14
-msgid ""
-"```c++\n"
-"void say_hello(std::unique_ptr person) {\n"
-" std::cout << \"Hello \" << person->name << std::endl;\n"
-"}\n"
-"```"
-msgstr ""
-"```c++\n"
-"void diga_ola(std::unique_ptr pessoa) {\n"
-" std::cout << \"Olá \" << pessoa->nome << std::endl;\n"
-"}\n"
-"```"
-
#: src/memory-management/scope-based.md:20
msgid ""
"The `std::unique_ptr` object is allocated on the stack, and points to memory "
@@ -5037,17 +4426,9 @@ msgstr ""
"Construtores especiais de movimento (_move_) são usados ao passar o "
"_\"ownership\"_ para uma função:"
-#: src/memory-management/scope-based.md:27
-msgid ""
-"```c++\n"
-"std::unique_ptr person = find_person(\"Carla\");\n"
-"say_hello(std::move(person));\n"
-"```"
-msgstr ""
-"```c++\n"
-"std::unique_ptr pessoa = encontrar_pessoa(\"Carla\");\n"
-"diga_ola(std::move(pessoa));\n"
-"```"
+#: src/memory-management/scope-based.md:28
+msgid "\"Carla\""
+msgstr "\"Carla\""
#: src/memory-management/garbage-collection.md:1
msgid "Automatic Memory Management"
@@ -5081,20 +4462,6 @@ msgstr "Exemplo em Java"
msgid "The `person` object is not deallocated after `sayHello` returns:"
msgstr "O objeto `pessoa` não é desalocado depois que `digaOla` retorna:"
-#: src/memory-management/garbage-collection.md:13
-msgid ""
-"```java\n"
-"void sayHello(Person person) {\n"
-" System.out.println(\"Hello \" + person.getName());\n"
-"}\n"
-"```"
-msgstr ""
-"```java\n"
-"void digaOla(Pessoa pessoa) {\n"
-" System.out.println(\"Olá \" + pessoa.obterNome());\n"
-"}\n"
-"```"
-
#: src/memory-management/rust.md:1
msgid "Memory Management in Rust"
msgstr "Gerenciamento de Memória no Rust"
@@ -5263,29 +4630,13 @@ msgstr ""
"Todas as associações de variáveis têm um _escopo_ onde são válidas e é um "
"erro usar uma variável fora de seu escopo:"
-#: src/ownership.md:6
-msgid ""
-"```rust,editable,compile_fail\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn main() {\n"
-" {\n"
-" let p = Point(3, 4);\n"
-" println!(\"x: {}\", p.0);\n"
-" }\n"
-" println!(\"y: {}\", p.1);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" {\n"
-" let p = Ponto(3, 4);\n"
-" println!(\"x: {}\", p.0);\n"
-" }\n"
-" println!(\"y: {}\", p.1);\n"
-"}\n"
-"```"
+#: src/ownership.md:12
+msgid "\"x: {}\""
+msgstr "\"x: {}\""
+
+#: src/ownership.md:14
+msgid "\"y: {}\""
+msgstr "\"y: {}\""
#: src/ownership.md:18
msgid ""
@@ -5306,25 +4657,13 @@ msgstr "Dizemos que a variável _possui_ (_owns_) o valor."
msgid "An assignment will transfer _ownership_ between variables:"
msgstr "Uma atribuição transferirá o _ownership_ entre variáveis:"
-#: src/ownership/move-semantics.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1: String = String::from(\"Hello!\");\n"
-" let s2: String = s1;\n"
-" println!(\"s2: {s2}\");\n"
-" // println!(\"s1: {s1}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1: String = String::from(\"Olá!\");\n"
-" let s2: String = s1;\n"
-" println!(\"s2: {s2}\");\n"
-" // println!(\"s1: {s1}\");\n"
-"}\n"
-"```"
+#: src/ownership/move-semantics.md:7
+msgid "\"Hello!\""
+msgstr "\"Olá!\""
+
+#: src/ownership/move-semantics.md:10
+msgid "// println!(\"s1: {s1}\");\n"
+msgstr "// println!(\"s1: {s1}\");\n"
#: src/ownership/move-semantics.md:14
msgid "The assignment of `s1` to `s2` transfers ownership."
@@ -5373,14 +4712,8 @@ msgstr ""
msgid "In Rust, clones are explicit (by using `clone`)."
msgstr "No Rust, clones são explícitos (utilizando-se `clone`)."
-#: src/ownership/moved-strings-rust.md:3
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let s1: String = String::from(\"Rust\");\n"
-" let s2: String = s1;\n"
-"}\n"
-"```"
+#: src/ownership/moved-strings-rust.md:5
+msgid "\"Rust\""
msgstr ""
#: src/ownership/moved-strings-rust.md:10
@@ -5395,38 +4728,6 @@ msgstr "Quando `s1` sai do escopo, nada acontece (foi movido dele)."
msgid "Before move to `s2`:"
msgstr "Antes de mover para `s2`:"
-#: src/ownership/moved-strings-rust.md:15
-msgid ""
-"```bob\n"
-" Stack Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+----+ :\n"
-": | ptr | o---+---+-----+-->| R | u | s | t | :\n"
-": | len | 4 | : : +----+----+----+----+ :\n"
-": | capacity | 4 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - - - -'\n"
-": :\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-msgstr ""
-"```bob\n"
-" Pilha Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +------------+------+ : : +----+----+----+----+ :\n"
-": | ponteiro | o---+---+-----+-->| R | u | s | t | :\n"
-": | tamanho | 4 | : : +----+----+----+----+ :\n"
-": | capacidade | 4 | : : :\n"
-": +------------+------+ : : :\n"
-": : `- - - - - - - - - - - - - -'\n"
-": :\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-
#: src/ownership/moved-strings-rust.md:30
msgid "After move to `s2`:"
msgstr "Depois de mover para `s2`:"
@@ -5483,17 +4784,13 @@ msgstr "Trabalho Extra em C++ Moderno"
msgid "Modern C++ solves this differently:"
msgstr "O C++ moderno resolve isso de maneira diferente:"
-#: src/ownership/double-free-modern-cpp.md:5
-msgid ""
-"```c++\n"
-"std::string s1 = \"Cpp\";\n"
-"std::string s2 = s1; // Duplicate the data in s1.\n"
-"```"
-msgstr ""
-"```c++\n"
-"std::string s1 = \"Cpp\";\n"
-"std::string s2 = s1; // Duplica os dados em s1.\n"
-"```"
+#: src/ownership/double-free-modern-cpp.md:6
+msgid "\"Cpp\""
+msgstr "\"Cpp\""
+
+#: src/ownership/double-free-modern-cpp.md:7
+msgid "// Duplicate the data in s1.\n"
+msgstr "// Duplica os dados em s1.\n"
#: src/ownership/double-free-modern-cpp.md:10
msgid ""
@@ -5510,84 +4807,10 @@ msgstr "Quando `s1` e `s2` saem de escopo, cada um libera sua própria memória.
msgid "Before copy-assignment:"
msgstr "Antes da atribuição por cópia:"
-#: src/ownership/double-free-modern-cpp.md:16
-msgid ""
-"```bob\n"
-" Stack Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+--+--+-->| C | p | p | :\n"
-": | len | 3 | : : +----+----+----+ :\n"
-": | capacity | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-msgstr ""
-"```bob\n"
-" Pilha Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+--+--+-->| C | p | p | :\n"
-": | tam | 3 | : : +----+----+----+ :\n"
-": | capac | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-
#: src/ownership/double-free-modern-cpp.md:30
msgid "After copy-assignment:"
msgstr "Após atribuição por cópia:"
-#: src/ownership/double-free-modern-cpp.md:32
-msgid ""
-"```bob\n"
-" Stack Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+--+--+-->| C | p | p | :\n"
-": | len | 3 | : : +----+----+----+ :\n"
-": | capacity | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : : :\n"
-": s2 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+-----+-->| C | p | p | :\n"
-": | len | 3 | : : +----+----+----+ :\n"
-": | capacity | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-msgstr ""
-"```bob\n"
-" Pilha Heap\n"
-".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n"
-": : : :\n"
-": s1 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+--+--+-->| C | p | p | :\n"
-": | tam | 3 | : : +----+----+----+ :\n"
-": | capac | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : : :\n"
-": s2 : : :\n"
-": +-----------+-------+ : : +----+----+----+ :\n"
-": | ptr | o---+---+-----+-->| C | p | p | :\n"
-": | tam | 3 | : : +----+----+----+ :\n"
-": | capac | 3 | : : :\n"
-": +-----------+-------+ : : :\n"
-": : `- - - - - - - - - - - -'\n"
-"`- - - - - - - - - - - - - -'\n"
-"```"
-
#: src/ownership/moves-function-calls.md:3
msgid ""
"When you pass a value to a function, the value is assigned to the function "
@@ -5596,31 +4819,18 @@ msgstr ""
"Quando você passa um valor para uma função, o valor é atribuído ao parâmetro "
"da função. Isso transfere a _ownership_:"
-#: src/ownership/moves-function-calls.md:6
-msgid ""
-"```rust,editable\n"
-"fn say_hello(name: String) {\n"
-" println!(\"Hello {name}\")\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let name = String::from(\"Alice\");\n"
-" say_hello(name);\n"
-" // say_hello(name);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn diga_ola(nome: String) {\n"
-" println!(\"Olá {nome}\")\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let nome = String::from(\"Alice\");\n"
-" diga_ola(nome);\n"
-" // diga_ola(nome);\n"
-"}\n"
-"```"
+#: src/ownership/moves-function-calls.md:8 src/traits/impl-trait.md:10
+msgid "\"Hello {name}\""
+msgstr "\"Olá {nome}\""
+
+#: src/ownership/moves-function-calls.md:12
+#: src/android/interoperability/java.md:56
+msgid "\"Alice\""
+msgstr "\"Alice\""
+
+#: src/ownership/moves-function-calls.md:14
+msgid "// say_hello(name);\n"
+msgstr "// diga_ola(nome);\n"
#: src/ownership/moves-function-calls.md:20
msgid ""
@@ -5670,25 +4880,9 @@ msgstr ""
"Embora a semântica de movimento seja o padrão, certos tipos são copiados por "
"padrão:"
-#: src/ownership/copy-clone.md:5
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let x = 42;\n"
-" let y = x;\n"
-" println!(\"x: {x}\");\n"
-" println!(\"y: {y}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let x = 42;\n"
-" let y = x;\n"
-" println!(\"x: {x}\");\n"
-" println!(\"y: {y}\");\n"
-"}\n"
-"```"
+#: src/ownership/copy-clone.md:10 src/control-flow/blocks.md:11
+msgid "\"y: {y}\""
+msgstr "\"y: {y}\""
#: src/ownership/copy-clone.md:14
msgid "These types implement the `Copy` trait."
@@ -5699,31 +4893,13 @@ msgid "You can opt-in your own types to use copy semantics:"
msgstr ""
"Você pode habilitar seus próprios tipos para usar a semântica de cópia:"
-#: src/ownership/copy-clone.md:18
-msgid ""
-"```rust,editable\n"
-"#[derive(Copy, Clone, Debug)]\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn main() {\n"
-" let p1 = Point(3, 4);\n"
-" let p2 = p1;\n"
-" println!(\"p1: {p1:?}\");\n"
-" println!(\"p2: {p2:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Copy, Clone, Debug)]\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn main() {\n"
-" let p1 = Ponto(3, 4);\n"
-" let p2 = p1;\n"
-" println!(\"p1: {p1:?}\");\n"
-" println!(\"p2: {p2:?}\");\n"
-"}\n"
-"```"
+#: src/ownership/copy-clone.md:25
+msgid "\"p1: {p1:?}\""
+msgstr "\"p1: {p1:?}\""
+
+#: src/ownership/copy-clone.md:26
+msgid "\"p2: {p2:?}\""
+msgstr "\"p2: {p2:?}\""
#: src/ownership/copy-clone.md:30
msgid "After the assignment, both `p1` and `p2` own their own data."
@@ -5806,39 +4982,9 @@ msgstr ""
"Em vez de transferir a ownership ao chamar uma função, você pode permitir "
"que uma função _empreste_ o valor:"
-#: src/ownership/borrowing.md:6
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn add(p1: &Point, p2: &Point) -> Point {\n"
-" Point(p1.0 + p2.0, p1.1 + p2.1)\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1 = Point(3, 4);\n"
-" let p2 = Point(10, 20);\n"
-" let p3 = add(&p1, &p2);\n"
-" println!(\"{p1:?} + {p2:?} = {p3:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn somar(p1: &Ponto, p2: &Ponto) -> Ponto {\n"
-" Ponto(p1.0 + p2.0, p1.1 + p2.1)\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1 = Ponto(3, 4);\n"
-" let p2 = Ponto(10, 20);\n"
-" let p3 = somar(&p1, &p2);\n"
-" println!(\"{p1:?} + {p2:?} = {p3:?}\");\n"
-"}\n"
-"```"
+#: src/ownership/borrowing.md:18 src/ownership/borrowing.md:45
+msgid "\"{p1:?} + {p2:?} = {p3:?}\""
+msgstr "\"{p1:?} + {p2:?} = {p3:?}\""
#: src/ownership/borrowing.md:22
msgid "The `add` function _borrows_ two points and returns a new point."
@@ -5870,43 +5016,15 @@ msgstr ""
"nível de otimização \"DEBUG\", os endereços devem mudar, enquanto eles "
"permanecem os mesmos quando a configuração é alterada para \"RELEASE\":"
-#: src/ownership/borrowing.md:30
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn add(p1: &Point, p2: &Point) -> Point {\n"
-" let p = Point(p1.0 + p2.0, p1.1 + p2.1);\n"
-" println!(\"&p.0: {:p}\", &p.0);\n"
-" p\n"
-"}\n"
-"\n"
-"pub fn main() {\n"
-" let p1 = Point(3, 4);\n"
-" let p2 = Point(10, 20);\n"
-" let p3 = add(&p1, &p2);\n"
-" println!(\"&p3.0: {:p}\", &p3.0);\n"
-" println!(\"{p1:?} + {p2:?} = {p3:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn somar(p1: &Ponto, p2: &Ponto) -> Ponto {\n"
-" Ponto(p1.0 + p2.0, p1.1 + p2.1)\n"
-"}\n"
-"\n"
-" pub fn main() {\n"
-" let p1 = Ponto(3, 4);\n"
-" let p2 = Ponto(10, 20);\n"
-" let p3 = somar(&p1, &p2);\n"
-" println!(\"&p3.0: {:p}\", &p3.0);\n"
-" println!(\"{p1:?} + {p2:?} = {p3:?}\");\n"
-" }\n"
-"```"
+#: src/ownership/borrowing.md:36
+#, fuzzy
+msgid "\"&p.0: {:p}\""
+msgstr "\"&p3.0: {:p}\""
+
+#: src/ownership/borrowing.md:44
+#, fuzzy
+msgid "\"&p3.0: {:p}\""
+msgstr "\"{p1:?} + {p2:?} = {p3:?}\""
#: src/ownership/borrowing.md:48
msgid "The Rust compiler can do return value optimization (RVO)."
@@ -5938,37 +5056,13 @@ msgstr "Você pode ter um ou mais valores `&T` a qualquer momento, _ou_"
msgid "You can have exactly one `&mut T` value."
msgstr "Você pode ter exatamente um valor `&mut T`."
-#: src/ownership/shared-unique-borrows.md:8
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let mut a: i32 = 10;\n"
-" let b: &i32 = &a;\n"
-"\n"
-" {\n"
-" let c: &mut i32 = &mut a;\n"
-" *c = 20;\n"
-" }\n"
-"\n"
-" println!(\"a: {a}\");\n"
-" println!(\"b: {b}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let mut a: i32 = 10;\n"
-" let b: &i32 = &a;\n"
-"\n"
-" {\n"
-" let c: &mut i32 = &mut a;\n"
-" *c = 20;\n"
-" }\n"
-"\n"
-" println!(\"a: {a}\");\n"
-" println!(\"b: {b}\");\n"
-"}\n"
-"```"
+#: src/ownership/shared-unique-borrows.md:18 src/std/rc.md:13
+msgid "\"a: {a}\""
+msgstr "\"a: {a}\""
+
+#: src/ownership/shared-unique-borrows.md:19 src/std/rc.md:14
+msgid "\"b: {b}\""
+msgstr "\"b: {b}\""
#: src/ownership/shared-unique-borrows.md:25
msgid ""
@@ -6053,39 +5147,10 @@ msgstr ""
"Além de emprestar seus argumentos, uma função pode retornar um valor "
"emprestado:"
-#: src/ownership/lifetimes-function-calls.md:5
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn left_most<'a>(p1: &'a Point, p2: &'a Point) -> &'a Point {\n"
-" if p1.0 < p2.0 { p1 } else { p2 }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1: Point = Point(10, 10);\n"
-" let p2: Point = Point(20, 20);\n"
-" let p3: &Point = left_most(&p1, &p2);\n"
-" println!(\"left-most point: {:?}\", p3);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn mais_a_esquerda<'a>(p1: &'a Ponto, p2: &'a Ponto) -> &'a Ponto {\n"
-" if p1.0 < p2.0 { p1 } else { p2 }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1: Ponto = Ponto(10, 10);\n"
-" let p2: Ponto = Ponto(20, 20);\n"
-" let p3: &Ponto = mais_a_esquerda(&p1, &p2);\n"
-" println!(\"Ponto mais à esquerda: {:?}\", p3);\n"
-"}\n"
-"```"
+#: src/ownership/lifetimes-function-calls.md:17
+#: src/ownership/lifetimes-function-calls.md:47
+msgid "\"left-most point: {:?}\""
+msgstr "\"Ponto mais à esquerda: {:?}\""
#: src/ownership/lifetimes-function-calls.md:21
msgid "`'a` is a generic parameter, it is inferred by the compiler."
@@ -6110,46 +5175,6 @@ msgstr ""
"Mova a declaração de `p2` e `p3` para um novo escopo (`{ ... }`), resultando "
"no seguinte código:"
-#: src/ownership/lifetimes-function-calls.md:32
-msgid ""
-"```rust,ignore\n"
-"#[derive(Debug)]\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn left_most<'a>(p1: &'a Point, p2: &'a Point) -> &'a Point {\n"
-" if p1.0 < p2.0 { p1 } else { p2 }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1: Point = Point(10, 10);\n"
-" let p3: &Point;\n"
-" {\n"
-" let p2: Point = Point(20, 20);\n"
-" p3 = left_most(&p1, &p2);\n"
-" }\n"
-" println!(\"left-most point: {:?}\", p3);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,ignore\n"
-"#[derive(Debug)]\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn mais_a_esquerda<'a>(p1: &'a Ponto, p2: &'a Ponto) -> &'a Ponto {\n"
-" if p1.0 < p2.0 { p1 } else { p2 }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let p1: Ponto = Ponto(10, 10);\n"
-" let p3: &Ponto;\n"
-" {\n"
-" let p2: Ponto = Ponto(20, 20);\n"
-" p3 = mais_a_esquerda(&p1, &p2);\n"
-" }\n"
-" println!(\"ponto mais à esquerda: {:?}\", p3);\n"
-"}\n"
-"```"
-
#: src/ownership/lifetimes-function-calls.md:50
msgid "Note how this does not compile since `p3` outlives `p2`."
msgstr "Note como isto não compila uma vez que `p3` vive mais que `p2`."
@@ -6200,45 +5225,25 @@ msgstr ""
"Se um tipo de dados armazena dados emprestados, ele deve ser anotado com um "
"tempo de vida:"
-#: src/ownership/lifetimes-data-structures.md:5
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Highlight<'doc>(&'doc str);\n"
-"\n"
-"fn erase(text: String) {\n"
-" println!(\"Bye {text}!\");\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let text = String::from(\"The quick brown fox jumps over the lazy dog."
-"\");\n"
-" let fox = Highlight(&text[4..19]);\n"
-" let dog = Highlight(&text[35..43]);\n"
-" // erase(text);\n"
-" println!(\"{fox:?}\");\n"
-" println!(\"{dog:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Destaque<'doc>(&'doc str);\n"
-"\n"
-"fn apagar(texto: String) {\n"
-" println!(\"Até logo {texto}!\");\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let texto = String::from(\"A raposa marrom ágil pula sobre o cachorro "
-"preguiçoso.\");\n"
-" let raposa = Destaque(&texto[2..21]);\n"
-" let cachorro = Destaque(&texto[35..53]);\n"
-" // apagar(texto);\n"
-" println!(\"{raposa:?}\");\n"
-" println!(\"{cachorro:?}\");\n"
-"}\n"
-"```"
+#: src/ownership/lifetimes-data-structures.md:10
+msgid "\"Bye {text}!\""
+msgstr "\"Até logo {texto}!\""
+
+#: src/ownership/lifetimes-data-structures.md:14
+msgid "\"The quick brown fox jumps over the lazy dog.\""
+msgstr "\"A raposa marrom ágil pula sobre o cachorro preguiçoso.\""
+
+#: src/ownership/lifetimes-data-structures.md:17
+msgid "// erase(text);\n"
+msgstr "// apagar(texto);\n"
+
+#: src/ownership/lifetimes-data-structures.md:18
+msgid "\"{fox:?}\""
+msgstr "\"{raposa:?}\""
+
+#: src/ownership/lifetimes-data-structures.md:19
+msgid "\"{dog:?}\""
+msgstr "\"{cachorro:?}\""
#: src/ownership/lifetimes-data-structures.md:25
msgid ""
@@ -6321,31 +5326,13 @@ msgstr ""
"Nós iremos aprender muito mais sobre _structs_ e o tipo `Vec` amanhã. Por "
"hora, você só precisa conhecer parte de sua API:"
-#: src/exercises/day-1/book-library.md:6
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let mut vec = vec![10, 20];\n"
-" vec.push(30);\n"
-" let midpoint = vec.len() / 2;\n"
-" println!(\"middle value: {}\", vec[midpoint]);\n"
-" for item in &vec {\n"
-" println!(\"item: {item}\");\n"
-" }\n"
-"}\n"
-"```"
-msgstr ""
-"```rust, editable\n"
-"fn main() {\n"
-" let mut vetor = vec![10, 20];\n"
-" vetor.push(30);\n"
-" let ponto_central = vetor.len() / 2;\n"
-" println!(\"valor do meio: {}\", vetor[ponto_central]);\n"
-" for item in vetor.iter() {\n"
-" println!(\"item: {item}\");\n"
-" }\n"
-"}\n"
-"```"
+#: src/exercises/day-1/book-library.md:11
+msgid "\"middle value: {}\""
+msgstr "\"valor do meio: {}\""
+
+#: src/exercises/day-1/book-library.md:13
+msgid "\"item: {item}\""
+msgstr "\"item: {item}\""
#: src/exercises/day-1/book-library.md:18
msgid ""
@@ -6356,69 +5343,101 @@ msgstr ""
"código abaixo para e atualize os tipos para "
"compilar:"
-#: src/exercises/day-1/book-library.md:21
+#: src/exercises/day-1/book-library.md:32
+#: src/exercises/day-1/solutions-afternoon.md:33
+msgid "// This is a constructor, used below.\n"
+msgstr "// Este é um construtor, utilizado abaixo.\n"
+
+#: src/exercises/day-1/book-library.md:40
+#: src/exercises/day-1/solutions-afternoon.md:41
msgid ""
-"```rust,should_panic\n"
-"struct Library {\n"
-" books: Vec,\n"
-"}\n"
-"\n"
-"struct Book {\n"
-" title: String,\n"
-" year: u16,\n"
-"}\n"
-"\n"
-"impl Book {\n"
-" // This is a constructor, used below.\n"
-" fn new(title: &str, year: u16) -> Book {\n"
-" Book {\n"
-" title: String::from(title),\n"
-" year,\n"
-" }\n"
-" }\n"
-"}\n"
-"\n"
"// Implement the methods below. Update the `self` parameter to\n"
"// indicate the method's required level of ownership over the object:\n"
"//\n"
"// - `&self` for shared read-only access,\n"
"// - `&mut self` for unique and mutable access,\n"
"// - `self` for unique access by value.\n"
-"impl Library {\n"
-" fn new() -> Library {\n"
-" todo!(\"Initialize and return a `Library` value\")\n"
-" }\n"
-"\n"
-" //fn len(self) -> usize {\n"
+msgstr ""
+"// Implemente os métodos abaixo. Atualize o parâmetro `self` para\n"
+"// indicar o nível requerido de ownership sobre o objeto:\n"
+"//\n"
+"// - `&self` para acesso compartilhado de apenas leitura,\n"
+"// - `&mut self` para acesso mutável exclusivo,\n"
+"// - `self` para acesso exclusivo por valor.\n"
+
+#: src/exercises/day-1/book-library.md:49
+msgid "\"Initialize and return a `Library` value\""
+msgstr "\"Inicialize e retorne um valor `Biblioteca`\""
+
+#: src/exercises/day-1/book-library.md:52
+msgid ""
+"//fn len(self) -> usize {\n"
" // todo!(\"Return the length of `self.books`\")\n"
" //}\n"
-"\n"
-" //fn is_empty(self) -> bool {\n"
+msgstr ""
+"//fn tamanho(self) -> usize {\n"
+" // todo!(\"Retorne o tamanho de `self.livros`\")\n"
+" //}\n"
+
+#: src/exercises/day-1/book-library.md:56
+msgid ""
+"//fn is_empty(self) -> bool {\n"
" // todo!(\"Return `true` if `self.books` is empty\")\n"
" //}\n"
-"\n"
-" //fn add_book(self, book: Book) {\n"
+msgstr ""
+"//fn esta_vazia(self) -> bool {\n"
+" // todo!(\"Retorne `true` se `self.livros` for vazio\")\n"
+" //}\n"
+
+#: src/exercises/day-1/book-library.md:60
+msgid ""
+"//fn add_book(self, book: Book) {\n"
" // todo!(\"Add a new book to `self.books`\")\n"
" //}\n"
-"\n"
-" //fn print_books(self) {\n"
+msgstr ""
+"//fn adicionar_livro(self, book: Livro) {\n"
+" // todo!(\"Adicione um novo livro em `self.livros`\")\n"
+" //}\n"
+
+#: src/exercises/day-1/book-library.md:64
+msgid ""
+"//fn print_books(self) {\n"
" // todo!(\"Iterate over `self.books` and each book's title and "
"year\")\n"
" //}\n"
-"\n"
-" //fn oldest_book(self) -> Option<&Book> {\n"
+msgstr ""
+"//fn imprimir_livros(self) {\n"
+" // todo!(\"Itere sobre `self.livros` e sobre o título e ano de cada "
+"livro\")\n"
+" //}\n"
+
+#: src/exercises/day-1/book-library.md:68
+msgid ""
+"//fn oldest_book(self) -> Option<&Book> {\n"
" // todo!(\"Return a reference to the oldest book (if any)\")\n"
" //}\n"
-"}\n"
-"\n"
+msgstr ""
+"//fn livro_mais_antigo(self) -> Option<&Livro> {\n"
+" // todo!(\"Retorne uma referência para o livro mais antigo (se "
+"houver)\")\n"
+" //}\n"
+
+#: src/exercises/day-1/book-library.md:72
+msgid ""
"// This shows the desired behavior. Uncomment the code below and\n"
"// implement the missing methods. You will need to update the\n"
"// method signatures, including the \"self\" parameter! You may\n"
"// also need to update the variable bindings within main.\n"
-"fn main() {\n"
-" let library = Library::new();\n"
-"\n"
-" //println!(\"The library is empty: library.is_empty() -> {}\", library."
+msgstr ""
+"// Isto demonstra o comportamento esperado. Descomente o código abaixo e\n"
+"// implemente os métodos que faltam. Você precisará atualizar as\n"
+"// assinaturas dos métodos, incluindo o parâmetro \"self\"! Você talvez\n"
+"// precise atualizar as atribuições de variável dentro de `main()`.\n"
+
+#: src/exercises/day-1/book-library.md:80
+#: src/exercises/day-1/solutions-afternoon.md:124
+msgid ""
+"//println!(\"The library is empty: library.is_empty() -> {}\", library."
"is_empty());\n"
" //\n"
" //library.add_book(Book::new(\"Lord of the Rings\", 1954));\n"
@@ -6438,71 +5457,8 @@ msgid ""
" //\n"
" //println!(\"The library has {} books\", library.len());\n"
" //library.print_books();\n"
-"}\n"
-"```"
msgstr ""
-"```rust,should_panic\n"
-"struct Biblioteca {\n"
-" livros: Vec,\n"
-"}\n"
-"\n"
-"struct Livro {\n"
-" titulo: String,\n"
-" ano: u16,\n"
-"}\n"
-"\n"
-"impl Livro {\n"
-" // Este é um construtor, utilizado abaixo.\n"
-" fn new(titulo: &str, ano: u16) -> Livro {\n"
-" Livro {\n"
-" titulo: String::from(titulo),\n"
-" ano,\n"
-" }\n"
-" }\n"
-"}\n"
-"\n"
-"// Implemente os métodos abaixo. Atualize o parâmetro `self` para\n"
-"// indicar o nível requerido de ownership sobre o objeto:\n"
-"//\n"
-"// - `&self` para acesso compartilhado de apenas leitura,\n"
-"// - `&mut self` para acesso mutável exclusivo,\n"
-"// - `self` para acesso exclusivo por valor.\n"
-"impl Biblioteca {\n"
-" fn new() -> Biblioteca {\n"
-" todo!(\"Inicialize e retorne um valor `Biblioteca`\")\n"
-" }\n"
-"\n"
-" //fn tamanho(self) -> usize {\n"
-" // todo!(\"Retorne o tamanho de `self.livros`\")\n"
-" //}\n"
-"\n"
-" //fn esta_vazia(self) -> bool {\n"
-" // todo!(\"Retorne `true` se `self.livros` for vazio\")\n"
-" //}\n"
-"\n"
-" //fn adicionar_livro(self, book: Livro) {\n"
-" // todo!(\"Adicione um novo livro em `self.livros`\")\n"
-" //}\n"
-"\n"
-" //fn imprimir_livros(self) {\n"
-" // todo!(\"Itere sobre `self.livros` e sobre o título e ano de cada "
-"livro\")\n"
-" //}\n"
-"\n"
-" //fn livro_mais_antigo(self) -> Option<&Livro> {\n"
-" // todo!(\"Retorne uma referência para o livro mais antigo (se "
-"houver)\")\n"
-" //}\n"
-"}\n"
-"\n"
-"// Isto demonstra o comportamento esperado. Descomente o código abaixo e\n"
-"// implemente os métodos que faltam. Você precisará atualizar as\n"
-"// assinaturas dos métodos, incluindo o parâmetro \"self\"! Você talvez\n"
-"// precise atualizar as atribuições de variável dentro de `main()`.\n"
-"fn main() {\n"
-" let biblioteca = Biblioteca::new();\n"
-"\n"
-" //println!(\"A biblioteca está vazia: biblioteca.esta_vazia() -> {}\", "
+"//println!(\"A biblioteca está vazia: biblioteca.esta_vazia() -> {}\", "
"biblioteca.esta_vazia());\n"
" //\n"
" //biblioteca.adicionar_livro(Livro::new(\"Lord of the Rings\", 1954));\n"
@@ -6523,8 +5479,6 @@ msgstr ""
" //\n"
" //println!(\"The biblioteca tem {} livros\", biblioteca.tamanho());\n"
" //biblioteca.imprimir_livros();\n"
-"}\n"
-"```"
#: src/exercises/day-1/book-library.md:102
msgid "[Solution](solutions-afternoon.md#designing-a-library)"
@@ -6556,77 +5510,34 @@ msgstr ""
"para um tipo. O _trait_ `Iterator` simplesmente diz que você pode chamar "
"`next` até obter `None` como retorno:"
-#: src/exercises/day-1/iterators-and-ownership.md:13
-msgid ""
-"```rust\n"
-"pub trait Iterator {\n"
-" type Item;\n"
-" fn next(&mut self) -> Option;\n"
-"}\n"
-"```"
-msgstr ""
-"```rust\n"
-"pub trait Iterator {\n"
-" type Item;\n"
-" fn next(&mut self) -> Option;\n"
-"}\n"
-"```"
-
#: src/exercises/day-1/iterators-and-ownership.md:20
msgid "You use this trait like this:"
msgstr "Você usa esse _trait_ da seguinte forma:"
-#: src/exercises/day-1/iterators-and-ownership.md:22
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let v: Vec = vec![10, 20, 30];\n"
-" let mut iter = v.iter();\n"
-"\n"
-" println!(\"v[0]: {:?}\", iter.next());\n"
-" println!(\"v[1]: {:?}\", iter.next());\n"
-" println!(\"v[2]: {:?}\", iter.next());\n"
-" println!(\"No more items: {:?}\", iter.next());\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let v: Vec = vec![10, 20, 30];\n"
-" let mut iter = v.iter();\n"
-"\n"
-" println!(\"v[0]: {:?}\", iter.next());\n"
-" println!(\"v[1]: {:?}\", iter.next());\n"
-" println!(\"v[2]: {:?}\", iter.next());\n"
-" println!(\"Sem mais itens: {:?}\", iter.next());\n"
-"}\n"
-"```"
+#: src/exercises/day-1/iterators-and-ownership.md:27
+msgid "\"v[0]: {:?}\""
+msgstr "\"v[0]: {:?}\""
+
+#: src/exercises/day-1/iterators-and-ownership.md:28
+msgid "\"v[1]: {:?}\""
+msgstr "\"v[1]: {:?}\""
+
+#: src/exercises/day-1/iterators-and-ownership.md:29
+msgid "\"v[2]: {:?}\""
+msgstr "\"v[2]: {:?}\""
+
+#: src/exercises/day-1/iterators-and-ownership.md:30
+msgid "\"No more items: {:?}\""
+msgstr "\"Sem mais itens: {:?}\""
#: src/exercises/day-1/iterators-and-ownership.md:34
msgid "What is the type returned by the iterator? Test your answer here:"
msgstr "Qual é o tipo retornado pelo iterador? Teste sua resposta aqui:"
-#: src/exercises/day-1/iterators-and-ownership.md:36
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let v: Vec = vec![10, 20, 30];\n"
-" let mut iter = v.iter();\n"
-"\n"
-" let v0: Option<..> = iter.next();\n"
-" println!(\"v0: {v0:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let v: Vec = vec![10, 20, 30];\n"
-" let mut iter = v.iter();\n"
-"\n"
-" let v0: Option<..> = iter.next();\n"
-" println!(\"v0: {v0:?}\");\n"
-"}\n"
-"```"
+#: src/exercises/day-1/iterators-and-ownership.md:42
+#: src/exercises/day-1/iterators-and-ownership.md:79
+msgid "\"v0: {v0:?}\""
+msgstr "\"v0: {v0:?}\""
#: src/exercises/day-1/iterators-and-ownership.md:46
msgid "Why is this type used?"
@@ -6645,26 +5556,6 @@ msgstr ""
"O _trait_ `Iterator` informa como _iterar_ depois de criar um iterador. O "
"_trait_ relacionado `IntoIterator` lhe informa como criar o iterador:"
-#: src/exercises/day-1/iterators-and-ownership.md:53
-msgid ""
-"```rust\n"
-"pub trait IntoIterator {\n"
-" type Item;\n"
-" type IntoIter: Iterator- ;\n"
-"\n"
-" fn into_iter(self) -> Self::IntoIter;\n"
-"}\n"
-"```"
-msgstr ""
-"```rust\n"
-"pub trait IntoIterator {\n"
-" type Item;\n"
-" type IntoIter: Iterator
- ;\n"
-"\n"
-" fn into_iter(self) -> Self::IntoIter;\n"
-"}\n"
-"```"
-
#: src/exercises/day-1/iterators-and-ownership.md:62
msgid ""
"The syntax here means that every implementation of `IntoIterator` must "
@@ -6693,29 +5584,20 @@ msgstr ""
msgid "Like before, what is the type returned by the iterator?"
msgstr "Como antes, qual é o tipo retornado pelo iterador?"
-#: src/exercises/day-1/iterators-and-ownership.md:73
-msgid ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let v: Vec = vec![String::from(\"foo\"), String::"
-"from(\"bar\")];\n"
-" let mut iter = v.into_iter();\n"
-"\n"
-" let v0: Option<..> = iter.next();\n"
-" println!(\"v0: {v0:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"fn main() {\n"
-" let v: Vec = vec![String::from(\"foo\"), String::"
-"from(\"bar\")];\n"
-" let mut iter = v.into_iter();\n"
-"\n"
-" let v0: Option<..> = iter.next();\n"
-" println!(\"v0: {v0:?}\");\n"
-"}\n"
-"```"
+#: src/exercises/day-1/iterators-and-ownership.md:75
+#: src/exercises/day-1/iterators-and-ownership.md:91
+#: src/exercises/day-2/luhn.md:35 src/traits/trait-bounds.md:22
+#: src/traits/impl-trait.md:14 src/exercises/day-3/simple-gui.md:150
+#: src/exercises/day-3/simple-gui.md:151 src/exercises/day-3/simple-gui.md:152
+#: src/testing/test-modules.md:21 src/exercises/day-2/solutions-afternoon.md:60
+msgid "\"foo\""
+msgstr "\"foo\""
+
+#: src/exercises/day-1/iterators-and-ownership.md:75
+#: src/exercises/day-1/iterators-and-ownership.md:91
+#: src/testing/test-modules.md:21
+msgid "\"bar\""
+msgstr "\"bar\""
#: src/exercises/day-1/iterators-and-ownership.md:83
msgid "`for` Loops"
@@ -6731,37 +5613,10 @@ msgstr ""
"`for`. Eles chamam `into_iter()` em uma expressão e itera sobre o iterador "
"resultante:"
-#: src/exercises/day-1/iterators-and-ownership.md:89
-msgid ""
-"```rust,editable\n"
-"fn main() {\n"
-" let v: Vec = vec![String::from(\"foo\"), String::"
-"from(\"bar\")];\n"
-"\n"
-" for word in &v {\n"
-" println!(\"word: {word}\");\n"
-" }\n"
-"\n"
-" for word in v {\n"
-" println!(\"word: {word}\");\n"
-" }\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"fn main() {\n"
-" let v: Vec = vec![String::from(\"foo\"), String::"
-"from(\"bar\")];\n"
-"\n"
-" for palavra in &v {\n"
-" println!(\"palavra: {palavra}\");\n"
-" }\n"
-"\n"
-" for palavra in v {\n"
-" println!(\"palavra: {palavra}\");\n"
-" }\n"
-"}\n"
-"```"
+#: src/exercises/day-1/iterators-and-ownership.md:94
+#: src/exercises/day-1/iterators-and-ownership.md:98
+msgid "\"word: {word}\""
+msgstr "\"palavra: {palavra}\""
#: src/exercises/day-1/iterators-and-ownership.md:103
msgid "What is the type of `word` in each loop?"
@@ -6822,55 +5677,18 @@ msgstr ""
msgid "Like C and C++, Rust has support for custom structs:"
msgstr "Como C e C++, Rust tem suporte para `structs` personalizadas:"
-#: src/structs.md:5
-msgid ""
-"```rust,editable\n"
-"struct Person {\n"
-" name: String,\n"
-" age: u8,\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let mut peter = Person {\n"
-" name: String::from(\"Peter\"),\n"
-" age: 27,\n"
-" };\n"
-" println!(\"{} is {} years old\", peter.name, peter.age);\n"
-" \n"
-" peter.age = 28;\n"
-" println!(\"{} is {} years old\", peter.name, peter.age);\n"
-" \n"
-" let jackie = Person {\n"
-" name: String::from(\"Jackie\"),\n"
-" ..peter\n"
-" };\n"
-" println!(\"{} is {} years old\", jackie.name, jackie.age);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"struct Pessoa {\n"
-" nome: String,\n"
-" idade: u8,\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let mut pedro = Pessoa {\n"
-" nome: String::from(\"Pedro\"),\n"
-" idade: 27,\n"
-" };\n"
-" println!(\"{} tem {} anos.\", pedro.nome, pedro.idade);\n"
-" \n"
-" pedro.idade= 28;\n"
-" println!(\"{} tem {} anos.\", pedro.nome, pedro.idade);\n"
-" \n"
-" let jackie = Pessoa {\n"
-" nome: String::from(\"Jackie\"),\n"
-" ..pedro\n"
-" };\n"
-" println!(\"{} tem {} anos.\", jackie.nome, jackie.idade);\n"
-"}\n"
-"```"
+#: src/structs.md:13 src/structs/field-shorthand.md:20 src/methods.md:21
+#: src/android/interoperability/with-c/bindgen.md:87
+msgid "\"Peter\""
+msgstr "\"Pedro\""
+
+#: src/structs.md:16 src/structs.md:19 src/structs.md:25
+msgid "\"{} is {} years old\""
+msgstr "\"{} tem {} anos.\""
+
+#: src/structs.md:22
+msgid "\"Jackie\""
+msgstr "\"Jackie\""
#: src/structs.md:31 src/enums.md:34 src/enums/sizes.md:28 src/methods.md:30
#: src/methods/example.md:46 src/pattern-matching.md:25
@@ -6941,25 +5759,9 @@ msgstr ""
"Se os nomes dos campos não forem importantes, você pode usar uma estrutura "
"de tupla:"
-#: src/structs/tuple-structs.md:5
-msgid ""
-"```rust,editable\n"
-"struct Point(i32, i32);\n"
-"\n"
-"fn main() {\n"
-" let p = Point(17, 23);\n"
-" println!(\"({}, {})\", p.0, p.1);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"struct Ponto(i32, i32);\n"
-"\n"
-"fn main() {\n"
-" let p = Ponto(17, 23);\n"
-" println!(\"({}, {})\", p.0, p.1);\n"
-"}\n"
-"```"
+#: src/structs/tuple-structs.md:10
+msgid "\"({}, {})\""
+msgstr "\"({}, {})\""
#: src/structs/tuple-structs.md:14
msgid "This is often used for single-field wrappers (called newtypes):"
@@ -6967,45 +5769,15 @@ msgstr ""
"Isso é comumente utilizado para _wrappers_ (invólucros) com campo único "
"(chamados _newtypes_):"
-#: src/structs/tuple-structs.md:16
-msgid ""
-"```rust,editable,compile_fail\n"
-"struct PoundsOfForce(f64);\n"
-"struct Newtons(f64);\n"
-"\n"
-"fn compute_thruster_force() -> PoundsOfForce {\n"
-" todo!(\"Ask a rocket scientist at NASA\")\n"
-"}\n"
-"\n"
-"fn set_thruster_force(force: Newtons) {\n"
-" // ...\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let force = compute_thruster_force();\n"
-" set_thruster_force(force);\n"
-"}\n"
-"\n"
-"```"
-msgstr ""
-"```rust,editable,compile_fail\n"
-"struct LibrasDeForca(f64);\n"
-"struct Newtons(f64);\n"
-"\n"
-"fn calcular_forca_nas_turbinas() -> LibrasDeForca {\n"
-" todo!(\"Pergunte para um cientista de foguetes da NASA\")\n"
-"}\n"
-"\n"
-"fn definir_forca_nas_turbinas(force: Newtons) {\n"
-" // …\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let forca = calcular_forca_nas_turbinas();\n"
-" definir_forca_nas_turbinas(forca);\n"
-"}\n"
-"\n"
-"```"
+#: src/structs/tuple-structs.md:21
+msgid "\"Ask a rocket scientist at NASA\""
+msgstr "\"Pergunte para um cientista de foguetes da NASA\""
+
+#: src/structs/tuple-structs.md:25
+#: src/bare-metal/microcontrollers/type-state.md:14
+#: src/async/pitfalls/cancellation.md:99
+msgid "// ...\n"
+msgstr "// …\n"
#: src/structs/tuple-structs.md:37
msgid ""
@@ -7064,45 +5836,9 @@ msgstr ""
"Se você já tiver variáveis com os nomes corretos, poderá criar a estrutura "
"(_struct_) usando uma abreviação:"
-#: src/structs/field-shorthand.md:6
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Person {\n"
-" name: String,\n"
-" age: u8,\n"
-"}\n"
-"\n"
-"impl Person {\n"
-" fn new(name: String, age: u8) -> Person {\n"
-" Person { name, age }\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let peter = Person::new(String::from(\"Peter\"), 27);\n"
-" println!(\"{peter:?}\");\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Pessoa {\n"
-" nome: String,\n"
-" idade: u8,\n"
-"}\n"
-"\n"
-"impl Pessoa {\n"
-" fn new(nome: String, idade: u8) -> Pessoa {\n"
-" Pessoa { nome, idade }\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let pedro = Pessoa::new(String::from(\"Pedro\"), 27);\n"
-" println!(\"{pedro:?}\");\n"
-"}\n"
-"```"
+#: src/structs/field-shorthand.md:21
+msgid "\"{peter:?}\""
+msgstr "\"{pedro:?}\""
#: src/structs/field-shorthand.md:27
msgid ""
@@ -7112,34 +5848,6 @@ msgstr ""
"A função `new` poderia ser escrita utilizando `Self` como tipo, já que ele é "
"intercambiável com o nome da _struct_"
-#: src/structs/field-shorthand.md:29
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Person {\n"
-" name: String,\n"
-" age: u8,\n"
-"}\n"
-"impl Person {\n"
-" fn new(name: String, age: u8) -> Self {\n"
-" Self { name, age }\n"
-" }\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Pessoa {\n"
-" nome: String,\n"
-" idade: u8,\n"
-"}\n"
-"impl Pessoa {\n"
-" fn new(nome: String, idade: u8) -> Self {\n"
-" Self { nome, idade }\n"
-" }\n"
-"}\n"
-"```"
-
#: src/structs/field-shorthand.md:41
msgid ""
"Implement the `Default` trait for the struct. Define some fields and use the "
@@ -7148,57 +5856,13 @@ msgstr ""
"Implemente a _trait_ `Default` (Padrão) para a _struct_. Defina alguns "
"campos e utilize valores padrão para os demais."
-#: src/structs/field-shorthand.md:43
-msgid ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Person {\n"
-" name: String,\n"
-" age: u8,\n"
-"}\n"
-"impl Default for Person {\n"
-" fn default() -> Person {\n"
-" Person {\n"
-" name: \"Bot\".to_string(),\n"
-" age: 0,\n"
-" }\n"
-" }\n"
-"}\n"
-"fn create_default() {\n"
-" let tmp = Person {\n"
-" ..Person::default()\n"
-" };\n"
-" let tmp = Person {\n"
-" name: \"Sam\".to_string(),\n"
-" ..Person::default()\n"
-" };\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[derive(Debug)]\n"
-"struct Pessoa {\n"
-" nome: String,\n"
-" idade: u8,\n"
-"}\n"
-"impl Default for Pessoa {\n"
-" fn default() -> Pessoa {\n"
-" Pessoa {\n"
-" nome: \"Robô\".to_string(),\n"
-" idade: 0,\n"
-" }\n"
-" }\n"
-"}\n"
-"fn create_default() {\n"
-" let tmp = Pessoa {\n"
-" ..Pessoa::default()\n"
-" };\n"
-" let tmp = Pessoa {\n"
-" nome: \"Sam\".to_string(),\n"
-" ..Pessoa::default()\n"
-" };\n"
-"}\n"
-"```"
+#: src/structs/field-shorthand.md:52
+msgid "\"Bot\""
+msgstr "\"Robô\""
+
+#: src/structs/field-shorthand.md:62
+msgid "\"Sam\""
+msgstr "\"Sam\""
#: src/structs/field-shorthand.md:68
msgid "Methods are defined in the `impl` block."
@@ -7227,60 +5891,18 @@ msgstr ""
"A palavra-chave `enum` permite a criação de um tipo que possui algumas "
"variantes diferentes:"
-#: src/enums.md:6
-msgid ""
-"```rust,editable\n"
-"fn generate_random_number() -> i32 {\n"
-" // Implementation based on https://xkcd.com/221/\n"
-" 4 // Chosen by fair dice roll. Guaranteed to be random.\n"
-"}\n"
-"\n"
-"#[derive(Debug)]\n"
-"enum CoinFlip {\n"
-" Heads,\n"
-" Tails,\n"
-"}\n"
-"\n"
-"fn flip_coin() -> CoinFlip {\n"
-" let random_number = generate_random_number();\n"
-" if random_number % 2 == 0 {\n"
-" return CoinFlip::Heads;\n"
-" } else {\n"
-" return CoinFlip::Tails;\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"You got: {:?}\", flip_coin());\n"
-"}\n"
-"```"
+#: src/enums.md:8
+msgid "// Implementation based on https://xkcd.com/221/\n"
+msgstr "// Implementação baseada em https://xkcd.com/221/\n"
+
+#: src/enums.md:9
+msgid "// Chosen by fair dice roll. Guaranteed to be random.\n"
msgstr ""
-"```rust,editable\n"
-"fn gerar_numero_aleatorio() -> i32 {\n"
-" // Implementação baseada em https://xkcd.com/221/\n"
-" 4 // Escolhido por uma rolagem de dados justa. Garantido ser "
-"aleatório.\n"
-"}\n"
-"\n"
-"#[derive(Debug)]\n"
-"enum MoedaJogada {\n"
-" Cara,\n"
-" Coroa,\n"
-"}\n"
-"\n"
-"fn jogar_moeda() -> MoedaJogada {\n"
-" let numero_aleatorio = gerar_numero_aleatorio();\n"
-" if numero_aleatorio % 2 == 0 {\n"
-" return MoedaJogada::Cara;\n"
-" } else {\n"
-" return MoedaJogada::Coroa;\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"Você tirou: {:?}\", jogar_moeda());\n"
-"}\n"
-"```"
+"// Escolhido por uma rolagem de dados justa. Garantido ser aleatório.\n"
+
+#: src/enums.md:28
+msgid "\"You got: {:?}\""
+msgstr "\"Você tirou: {:?}\""
#: src/enums.md:36
msgid "Enumerations allow you to collect a set of values under one type"
@@ -7330,62 +5952,33 @@ msgstr ""
"pode então usar a instrução `match` (corresponder) para extrair os dados de "
"cada variante:"
-#: src/enums/variant-payloads.md:6
-msgid ""
-"```rust,editable\n"
-"enum WebEvent {\n"
-" PageLoad, // Variant without payload\n"
-" KeyPress(char), // Tuple struct variant\n"
-" Click { x: i64, y: i64 }, // Full struct variant\n"
-"}\n"
-"\n"
-"#[rustfmt::skip]\n"
-"fn inspect(event: WebEvent) {\n"
-" match event {\n"
-" WebEvent::PageLoad => println!(\"page loaded\"),\n"
-" WebEvent::KeyPress(c) => println!(\"pressed '{c}'\"),\n"
-" WebEvent::Click { x, y } => println!(\"clicked at x={x}, y={y}\"),\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let load = WebEvent::PageLoad;\n"
-" let press = WebEvent::KeyPress('x');\n"
-" let click = WebEvent::Click { x: 20, y: 80 };\n"
-"\n"
-" inspect(load);\n"
-" inspect(press);\n"
-" inspect(click);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"enum EventoWeb {\n"
-" CarregarPagina, // Variante sem conteúdo\n"
-" TeclaPressionada(char), // Variante tupla\n"
-" Clique { x: i64, y: i64 }, // Variante completa\n"
-"}\n"
-"\n"
-"#[rustfmt::skip]\n"
-"fn inspecionar(evento: EventoWeb) {\n"
-" match evento {\n"
-" EventoWeb::CarregarPagina => println!(\"página carregada\"),\n"
-" EventoWeb::TeclaPressionada(c) => println!(\"pressionou "
-"'{c}'\"),\n"
-" EventoWeb::Clique { x, y } => println!(\"clicou em x={x}, y={y}\"),\n"
-" }\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" let carregar = EventoWeb::CarregarPagina;\n"
-" let pressionar = EventoWeb::TeclaPressionada('x');\n"
-" let clicar = EventoWeb::Clique { x: 20, y: 80 };\n"
-"\n"
-" inspecionar(carregar);\n"
-" inspecionar(pressionar);\n"
-" inspecionar(clicar);\n"
-"}\n"
-"```"
+#: src/enums/variant-payloads.md:8
+msgid "// Variant without payload\n"
+msgstr "// Variante sem conteúdo\n"
+
+#: src/enums/variant-payloads.md:9
+msgid "// Tuple struct variant\n"
+msgstr "// Variante tupla\n"
+
+#: src/enums/variant-payloads.md:10
+msgid "// Full struct variant\n"
+msgstr "// Variante completa\n"
+
+#: src/enums/variant-payloads.md:16
+msgid "\"page loaded\""
+msgstr "\"página carregada\""
+
+#: src/enums/variant-payloads.md:17
+msgid "\"pressed '{c}'\""
+msgstr "\"pressionou '{c}'\""
+
+#: src/enums/variant-payloads.md:18
+msgid "\"clicked at x={x}, y={y}\""
+msgstr "\"clicou em x={x}, y={y}\""
+
+#: src/enums/variant-payloads.md:24 src/pattern-matching.md:10
+msgid "'x'"
+msgstr "'x'"
#: src/enums/variant-payloads.md:35
msgid ""
@@ -7468,45 +6061,9 @@ msgstr ""
"Enums, em Rust, são agrupados de maneira compacta, levando em consideração "
"restrições devido ao alinhamento:"
-#: src/enums/sizes.md:5
-msgid ""
-"```rust,editable\n"
-"use std::any::type_name;\n"
-"use std::mem::{align_of, size_of};\n"
-"\n"
-"fn dbg_size() {\n"
-" println!(\"{}: size {} bytes, align: {} bytes\",\n"
-" type_name::(), size_of::(), align_of::());\n"
-"}\n"
-"\n"
-"enum Foo {\n"
-" A,\n"
-" B,\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" dbg_size::();\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"use std::any::type_name;\n"
-"use std::mem::{align_of, size_of};\n"
-"\n"
-"fn dbg_size() {\n"
-" println!(\"{}: tamanho {} bytes, alinhamento: {} bytes\",\n"
-" type_name::(), size_of::(), align_of::());\n"
-"}\n"
-"\n"
-"enum Foo {\n"
-" A,\n"
-" B,\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" dbg_size::();\n"
-"}\n"
-"```"
+#: src/enums/sizes.md:10
+msgid "\"{}: size {} bytes, align: {} bytes\""
+msgstr "\"{}: tamanho {} bytes, alinhamento: {} bytes\""
#: src/enums/sizes.md:24
msgid ""
@@ -7531,37 +6088,25 @@ msgstr ""
"É possível controlar a discriminante se necessário (e.g., para "
"compatibilidade com C):"
-#: src/enums/sizes.md:34
-msgid ""
-"```rust,editable\n"
-"#[repr(u32)]\n"
-"enum Bar {\n"
-" A, // 0\n"
-" B = 10000,\n"
-" C, // 10001\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"A: {}\", Bar::A as u32);\n"
-" println!(\"B: {}\", Bar::B as u32);\n"
-" println!(\"C: {}\", Bar::C as u32);\n"
-"}\n"
-"```"
-msgstr ""
-"```rust,editable\n"
-"#[repr(u32)]\n"
-"enum Bar {\n"
-" A, // 0\n"
-" B = 10000,\n"
-" C, // 10001\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" println!(\"A: {}\", Bar::A as u32);\n"
-" println!(\"B: {}\", Bar::B as u32);\n"
-" println!(\"C: {}\", Bar::C as u32);\n"
-"}\n"
-"```"
+#: src/enums/sizes.md:37
+msgid "// 0\n"
+msgstr "// 0\n"
+
+#: src/enums/sizes.md:39
+msgid "// 10001\n"
+msgstr "// 10001\n"
+
+#: src/enums/sizes.md:43
+msgid "\"A: {}\""
+msgstr "\"A: {}\""
+
+#: src/enums/sizes.md:44
+msgid "\"B: {}\""
+msgstr "\"B: {}\""
+
+#: src/enums/sizes.md:45
+msgid "\"C: {}\""
+msgstr "\"C: {}\""
#: src/enums/sizes.md:49
msgid ""
@@ -7630,79 +6175,33 @@ msgstr ""
"garantia a respeito dessa representação, portanto isso é completamente "
"inseguro."
-#: src/enums/sizes.md:70
+#: src/enums/sizes.md:75 src/enums/sizes.md:114
+msgid "\"- {}: {:#x}\""
+msgstr "\"- {}: {:#x}\""
+
+#: src/enums/sizes.md:80 src/enums/sizes.md:131
msgid ""
-"```rust,editable\n"
-"use std::mem::transmute;\n"
-"\n"
-"macro_rules! dbg_bits {\n"
-" ($e:expr, $bit_type:ty) => {\n"
-" println!(\"- {}: {:#x}\", stringify!($e), transmute::<_, "
-"$bit_type>($e));\n"
-" };\n"
-"}\n"
-"\n"
-"fn main() {\n"
-" // TOTALLY UNSAFE. Rust provides no guarantees about the bitwise\n"
+"// TOTALLY UNSAFE. Rust provides no guarantees about the bitwise\n"
" // representation of types.\n"
-" unsafe {\n"
-" println!(\"Bitwise representation of bool\");\n"
-" dbg_bits!(false, u8);\n"
-" dbg_bits!(true, u8);\n"
-"\n"
-" println!(\"Bitwise representation of Option\");\n"
-" dbg_bits!(None::, u8);\n"
-" dbg_bits!(Some(false), u8);\n"
-" dbg_bits!(Some(true), u8);\n"
-"\n"
-" println!(\"Bitwise representation of Option