diff --git a/po/pt-BR.po b/po/pt-BR.po index b9ebd8f7092b..8b1ead2a0bb3 100644 --- a/po/pt-BR.po +++ b/po/pt-BR.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-02-14 08:57+0000\n" +"PO-Revision-Date: 2023-02-17 15:06+0100\n" "Last-Translator: Martin Geisler \n" "Language-Team: \n" "Language: pt_BR\n" @@ -120,8 +120,8 @@ msgstr "Métodos" msgid "Overloading" msgstr "Sobrecargo" -#: src/SUMMARY.md:35 src/SUMMARY.md:64 src/SUMMARY.md:88 src/SUMMARY.md:117 src/SUMMARY.md:146 -#: src/SUMMARY.md:174 src/SUMMARY.md:197 src/SUMMARY.md:224 +#: src/SUMMARY.md:35 src/SUMMARY.md:64 src/SUMMARY.md:88 src/SUMMARY.md:117 src/SUMMARY.md:146 src/SUMMARY.md:174 +#: src/SUMMARY.md:197 src/SUMMARY.md:224 msgid "Exercises" msgstr "Exercícios" @@ -885,43 +885,34 @@ msgstr "" "Se você sabe programar em uma linguagem de tipagem dinâmica, como Python ou\n" "JavaScript, então você também será capaz de acompanhar." -#: src/welcome.md:46 src/cargo/rust-ecosystem.md:19 src/cargo/code-samples.md:22 -#: src/cargo/running-locally.md:68 src/welcome-day-1.md:14 src/welcome-day-1/what-is-rust.md:19 -#: src/hello-world.md:20 src/hello-world/small-example.md:21 src/why-rust.md:9 -#: src/why-rust/compile-time.md:14 src/why-rust/runtime.md:8 src/why-rust/modern.md:19 -#: src/basic-syntax/compound-types.md:28 src/basic-syntax/slices.md:18 -#: src/basic-syntax/string-slices.md:25 src/basic-syntax/functions.md:33 -#: src/basic-syntax/functions-interlude.md:25 src/exercises/day-1/morning.md:9 -#: src/exercises/day-1/for-loops.md:90 src/basic-syntax/variables.md:15 -#: src/basic-syntax/type-inference.md:24 src/basic-syntax/static-and-const.md:46 -#: src/basic-syntax/scopes-shadowing.md:23 src/memory-management/stack.md:26 -#: src/memory-management/rust.md:12 src/ownership/move-semantics.md:20 -#: src/ownership/moves-function-calls.md:18 src/ownership/copy-clone.md:33 -#: src/ownership/borrowing.md:25 src/ownership/shared-unique-borrows.md:23 +#: src/welcome.md:46 src/cargo/rust-ecosystem.md:19 src/cargo/code-samples.md:22 src/cargo/running-locally.md:68 +#: src/welcome-day-1.md:14 src/welcome-day-1/what-is-rust.md:19 src/hello-world.md:20 src/hello-world/small-example.md:21 +#: src/why-rust.md:9 src/why-rust/compile-time.md:14 src/why-rust/runtime.md:8 src/why-rust/modern.md:19 +#: src/basic-syntax/compound-types.md:28 src/basic-syntax/slices.md:18 src/basic-syntax/string-slices.md:25 +#: src/basic-syntax/functions.md:33 src/basic-syntax/functions-interlude.md:25 src/exercises/day-1/morning.md:9 +#: src/exercises/day-1/for-loops.md:90 src/basic-syntax/variables.md:15 src/basic-syntax/type-inference.md:24 +#: src/basic-syntax/static-and-const.md:46 src/basic-syntax/scopes-shadowing.md:23 src/memory-management/stack.md:26 +#: src/memory-management/rust.md:12 src/ownership/move-semantics.md:20 src/ownership/moves-function-calls.md:18 +#: src/ownership/copy-clone.md:33 src/ownership/borrowing.md:25 src/ownership/shared-unique-borrows.md:23 #: src/ownership/lifetimes-function-calls.md:27 src/ownership/lifetimes-data-structures.md:23 -#: src/exercises/day-1/afternoon.md:9 src/structs/tuple-structs.md:35 -#: src/structs/field-shorthand.md:25 src/enums/variant-payloads.md:33 src/methods.md:28 -#: src/pattern-matching/destructuring-enums.md:33 src/pattern-matching/destructuring-arrays.md:18 -#: src/pattern-matching/match-guards.md:20 src/exercises/day-2/morning.md:9 -#: src/exercises/day-2/points-polygons.md:115 src/control-flow/blocks.md:40 -#: src/control-flow/if-expressions.md:29 src/control-flow/if-let-expressions.md:19 -#: src/control-flow/while-let-expressions.md:25 src/std/option-result.md:16 src/std/string.md:28 -#: src/std/vec.md:35 src/std/hashmap.md:36 src/std/box.md:32 src/std/rc.md:29 src/modules.md:26 -#: src/modules/visibility.md:37 src/exercises/day-2/afternoon.md:5 src/traits.md:39 -#: src/traits/iterator.md:30 src/traits/from-iterator.md:15 src/traits/operators.md:24 -#: src/traits/drop.md:32 src/traits/default.md:38 src/generics/methods.md:23 -#: src/generics/trait-bounds.md:33 src/generics/impl-trait.md:22 src/generics/closures.md:23 -#: src/exercises/day-3/morning.md:5 src/error-handling/result.md:25 -#: src/error-handling/try-operator.md:48 src/error-handling/converting-error-types-example.md:48 -#: src/error-handling/deriving-error-enums.md:37 src/error-handling/dynamic-errors.md:34 -#: src/error-handling/error-contexts.md:33 src/unsafe.md:26 src/unsafe/raw-pointers.md:24 -#: src/unsafe/mutable-static-variables.md:30 src/unsafe/unions.md:19 -#: src/unsafe/writing-unsafe-functions.md:31 src/unsafe/extern-functions.md:19 -#: src/unsafe/unsafe-traits.md:28 src/exercises/day-3/afternoon.md:5 src/concurrency/threads.md:28 -#: src/concurrency/channels.md:25 src/concurrency/shared_state/arc.md:27 -#: src/concurrency/shared_state/example.md:21 src/concurrency/send-sync.md:18 -#: src/concurrency/send-sync/sync.md:12 src/exercises/day-4/morning.md:10 -#: src/android/interoperability/with-c/rust.md:81 src/exercises/day-4/afternoon.md:10 +#: src/exercises/day-1/afternoon.md:9 src/structs/tuple-structs.md:35 src/structs/field-shorthand.md:25 +#: src/enums/variant-payloads.md:33 src/methods.md:28 src/pattern-matching/destructuring-enums.md:33 +#: src/pattern-matching/destructuring-arrays.md:18 src/pattern-matching/match-guards.md:20 src/exercises/day-2/morning.md:9 +#: src/exercises/day-2/points-polygons.md:115 src/control-flow/blocks.md:40 src/control-flow/if-expressions.md:29 +#: src/control-flow/if-let-expressions.md:19 src/control-flow/while-let-expressions.md:25 src/std/option-result.md:16 +#: src/std/string.md:28 src/std/vec.md:35 src/std/hashmap.md:36 src/std/box.md:32 src/std/rc.md:29 src/modules.md:26 +#: src/modules/visibility.md:37 src/exercises/day-2/afternoon.md:5 src/traits.md:39 src/traits/iterator.md:30 +#: src/traits/from-iterator.md:15 src/traits/operators.md:24 src/traits/drop.md:32 src/traits/default.md:38 +#: src/generics/methods.md:23 src/generics/trait-bounds.md:33 src/generics/impl-trait.md:22 src/generics/closures.md:23 +#: src/exercises/day-3/morning.md:5 src/error-handling/result.md:25 src/error-handling/try-operator.md:48 +#: src/error-handling/converting-error-types-example.md:48 src/error-handling/deriving-error-enums.md:37 +#: src/error-handling/dynamic-errors.md:34 src/error-handling/error-contexts.md:33 src/unsafe.md:26 +#: src/unsafe/raw-pointers.md:24 src/unsafe/mutable-static-variables.md:30 src/unsafe/unions.md:19 +#: src/unsafe/writing-unsafe-functions.md:31 src/unsafe/extern-functions.md:19 src/unsafe/unsafe-traits.md:28 +#: src/exercises/day-3/afternoon.md:5 src/concurrency/threads.md:28 src/concurrency/channels.md:25 +#: src/concurrency/shared_state/arc.md:27 src/concurrency/shared_state/example.md:21 src/concurrency/send-sync.md:18 +#: src/concurrency/send-sync/sync.md:12 src/exercises/day-4/morning.md:10 src/android/interoperability/with-c/rust.md:81 +#: src/exercises/day-4/afternoon.md:10 msgid "
" msgstr "
" @@ -935,38 +926,30 @@ msgstr "" "informações aos slides. Estes podem ser pontos chave em que o instrutor deve\n" "cobrir respostas à perguntas típicas que surgem em sala de aula." -#: src/welcome.md:52 src/cargo/rust-ecosystem.md:67 src/cargo/code-samples.md:35 -#: src/cargo/running-locally.md:74 src/welcome-day-1.md:42 src/welcome-day-1/what-is-rust.md:29 -#: src/hello-world.md:36 src/hello-world/small-example.md:44 src/why-rust.md:24 -#: src/why-rust/compile-time.md:35 src/why-rust/runtime.md:22 src/why-rust/modern.md:66 -#: src/basic-syntax/compound-types.md:62 src/basic-syntax/references.md:28 -#: src/basic-syntax/slices.md:36 src/basic-syntax/functions.md:54 src/exercises/day-1/morning.md:28 -#: src/exercises/day-1/for-loops.md:95 src/basic-syntax/variables.md:20 -#: src/basic-syntax/type-inference.md:48 src/basic-syntax/static-and-const.md:52 -#: src/basic-syntax/scopes-shadowing.md:39 src/memory-management/stack.md:49 -#: src/memory-management/rust.md:18 src/ownership/move-semantics.md:26 -#: src/ownership/moves-function-calls.md:26 src/ownership/borrowing.md:51 -#: src/ownership/shared-unique-borrows.md:29 src/ownership/lifetimes-function-calls.md:60 -#: src/exercises/day-1/afternoon.md:15 src/exercises/day-1/book-library.md:103 src/structs.md:41 -#: src/enums/variant-payloads.md:41 src/enums/sizes.md:136 src/methods/example.md:53 -#: src/pattern-matching/destructuring-enums.md:39 src/exercises/day-2/morning.md:15 -#: src/exercises/day-2/points-polygons.md:125 src/control-flow/if-let-expressions.md:26 -#: src/control-flow/for-expressions.md:29 src/control-flow/loop-expressions.md:27 src/std.md:31 -#: src/std/option-result.md:25 src/std/string.md:34 src/std/vec.md:49 src/std/hashmap.md:40 -#: src/std/rc.md:66 src/modules.md:32 src/modules/visibility.md:48 -#: src/exercises/day-2/afternoon.md:11 src/traits.md:54 src/traits/from-iterator.md:26 -#: src/traits/operators.md:38 src/traits/drop.md:42 src/traits/default.md:47 +#: src/welcome.md:52 src/cargo/rust-ecosystem.md:67 src/cargo/code-samples.md:35 src/cargo/running-locally.md:74 +#: src/welcome-day-1.md:42 src/welcome-day-1/what-is-rust.md:29 src/hello-world.md:36 src/hello-world/small-example.md:44 +#: src/why-rust.md:24 src/why-rust/compile-time.md:35 src/why-rust/runtime.md:22 src/why-rust/modern.md:66 +#: src/basic-syntax/compound-types.md:62 src/basic-syntax/references.md:28 src/basic-syntax/slices.md:36 +#: src/basic-syntax/functions.md:54 src/exercises/day-1/morning.md:28 src/exercises/day-1/for-loops.md:95 +#: src/basic-syntax/variables.md:20 src/basic-syntax/type-inference.md:48 src/basic-syntax/static-and-const.md:52 +#: src/basic-syntax/scopes-shadowing.md:39 src/memory-management/stack.md:49 src/memory-management/rust.md:18 +#: src/ownership/move-semantics.md:26 src/ownership/moves-function-calls.md:26 src/ownership/borrowing.md:51 +#: src/ownership/shared-unique-borrows.md:29 src/ownership/lifetimes-function-calls.md:60 src/exercises/day-1/afternoon.md:15 +#: src/exercises/day-1/book-library.md:103 src/structs.md:41 src/enums/variant-payloads.md:41 src/enums/sizes.md:136 +#: src/methods/example.md:53 src/pattern-matching/destructuring-enums.md:39 src/exercises/day-2/morning.md:15 +#: src/exercises/day-2/points-polygons.md:125 src/control-flow/if-let-expressions.md:26 src/control-flow/for-expressions.md:29 +#: src/control-flow/loop-expressions.md:27 src/std.md:31 src/std/option-result.md:25 src/std/string.md:34 src/std/vec.md:49 +#: src/std/hashmap.md:40 src/std/rc.md:66 src/modules.md:32 src/modules/visibility.md:48 src/exercises/day-2/afternoon.md:11 +#: src/traits.md:54 src/traits/from-iterator.md:26 src/traits/operators.md:38 src/traits/drop.md:42 src/traits/default.md:47 #: src/generics/methods.md:31 src/generics/closures.md:38 src/exercises/day-3/morning.md:11 #: src/error-handling/try-operator.md:55 src/error-handling/converting-error-types-example.md:60 #: src/error-handling/deriving-error-enums.md:45 src/error-handling/dynamic-errors.md:41 #: src/error-handling/error-contexts.md:42 src/unsafe.md:32 src/unsafe/raw-pointers.md:42 -#: src/unsafe/mutable-static-variables.md:35 src/unsafe/unions.md:28 -#: src/unsafe/writing-unsafe-functions.md:38 src/unsafe/extern-functions.md:28 -#: src/unsafe/unsafe-traits.md:37 src/exercises/day-3/afternoon.md:11 src/concurrency/threads.md:45 -#: src/concurrency/channels.md:32 src/concurrency/shared_state/arc.md:38 -#: src/concurrency/shared_state/example.md:60 src/concurrency/send-sync/sync.md:18 -#: src/exercises/day-4/morning.md:16 src/android/interoperability/with-c/rust.md:86 -#: src/exercises/day-4/afternoon.md:15 +#: src/unsafe/mutable-static-variables.md:35 src/unsafe/unions.md:28 src/unsafe/writing-unsafe-functions.md:38 +#: src/unsafe/extern-functions.md:28 src/unsafe/unsafe-traits.md:37 src/exercises/day-3/afternoon.md:11 +#: src/concurrency/threads.md:45 src/concurrency/channels.md:32 src/concurrency/shared_state/arc.md:38 +#: src/concurrency/shared_state/example.md:60 src/concurrency/send-sync/sync.md:18 src/exercises/day-4/morning.md:16 +#: src/android/interoperability/with-c/rust.md:86 src/exercises/day-4/afternoon.md:15 msgid "
" msgstr "
" @@ -1013,7 +996,7 @@ msgid "" msgstr "" "2. Decida as datas. Como o curso é grande, recomendamos que você\n" " agende os quatro dias em duas semanas. Os participantes do curso disseram que\n" -" eles acham útil ter uma lacuna no curso, pois os ajuda a processar\n" +" eles acham útil ter uma pausa no curso, pois os ajuda a processar\n" " todas as informações que lhes damos." #: src/running-the-course.md:21 @@ -1023,24 +1006,22 @@ msgid "" " asking questions --- it's also small enough that one instructor will have\n" " time to answer the questions." msgstr "" -"3. Encontre uma sala suficientemente grande para seus participantes presenciais. Recomendamos um\n" -" turmas de 15 a 20 Persons. Isso é suficientemente pequeno para que as Persons se sintam " -"confortáveis\n" -" fazendo perguntas é para que um instrutor tenha\n" +"3. Encontre uma sala suficientemente grande para seus participantes presenciais. Recomendamos\n" +" turmas de 15 a 20 pessoas. Isso é suficientemente pequeno para que as pessoas se sintam confortáveis\n" +" em fazer perguntas --- e para que um instrutor tenha\n" " tempo para responder às perguntas." #: src/running-the-course.md:26 msgid "" "4. On the day of your course, show up to the room a little early to set things\n" " up. We recommend presenting directly using `mdbook serve` running on your\n" -" laptop (see the [installation instructions][5]). This ensures optimal performance with no lag " -"as you change pages.\n" +" laptop (see the [installation instructions][5]). This ensures optimal performance with no lag as you change pages.\n" " Using your laptop will also allow you to fix typos as you or the course\n" " participants spot them." msgstr "" "4. No dia do seu curso, chegue um pouco mais cedo na sala para acertar as coisas.\n" " Recomendamos apresentar diretamente usando `mdbook serve` rodando em seu\n" -" computador portátil. Isso garante um desempenho ideal sem atrasos quando você muda de página.\n" +" laptop. Isso garante um desempenho ideal sem atrasos quando você muda de página.\n" " Usar seu laptop também permitirá que você corrija erros de digitação enquanto você ou\n" " os participantes os identificam." @@ -1052,12 +1033,11 @@ msgid "" " and offer a solution, e.g., by showing people where to find the relevant\n" " information in the standard library." msgstr "" -"5. Deixe as Persons resolverem os exercícios sozinhas ou em pequenos grupos. Tenha certeza de\n" -" pergunte às Persons se elas estão empacadas ou se há algo em que você possa ajudar. Quando\n" -" você vê que várias Persons têm o mesmo problema, chame a turma\n" -" e oferecer uma solução, por exemplo, mostrando às Persons onde encontrar as informações " -"relevantes\n" -" informações na biblioteca padrão." +"5. Deixe as pessoas resolverem os exercícios sozinhas ou em pequenos grupos. Tenha certeza de\n" +" perguntar às pessoas se elas estão com dificuldades ou se há algo em que você possa ajudar. Quando\n" +" você vê que várias pessoas têm o mesmo problema, chame a turma\n" +" e oferecer uma solução, por exemplo, mostrando às pessoas onde encontrar as informações relevantes\n" +" na biblioteca padrão." #: src/running-the-course.md:38 msgid "" @@ -1067,11 +1047,11 @@ msgid "" " checkout. This will ensure that the Android build system sees the\n" " `Android.bp` files in `src/android/`." msgstr "" -"6. Se você não pular as partes específicas do Android no Dia 4, precisará de um [AOSP\n" -" checkout [1]. Faça um checkout do [repositório do curso][2] no mesmo\n" -" máquina e mova o diretório `src/android/` para a raiz do seu AOSP\n" -" checkout. Isso garantirá que o sistema de compilação do Android veja o\n" -" Arquivos `Android.bp` em `src/android/`." +"6. Se você não pular as partes específicas do Android no Dia 4, precisará de um [checkout\n" +" do AOSP][1]. Faça um checkout do [repositório do curso][2] no mesmo\n" +" computador e mova o diretório `src/android/` para a raiz do seu checkout doAOSP.\n" +" Isso garantirá que o sistema de compilação do Android veja os\n" +" arquivos `Android.bp` em `src/android/`." #: src/running-the-course.md:44 msgid "" @@ -1079,7 +1059,7 @@ msgid "" " all Android examples using `src/android/build_all.sh`. Read the script to see\n" " the commands it runs and make sure they work when you run them by hand." msgstr "" -" Certifique-se de que `adb sync` funcione com seu emulador ou dispositivo real e pré-construa\n" +" Certifique-se de que `adb sync` funcione com seu emulador ou dispositivo real e pré-compile\n" " todos os exemplos do Android usando `src/android/build_all.sh`. Leia o roteiro para ver\n" " os comandos executados e verifique se eles funcionam quando você os executa manualmente." @@ -1120,7 +1100,7 @@ msgstr "# Estrutura do curso" #: src/running-the-course/course-structure.md:5 msgid "The course is fast paced and covers a lot of ground:" -msgstr "O curso é rápido e cobre muito terreno:" +msgstr "O curso é rápido e muito abrangente:" #: src/running-the-course/course-structure.md:7 msgid "" @@ -1131,8 +1111,8 @@ msgid "" msgstr "" "* Dia 1: Rust básico, ownership e verificador de empréstimo.\n" "* Dia 2: Tipos de dados compostos, correspondência de padrões, a biblioteca padrão.\n" -"* Dia 3: Características e genéricos, tratamento de erros, testes, Rust inseguro.\n" -"* Dia 4: Simultaneage em Rust e interoperabilage com outras linguagens" +"* Dia 3: Traits e generics, tratamento de erros, testes, Rust inseguro.\n" +"* Dia 4: Concorrência em Rust e interoperabilidade com outras linguagens" #: src/running-the-course/course-structure.md:12 msgid "" @@ -1146,15 +1126,15 @@ msgstr "" #: src/running-the-course/course-structure.md:16 msgid "## Format" -msgstr "## Format" +msgstr "## Formato" #: src/running-the-course/course-structure.md:18 msgid "" "The course is meant to be very interactive and we recommend letting the\n" "questions drive the exploration of Rust!" msgstr "" -"O curso pretende ser muito interativo e recomendamos deixar o\n" -"perguntas conduzem a exploração de Rust!" +"O curso pretende ser muito interativo e recomendamos deixar as\n" +"perguntas conduzirem a exploração de Rust!" #: src/running-the-course/keyboard-shortcuts.md:1 msgid "# Keyboard Shortcuts" @@ -1182,16 +1162,14 @@ msgstr "# Usando cargo" #: src/cargo.md:3 msgid "" -"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-lang.org/cargo/), " -"the standard tool\n" +"When you start reading about Rust, you will soon meet [Cargo](https://doc.rust-lang.org/cargo/), the standard tool\n" "used in the Rust ecosystem to build and run Rust applications. Here we want to\n" "give a brief overview of what Cargo is and how it fits into the wider ecosystem\n" "and how it fits into this training." msgstr "" -"Quando você começar a ler sobre Rust, logo conhecerá [Cargo](https://doc.rust-lang.org/cargo/), a " -"ferramenta padrão\n" -"usado no ecossistema Rust para criar e executar aplicativos Rust. Aqui nós queremos\n" -"dê uma breve visão geral do que é Cargo e como ele se encaixa no ecossistema mais amplo\n" +"Quando você começar a ler sobre Rust, logo conhecerá o [Cargo](https://doc.rust-lang.org/cargo/), a ferramenta padrão\n" +"usada no ecossistema Rust para criar e executar aplicativos Rust. Aqui nós queremos\n" +"dar uma breve visão geral do que é o Cargo e como ele se encaixa no ecossistema mais amplo\n" "e como ele se encaixa neste treinamento." #: src/cargo.md:8 @@ -1204,19 +1182,19 @@ msgstr "### Rustup (Recomendado)" #: src/cargo.md:12 msgid "" -"You can follow the instructions to install cargo and rust compiler, among other standard ecosystem " -"tools with the [rustup][3] tool, which is maintained by the Rust Foundation." +"You can follow the instructions to install cargo and rust compiler, among other standard ecosystem tools with the [rustup]" +"[3] tool, which is maintained by the Rust Foundation." msgstr "" -"Você pode seguir as instruções para instalar o compilador de cargo e Rust, entre outras " -"ferramentas padrão do ecossistema com a ferramenta [rustup][3], que é mantida pela Rust Foundation." +"Você pode seguir as instruções para instalar o cargo e o compilador de Rust, entre outras ferramentas padrão do ecossistema " +"com a ferramenta [rustup][3], que é mantida pela Rust Foundation." #: src/cargo.md:14 msgid "" -"Along with cargo and rustc, Rustup will install itself as a command line utility that you can use " -"to install/switch toolchains, setup cross compilation, etc." +"Along with cargo and rustc, Rustup will install itself as a command line utility that you can use to install/switch " +"toolchains, setup cross compilation, etc." msgstr "" -"Juntamente com cargo e rustc, o Rustup se instalará como um utilitário de linha de comando que " -"você pode usar para instalar/alternar ferramentas, configurar compilação cruzada, etc." +"Juntamente com cargo e rustc, o Rustup se instalará como um utilitário de linha de comando que você pode usar para instalar/" +"alternar ferramentas, configurar compilação cruzada, etc." #: src/cargo.md:16 msgid "### Package Managers" @@ -1245,19 +1223,18 @@ msgid "" "This will allow [rust-analyzer][1] to jump to the definitions. We suggest using\n" "[VS Code][2] to edit the code (but any LSP compatible editor works)." msgstr "" -"Isso permitirá que o [analisador de rust] [1] pule para as definições. Sugerimos usar\n" +"Isso permitirá que o [rust-analyzer][1] localize as definições. Sugerimos usar o\n" "[VS Code][2] para editar o código (mas qualquer editor compatível com LSP funciona)." #: src/cargo.md:29 msgid "" -"Some folks also like to use the [JetBrains][4] family of IDEs, which do their own analysis but " -"have their own tradeoffs. If you prefer them, you can install the [Rust Plugin][5]. Please take " -"note that as of January 2023 debugging only works on the CLion version of the JetBrains IDEA suite." +"Some folks also like to use the [JetBrains][4] family of IDEs, which do their own analysis but have their own tradeoffs. If " +"you prefer them, you can install the [Rust Plugin][5]. Please take note that as of January 2023 debugging only works on the " +"CLion version of the JetBrains IDEA suite." msgstr "" -"Algumas Persons também gostam de usar a família de IDEs [JetBrains][4], que fazem suas próprias " -"análises, mas têm suas próprias compensações. Se você preferir, pode instalar o [Plugin Rust] [5]. " -"Observe que, a partir de Janeiro de 2023, a depuração funciona apenas na versão CLion do pacote " -"JetBrains IDEA." +"Algumas Persons também gostam de usar a família de IDEs [JetBrains][4], que fazem suas próprias análises, mas têm suas " +"próprias vantagens e desvantagens. Se você preferir, pode instalar o [Plugin Rust][5]. Observe que, a partir de Janeiro de " +"2023, a depuração funciona apenas na versão CLion do pacote JetBrains IDEA." #: src/cargo.md:31 msgid "" @@ -1297,10 +1274,10 @@ msgid "" " `rustc` when building your project. Cargo also comes with a built-in test\n" " runner which is used to execute unit tests." msgstr "" -"* `cargo`: o gerenciador de dependências Rust e a ferramenta de construção. cargo sabe como\n" -" baixe as dependências hospedadas em e as passará para\n" -" `rustc` ao construir seu projeto. Cargo também vem com um teste embutido\n" -" runner que é usado para executar testes de unage[^cargo]." +"* `cargo`: o gerenciador de dependências Rust e a ferramenta de compilação. O Cargo sabe como\n" +" baixar as dependências hospedadas em e as passará para\n" +" o `rustc` ao compilar o seu projeto. O Cargo também vem com um executor de testes\n" +" embutido que é usado para executar testes unitários." #: src/cargo/rust-ecosystem.md:13 msgid "" @@ -1310,19 +1287,17 @@ msgid "" " library. You can have multiple versions of Rust installed at once and `rustup`\n" " will let you switch between them as needed." msgstr "" -"* `rustup`: o instalador e atualizador da cadeia de ferramentas Rust. Esta ferramenta é utilizada " -"para\n" -" instale e atualize `rustc` e `cargo` quando novas versões do Rust forem lançadas.\n" -" Além disso, `rustup` também pode baixar documentação para o padrão\n" -" biblioteca. Você pode ter várias versões do Rust instaladas ao mesmo tempo e `rustup`\n" +"* `rustup`: o instalador e atualizador do toolchain do Rust. Esta ferramenta é utilizada para\n" +" instalar e atualizar o `rustc` e o `cargo` quando novas versões do Rust forem lançadas.\n" +" Além disso, `rustup` também pode baixar documentação da biblioteca\n" +" padrão. Você pode ter várias versões do Rust instaladas ao mesmo tempo e `rustup`\n" " permitirá que você alterne entre eles conforme necessário." -#: src/cargo/rust-ecosystem.md:21 src/hello-world.md:25 src/hello-world/small-example.md:27 -#: src/why-rust/runtime.md:10 src/why-rust/modern.md:21 src/basic-syntax/compound-types.md:30 -#: src/error-handling/try-operator.md:50 src/error-handling/converting-error-types-example.md:50 -#: src/concurrency/threads.md:30 +#: src/cargo/rust-ecosystem.md:21 src/hello-world.md:25 src/hello-world/small-example.md:27 src/why-rust/runtime.md:10 +#: src/why-rust/modern.md:21 src/basic-syntax/compound-types.md:30 src/error-handling/try-operator.md:50 +#: src/error-handling/converting-error-types-example.md:50 src/concurrency/threads.md:30 msgid "Key points:" -msgstr "Points chave:" +msgstr "Pontos chave:" #: src/cargo/rust-ecosystem.md:23 msgid "" @@ -1330,9 +1305,9 @@ msgid "" " every six weeks. New releases maintain backwards compatibility with\n" " old releases --- plus they enable new functionality." msgstr "" -"* Rust tem um cronograma de lançamento rápido com um novo lançamento saindo\n" -" a cada seis semanas. Novos lançamentos mantêm compatibilage com versões anteriores\n" -" lançamentos antigos --- além disso, eles permitem novas funcionalages." +"* Rust tem um rápido cronograma de lançamento com um novo lançamento saindo\n" +" a cada seis semanas. Novos lançamentos mantêm compatibilidade com versões anteriores\n" +" --- além disso, eles permitem novas funcionalidades." #: src/cargo/rust-ecosystem.md:27 msgid "* There are three release channels: \"stable\", \"beta\", and \"nightly\"." @@ -1351,8 +1326,8 @@ msgid "" "* Rust also has [editions]: the current edition is Rust 2021. Previous\n" " editions were Rust 2015 and Rust 2018." msgstr "" -"* Rust também tem [edições]: a edição atual é Rust 2021. Anterior\n" -" edições foram Rust 2015 e Rust 2018." +"* Rust também tem [edições]: a edição atual é Rust 2021. Edições\n" +" anteriores foram Rust 2015 e Rust 2018." #: src/cargo/rust-ecosystem.md:35 msgid "" @@ -1360,15 +1335,15 @@ msgid "" " the language." msgstr "" " * As edições podem fazer alterações incompatíveis com versões anteriores\n" -" o idioma." +" da linguagem." #: src/cargo/rust-ecosystem.md:38 msgid "" " * To prevent breaking code, editions are opt-in: you select the\n" " edition for your crate via the `Cargo.toml` file." msgstr "" -" * Para evitar quebra de código, as edições são opcionais: você seleciona o\n" -" edição para sua caixa através do arquivo `Cargo.toml`." +" * Para evitar rupturas, as edições são opcionais: você seleciona a\n" +" edição para o seu crate através do arquivo `Cargo.toml`." #: src/cargo/rust-ecosystem.md:41 msgid "" @@ -1379,17 +1354,14 @@ msgstr "" " escrito para diferentes edições." #: src/cargo/rust-ecosystem.md:44 -msgid "" -" * Mention that it is quite rare to ever use the compiler directly not through `cargo` (most " -"users never do)." +msgid " * Mention that it is quite rare to ever use the compiler directly not through `cargo` (most users never do)." msgstr "" -" * Mencione que é muito raro usar o compilador diretamente, não através do `cargo` (a maioria dos " -"usuários nunca o faz)." +" * Mencione que é muito raro usar o compilador diretamente, não através do `cargo` (a maioria dos usuários nunca o faz)." #: src/cargo/rust-ecosystem.md:46 msgid "" -" * It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool. " -"It is capable of many advanced features including but not limited to: \n" +" * It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool. It is capable of many " +"advanced features including but not limited to: \n" " * Project/package structure\n" " * [workspaces]\n" " * Dev Dependencies and Runtime Dependency management/caching\n" @@ -1398,15 +1370,15 @@ msgid "" " * It is also extensible with sub command plugins as well (such as [cargo clippy]).\n" " * Read more from the [official Cargo Book]" msgstr "" -" * Pode valer a pena aludir que o próprio Cargo é uma ferramenta extremamente poderosa e " -"abrangente. Ele é capaz de muitos recursos avançados, incluindo, entre outros:\n" +" * Pode valer a pena mencionar que o Cargo é uma ferramenta extremamente poderosa e abrangente. Ele é capaz de muitos " +"recursos avançados, incluindo, entre outros:\n" " * Estrutura do projeto/pacote\n" -" * [espaços de trabalho]\n" -" * Dependências de desenvolvimento e gerenciamento/cache de dependência de tempo de execução\n" -" * [criar script]\n" +" * [workspaces]\n" +" * Gerenciamento de Dependências de desenvolvimento e dependências de tempo de execução/cache\n" +" * [scripts de compilação]\n" " * [instalação global]\n" " * Também é extensível com plugins de subcomando (como [cargo clippy]).\n" -" * Leia mais no [livro de cargo oficial]" +" * Leia mais no [livro oficial do Cargo]" #: src/cargo/rust-ecosystem.md:55 msgid "[editions]: https://doc.rust-lang.org/edition-guide/" @@ -1414,11 +1386,11 @@ msgstr "[edições]: https://doc.rust-lang.org/edition-guide/" #: src/cargo/rust-ecosystem.md:57 msgid "[workspaces]: https://doc.rust-lang.org/cargo/reference/workspaces.html" -msgstr "[espaços de trabalho]: https://doc.rust-lang.org/cargo/reference/workspaces.html" +msgstr "[workspaces]: https://doc.rust-lang.org/cargo/reference/workspaces.html" #: src/cargo/rust-ecosystem.md:59 msgid "[build scripting]: https://doc.rust-lang.org/cargo/reference/build-scripts.html" -msgstr "[script de construção]: https://doc.rust-lang.org/cargo/reference/build-scripts.html" +msgstr "[scripts de compilação]: https://doc.rust-lang.org/cargo/reference/build-scripts.html" #: src/cargo/rust-ecosystem.md:61 msgid "[global installation]: https://doc.rust-lang.org/cargo/commands/cargo-install.html" @@ -1430,11 +1402,11 @@ msgstr "[cargo clippy]: https://github.com/rust-lang/rust-clippy" #: src/cargo/rust-ecosystem.md:65 msgid "[official Cargo Book]: https://doc.rust-lang.org/cargo/" -msgstr "[Livro de cargo oficial]: https://doc.rust-lang.org/cargo/" +msgstr "[livro oficial do Cargo]: https://doc.rust-lang.org/cargo/" #: src/cargo/code-samples.md:1 msgid "# Code Samples in This Training" -msgstr "# Amostras de código neste treinamento" +msgstr "# Exemplos de código neste treinamento" #: src/cargo/code-samples.md:3 msgid "" @@ -1443,7 +1415,7 @@ msgid "" "ensures a consistent experience for everyone." msgstr "" "Para este treinamento, exploraremos principalmente a linguagem Rust por meio de exemplos\n" -"que pode ser executado através do seu navegador. Isso torna a configuração muito mais fácil e\n" +"que podem ser executados através do seu navegador. Isso torna a instalação muito mais fácil e\n" "garante uma experiência consistente para todos." #: src/cargo/code-samples.md:7 @@ -1452,9 +1424,9 @@ msgid "" "exercises. On the last day, we will do a larger exercise which shows you how to\n" "work with dependencies and for that you need Cargo." msgstr "" -"A instalação do Cargo ainda é incentivada: será mais fácil para você fazer o\n" +"A instalação do Cargo ainda assim é incentivada: será mais fácil para você fazer os\n" "exercícios. No último dia, faremos um exercício maior que mostra como\n" -"Trabalho com dependências e para isso você precisa do Cargo." +"trabalhar com dependências e para isso você precisa do Cargo." #: src/cargo/code-samples.md:11 msgid "The code blocks in this course are fully interactive:" @@ -1479,7 +1451,7 @@ msgid "" "You can use Ctrl + Enter to execute the code when focus is in the\n" "text box." msgstr "" -"Você pode usar Ctrl + Enter para executar o código quando o foco estiver no\n" +"Você pode usar Ctrl + Enter para executar o código quando o foco estiver na\n" "caixa de texto." #: src/cargo/code-samples.md:24 @@ -1495,8 +1467,8 @@ msgid "" "* The embedded playgrounds cannot execute unit tests. Copy-paste the\n" " code and open it in the real Playground to demonstrate unit tests." msgstr "" -"* Os playgrounds incorporados não podem executar testes de unage. Copie e cole o\n" -" código e abri-lo no Playground real para demonstrar os testes de unage." +"* Os playgrounds incorporados não podem executar testes de unitários. Copie e cole o\n" +" código e abra-o no Playground real para demonstrar os testes unitários." #: src/cargo/code-samples.md:30 msgid "" @@ -1507,12 +1479,12 @@ msgid "" msgstr "" "* Os playgrounds embutidos perdem seu estado no momento em que você navega\n" " fora da página! Esta é a razão pela qual os alunos devem\n" -" resolva os exercícios usando uma instalação Rust local ou via\n" -" Parque infantil." +" resolver os exercícios usando uma instalação Rust local ou via\n" +" Playground." #: src/cargo/running-locally.md:1 msgid "# Running Code Locally with Cargo" -msgstr "# Executando código localmente com cargo" +msgstr "# Executando código localmente com o Cargo" #: src/cargo/running-locally.md:3 msgid "" @@ -1522,9 +1494,9 @@ msgid "" "writing, the latest stable Rust release has these version numbers:" msgstr "" "Se você quiser experimentar o código em seu próprio sistema, precisará\n" -"para primeiro instalar o Rust. Faça isso seguindo as [instruções no Rust\n" -"Livro][1]. Isso deve fornecer `rustc` e `cargo` funcionando. Na hora de\n" -"escrevendo, a última versão estável do Rust tem estes números de versão:" +"primeiro instalar o Rust. Faça isso seguindo as [instruções][1].\n" +"Isso deve fornecer o `rustc` e o `cargo` funcionando. Ao escrever\n" +"Este curso, a última versão estável do Rust é:" #: src/cargo/running-locally.md:8 msgid "" @@ -1547,7 +1519,7 @@ msgid "" "With this is in place, then follow these steps to build a Rust binary from one\n" "of the examples in this training:" msgstr "" -"Com isso instalado, siga estas etapas para criar um binário Rust a partir de um\n" +"Com isso finalizado, siga estas etapas para criar um binário Rust a partir de um\n" "dos exemplos neste treinamento:" #: src/cargo/running-locally.md:18 @@ -1565,10 +1537,6 @@ msgid "" " Created binary (application) `exercise` package\n" " ```" msgstr "" -" ```shell\n" -" $ cargo new exercise\n" -" Criou o pacote binário (aplicativo) `exercise`\n" -" ```" #: src/cargo/running-locally.md:27 msgid "3. Navigate into `exercise/` and use `cargo run` to build and run your binary:" @@ -1585,22 +1553,14 @@ msgid "" " Hello, world!\n" " ```" msgstr "" -" ```shell\n" -" exercise $cd\n" -" $ cargo run\n" -" exercise de compilação v0.1.0 (/home/mgeisler/tmp/exercise)\n" -" Destino(s) dev finalizado [não otimizado + debuginfo] em 0,75s\n" -" Executando `target/debug/exercise`\n" -" Olá Mundo!\n" -" ```" #: src/cargo/running-locally.md:38 msgid "" "4. Replace the boiler-plate code in `src/main.rs` with your own code. For\n" " example, using the example on the previous page, make `src/main.rs` look like" msgstr "" -"4. Substitua o código da placa da caldeira em `src/main.rs` pelo seu próprio código. Para\n" -" exemplo, usando o exemplo da página anterior, faça `src/main.rs` parecer" +"4. Substitua o código de exemplo em `src/main.rs` pelo seu próprio código. Por\n" +" exemplo, usando o código da página anterior, faça `src/main.rs` parecer" #: src/cargo/running-locally.md:41 msgid "" @@ -1610,11 +1570,6 @@ msgid "" " }\n" " ```" msgstr "" -" ```rust\n" -" fn main() {\n" -" println!(\"Edite-me!\");\n" -" }\n" -" ```" #: src/cargo/running-locally.md:47 msgid "5. Use `cargo run` to build and run your updated binary:" @@ -1630,13 +1585,6 @@ msgid "" " 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" -" Edite-me!\n" -" ```" #: src/cargo/running-locally.md:57 msgid "" @@ -1647,9 +1595,8 @@ msgid "" msgstr "" "6. Use `cargo check` para verificar rapidamente se há erros em seu projeto, use `cargo build`\n" " para compilá-lo sem executá-lo. Você encontrará a saída em `target/debug/`\n" -" para uma compilação de depuração normal. Use `cargo build --release` para produzir um " -"otimizado\n" -" libere build em `target/release/`." +" para uma compilação de depuração. Use `cargo build --release` para produzir um binário\n" +" otimizado em `target/release/`." #: src/cargo/running-locally.md:62 msgid "" @@ -1657,8 +1604,8 @@ msgid "" " run `cargo` commands, it will automatically download and compile missing\n" " dependencies for you." msgstr "" -"7. Você pode adicionar dependências para seu projeto editando `Cargo.toml`. Quando você\n" -" execute os comandos `cargo`, ele irá baixar e compilar automaticamente\n" +"7. Você pode adicionar dependências ao seu projeto editando `Cargo.toml`. Quando você\n" +" executar os comandos `cargo`, ele irá baixar e compilar automaticamente\n" " dependências para você." #: src/cargo/running-locally.md:66 @@ -1671,8 +1618,8 @@ msgid "" "local editor. It will make their life easier since they will have a\n" "normal development environment." msgstr "" -"Tente encorajar os participantes da aula a instalar o Cargo e usar um\n" -"redator local. Isso facilitará a vida deles, pois eles terão uma\n" +"Tente encorajar os participantes do curso a instalar o Cargo e usar um\n" +"editor local. Isso facilitará a vida deles, pois eles terão um\n" "ambiente normal de desenvolvimento." #: src/welcome-day-1.md:1 @@ -1684,7 +1631,7 @@ msgid "" "This is the first day of Comprehensive Rust. We will cover a lot of ground\n" "today:" msgstr "" -"Este é o primeiro dia do Comprehensive Rust. Nós cobriremos muito terreno\n" +"Este é o primeiro dia do Comprehensive Rust. Nós cobriremos muitos pontos\n" "hoje:" #: src/welcome-day-1.md:6 @@ -1700,9 +1647,8 @@ msgid "" "* Memory management: stack vs heap, manual memory management, scope-based memory\n" " management, and garbage collection." msgstr "" -"* Gerenciamento de memória: pilha versus heap, gerenciamento de memória manual, memória baseada em " -"escopo\n" -" gerenciamento e garbage collection (coleta de lixo)." +"* Gerenciamento de memória: stack versus heap, gerenciamento manual de memória, gerenciamento de memória\n" +" baseada em escopo e garbage collection (coleta de lixo)." #: src/welcome-day-1.md:12 msgid "* Ownership: move semantics, copying and cloning, borrowing, and lifetimes." @@ -1725,16 +1671,16 @@ msgid "" " that the slides are just a support and you are free to skip them as you\n" " like." msgstr "" -"* Devem fazer perguntas quando as obtiverem, não as guarde para o fim.\n" +"* Eles devem fazer perguntas na hora, não as guarde para o fim.\n" "* A aula é para ser interativa e as discussões são muito encorajadas!\n" " * Como instrutor, você deve tentar manter as discussões relevantes, ou seja,\n" -" mantenha o relacionado a como Rust faz as coisas versus alguma outra linguagem. Pode ser\n" +" mantenha o que é relacionado a como Rust faz as coisas versus alguma outra linguagem. Pode ser\n" " difícil encontrar o equilíbrio certo, mas erra ao permitir discussões\n" -" uma vez que envolvem as Persons muito mais do que uma comunicação unidirecional.\n" -"* As perguntas provavelmente significarão que estamos falando sobre as coisas antes dos slides.\n" -" * Isso está perfeitamente bem! A repetição é uma parte importante do aprendizado. Lembrar\n" -" que os slides são apenas um suporte e você está livre para ignorá-los enquanto\n" -" Curti." +" uma vez que envolvem as pessoas muito mais do que uma comunicação unidirecional.\n" +"* As perguntas provavelmente parecerão que estamos falando sobre as coisas antes dos slides.\n" +" * Isso está perfeitamente OK! A repetição é uma parte importante do aprendizado. Lembre-se\n" +" que os slides são apenas um suporte e você está livre para ignorá-los quando\n" +" Quiser." #: src/welcome-day-1.md:29 msgid "" @@ -1743,8 +1689,7 @@ msgid "" "and we should show students this right away." msgstr "" "A ideia para o primeiro dia é mostrar _apenas o suficiente_ de Rust para poder falar\n" -"sobre o famoso verificador de empréstimos. A maneira como o Rust lida com a memória é uma " -"característica importante\n" +"sobre o famoso verificador de empréstimos. A maneira como o Rust lida com a memória é uma característica importante\n" "e devemos mostrar isso aos alunos imediatamente." #: src/welcome-day-1.md:33 @@ -1753,14 +1698,14 @@ msgid "" "schedule. We suggest splitting the day into two parts (following the slides):" msgstr "" "Se você estiver ensinando isso em uma sala de aula, este é um bom lugar para repassar\n" -"cronograma. Sugerimos dividir o dia em duas partes (seguindo os slides):" +"o cronograma. Sugerimos dividir o dia em duas partes (seguindo os slides):" #: src/welcome-day-1.md:36 msgid "" "* Morning: 9:00 to 12:00,\n" "* Afternoon: 13:00 to 16:00." msgstr "" -"* Manhã: 9h00 às 12h00,\n" +"* Manhã: 9h às 12h,\n" "* Tarde: 13h às 16h." #: src/welcome-day-1.md:39 @@ -1769,15 +1714,15 @@ msgid "" "we recommend a break every hour!" msgstr "" "É claro que você pode ajustar isso conforme necessário. Certifique-se de incluir pausas,\n" -"recomendamos uma pausa a cada hora!" +" Recomendamos uma pausa a cada hora!" #: src/welcome-day-1/what-is-rust.md:1 msgid "# What is Rust?" -msgstr "# O que é rust?" +msgstr "# O que é Rust?" #: src/welcome-day-1/what-is-rust.md:3 msgid "Rust is a new programming language which had its [1.0 release in 2015][1]:" -msgstr "Rust é uma nova linguagem de programação que teve seu lançamento 1.0 em 2015:" +msgstr "Rust é uma nova linguagem de programação que teve sua versão 1.0 lançada em 2015:" #: src/welcome-day-1/what-is-rust.md:5 msgid "" @@ -1794,13 +1739,13 @@ msgid "" " * desktops,\n" " * servers." msgstr "" -"* Rust é uma linguagem compilada estaticamente em um papel semelhante ao C++\n" -" * `rustc` usa LLVM como back-end.\n" +"* Rust é uma linguagem compilada estaticamente e tem um papel semelhante ao C++\n" +" * `rustc` usa o LLVM como back-end.\n" "* Rust suporta muitas [plataformas e\n" " arquiteturas](https://doc.rust-lang.org/nightly/rustc/platform-support.html):\n" " * x86, ARM, WebAssembly, ...\n" " * Linux, Mac, Windows, ...\n" -"* Rust é usado para uma ampla gama de dispositivos:\n" +"* Rust é usado em uma ampla gama de dispositivos:\n" " * firmware e carregadores de boot,\n" " * monitores inteligentes,\n" " * celulares,\n" @@ -1819,11 +1764,11 @@ msgid "" "* Has no runtime or garbage collection.\n" "* Focuses on reliability and safety without sacrificing performance." msgstr "" -"* Alta flexibilage.\n" +"* Alta flexibilidade.\n" "* Alto nível de controle.\n" -"* Pode ser reduzido para dispositivos muito restritos, como telefones celulares.\n" -"* Não tem tempo de execução ou garbage collection.\n" -"* Concentra-se na confiabilage e segurança sem sacrificar o desempenho." +"* Pode ser reduzido para dispositivos com menos poder computacional, como telefones celulares.\n" +"* Não tem runtime ou garbage collection.\n" +"* Concentra-se na confiabilidade e segurança sem sacrificar o desempenho." #: src/welcome-day-1/what-is-rust.md:31 msgid "[1]: https://blog.rust-lang.org/2015/05/15/Rust-1.0.html" @@ -1837,9 +1782,7 @@ msgstr "# Olá Mundo!" msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World\n" "program:" -msgstr "" -"Vamos pular para o programa Rust mais simples possível, um clássico Hello World\n" -"programa:" +msgstr "Vamos pular para o programa em Rust mais simples possível, um clássico Hello World:" #: src/hello-world.md:6 msgid "" @@ -1849,11 +1792,6 @@ msgid "" "}\n" "```" msgstr "" -"```rust\n" -"fn main() {\n" -" println!(\"Olá 🌍!\");\n" -"}\n" -"```" #: src/hello-world.md:12 msgid "What you see:" @@ -1869,8 +1807,8 @@ msgid "" msgstr "" "* Funções são introduzidas com `fn`.\n" "* Os blocos são delimitados por chaves como em C e C++.\n" -"* A função `main` é o Point de entrada do programa.\n" -"* Rust tem macros higiênicas, `println!` é um exemplo disso.\n" +"* A função `main` é o ponto de entrada do programa.\n" +"* Rust tem macros, `println!` é um exemplo disso.\n" "* As strings Rust são codificadas em UTF-8 e podem conter qualquer caractere Unicode." #: src/hello-world.md:22 @@ -1878,8 +1816,8 @@ msgid "" "This slide tries to make the students comfortable with Rust code. They will see\n" "a ton of it over the next four days so we start small with something familiar." msgstr "" -"Este slide tenta deixar os alunos familiarizados com o código Rust. Eles vão ver\n" -"uma tonelada nos próximos quatro dias, então começamos pequeno com algo familiar." +"Este slide tenta deixar os alunos familiarizados com o código em Rust. Eles vão ver\n" +"uma tonelada nos próximos quatro dias, então começamos pequeno e com algo familiar." #: src/hello-world.md:27 msgid "" @@ -1887,13 +1825,13 @@ msgid "" " imperative (not functional) and it doesn't try to reinvent things unless\n" " absolutely necessary." msgstr "" -"* Rust é muito parecido com outras linguagens na tradição do C/C++/Java. Isso é\n" +"* Rust é muito parecido com outras linguagens na tradição do C/C++/Java. É\n" " imperativo (não funcional) e não tenta reinventar as coisas a menos que\n" " absolutamente necessário." #: src/hello-world.md:31 msgid "* Rust is modern with full support for things like Unicode." -msgstr "* Rust é moderno com suporte total para coisas como Unicode." +msgstr "* Rust é moderno com amplo suporte para coisas como Unicode." #: src/hello-world.md:33 msgid "" @@ -1901,7 +1839,7 @@ msgid "" " arguments (no function [overloading](basic-syntax/functions-interlude.md))." msgstr "" "* Rust usa macros para situações em que você deseja ter um número variável de\n" -" argumentos (sem função [overloading](sintaxe-básica/funções-interlude.md))." +" argumentos (sem [overloading](sintaxe-básica/funções-interlude.md) de funções)." #: src/hello-world/small-example.md:1 msgid "# Small Example" @@ -1929,13 +1867,13 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() { // Point de entrada do programa\n" -" let mut x: i32 = 6; // Vinculação de variável mutável\n" -" print!(\"{x}\"); // Macro para impressão, como printf\n" -" while x != 1 { // Sem parênteses em torno da expressão\n" -" if x % 2 == 0 { // Matemática como em outras linguagens\n" -" x = x/2;\n" +"```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" @@ -1952,7 +1890,7 @@ msgid "" "inputs." msgstr "" "O código implementa a conjectura de Collatz: acredita-se que o loop\n" -"sempre termina, mas isso ainda não está provado. Edite o código e jogue com diferentes\n" +"sempre termina, mas isso ainda não está provado. Edite o código e tente diferentes\n" "entradas." #: src/hello-world/small-example.md:29 @@ -1960,9 +1898,8 @@ msgid "" "* Explain that all variables are statically typed. Try removing `i32` to trigger\n" " type inference. Try with `i8` instead and trigger a runtime integer overflow." msgstr "" -"* Explique que todas as variáveis são estaticamente tipadas. Tente remover `i32` para acionar\n" -" inferência de tipo. Em vez disso, tente com `i8` e acione um estouro de número inteiro em tempo " -"de execução." +"* Explique que todas as variáveis são estaticamente tipadas. Tente remover `i32` para acionar a\n" +" inferência de tipo. Em vez disso, tente com `i8` e dispare um estouro de número inteiro em tempo de execução." #: src/hello-world/small-example.md:32 msgid "* Change `let mut x` to `let x`, discuss the compiler error." @@ -1973,7 +1910,7 @@ msgid "" "* Show how `print!` gives a compilation error if the arguments don't match the\n" " format string." msgstr "" -"* Mostra como `print!` dá um erro de compilação se os argumentos não combinam com o\n" +"* Mostre como `print!` gera um erro de compilação se os argumentos não combinam com a\n" " sequência de formato." #: src/hello-world/small-example.md:37 @@ -1981,7 +1918,7 @@ msgid "" "* Show how you need to use `{}` as a placeholder if you want to print an\n" " expression which is more complex than just a single variable." msgstr "" -"* Mostre como você precisa usar `{}` como espaço reservado se quiser imprimir um\n" +"* Mostre como você precisa usar `{}` como espaço reservado se quiser imprimir uma\n" " expressão que é mais complexa do que apenas uma única variável." #: src/hello-world/small-example.md:40 @@ -1990,9 +1927,9 @@ msgid "" " which has the rules of the formatting mini-language. It's important that the\n" " students become familiar with searching in the standard library." msgstr "" -"* Mostre aos alunos a biblioteca padrão, mostre como pesquisar `std::fmt`\n" -" que possui as regras da minilinguagem de formatação. É importante que o\n" -" os alunos se familiarizam com a pesquisa na biblioteca padrão." +"* Mostre aos alunos a biblioteca padrão, mostre como pesquisar `std::fmt`, \n" +" que possui as regras da mini-linguagem de formatação. É importante que\n" +" os alunos se familiarizem com pesquisas na biblioteca padrão." #: src/why-rust.md:1 msgid "# Why Rust?" @@ -2000,7 +1937,7 @@ msgstr "# Por que Rust?" #: src/why-rust.md:3 msgid "Some unique selling points of Rust:" -msgstr "Alguns Points de venda exclusivos de Rust:" +msgstr "Alguns pontos exclusivos do Rust:" #: src/why-rust.md:5 msgid "" @@ -2009,16 +1946,16 @@ msgid "" "* Modern language features." msgstr "" "* Segurança de memória em tempo de compilação.\n" -"* Falta de comportamento de tempo de execução indefinido.\n" -"* Recursos de linguagem moderna." +"* Sem comportamento indefinido em tempo de execução.\n" +"* Recursos de linguagem de programação modernas." #: src/why-rust.md:11 msgid "" "Make sure to ask the class which languages they have experience with. Depending\n" "on the answer you can highlight different features of Rust:" msgstr "" -"Certifique-se de perguntar à classe com quais idiomas eles têm experiência. dependendo\n" -"na resposta você pode destacar diferentes características do Rust:" +"Certifique-se de perguntar à classe com quais linguagens de programação eles têm experiência. Dependendo\n" +"da resposta você pode destacar diferentes características do Rust:" #: src/why-rust.md:14 msgid "" @@ -2030,7 +1967,7 @@ msgstr "" "* Experiência com C ou C++: Rust elimina toda uma classe de _erros de tempo de execução_\n" " através do verificador de empréstimo. Você obtém desempenho como em C e C++, mas não\n" " tem problemas de insegurança de memória. Além disso, você obtém uma linguagem moderna com\n" -" construções como correspondência de padrões e gerenciamento de dependência integrado." +" construções como correspondência de padrões e gerenciamento de dependências integrado." #: src/why-rust.md:19 msgid "" @@ -2040,7 +1977,7 @@ msgid "" " as well as access to low-level hardware (should you need it)" msgstr "" "* Experiência com Java, Go, Python, JavaScript...: Você obtém a mesma segurança de memória\n" -" como nesses idiomas, além de um sentimento de idioma de alto nível semelhante. Além disso\n" +" como nessas linguagens, além de um sentimento semelhante ao de linguagem de alto nível. Além disso\n" " você obtém desempenho rápido e previsível como C e C++ (sem coletor de lixo)\n" " bem como acesso a hardware de baixo nível (caso você precise)" @@ -2064,21 +2001,21 @@ msgid "" "* No iterator invalidation." msgstr "" "* Nenhuma variável não inicializada.\n" -"* Sem vazamentos de memória (_principalmente_, veja as notas).\n" -"* Sem liberações duplas.\n" -"* Sem 'uso após livre'.\n" +"* Sem vazamentos de memória (_quase_, veja as notas).\n" +"* Sem double-free.\n" +"* Sem 'user-afer-free'.\n" "* Sem ponteiros `NULL`.\n" "* Sem mutexes bloqueados esquecidos.\n" -"* Sem corridas de dados entre threads.\n" -"* Nenhuma invalidação do iterador." +"* Sem condições de corridas threads.\n" +"* Nenhuma invalidação de iteradores." #: src/why-rust/compile-time.md:16 msgid "" "It is possible to produce memory leaks in (safe) Rust. Some examples\n" "are:" msgstr "" -"É possível produzir vazamentos de memória no Rust (seguro). Alguns exemplos\n" -"está:" +"É possível produzir vazamentos de memória no Rust seguro. Alguns exemplos\n" +"são:" #: src/why-rust/compile-time.md:19 msgid "" @@ -2092,14 +2029,13 @@ msgid "" " leak and Rust does not protect from those." msgstr "" "* Você pode usar [`Box::leak`] para vazar um ponteiro. Um uso disso poderia\n" -" be para obter variáveis estáticas inicializadas em tempo de execução e dimensionadas em tempo de " -"execução\n" +" ser para obter variáveis estáticas inicializadas e dimensionadas em tempo de execução\n" "* Você pode usar [`std::mem::forget`] para fazer o compilador \"esquecer\" sobre\n" -" um valor (o que significa que o destruidor nunca é executado).\n" -"* Você também pode criar acidentalmente um [ciclo de referência] com `Rc` ou\n" +" um valor (o que significa que o destrutor nunca é executado).\n" +"* Você também pode criar acidentalmente um [referência cíclica] com `Rc` ou\n" " `Arc`.\n" -"* Na verdade, alguns considerarão preencher infinitamente uma coleção de uma memória\n" -" vazamento e Rust não protege deles." +"* Na verdade, alguns considerarão preencher infinitamente uma coleção\n" +" como vazamento de memória e Rust não protege disso." #: src/why-rust/compile-time.md:28 msgid "" @@ -2117,7 +2053,7 @@ msgid "" msgstr "" "[`Box::leak`]: https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak\n" "[`std::mem::forget`]: https://doc.rust-lang.org/std/mem/fn.forget.html\n" -"[ciclo de referência]: https://doc.rust-lang.org/book/ch15-06-reference-cycles.html" +"[referência cíclica]: https://doc.rust-lang.org/book/ch15-06-reference-cycles.html" #: src/why-rust/runtime.md:1 msgid "# Runtime Guarantees" @@ -2132,8 +2068,8 @@ msgid "" "* Array access is bounds checked.\n" "* Integer overflow is defined." msgstr "" -"* O acesso ao array tem limites verificados.\n" -"* Estouro inteiro é definido." +"* O acesso à arrays tem limites verificados.\n" +"* Estouro de números inteiros é definido." #: src/why-rust/runtime.md:12 msgid "" @@ -2142,11 +2078,10 @@ msgid "" " semantics. By default, you get panics in debug mode (`cargo build`)\n" " and wrap-around in release mode (`cargo build --release`)." msgstr "" -"* O estouro de inteiro é definido por meio de um sinalizador de tempo de compilação. As opções " -"são\n" -" ou um pânico (uma falha controlada do programa) ou wrap-around\n" -" semântica. Por padrão, você obtém pânico no modo de depuração (`cargo build`)\n" -" e wrap-around no modo de liberação (`cargo build --release`)." +"* O estouro de números inteiros é definido por meio de um sinalizador de tempo de compilação. As opções são\n" +" ou um pânico (uma falha controlada do programa) ou semântica\n" +" wrap-around. Por padrão, você obtém pânico no modo de depuração (`cargo build`)\n" +" e wrap-around no modo de produção (`cargo build --release`)." #: src/why-rust/runtime.md:17 msgid "" @@ -2155,8 +2090,8 @@ msgid "" " `unsafe` allows you to call functions such as `slice::get_unchecked`\n" " which does not do bounds checking." msgstr "" -"* A verificação de limites não pode ser desativada com um sinalizador de compilador. também pode\n" -" não pode ser desativado diretamente com a palavra-chave `unsafe`. No entanto,\n" +"* A verificação de limites não pode ser desativada com um sinalizador de compilador. Também não\n" +" pode ser desativado diretamente com a palavra-chave `unsafe`. No entanto,\n" " `unsafe` permite que você chame funções como `slice::get_unchecked`\n" " que não faz verificação de limites." @@ -2166,7 +2101,7 @@ msgstr "# Recursos modernos" #: src/why-rust/modern.md:3 msgid "Rust is built with all the experience gained in the last 40 years." -msgstr "A Rust é construída com toda a experiência adquirida nos últimos 40 anos." +msgstr "O Rust é construído com toda a experiência adquirida nos últimos 40 anos." #: src/why-rust/modern.md:5 msgid "## Language Features" @@ -2180,8 +2115,8 @@ msgid "" "* Zero-cost abstractions." msgstr "" "* Enums e correspondência de padrões.\n" -"* Genéricos.\n" -"* Sem sobrecargo FFI.\n" +"* Generics.\n" +"* FFI sem overhead.\n" "* Abstrações de custo zero." #: src/why-rust/modern.md:12 @@ -2195,10 +2130,10 @@ msgid "" "* Built-in support for testing.\n" "* Excellent Language Server Protocol support." msgstr "" -"* Grandes erros do compilador.\n" +"* Excelentes mensagens de erro do compilador.\n" "* Gerenciador de dependências integrado.\n" "* Suporte integrado para testes.\n" -"* Excelente suporte ao protocolo de servidor de idiomas." +"* Excelente suporte ao protocolo de servidor de linguagem (LSP)." #: src/why-rust/modern.md:23 msgid "" @@ -2208,9 +2143,9 @@ msgid "" " instructions as using the `.iter().fold()` construct." msgstr "" "* Abstrações de custo zero, semelhantes ao C++, significa que você não precisa 'pagar'\n" -" para construções de programação de alto nível com memória ou CPU. Por exemplo,\n" -" escrever um loop usando `for` deve resultar aproximadamente no mesmo nível baixo\n" -" instruções como usar a construção `.iter().fold()`." +" com memória ou CPU por construções de programação de alto nível. Por exemplo,\n" +" escrever um loop usando `for` deve resultar aproximadamente nos mesmas instruções\n" +" de baixo nível como ao usar a construção `.iter().fold()`." #: src/why-rust/modern.md:28 msgid "" @@ -2218,8 +2153,8 @@ msgid "" " known as 'sum types', which allow the type system to express things like\n" " `Option` and `Result`." msgstr "" -"* Pode valer a pena mencionar que Rust enums são 'Algebraic Data Types', também\n" -" conhecidos como 'tipos de soma', que permitem que o sistema de tipos expresse coisas como\n" +"* Pode valer a pena mencionar que enums em Rust também são 'tipos de dados algébricos', também\n" +" conhecidos como 'tipos de soma', os quais permitem que o sistema de tipos expresse coisas como\n" " `Option` e `Result`." #: src/why-rust/modern.md:32 @@ -2229,10 +2164,10 @@ msgid "" " talkative than other compilers. It will often provide you with _actionable_\n" " feedback, ready to copy-paste into your code." msgstr "" -"* Lembre as Persons de lerem os erros --- muitos desenvolvedores se acostumaram\n" -" ignore a longa saída do compilador. O compilador Rust é significativamente mais\n" -" falador do que outros compiladores. Muitas vezes, ele fornecerá a você _acionável_\n" -" feedback, pronto para copiar e colar em seu código." +"* Lembre as pessoas de lerem os erros --- muitos desenvolvedores se acostumaram\n" +" a ignorar as longas saída do compilador. O compilador Rust é significativamente mais\n" +" verboso do que outros compiladores. Muitas vezes, ele fornecerá a você feedback\n" +" _utilizável_, pronto para copiar e colar em seu código." #: src/why-rust/modern.md:37 msgid "" @@ -2241,7 +2176,7 @@ msgid "" " essential:" msgstr "" "* A biblioteca padrão do Rust é pequena comparada a linguagens como Java, Python,\n" -" e ir. Rust não vem com várias coisas que você pode considerar padrão e\n" +" e Go. Rust não vem com várias coisas que você pode considerar padrão e\n" " essencial:" #: src/why-rust/modern.md:41 @@ -2261,10 +2196,10 @@ msgid "" " community is still working on finding the best solution --- and perhaps there\n" " isn't a single \"best solution\" for some of these things." msgstr "" -" O raciocínio por trás disso é que a funcionalage na biblioteca padrão não pode\n" -" ir embora, então tem que ser muito estável. Para os exemplos acima, o Rust\n" -" comunage ainda está trabalhando para encontrar a melhor solução --- e talvez haja\n" -" não é uma única \"melhor solução\" para algumas dessas coisas." +" O raciocínio por trás disso é que a funcionalidades na biblioteca padrão não podem\n" +" ser descartadas, portanto têm que ser muito estáveis. Para os exemplos acima, a comunidade\n" +" Rust ainda está trabalhando para encontrar a melhor solução --- e talvez não\n" +" haja uma única \"melhor solução\" para algumas dessas coisas." #: src/why-rust/modern.md:50 msgid "" @@ -2272,8 +2207,8 @@ msgid "" " it trivial to download and compile third-party crates. A consequence of this\n" " is that the standard library can be smaller." msgstr "" -" Rust vem com um gerenciador de pacotes embutido na forma de Cargo e isso torna\n" -" é trivial baixar e compilar caixas de terceiros. Uma consequência disso\n" +" O Rust vem com um gerenciador de pacotes embutido na forma de Cargo e isso torna\n" +" trivial baixar e compilar crates de terceiros. Uma consequência disso\n" " é que a biblioteca padrão pode ser menor." #: src/why-rust/modern.md:54 @@ -2285,9 +2220,9 @@ msgid "" "* [rust-analyzer] is a well supported LSP implementation used in major\n" " IDEs and text editors." msgstr "" -" Descobrir boas caixas de terceiros pode ser um problema. sites como\n" -" ajuda com isso, permitindo que você compare métricas de saúde para\n" -" caixotes para encontrar um bom e confiável.\n" +" Descobrir bons crates de terceiros pode ser um problema. Sites como\n" +" ajudam com isso, permitindo que você compare métricas para\n" +" para encontrar um crate bom e confiável.\n" " \n" "* [rust-analyzer] é uma implementação LSP bem suportada usada em grandes\n" " IDEs e editores de texto." @@ -2302,7 +2237,7 @@ msgstr "" "[rand]: https://docs.rs/rand/\n" "[rusttls]: https://docs.rs/rustls/\n" "[serde_json]: https://docs.rs/serde_json/\n" -"[analisador de rust]: https://rust-analyzer.github.io/" +"[rust-analyzer]: https://rust-analyzer.github.io/" #: src/basic-syntax.md:1 msgid "# Basic Syntax" @@ -2324,7 +2259,7 @@ msgstr "" "* Comentários de linha são iniciados com `//`, comentários de bloco são delimitados por `/* ...\n" " */`.\n" "* Palavras-chave como `if` e `while` funcionam da mesma forma.\n" -"* A atribuição de variável é feita com `=`, a comparação é feita com `==`." +"* A atribuição de variáveis é feita com `=`, a comparação é feita com `==`." #: src/basic-syntax/scalar-types.md:1 msgid "# Scalar Types" @@ -2332,39 +2267,29 @@ msgstr "# Tipos escalares" #: src/basic-syntax/scalar-types.md:3 msgid "" -"| | Types | " -"Literals |\n" +"| | Types | Literals |\n" "|------------------------|--------------------------------------------|-------------------------------|\n" -"| Signed integers | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | `-10`, `0`, `1_000`, " -"`123i64` |\n" -"| Unsigned integers | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, `123`, " -"`10u16` |\n" -"| Floating point numbers | `f32`, `f64` | `3.14`, `-10.0e20`, " -"`2f32` |\n" -"| Strings | `&str` | `\"foo\"`, `r#\"\\\\" -"\"#` |\n" -"| Unicode scalar values | `char` | `'a'`, `'α'`, " -"`'∞'` |\n" -"| Byte strings | `&[u8]` | `b\"abc\"`, `br#\" \" " -"\"#` |\n" -"| Booleans | `bool` | `true`, " -"`false` |" -msgstr "" -"| | Tipos | Literais |\n" -"|------------------------|------------------------ " -"--------------------|----------------------------- --|\n" -"| Inteiros assinados | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | `-10`, `0`, `1_000`, `123i64` " -"|\n" -"| Inteiros sem sinal | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, `123`, `10u16` |\n" -"| Números de Point flutuante | `f32`, `f64` | `3.14`, `-10.0e20`, `2f32` |\n" -"| Strings | `&str` | `\"foo\"`, `r#\"\\\\\"#` |\n" -"| Valores escalares Unicode | `char` | `'a'`, `'α'`, `'∞'` |\n" -"| Cadeias de bytes | `&[u8]` | `b\"abc\"`, `br#\" \" \"#` |\n" -"| Booleanos | `bool` | `true`, `false` |" +"| Signed integers | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | `-10`, `0`, `1_000`, `123i64` |\n" +"| Unsigned integers | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, `123`, `10u16` |\n" +"| Floating point numbers | `f32`, `f64` | `3.14`, `-10.0e20`, `2f32` |\n" +"| Strings | `&str` | `\"foo\"`, `r#\"\\\\\"#` |\n" +"| Unicode scalar values | `char` | `'a'`, `'α'`, `'∞'` |\n" +"| Byte strings | `&[u8]` | `b\"abc\"`, `br#\" \" \"#` |\n" +"| Booleans | `bool` | `true`, `false` |" +msgstr "" +"| | Tipos | Literais |\n" +"|---------------------------|--------------------------------------------|-------------------------------|\n" +"| Inteiro sinalizado | `i8`, `i16`, `i32`, `i64`, `i128`, `isize` | `-10`, `0`, `1_000`, `123i64` |\n" +"| Inteiro não sinalizado | `u8`, `u16`, `u32`, `u64`, `u128`, `usize` | `0`, `123`, `10u16` |\n" +"| Ponto flutuante | `f32`, `f64` | `3.14`, `-10.0e20`, `2f32` |\n" +"| Strings | `&str` | `\"foo\"`, `r#\"\\\\\"#` |\n" +"| Valores Unicode escalares | `char` | `'a'`, `'α'`, `'∞'` |\n" +"| Byte strings | `&[u8]` | `b\"abc\"`, `br#\" \" \"#` |\n" +"| Booleanos | `bool` | `true`, `false` |" #: src/basic-syntax/scalar-types.md:13 msgid "The types have widths as follows:" -msgstr "Os tipos têm larguras como segue:" +msgstr "Os tipos têm tamanhos como se segue:" #: src/basic-syntax/scalar-types.md:15 msgid "" @@ -2373,14 +2298,14 @@ msgid "" "* `char` is 32 bit wide,\n" "* `bool` is 8 bit wide." msgstr "" -"* `iN`, `uN` e `fN` são _N_ bits de largura,\n" -"* `isize` e `usize` são a largura de um ponteiro,\n" -"* `char` tem 32 bits de largura,\n" -"* `bool` tem 8 bits de largura." +"* `iN`, `uN` e `fN` são _N_ bits,\n" +"* `isize` e `usize` são o tamanho de um ponteiro,\n" +"* `char` tem 32 bits,\n" +"* `bool` tem 8 bits." #: src/basic-syntax/compound-types.md:1 msgid "# Compound Types" -msgstr "# Tipos de compostos" +msgstr "# Tipos compostos" #: src/basic-syntax/compound-types.md:3 msgid "" @@ -2389,14 +2314,14 @@ msgid "" "| Arrays | `[T; N]` | `[20, 30, 40]`, `[0; 3]` |\n" "| Tuples | `()`, `(T,)`, `(T1, T2)`, ... | `()`, `('x',)`, `('x', 1.2)`, ... |" msgstr "" -"| | Tipos | Literais |\n" -"|--------|-------------------------------|-------- ---------------------------|\n" -"| Arrays | `[T; N]` | `[20, 30, 40]`, `[0; 3]` |\n" +"| | Tipos | Literais |\n" +"|--------|-------------------------------|-----------------------------------|\n" +"| Arrays | `[T; N]` | `[20, 30, 40]`, `[0; 3]` |\n" "| Tuplas | `()`, `(T,)`, `(T1, T2)`, ... | `()`, `('x',)`, `('x', 1.2)`, ... |" #: src/basic-syntax/compound-types.md:8 msgid "Array assignment and access:" -msgstr "Atribuição e acesso ao array:" +msgstr "Atribuição e acesso a arrays:" #: src/basic-syntax/compound-types.md:10 msgid "" @@ -2408,7 +2333,7 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "fn main() {\n" " let mut a: [i8; 10] = [42; 10];\n" " a[5] = 0;\n" @@ -2418,7 +2343,7 @@ msgstr "" #: src/basic-syntax/compound-types.md:18 msgid "Tuple assignment and access:" -msgstr "Atribuição e acesso de tupla:" +msgstr "Atribuição e acesso a tuplas:" #: src/basic-syntax/compound-types.md:20 msgid "" @@ -2430,13 +2355,6 @@ msgid "" "}\n" "```" msgstr "" -"```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" -"```" #: src/basic-syntax/compound-types.md:32 msgid "Arrays:" @@ -2448,8 +2366,7 @@ msgid "" " Note that the length of the array is *part of its type*, which means that `[u8; 3]` and\n" " `[u8; 4]` are considered two different types." msgstr "" -"* Arrays possuem elementos do mesmo tipo, `T`, e comprimento, `N`, que é uma constante de tempo de " -"compilação.\n" +"* Arrays possuem elementos do mesmo tipo, `T`, e comprimento, `N`, que é uma constante de tempo de compilação.\n" " Observe que o comprimento do array é *parte de seu tipo*, o que significa que `[u8; 3]` e\n" " `[u8; 4]` são considerados dois tipos diferentes." @@ -2464,16 +2381,14 @@ msgid "" " could also have used `{a}` and `{a:?}` without specifying the value after the\n" " format string." msgstr "" -"* Na função principal, a instrução print solicita a implementação de depuração com o formato `?`\n" -" parâmetro: `{}` fornece a saída padrão, `{:?}` fornece a saída de depuração. Nós\n" -" também poderia ter usado `{a}` e `{a:?}` sem especificar o valor após o\n" -" sequência de formato." +"* Na função `main`, a instrução print solicita a implementação de depuração com um `?` no\n" +" formatador: `{}` fornece a saída padrão, `{:?}` fornece a saída de depuração. Nós\n" +" também poderíamos ter usado `{a}` e `{a:?}` sem especificar o valor após a\n" +" sequência de formatadores." #: src/basic-syntax/compound-types.md:45 msgid "* Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be easier to read." -msgstr "" -"* Adicionar `#`, por exemplo `{a:#?}`, chama um formato de \"impressão bonita\", que pode ser mais " -"fácil de ler." +msgstr "* Adicionando `#`, por exemplo `{a:#?}`, chama um formatado de \"impressão bonita\", que pode ser mais fácil de ler." #: src/basic-syntax/compound-types.md:47 msgid "Tuples:" @@ -2488,11 +2403,8 @@ msgid "* Tuples group together values of different types into a compound type." msgstr "* As tuplas agrupam valores de tipos diferentes em um tipo composto." #: src/basic-syntax/compound-types.md:53 -msgid "" -"* Fields of a tuple can be accessed by the period and the index of the value, e.g. `t.0`, `t.1`." -msgstr "" -"* Os campos de uma tupla podem ser acessados pelo Point e pelo índice do valor, por exemplo `t.0`, " -"`t.1`." +msgid "* Fields of a tuple can be accessed by the period and the index of the value, e.g. `t.0`, `t.1`." +msgstr "* Os campos de uma tupla podem ser acessados pelo 'ponto' e pelo índice do valor, por exemplo `t.0`, `t.1`." #: src/basic-syntax/compound-types.md:55 msgid "" @@ -2503,10 +2415,10 @@ msgid "" " * You can think of it as `void` that can be familiar to you from other \n" " programming languages." msgstr "" -"* A tupla vazia `()` também é conhecida como \"tipo de unage\". É um tipo e\n" +"* A tupla vazia `()` também é conhecida como \"tipo unitário\". É um tipo e\n" " o único valor válido desse tipo - ou seja, o tipo e seu valor\n" " são expressos como `()`. É usado para indicar, por exemplo, que uma função ou\n" -" A expressão não tem valor de retorno, como veremos em um slide futuro.\n" +" uma expressão não tem valor de retorno, como veremos em um próximo slide.\n" " * Você pode pensar nisso como um 'vazio' que pode ser familiar para você de outras\n" " linguagens de programação." @@ -2529,14 +2441,6 @@ msgid "" "}\n" "```" msgstr "" -"```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" -"```" #: src/basic-syntax/references.md:14 msgid "Some notes:" @@ -2549,11 +2453,10 @@ msgid "" " methods (try `ref_x.count_ones()`).\n" "* References that are declared as `mut` can be bound to different values over their lifetime." msgstr "" -"* Devemos desreferenciar `ref_x` ao atribuir a ele, semelhante aos ponteiros C e C++.\n" +"* Devemos desreferenciar `ref_x` ao atribuir um valor, semelhante à ponteiros em C e C++.\n" "* Rust desreferenciará automaticamente em alguns casos, em particular ao invocar\n" " métodos (tente `ref_x.count_ones()`).\n" -"* As referências que são declaradas como `mut` podem ser vinculadas a diferentes valores ao longo " -"de seu tempo de vida." +"* As referências que são declaradas como `mut` podem ser vinculadas a diferentes valores ao longo de seu tempo de vida." #: src/basic-syntax/references.md:21 msgid "" @@ -2561,7 +2464,7 @@ msgid "" "Key points:" msgstr "" "
\n" -"Points chave:" +"Pontos chave:" #: src/basic-syntax/references.md:24 msgid "" @@ -2571,7 +2474,7 @@ msgid "" msgstr "" "* Certifique-se de observar a diferença entre `let mut ref_x: &i32` e `let ref_x:\n" " &mut i32`. O primeiro representa uma referência mutável que pode ser ligada a\n" -" valores diferentes, enquanto o segundo representa uma referência a um valor mutável." +" diferentes valores, enquanto o segundo representa uma referência a um valor mutável." #: src/basic-syntax/references-dangling.md:1 msgid "# Dangling References" @@ -2579,7 +2482,7 @@ msgstr "# Referências pendentes" #: src/basic-syntax/references-dangling.md:3 msgid "Rust will statically forbid dangling references:" -msgstr "Rust proibirá estaticamente as referências pendentes:" +msgstr "Rust estaticamente proibirá referências pendentes:" #: src/basic-syntax/references-dangling.md:5 msgid "" @@ -2594,16 +2497,6 @@ msgid "" "}\n" "```" msgstr "" -"```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:16 msgid "" @@ -2613,14 +2506,13 @@ msgid "" "* We will talk more about borrowing when we get to ownership." msgstr "" "* Diz-se que uma referência \"pega emprestado\" o valor a que se refere.\n" -"* Rust está rastreando os tempos de vida de todas as referências para garantir que elas durem " -"muito\n" +"* Rust está rastreando os tempos de vida de todas as referências para garantir que elas durem\n" " o suficiente.\n" "* Falaremos mais sobre empréstimos quando chegarmos à ownership." #: src/basic-syntax/slices.md:1 msgid "# Slices" -msgstr "# Slices (do Inglês, slice)" +msgstr "# Slices" #: src/basic-syntax/slices.md:3 msgid "A slice gives you a view into a larger collection:" @@ -2633,10 +2525,6 @@ msgid "" " let a: [i32; 6] = [10, 20, 30, 40, 50, 60];\n" " println!(\"a: {a:?}\");" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let a: [i32; 6] = [10, 20, 30, 40, 50, 60];\n" -" println!(\"a: {a:?}\");" #: src/basic-syntax/slices.md:10 msgid "" @@ -2645,35 +2533,28 @@ msgid "" "}\n" "```" msgstr "" -" let: &[i32] = &a[2..4];\n" -" println!(\"s: {s:?}\");\n" -"}\n" -"```" #: src/basic-syntax/slices.md:15 msgid "" "* Slices borrow data from the sliced type.\n" "* Question: What happens if you modify `a[3]`?" msgstr "" -"* As slices emprestam dados do tipo slicedo.\n" +"* As slices pegam dados emprestados.\n" "* Pergunta: O que acontece se você modificar `a[3]`?" #: src/basic-syntax/slices.md:20 -msgid "" -"* We create a slice by borrowing `a` and specifying the starting and ending indexes in brackets." -msgstr "" -"* Criamos uma slice pegando emprestado `a` e especificando os índices inicial e final entre " -"colchetes." +msgid "* We create a slice by borrowing `a` and specifying the starting and ending indexes in brackets." +msgstr "* Criamos uma slice pegando emprestado `a` e especificando os índices inicial e final entre colchetes." #: src/basic-syntax/slices.md:22 msgid "" -"* If the slice starts at index 0, Rust’s range syntax allows us to drop the starting index, " -"meaning that `&a[0..a.len()]` and `&a[..a.len()]` are identical.\n" +"* If the slice starts at index 0, Rust's range syntax allows us to drop the starting index, meaning that `&a[0..a.len()]` " +"and `&a[..a.len()]` are identical.\n" " \n" "* The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are identical." msgstr "" -"* Se a slice começa no índice 0, a sintaxe de intervalo do Rust nos permite descartar o índice " -"inicial, o que significa que `&a[0..a.len()]` e `&a[..a.len()]` são idênticos .\n" +"* Se a slice começa no índice 0, a sintaxe de intervalo do Rust nos permite descartar o índice inicial, o que significa que " +"`&a[0..a.len()]` e `&a[..a.len()]` são idênticos .\n" " \n" "* O mesmo vale para o último índice, então `&a[2..a.len()]` e `&a[2..]` são idênticos." @@ -2683,28 +2564,26 @@ msgstr "* Para criar facilmente uma slice do array completo, podemos usar `&a[.. #: src/basic-syntax/slices.md:28 msgid "" -"* `s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) no longer " -"mentions the array length. This allows us to perform computation on slices of different sizes.\n" +"* `s` is a reference to a slice of `i32`s. Notice that the type of `s` (`&[i32]`) no longer mentions the array length. This " +"allows us to perform computation on slices of different sizes.\n" " \n" -"* Slices always borrow from another object. In this example, `a` has to remain 'alive' (in scope) " -"for at least as long as our slice. \n" +"* Slices always borrow from another object. In this example, `a` has to remain 'alive' (in scope) for at least as long as " +"our slice. \n" " \n" -"* The question about modifying `a[3]` can spark an interesting discussion, but the answer is that " -"for memory safety reasons\n" -" you cannot do it through `a` after you created a slice, but you can read the data from both `a` " -"and `s` safely. \n" +"* The question about modifying `a[3]` can spark an interesting discussion, but the answer is that for memory safety " +"reasons\n" +" you cannot do it through `a` after you created a slice, but you can read the data from both `a` and `s` safely. \n" " More details will be explained in the borrow checker section." msgstr "" -"* `s` é uma referência a uma slice de `i32`s. Observe que o tipo de `s` (`&[i32]`) não menciona " -"mais o tamanho do array. Isso nos permite realizar cálculos em slices de tamanhos diferentes.\n" +"* `s` é uma referência a uma slice de `i32`s. Observe que o tipo de `s` (`&[i32]`) não menciona mais o tamanho do array. " +"Isso nos permite realizar cálculos em slices de tamanhos diferentes.\n" " \n" -"* As slices sempre pegam emprestado de outro objeto. Neste exemplo, `a` deve permanecer 'vivo' (no " -"escopo) por pelo menos tanto tempo quanto nossa slice.\n" +"* As slices sempre pegam emprestado de outro objeto. Neste exemplo, `a` deve permanecer 'vivo' (no escopo) por pelo menos " +"tanto tempo quanto nossa slice.\n" " \n" -"* A questão sobre a modificação de `a[3]` pode gerar uma discussão interessante, mas a resposta é " -"por motivos de segurança de memória\n" -" você não pode fazer isso por meio de `a` depois de criar uma slice, mas pode ler os dados de `a` " -"e `s` com segurança.\n" +"* A questão sobre a modificação de `a[3]` pode gerar uma discussão interessante, mas a resposta é por motivos de segurança " +"de memória\n" +" você não pode fazer isso por meio de `a` depois de criar uma slice, mas pode ler os dados de `a` e `s` com segurança.\n" " Mais detalhes serão explicados na seção do verificador de empréstimo." #: src/basic-syntax/string-slices.md:1 @@ -2713,7 +2592,7 @@ msgstr "# `String` vs `str`" #: src/basic-syntax/string-slices.md:3 msgid "We can now understand the two string types in Rust:" -msgstr "Agora podemos entender os dois tipos de string em Rust:" +msgstr "Agora podemos entender os dois tipos de strings em Rust:" #: src/basic-syntax/string-slices.md:5 msgid "" @@ -2722,10 +2601,6 @@ msgid "" " let s1: &str = \"World\";\n" " println!(\"s1: {s1}\");" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let s1: &str = \"Mundo\";\n" -" println!(\"s1: {s1}\");" #: src/basic-syntax/string-slices.md:10 msgid "" @@ -2739,54 +2614,38 @@ msgid "" "}\n" "```" msgstr "" -" 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:20 msgid "Rust terminology:" -msgstr "Terminologia da rust:" +msgstr "Terminologia do Rust:" #: src/basic-syntax/string-slices.md:22 msgid "" "* `&str` an immutable reference to a string slice.\n" "* `String` a mutable string buffer." msgstr "" -"* `&str` uma referência imutável para uma slice de string.\n" -"* `String` um buffer de string mutável." +"* `&str` é uma referência imutável para uma slice de string.\n" +"* `String` é um buffer de string mutável." #: src/basic-syntax/string-slices.md:27 msgid "" "* `&str` introduces a string slice, which is an immutable reference to UTF-8 encoded string data \n" -" stored in a block of memory. String literals (`”Hello”`), are stored in the program’s binary." +" stored in a block of memory. String literals (`\"Hello\"`), are stored in the program's binary." msgstr "" -"* `&str` introduz uma slice de string, que é uma referência imutável para dados de string " -"codificados em UTF-8\n" -" armazenados em um bloco de memória. String literais (`”Hello”`), são armazenados no binário do " -"programa." +"* `&str` introduz uma slice de string, que é uma referência imutável para dados de string codificados em UTF-8\n" +" armazenados em um bloco de memória. String literais (`\"Hello\"`), são armazenados no binário do programa." #: src/basic-syntax/string-slices.md:30 msgid "" -"* Rust’s `String` type is a wrapper around a vector of bytes. As with a `Vec`, it is owned.\n" +"* Rust's `String` type is a wrapper around a vector of bytes. As with a `Vec`, it is owned.\n" " \n" -"* As with many other types `String::from()` creates a string from a string literal; `String::" -"new()` \n" -" creates a new empty string, to which string data can be added using the `push()` and " -"`push_str()` methods." +"* As with many other types `String::from()` creates a string from a string literal; `String::new()` \n" +" creates a new empty string, to which string data can be added using the `push()` and `push_str()` methods." msgstr "" -"* O tipo `String` do Rust é um wrapper em torno de um vetor de bytes. Tal como acontece com um " -"`Vec`, ele é possuído.\n" +"* O tipo `String` do Rust é um wrapper em torno de um vetor de bytes. Tal como acontece com um `Vec`, ele é um valor.\n" " \n" -"* Assim como muitos outros tipos `String::from()` cria uma string a partir de uma string literal; " -"`String::new()`\n" -" cria uma nova string vazia, na qual os dados da string podem ser adicionados usando os métodos " -"`push()` e `push_str()`." +"* Assim como muitos outros tipos, `String::from()` cria uma string a partir de uma string literal; `String::new()`\n" +" cria uma nova string vazia, na qual os dados da string podem ser adicionados usando os métodos `push()` e `push_str()`." #: src/basic-syntax/string-slices.md:35 msgid "" @@ -2797,22 +2656,18 @@ msgid "" " \n" "* For C++ programmers: think of `&str` as `const char*` from C++, but the one that always points \n" " to a valid string in memory. Rust `String` is a rough equivalent of `std::string` from C++ \n" -" (main difference: it can only contain UTF-8 encoded bytes and will never use a small-string " -"optimization).\n" +" (main difference: it can only contain UTF-8 encoded bytes and will never use a small-string optimization).\n" " \n" "
" msgstr "" -"* A macro `format!()` é uma maneira conveniente de gerar uma string própria a partir de valores " -"dinâmicos. Isto\n" -" aceita a mesma especificação de formato que `println!()`.\n" +"* A macro `format!()` é uma maneira conveniente de gerar uma string a partir de valores dinâmicos. Isto\n" +" aceita os mesmos formatadores que `println!()`.\n" " \n" -"* Você pode emprestar slices `&str` de `String` via `&` e, opcionalmente, seleção de intervalo.\n" +"* Você pode emprestar slices `&str` de `String` via `&` e, opcionalmente, selecionar um intervalo.\n" " \n" -"* Para programadores C++: pense em `&str` como `const char*` de C++, mas aquele que sempre aponta\n" -" para uma string válida na memória. Rust `String` é um equivalente aproximado de `std::string` de " -"C++\n" -" (principal diferença: ele só pode conter bytes codificados em UTF-8 e nunca usará uma otimização " -"de string pequena).\n" +"* Para programadores C++: pense em `&str` como `const char*` de C++, mas que sempre aponta\n" +" para uma string válida na memória. Em Rust, `String` é um equivalente aproximado de `std::string` de C++\n" +" (principal diferença: ele só pode conter bytes codificados em UTF-8 e nunca usará uma otimização de string pequena).\n" " \n" "" @@ -2821,12 +2676,8 @@ msgid "# Functions" msgstr "# Funções" #: src/basic-syntax/functions.md:3 -msgid "" -"A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) interview " -"question:" -msgstr "" -"Uma versão Rust da famosa pergunta da entrevista [FizzBuzz](https://en.wikipedia.org/wiki/" -"Fizz_buzz):" +msgid "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) interview question:" +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 "" @@ -2837,7 +2688,7 @@ msgid "" msgstr "" "```rust, editable\n" "fn main() {\n" -" fizzbuzz_to(20); // Definido abaixo, nenhuma declaração de encaminhamento é necessária\n" +" fizzbuzz_to(20); // Definido abaixo, nenhuma declaração prévia é necessária\n" "}" #: src/basic-syntax/functions.md:10 @@ -2850,10 +2701,10 @@ msgid "" "}" msgstr "" "fn is_divisible_by(lhs: u32, rhs: u32) -> bool {\n" -" if rh == 0 {\n" -" return false; // Caixa de canto, retorno antecipado\n" +" if rhs == 0 {\n" +" return false; // Caso especial, retorne antes\n" " }\n" -" lhs % rhs == 0 // A última expressão em um bloco é o valor de retorno\n" +" lhs % rhs == 0 // A última expressão em um bloco é o valor de retorno\n" "}" #: src/basic-syntax/functions.md:17 @@ -2867,11 +2718,11 @@ msgid "" " }\n" "}" msgstr "" -"fn fizzbuzz(n: u32) -> () { // Nenhum valor de retorno significa retornar o type `()`\n" -" match (is_divisible_by(n, 3), é_divisível_por(n, 5)) {\n" -" (true, true) => println!(\"fizzbuzz\"),\n" -" (true, false) => println!(\"fizz\"),\n" -" (false, true) => println!(\"buzz\"),\n" +"fn fizzbuzz(n: u32) -> () { // // Nenhum valor de retorno significa retornar o tipo `()`\n" +" match (is_divisible_by(n, 3), is_divisible_by(n, 5)) {\n" +" (true, true) => println!(\"fizzbuzz\"),\n" +" (true, false) => println!(\"fizz\"),\n" +" (false, true) => println!(\"buzz\"),\n" " (false, false) => println!(\"{n}\"),\n" " }\n" "}" @@ -2894,31 +2745,24 @@ msgstr "" #: src/basic-syntax/functions.md:35 msgid "" -"* We refer in `main` to a function written below. Neither forward declarations nor headers are " -"necessary. \n" -"* Declaration parameters are followed by a type (the reverse of some programming languages), then " -"a return type.\n" -"* The last expression in a function body (or any block) becomes the return value. Simply omit the " -"`;` at the end of the expression.\n" -"* Some functions have no return value, and return the 'unit type', `()`. The compiler will infer " -"this if the `-> ()` return type is omitted.\n" -"* The range expression in the `for` loop in `fizzbuzz_to()` contains `=n`, which causes it to " -"include the upper bound.\n" -"* The `match` expression in `fizzbuzz()` is doing a lot of work. It is expanded below to show what " -"is happening." -msgstr "" -"* Nos referimos em `main` a uma função escrita abaixo. Nem declarações de encaminhamento nem " -"cabeçalhos são necessários.\n" -"* Os parâmetros de declaração são seguidos por um tipo (o inverso de algumas linguagens de " -"programação) e, em seguida, um tipo de retorno.\n" -"* A última expressão em um corpo de função (ou qualquer bloco) torna-se o valor de retorno. " -"Simplesmente omita o `;` no final da expressão.\n" -"* Algumas funções não têm valor de retorno e retornam o 'tipo de unage', `()`. O compilador " -"inferirá isso se o tipo de retorno `-> ()` for omitido.\n" -"* A expressão de intervalo no loop `for` em `fizzbuzz_to()` contém `=n`, o que faz com que inclua " -"o limite superior.\n" -"* A expressão `match` em `fizzbuzz()` está dando muito trabalho. É expandido abaixo para mostrar o " -"que está acontecendo." +"* We refer in `main` to a function written below. Neither forward declarations nor headers are necessary. \n" +"* Declaration parameters are followed by a type (the reverse of some programming languages), then a return type.\n" +"* The last expression in a function body (or any block) becomes the return value. Simply omit the `;` at the end of the " +"expression.\n" +"* Some functions have no return value, and return the 'unit type', `()`. The compiler will infer this if the `-> ()` return " +"type is omitted.\n" +"* The range expression in the `for` loop in `fizzbuzz_to()` contains `=n`, which causes it to include the upper bound.\n" +"* The `match` expression in `fizzbuzz()` is doing a lot of work. It is expanded below to show what is happening." +msgstr "" +"* Nos referimos em `main` a uma função escrita abaixo. Nem declarações prévias e nem cabeçalhos são necessários.\n" +"* Os parâmetros de declaração são seguidos por um tipo (o inverso de algumas linguagens de programação) e, em seguida, um " +"tipo de retorno.\n" +"* A última expressão em um corpo de uma função (ou qualquer bloco) torna-se o valor de retorno. Simplesmente omita o `;` no " +"final da expressão.\n" +"* Algumas funções não têm valor de retorno e retornam o 'tipo unitário', `()`. O compilador inferirá isso se o tipo de " +"retorno `-> ()` for omitido.\n" +"* A expressão de intervalo no loop `for` em `fizzbuzz_to()` contém `=n`, o que faz com que inclua o limite superior.\n" +"* A expressão `match` em `fizzbuzz()` faz muita coisa. Ela será expandida abaixo para mostrar o que está acontecendo." #: src/basic-syntax/functions.md:42 msgid " (Type annotations added for clarity, but they can be elided.)" @@ -2934,17 +2778,10 @@ msgid "" " // ...\n" " ```" msgstr "" -" ```rust, ignore\n" -" let by_3: bool = is_divisible_by(n, 3);\n" -" let by_5: bool = is_divisible_by(n, 5);\n" -" let by_35: (bool, bool) = (by_3, by_5);\n" -" match by_35 {\n" -" // ...\n" -" ```" #: src/basic-syntax/functions.md:52 msgid " " -msgstr " " +msgstr "" #: src/basic-syntax/methods.md:1 src/methods.md:1 msgid "# Methods" @@ -2955,7 +2792,7 @@ msgid "" "Rust has methods, they are simply functions that are associated with a particular type. The\n" "first argument of a method is an instance of the type it is associated with:" msgstr "" -"Rust tem métodos, eles são simplesmente funções associadas a um tipo específico. o\n" +"Rust tem métodos, eles são simplesmente funções associadas a um tipo específico. O\n" "primeiro argumento de um método é uma instância do tipo ao qual está associado:" #: src/basic-syntax/methods.md:6 @@ -2966,8 +2803,8 @@ msgid "" " height: u32,\n" "}" msgstr "" -"```rust, editable\n" -"struct Retângulo {\n" +"```rust,editable\n" +"struct Rectangle {\n" " width: u32,\n" " height: u32,\n" "}" @@ -2979,10 +2816,6 @@ msgid "" " self.width * self.height\n" " }" msgstr "" -"impl Rectangle {\n" -" fn area(&self) -> u32 {\n" -" self.width * self.height\n" -" }" #: src/basic-syntax/methods.md:17 msgid "" @@ -2991,10 +2824,6 @@ msgid "" " }\n" "}" msgstr "" -" fn inc_width(&mut self, delta: u32) {\n" -" self.width += delta;\n" -" }\n" -"}" #: src/basic-syntax/methods.md:22 msgid "" @@ -3006,25 +2835,18 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let mut rect = Rectangle { width: 10, height: 5 };\n" -" println!(\"área antiga: {}\", rect.area());\n" -" rect.inc_width(5);\n" -" println!(\"nova área: {}\", rect.area());\n" -"}\n" -"```" #: src/basic-syntax/methods.md:30 msgid "* We will look much more at methods in today's exercise and in tomorrow's class." -msgstr "* Veremos muito mais métodos no exercício de hoje e na aula de amanhã." +msgstr "* Veremos muito mais sobre métodos no exercício de hoje e na aula de amanhã." #: src/basic-syntax/functions-interlude.md:1 msgid "# Function Overloading" -msgstr "# Sobrecargo de funções" +msgstr "# Sobrecarga de funções" #: src/basic-syntax/functions-interlude.md:3 msgid "Overloading is not supported:" -msgstr "A sobrecargo não é suportada:" +msgstr "A sobrecarga não é suportada:" #: src/basic-syntax/functions-interlude.md:5 msgid "" @@ -3036,11 +2858,11 @@ msgid "" " * Macros are sometimes used as an alternative." msgstr "" "* Cada função tem uma única implementação:\n" -" * Sempre leva um número fixo de parâmetros.\n" +" * Sempre tem um número fixo de parâmetros.\n" " * Sempre usa um único conjunto de tipos de parâmetros.\n" "* Valores padrão não são suportados:\n" -" * Todos os sites de chamada têm o mesmo número de argumentos.\n" -" * Às vezes, as macros são usadas como alternativa." +" * Todos as chamadas têm o mesmo número de argumentos.\n" +" * Às vezes macros são usadas como alternativa." #: src/basic-syntax/functions-interlude.md:12 msgid "However, function parameters can be generic:" @@ -3053,10 +2875,6 @@ msgid "" " if std::process::id() % 2 == 0 { a } else { b }\n" "}" msgstr "" -"```rust, editable\n" -"fn pick_one(a: T, b: T) -> T {\n" -" if std::process::id() % 2 == 0 { a } else { b }\n" -"}" #: src/basic-syntax/functions-interlude.md:19 msgid "" @@ -3066,19 +2884,14 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" println!(\"jogo de moeda: {}\", pick_one(\"cara\", \"coroa\"));\n" -" println!(\"prêmio em dinheiro: {}\", pick_one(500, 1000));\n" -"}\n" -"```" #: src/basic-syntax/functions-interlude.md:27 msgid "" "* When using generics, the standard library's `Into` can provide a kind of limited\n" " polymorphism on argument types. We will see more details in a later section." msgstr "" -"* Ao usar genéricos, o `Into` da biblioteca padrão pode fornecer um tipo de limitação\n" -" polimorfismo em tipos de argumento. Veremos mais detalhes em uma seção posterior." +"* Ao usar generics, o `Into` da biblioteca padrão pode fornecer um tipo polimorfismo\n" +" limitado nos tipos do argumento. Veremos mais detalhes em uma seção posterior." #: src/basic-syntax/functions-interlude.md:30 msgid "" @@ -3110,9 +2923,9 @@ msgid "" " auto-completion in your editor. See the page about [Using Cargo] for details\n" " on installing Rust." msgstr "" -"* Use uma instalação Rust local, se possível. Desta forma, você pode obter\n" -" preenchimento automático em seu editor. Veja a página sobre [Using Cargo] para detalhes\n" -" na instalação do Rust." +"* Se possível, use uma instalação local do Rust. Desta forma, você pode obter\n" +" preenchimento automático em seu editor. Veja a página sobre [Utilização do Cargo] para detalhes\n" +" sobre instalação do Rust." #: src/exercises/day-1/morning.md:17 msgid "* Alternatively, use the Rust Playground." @@ -3126,20 +2939,19 @@ msgstr "" "Os trechos de código não são editáveis de propósito: os trechos de código embutidos perdem\n" "seu estado se você sair da página." -#: src/exercises/day-1/morning.md:22 src/exercises/day-1/afternoon.md:11 -#: src/exercises/day-2/morning.md:11 src/exercises/day-2/afternoon.md:7 -#: src/exercises/day-3/morning.md:7 src/exercises/day-4/morning.md:12 +#: src/exercises/day-1/morning.md:22 src/exercises/day-1/afternoon.md:11 src/exercises/day-2/morning.md:11 +#: src/exercises/day-2/afternoon.md:7 src/exercises/day-3/morning.md:7 src/exercises/day-4/morning.md:12 msgid "After looking at the exercises, you can look at the [solutions] provided." msgstr "Depois de ver os exercícios, você pode ver as [soluções] fornecidas." -#: src/exercises/day-1/morning.md:24 src/exercises/day-2/morning.md:13 -#: src/exercises/day-3/morning.md:9 src/exercises/day-4/morning.md:14 +#: src/exercises/day-1/morning.md:24 src/exercises/day-2/morning.md:13 src/exercises/day-3/morning.md:9 +#: src/exercises/day-4/morning.md:14 msgid "[solutions]: solutions-morning.md" msgstr "[soluções]:solutions-morning.md" #: src/exercises/day-1/morning.md:26 msgid "[Using Cargo]: ../../cargo.md" -msgstr "[Usando Cargo]: ../../cargo.md" +msgstr "[Utilização do Cargo]: ../../cargo.md" #: src/exercises/day-1/implicit-conversions.md:1 msgid "# Implicit Conversions" @@ -3151,7 +2963,7 @@ msgid "" "C++][3]). You can see this in a program like this:" msgstr "" "Rust não aplicará automaticamente _conversões implícitas_ entre os tipos ([ao contrário\n" -"C++][3]). Você pode ver isso em um programa como este:" +"De C++][3]). Você pode ver isso em um programa como este:" #: src/exercises/day-1/implicit-conversions.md:6 msgid "" @@ -3160,10 +2972,6 @@ msgid "" " x * y\n" "}" msgstr "" -"```rust,editable,compile_fail\n" -"fn multiply(x: i16, y: i16) -> i16 {\n" -" x * y\n" -"}" #: src/exercises/day-1/implicit-conversions.md:11 msgid "" @@ -3171,9 +2979,6 @@ msgid "" " let x: i8 = 15;\n" " let y: i16 = 1000;" msgstr "" -"fn main() {\n" -" let x: i8 = 15;\n" -" let y: i16 = 1000;" #: src/exercises/day-1/implicit-conversions.md:15 msgid "" @@ -3181,9 +2986,6 @@ msgid "" "}\n" "```" msgstr "" -" println!(\"{x} * {y} = {}\", multiply(x, y));\n" -"}\n" -"```" #: src/exercises/day-1/implicit-conversions.md:19 msgid "" @@ -3193,9 +2995,8 @@ msgid "" "Implementing these traits is how a type expresses that it can be converted into\n" "another type." msgstr "" -"Todos os tipos Rust integer implementam [`From`][1] e [`Into`][2]\n" -"características para nos deixar converter entre eles. A característica `From` tem um único " -"`from()`\n" +"Todos os tipos inteiro do Rust implementam os traits [`From`][1] e [`Into`][2]\n" +"para nos deixar converter entre eles. Os traits `From` tem um único `from()`\n" "e da mesma forma, o trait `Into` tem um único método `into()`.\n" "A implementação dessas características é como um tipo expressa que pode ser convertido em\n" "outro tipo." @@ -3209,17 +3010,16 @@ msgid "" msgstr "" "A biblioteca padrão tem uma implementação de `From for i16`, o que significa\n" "que podemos converter uma variável `x` do tipo `i8` para um `i16` chamando\n" -"`i16::de(x)`. Ou, mais simples, com `x.into()`, porque `From for i16`\n" -"implementação cria automaticamente uma implementação de `Into para i8`." +"`i16::from(x)`. Ou, mais simples, com `x.into()`, porque a implementação `From for i16`\n" +"cria automaticamente uma implementação de `Into for i8`." #: src/exercises/day-1/implicit-conversions.md:30 msgid "" "The same applies for your own `From` implementations for your own types, so it is\n" "sufficient to only implement `From` to get a respective `Into` implementation automatically." msgstr "" -"O mesmo se aplica para suas próprias implementações `From` para seus próprios tipos, então é\n" -"suficiente para apenas implementar `From` para obter uma respectiva implementação `Into` " -"automaticamente." +"O mesmo se aplica a suas próprias implementações de `From` para seus tipos, então é\n" +"suficiente implementar apenas `From` para obter uma respectiva implementação `Into` automaticamente." #: src/exercises/day-1/implicit-conversions.md:33 msgid "1. Execute the above program and look at the compiler error." @@ -3237,9 +3037,9 @@ msgid "" " [standard library documentation][1] to see if `From` is implemented for\n" " the pairs you check." msgstr "" -"3. Mude os tipos de `x` e `y` para outras coisas (como `f32`, `bool`,\n" -" `i128`) para ver quais tipos você pode converter para quais outros tipos. Experimentar\n" -" convertendo tipos pequenos em tipos grandes e vice-versa. Verifica a\n" +"3. Mude os tipos de `x` e `y` para outros tipos (como `f32`, `bool`,\n" +" `i128`) para ver quais tipos você pode converter para quais outros tipos. Experimente\n" +" converter tipos pequenos em tipos grandes e vice-versa. Verifique a\n" " [documentação da biblioteca padrão][1] para ver se `From` está implementado para\n" " os pares que você verifica." @@ -3267,9 +3067,6 @@ msgid "" "let array = [10, 20, 30];\n" "```" msgstr "" -"```rust\n" -"let array = [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 `{:?}`:" @@ -3284,20 +3081,14 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let array = [10, 20, 30];\n" -" println!(\"array: {array:?}\");\n" -"}\n" -"```" #: src/exercises/day-1/for-loops.md:18 msgid "" "Rust lets you iterate over things like arrays and ranges using the `for`\n" "keyword:" msgstr "" -"Rust permite iterar coisas como arrays e intervalos usando o `for`\n" -"palavra-chave:" +"Rust permite iterar em coisas como arrays e intervalos usando um `for`\n" +":" #: src/exercises/day-1/for-loops.md:21 msgid "" @@ -3310,14 +3101,6 @@ msgid "" " }\n" " println!();" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let array = [10, 20, 30];\n" -" print!(\"Iterando sobre o array:\");\n" -" for n in array {\n" -" print!(\"{n}\");\n" -" }\n" -" println!();" #: src/exercises/day-1/for-loops.md:30 msgid "" @@ -3329,21 +3112,14 @@ msgid "" "}\n" "```" msgstr "" -" print!(\"Iterando sobre o intervalo:\");\n" -" for i in 0..3 {\n" -" imprima!(\" {}\", array[i]);\n" -" }\n" -" println!();\n" -"}\n" -"```" #: src/exercises/day-1/for-loops.md:38 msgid "" "Use the above to write a function `pretty_print` which pretty-print a matrix and\n" "a function `transpose` which will transpose a matrix (turn rows into columns):" msgstr "" -"Use o acima para escrever uma função `pretty_print` que imprime uma array e\n" -"uma função `transpose` que irá transpose uma array (transformar linhas em colunas):" +"Use o exercício acima para escrever uma função `pretty_print` que imprime um array e\n" +"uma função `transpose` que irá transpor um array (transformar linhas em colunas):" #: src/exercises/day-1/for-loops.md:41 msgid "" @@ -3353,34 +3129,25 @@ msgid "" " ⎝⎣7 8 9⎦⎠ ⎣3 6 9⎦\n" "```" msgstr "" -"```bob\n" -" ⎛⎡1 2 3⎤⎞ ⎡1 4 7⎤\n" -"\"transpose\"⎜⎢4 5 6⎥⎟ \"==\"⎢2 5 8⎥\n" -" ⎝⎣7 8 9⎦⎠ ⎣3 6 9⎦\n" -"```" #: src/exercises/day-1/for-loops.md:47 msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "Codifique ambas as funções para operar em Arrays 3 × 3." +msgstr "Limite ambas as funções a operar em arrays 3 × 3." #: src/exercises/day-1/for-loops.md:49 msgid "" "Copy the code below to and implement the\n" "functions:" msgstr "" -"Copie o código abaixo para e implemente o\n" +"Copie o código abaixo para e implemente as\n" "funções:" -#: src/exercises/day-1/for-loops.md:52 src/exercises/day-1/book-library.md:20 -#: src/exercises/day-2/health-statistics.md:13 +#: src/exercises/day-1/for-loops.md:52 src/exercises/day-1/book-library.md:20 src/exercises/day-2/health-statistics.md:13 msgid "" "```rust,should_panic\n" "// TODO: remove this when you're done with your implementation.\n" "#![allow(unused_variables, dead_code)]" msgstr "" -"```rust,should_panic\n" -"// TODO: remova isso quando terminar sua implementação.\n" -"#![allow(unused_variables, dead_code)]" #: src/exercises/day-1/for-loops.md:56 msgid "" @@ -3388,9 +3155,6 @@ msgid "" " unimplemented!()\n" "}" msgstr "" -"fn transpose(array: [[i32; 3]; 3]) -> [[i32; 3]; 3] {\n" -" não implementado!()\n" -"}" #: src/exercises/day-1/for-loops.md:60 msgid "" @@ -3398,9 +3162,6 @@ msgid "" " unimplemented!()\n" "}" msgstr "" -"fn pretty_print(array: &[[i32; 3]; 3]) {\n" -" não implementado!()\n" -"}" #: src/exercises/day-1/for-loops.md:64 msgid "" @@ -3412,7 +3173,7 @@ msgid "" " ];" msgstr "" "fn main() {\n" -" let array = [\n" +" let matrix = [\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" @@ -3423,8 +3184,6 @@ msgid "" " println!(\"matrix:\");\n" " pretty_print(&matrix);" msgstr "" -" println!(\"array:\");\n" -" bonita_impressão(&array);" #: src/exercises/day-1/for-loops.md:74 msgid "" @@ -3434,11 +3193,6 @@ msgid "" "}\n" "```" msgstr "" -" let transposed = transpose(array);\n" -" println!(\"transposto:\");\n" -" pretty_print(&transposed);\n" -"}\n" -"```" #: src/exercises/day-1/for-loops.md:80 msgid "## Bonus Question" @@ -3450,17 +3204,17 @@ msgid "" "argument and return types? Something like `&[&[i32]]` for a two-dimensional\n" "slice-of-slices. Why or why not?" msgstr "" -"Você poderia usar slices `&[i32]` em vez de Arrays 3 × 3 codificadas para o seu\n" -"argumentos e tipos de retorno? Algo como `&[&[i32]]` para um bidimensional\n" -"slice-de-slices. Por que ou por que não?" +"Você poderia usar slices `&[i32]` em vez de Arrays 3 × 3 estáticos para o seu\n" +"argumentos e tipos de retorno? Algo como `&[&[i32]]` para um slice-de-slices\n" +"bidimensional. Por que ou por que não?" #: src/exercises/day-1/for-loops.md:87 msgid "" "See the [`ndarray` crate](https://docs.rs/ndarray/) for a production quality\n" "implementation." msgstr "" -"Veja a [caixa `ndarray`](https://docs.rs/ndarray/) para uma qualage de produção\n" -"implementação." +"Veja o crate [`ndarray`](https://docs.rs/ndarray/) para uma implementação de produção\n" +"." #: src/exercises/day-1/for-loops.md:92 msgid "" @@ -3479,9 +3233,8 @@ msgid "" "Rust provides type safety via static typing. Variable bindings are immutable by\n" "default:" msgstr "" -"Rust fornece segurança de tipo por meio de digitação estática. Vinculações de variáveis são " -"imutáveis por\n" -"predefinição:" +"Rust fornece segurança de tipo por meio de tipagem estática. Variáveis são imutáveis por\n" +"padrão:" #: src/basic-syntax/variables.md:6 msgid "" @@ -3494,26 +3247,16 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let x: i32 = 10;\n" -" println!(\"x: {x}\");\n" -" // x = 20;\n" -" // println!(\"x: {x}\");\n" -"}\n" -"```" #: src/basic-syntax/variables.md:17 msgid "" -"* Due to type inference the `i32` is optional. We will gradually show the types less and less as " -"the course progresses.\n" -"* Note that since `println!` is a macro, `x` is not moved, even using the function like syntax of " -"`println!(\"x: {}\", x)`" +"* Due to type inference the `i32` is optional. We will gradually show the types less and less as the course progresses.\n" +"* Note that since `println!` is a macro, `x` is not moved, even using the function like syntax of `println!(\"x: {}\", x)`" msgstr "" -"* Devido à inferência de tipos, o `i32` é opcional. Mostraremos gradualmente os tipos cada vez " -"menos à medida que o tipo progride.\n" -"* Observe que como `println!` é uma macro, `x` não é movido, mesmo usando a função como a sintaxe " -"de `println!(\"x: {}\", x)`" +"* Devido à inferência de tipos, o `i32` é opcional. Gradualmente mostraremos os tipos cada vez menos à medida que o curso " +"progride.\n" +"* Observe que como `println!` é uma macro, `x` não é movido, mesmo usando uma sintaxe parecida com a de uma função `println!" +"(\"x: {}\", x)`" #: src/basic-syntax/type-inference.md:1 msgid "# Type Inference" @@ -3530,10 +3273,6 @@ msgid "" " println!(\"u32: {x}\");\n" "}" msgstr "" -"```rust, editable\n" -"fn takes_u32(x:u32) {\n" -" println!(\"u32: {x}\");\n" -"}" #: src/basic-syntax/type-inference.md:10 msgid "" @@ -3541,9 +3280,6 @@ msgid "" " println!(\"i8: {y}\");\n" "}" msgstr "" -"fn takes_i8(y: i8) {\n" -" println!(\"i8: {y}\");\n" -"}" #: src/basic-syntax/type-inference.md:14 msgid "" @@ -3551,9 +3287,6 @@ msgid "" " let x = 10;\n" " let y = 20;" msgstr "" -"fn main() {\n" -" let x = 10;\n" -" let y = 20;" #: src/basic-syntax/type-inference.md:18 msgid "" @@ -3563,39 +3296,28 @@ msgid "" "}\n" "```" msgstr "" -" takes_u32(x);\n" -" takes_i8(y);\n" -" // takes_u32(y);\n" -"}\n" -"```" #: src/basic-syntax/type-inference.md:26 msgid "" -"This slide demonstrates how the Rust compiler infers types based on constraints given by variable " -"declarations and usages.\n" +"This slide demonstrates how the Rust compiler infers types based on constraints given by variable declarations and usages.\n" " \n" -"It is very important to emphasize that variables declared like this are not of some sort of " -"dynamic \"any type\" that can\n" -"hold any data. The machine code generated by such declaration is identical to the explicit " -"declaration of a type.\n" +"It is very important to emphasize that variables declared like this are not of some sort of dynamic \"any type\" that can\n" +"hold any data. The machine code generated by such declaration is identical to the explicit declaration of a type.\n" "The compiler does the job for us and helps us to write a more concise code." msgstr "" -"Este slide demonstra como o compilador Rust infere tipos com base em restrições dadas por " -"declarações e usos de variáveis.\n" +"Este slide demonstra como o compilador Rust infere tipos com base em restrições dadas por declarações e usos de variáveis.\n" " \n" -"É muito importante enfatizar que variáveis declaradas assim não são de algum tipo dinâmico " -"\"qualquer tipo\" que possa\n" -"manter quaisquer dados. O código de máquina gerado por tal declaração é idêntico à declaração " -"explícita de um tipo.\n" +"É muito importante enfatizar que variáveis declaradas assim não são de um tipo dinâmico \"qualquer tipo\" que possa\n" +"armazenar quaisquer dados. O código de máquina gerado por tal declaração é idêntico à declaração explícita de um tipo.\n" "O compilador faz o trabalho para nós e nos ajuda a escrever um código mais conciso." #: src/basic-syntax/type-inference.md:32 msgid "" -"The following code tells the compiler to copy into a certain generic container without the code " -"ever explicitly specifying the contained type, using `_` as a placeholder:" +"The following code tells the compiler to copy into a certain generic container without the code ever explicitly specifying " +"the contained type, using `_` as a placeholder:" msgstr "" -"O código a seguir informa ao compilador para copiar em um determinado contêiner genérico sem que o " -"código especifique explicitamente o tipo contido, usando `_` como espaço reservado:" +"O código a seguir informa ao compilador para copiar para um determinado 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 "" @@ -3606,12 +3328,6 @@ msgid "" " v.push((20, true));\n" " println!(\"v: {v:?}\");" 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:?}\");" #: src/basic-syntax/type-inference.md:41 msgid "" @@ -3620,20 +3336,14 @@ msgid "" "}\n" "```" msgstr "" -" let vv = v.iter().collect::>();\n" -" println!(\"vv: {vv:?}\");\n" -"}\n" -"```" #: src/basic-syntax/type-inference.md:46 msgid "" -"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) relies " -"on `FromIterator`, which [`HashSet`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"implements." +"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) relies on `FromIterator`, which " +"[`HashSet`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) implements." msgstr "" -"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) depende " -"de `FromIterator`, que [`HashSet`](https:/ /doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"implementa." +"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.collect) depende de `FromIterator`, que " +"[`HashSet`](https:/ /doc.rust-lang.org/std/iter/trait.FromIterator.html) implementa." #: src/basic-syntax/static-and-const.md:1 msgid "# Static and Constant Variables" @@ -3657,9 +3367,6 @@ msgid "" "const DIGEST_SIZE: usize = 3;\n" "const ZERO: Option = Some(42);" msgstr "" -"```rust, editable\n" -"const DIGEST_SIZE: usize = 3;\n" -"const ZERO: Option = Some(42);" #: src/basic-syntax/static-and-const.md:13 msgid "" @@ -3671,13 +3378,6 @@ msgid "" " digest\n" "}" msgstr "" -"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" -"}" #: src/basic-syntax/static-and-const.md:21 msgid "" @@ -3687,19 +3387,14 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let digest = compute_digest(\"Hello\");\n" -" println!(\"Digest: {digest:?}\");\n" -"}\n" -"```" #: src/basic-syntax/static-and-const.md:27 msgid "According the the [Rust RFC Book][1] these are inlined upon use." -msgstr "De acordo com o [Rust RFC Book] [1], eles são embutidos após o uso." +msgstr "De acordo com o [Rust RFC Book] [1], eles são expandidos no próprio local (inline) após o uso." #: src/basic-syntax/static-and-const.md:29 msgid "## `static`" -msgstr "##`static`" +msgstr "## `static`" #: src/basic-syntax/static-and-const.md:31 msgid "You can also declare static variables:" @@ -3711,7 +3406,7 @@ msgid "" "static BANNER: &str = \"Welcome to RustOS 3.14\";" msgstr "" "```rust, editable\n" -"BANNER static: &str = \"Bem-vindo ao RustOS 3.14\";" +"static BANNER: &str = \"Bem-vindo ao RustOS 3.14\";" #: src/basic-syntax/static-and-const.md:36 msgid "" @@ -3720,38 +3415,30 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" println!(\"{BANNER}\");\n" -"}\n" -"```" #: src/basic-syntax/static-and-const.md:41 msgid "" -"As noted in the [Rust RFC Book][1], these are not inlined upon use and have an actual associated " -"memory location. This is useful for unsafe and embedded code, and the variable lives through the " -"entirety of the program execution." +"As noted in the [Rust RFC Book][1], these are not inlined upon use and have an actual associated memory location. This is " +"useful for unsafe and embedded code, and the variable lives through the entirety of the program execution." msgstr "" -"Conforme observado no [Rust RFC Book][1], eles não são embutidos após o uso e possuem um local de " -"memória real associado. Isso é útil para código inseguro e incorporado, e a variável permanece " -"durante toda a execução do programa." +"Conforme observado no [Rust RFC Book][1], `static` e `const` não são expandidos em linha (inlined) quando utilizados uso e " +"possuem um local de memória real associado. Isso é útil para código inseguro e embarcado, e a variável sobrevive durante " +"toda a execução do programa." #: src/basic-syntax/static-and-const.md:44 msgid "We will look at mutating static data in the [chapter on Unsafe Rust](../unsafe.md)." -msgstr "Veremos a mutação de dados statics no [capítulo sobre Unsafe Rust](../unsafe.md)." +msgstr "Veremos a mutação de dados estáticos no [capítulo sobre Unsafe Rust](../unsafe.md)." #: src/basic-syntax/static-and-const.md:48 msgid "" "* Mention that `const` behaves semantically similar to C++'s `constexpr`.\n" -"* `static`, on the other hand, is much more similar to a `const` or mutable global variable in C+" -"+.\n" -"* It isn't super common that one would need a runtime evaluated constant, but it is helpful and " -"safer than using a static." +"* `static`, on the other hand, is much more similar to a `const` or mutable global variable in C++.\n" +"* It isn't super common that one would need a runtime evaluated constant, but it is helpful and safer than using a static." msgstr "" "* Mencione que `const` se comporta semanticamente similar ao `constexpr` de C++.\n" -"* `static`, por outro lado, é muito mais parecido com um `const` ou variável global mutável em C+" -"+.\n" -"* Não é muito comum que alguém precise de uma constante avaliada em tempo de execução, mas é útil " -"e mais seguro do que usar uma estática." +"* `static`, por outro lado, é muito mais parecido com um `const` ou variável global mutável em C++.\n" +"* Não é muito comum que alguém precise de uma constante avaliada em tempo de execução, mas é útil e mais seguro do que usar " +"uma estática." #: src/basic-syntax/static-and-const.md:54 msgid "[1]: https://rust-lang.github.io/rfcs/0246-const-vs-static.html" @@ -3759,14 +3446,14 @@ msgstr "[1]: https://rust-lang.github.io/rfcs/0246-const-vs-static.html" #: src/basic-syntax/scopes-shadowing.md:1 msgid "# Scopes and Shadowing" -msgstr "# Escopos e Sombreamento" +msgstr "# Escopos e Sobreposição" #: src/basic-syntax/scopes-shadowing.md:3 msgid "" "You can shadow variables, both those from outer scopes and variables from the\n" "same scope:" msgstr "" -"Você pode sombrear variáveis, tanto aquelas de escopos externos quanto variáveis do\n" +"Você pode sobrepor (shadow) variáveis, tanto aquelas de escopos externos quanto variáveis do\n" "mesmo escopo:" #: src/basic-syntax/scopes-shadowing.md:6 @@ -3776,10 +3463,6 @@ msgid "" " let a = 10;\n" " println!(\"before: {a}\");" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let a = 10;\n" -" println!(\"antes: {a}\");" #: src/basic-syntax/scopes-shadowing.md:11 msgid "" @@ -3787,9 +3470,6 @@ msgid "" " let a = \"hello\";\n" " println!(\"inner scope: {a}\");" msgstr "" -" {\n" -" let um = \"olá\";\n" -" println!(\"escopo interno: {a}\");" #: src/basic-syntax/scopes-shadowing.md:15 msgid "" @@ -3797,9 +3477,6 @@ msgid "" " println!(\"shadowed in inner scope: {a}\");\n" " }" msgstr "" -" let a = true;\n" -" println!(\"sombreado no escopo interno: {a}\");\n" -" }" #: src/basic-syntax/scopes-shadowing.md:19 msgid "" @@ -3807,28 +3484,22 @@ msgid "" "}\n" "```" msgstr "" -" println!(\"após: {a}\");\n" -"}\n" -"```" #: src/basic-syntax/scopes-shadowing.md:25 msgid "" -"* Definition: 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. \n" +"* Definition: 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. \n" "* A shadowing variable can have a different type. \n" "* Shadowing looks obscure at first, but is convenient for holding on to values after `.unwrap()`.\n" -"* The following code demonstrates why the compiler can't simply reuse memory locations when " -"shadowing an immutable variable in a scope, even if the type does not change." -msgstr "" -"* Definição: O sombreamento é diferente da mutação, porque após o sombreamento, os locais de " -"memória de ambas as variáveis existem ao mesmo tempo. Ambos estão disponíveis com o mesmo name, " -"dependendo de onde você os usa no código.\n" -"* Uma variável de sombreamento pode ter um tipo diferente.\n" -"* O sombreamento parece obscuro a princípio, mas é conveniente para manter os valores após `." -"unwrap()`.\n" -"* O código a seguir demonstra por que o compilador não pode simplesmente reutilizar locais de " -"memória ao sombrear uma variável imutável em um escopo, mesmo que o tipo não seja alterado." +"* The following code demonstrates why the compiler can't simply reuse memory locations when shadowing an immutable variable " +"in a scope, even if the type does not change." +msgstr "" +"* Definição: A sobreposição é diferente da mutação, porque após a sobreposição, os locais de memória de ambas as variáveis " +"existem ao mesmo tempo. Ambos estão disponíveis com o mesmo nome, dependendo de onde você os usa no código.\n" +"* Uma variável sobreposta pode ter um tipo diferente.\n" +"* A sobreposição parece obscura a princípio, mas é conveniente para manter os valores após `.unwrap()`.\n" +"* O código a seguir demonstra por que o compilador não pode simplesmente 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 "" @@ -3841,14 +3512,6 @@ msgid "" "}\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/memory-management.md:1 msgid "# Memory Management" @@ -3856,16 +3519,15 @@ msgstr "# Gerenciamento de memória" #: src/memory-management.md:3 msgid "Traditionally, languages have fallen into two broad categories:" -msgstr "Tradicionalmente, as línguas caíram em duas grandes categorias:" +msgstr "Tradicionalmente, as linguagens se dividem em duas grandes categorias:" #: src/memory-management.md:5 msgid "" "* Full control via manual memory management: C, C++, Pascal, ...\n" "* Full safety via automatic memory management at runtime: Java, Python, Go, Haskell, ..." msgstr "" -"* Controle total via gerenciamento de memória manual: C, C++, Pascal, ...\n" -"* Segurança total através do gerenciamento automático de memória em tempo de execução: Java, " -"Python, Go, Haskell, ..." +"* Controle total através gerenciamento manual de memória: C, C++, Pascal, ...\n" +"* Segurança total através do gerenciamento automático de memória em tempo de execução: Java, Python, Go, Haskell, ..." #: src/memory-management.md:8 msgid "Rust offers a new mix:" @@ -3876,8 +3538,8 @@ msgid "" "> Full control *and* safety via compile time enforcement of correct memory\n" "> management." msgstr "" -"> Controle total *e* segurança por meio da aplicação do tempo de compilação da memória correta\n" -"> gestão." +"> Controle total *e* segurança por imposição do correto gerenciamento de memória em tempo de\n" +"> compilação." #: src/memory-management.md:13 msgid "It does this with an explicit ownership concept." @@ -3885,11 +3547,11 @@ msgstr "Ele faz isso com um conceito de ownership explícito." #: src/memory-management.md:15 msgid "First, let's refresh how memory management works." -msgstr "Primeiro, vamos atualizar como o gerenciamento de memória funciona." +msgstr "Primeiro, vamos rever como o gerenciamento de memória funciona." #: src/memory-management/stack-vs-heap.md:1 msgid "# The Stack vs The Heap" -msgstr "# A Pilha vs A Heap" +msgstr "# O Stack vs O Heap" #: src/memory-management/stack-vs-heap.md:3 msgid "" @@ -3901,9 +3563,9 @@ msgid "" msgstr "" "* Stack: Área contínua de memória para variáveis locais.\n" " * Os valores têm tamanhos fixos conhecidos em tempo de compilação.\n" -" * Extremamente rápido: basta mover um ponteiro de pilha.\n" +" * Extremamente rápido: basta mover um ponteiro do stack.\n" " * Fácil de gerenciar: segue chamadas de função.\n" -" * Ótima localage de memória." +" * Ótima localização na memória." #: src/memory-management/stack-vs-heap.md:9 msgid "" @@ -3914,20 +3576,20 @@ msgid "" msgstr "" "* Heap: Armazenamento de valores fora das chamadas de função.\n" " * Os valores têm tamanhos dinâmicos determinados em tempo de execução.\n" -" * Ligeiramente mais lento que a pilha: é necessária alguma contabilage.\n" -" * Sem garantia de localage de memória." +" * Ligeiramente mais lento que o stack: é necessária alguma contabilidade.\n" +" * Sem garantia de localização na memória." #: src/memory-management/stack.md:1 msgid "# Stack Memory" -msgstr "# Memória de Pilha" +msgstr "# Memória de Pilha (stack Memory)" #: src/memory-management/stack.md:3 msgid "" "Creating a `String` puts fixed-sized data on the stack and dynamically sized\n" "data on the heap:" msgstr "" -"A criação de uma `String` coloca dados de tamanho fixo na pilha e dimensionados dinamicamente\n" -"dados na heap:" +"A criação de uma `String` coloca dados de tamanho fixo no stack e dados dimensionados dinamicamente\n" +"no heap:" #: src/memory-management/stack.md:6 msgid "" @@ -3937,13 +3599,9 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let s1 = String::from(\"Olá\");\n" -"}\n" -"```" #: src/memory-management/stack.md:12 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -3959,42 +3617,26 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -"```bob\n" -" Pilha\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - -.\n" -": : : :\n" -":s1 : : :\n" -": +-----------+-------+ : : +----+----+----+----+----+ :\n" -": | ptr | o---+---+-----+-->| H | e | eu | eu | o | :\n" -": | len | 5 | : : +----+----+----+----+----+ :\n" -": | capacage | 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 length and can grow if " -"mutable via reallocation on the heap." +"* Mention that a `String` is backed by a `Vec`, so it has a capacity and length and can grow if mutable via reallocation on " +"the heap." msgstr "" -"* Mencione que um `String` é apoiado por um `Vec`, então ele tem capacage e comprimento e pode " -"crescer se for mutável por meio de realocação no heap." +"* Mencione que um `String` é baseada em um `Vec`, então ele tem capacidade e comprimento e pode crescer se for mutável por " +"meio de realocação no heap." #: src/memory-management/stack.md:30 msgid "" -"* If students ask about it, you can mention that the underlying memory is heap allocated using the " -"[System Allocator] and custom allocators can be implemented using the [Allocator API]" +"* If students ask about it, you can mention that the underlying memory is heap allocated using the [System Allocator] and " +"custom allocators can be implemented using the [Allocator API]" msgstr "" -"* Se os alunos perguntarem sobre isso, você pode mencionar que a memória subjacente é heap alocada " -"usando o [System Allocator] e alocadores personalizados podem ser implementados usando a " -"[Allocator API]" +"* Se os alunos perguntarem sobre isso, você pode mencionar que a memória do heap é alocada usando o [System Allocator] e " +"alocadores personalizados podem ser implementados usando a [Allocator API]" #: src/memory-management/stack.md:32 -msgid "" -"* We can inspect the memory layout with `unsafe` code. However, you should point out that this is " -"rightfully unsafe!" -msgstr "" +msgid "* We can inspect the memory layout with `unsafe` code. However, you should point out that this is rightfully unsafe!" +msgstr "* Pode-se inspecionar o layout de memória com `unsafe` code. Entretanto, deve-se salientar que isto é inseguro!" #: src/memory-management/stack.md:34 msgid "" @@ -4019,27 +3661,25 @@ msgid "" "[System Allocator]: https://doc.rust-lang.org/std/alloc/struct.System.html\n" "[Allocator API]: https://doc.rust-lang.org/std/alloc/index.html" msgstr "" -"[Alocador do sistema]: https://doc.rust-lang.org/std/alloc/struct.System.html\n" -"[API do alocador]: https://doc.rust-lang.org/std/alloc/index.html" +"[System Allocator]: https://doc.rust-lang.org/std/alloc/struct.System.html\n" +"[Allocator API]: https://doc.rust-lang.org/std/alloc/index.html" #: src/memory-management/manual.md:1 msgid "# Manual Memory Management" -msgstr "# Gerenciamento de memória manual" +msgstr "# Gerenciamento manual de memória" #: src/memory-management/manual.md:3 msgid "You allocate and deallocate heap memory yourself." -msgstr "Você mesmo aloca e desaloca memória heap." +msgstr "Você mesmo aloca e desaloca memória no heap." #: src/memory-management/manual.md:5 -msgid "" -"If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory leaks." +msgid "If not done with care, this can lead to crashes, bugs, security vulnerabilities, and memory leaks." msgstr "" -"Se não for feito com cuidado, isso pode levar a travamentos, bugs, vulnerabilages de segurança e " -"vazamentos de memória." +"Se não for feito com cuidado, isso pode levar a travamentos, bugs, vulnerabilidades de segurança e vazamentos de memória." #: src/memory-management/manual.md:7 msgid "## C Example" -msgstr "## C Exemplo" +msgstr "## Exemplo em C" #: src/memory-management/manual.md:9 msgid "You must call `free` on every pointer you allocate with `malloc`:" @@ -4057,22 +3697,13 @@ msgid "" "}\n" "```" msgstr "" -"```c\n" -"void foo(size_t n) {\n" -" int* int_array = (int*)malloc(n * sizeof(int));\n" -" //\n" -" // ... muito código\n" -" //\n" -" free(int_array);\n" -"}\n" -"```" #: src/memory-management/manual.md:21 msgid "" "Memory is leaked if the function returns early between `malloc` and `free`: the\n" "pointer is lost and we cannot deallocate the memory." msgstr "" -"A memória vaza se a função retornar cedo entre `malloc` e `free`: o\n" +"A memória vaza se a função retornar mais cedo entre `malloc` e `free`: o\n" "ponteiro é perdido e não podemos desalocar a memória." #: src/memory-management/scope-based.md:1 @@ -4081,7 +3712,7 @@ msgstr "# Gerenciamento de memória baseado em escopo" #: src/memory-management/scope-based.md:3 msgid "Constructors and destructors let you hook into the lifetime of an object." -msgstr "Construtores e destruidores permitem que você se conecte ao tempo de vida de um objeto." +msgstr "Construtores e destruidores permitem que a tempo de vida de um objeto seja rastreado." #: src/memory-management/scope-based.md:5 msgid "" @@ -4091,19 +3722,20 @@ msgid "" msgstr "" "Ao envolver um ponteiro em um objeto, você pode liberar memória quando o objeto é\n" "destruído. O compilador garante que isso aconteça, mesmo que uma exceção seja\n" -"criado." +"criada." #: src/memory-management/scope-based.md:9 msgid "" "This is often called _resource acquisition is initialization_ (RAII) and gives\n" "you smart pointers." msgstr "" -"Isso geralmente é chamado de _aquisição de recursos é inicialização_ (RAII) e fornece\n" -"vocês ponteiros inteligentes." +"Isso geralmente é chamado de _aquisição de recursos é inicialização_ (resource acquisition is initialization, RAII) e " +"fornece\n" +"ponteiros inteligentes." #: src/memory-management/scope-based.md:12 msgid "## C++ Example" -msgstr "## Exemplo C++" +msgstr "## Exemplo em C++" #: src/memory-management/scope-based.md:14 msgid "" @@ -4113,11 +3745,6 @@ msgid "" "}\n" "```" msgstr "" -"```c++\n" -"void say_hello(std::unique_ptr person) {\n" -" std::cout << \"Hello \" << person->name << std::endl;\n" -"}\n" -"```" #: src/memory-management/scope-based.md:20 msgid "" @@ -4126,14 +3753,14 @@ msgid "" "* At the end of `say_hello`, the `std::unique_ptr` destructor will run.\n" "* The destructor frees the `Person` object it points to." msgstr "" -"* O objeto `std::unique_ptr` é alocado na pilha e aponta para\n" +"* O objeto `std::unique_ptr` é alocado no stack e aponta para\n" " memória alocada no heap.\n" -"* No final de `say_hello`, o destruidor `std::unique_ptr` será executado.\n" -"* O destruidor libera o objeto `Person` para o qual ele aponta." +"* No final de `say_hello`, o destrutor `std::unique_ptr` será executado.\n" +"* O destrutor libera o objeto `Person` para o qual ele aponta." #: src/memory-management/scope-based.md:25 msgid "Special move constructors are used when passing ownership to a function:" -msgstr "Construtores de movimentos especiais são usados ao passar a ownership para uma função:" +msgstr "Construtores de movimentos especiais são usados ao passar a \"ownership\" para uma função:" #: src/memory-management/scope-based.md:27 msgid "" @@ -4142,10 +3769,6 @@ msgid "" "say_hello(std::move(person));\n" "```" msgstr "" -"```c++\n" -"std::unique_ptr person = find_person(\"Carla\");\n" -"say_hello(std::move(person));\n" -"```" #: src/memory-management/garbage-collection.md:1 msgid "# Automatic Memory Management" @@ -4156,8 +3779,8 @@ msgid "" "An alternative to manual and scope-based memory management is automatic memory\n" "management:" msgstr "" -"Uma alternativa ao gerenciamento de memória manual e baseado em escopo é a memória automática\n" -"gestão:" +"Uma alternativa ao gerenciamento de memória manual e baseado em escopo é o gerenciamento automático\n" +"de memória:" #: src/memory-management/garbage-collection.md:6 msgid "" @@ -4165,7 +3788,7 @@ msgid "" "* A garbage collector finds unused memory and deallocates it for the programmer." msgstr "" "* O programador nunca aloca ou desaloca memória explicitamente.\n" -"* Um garbage collector encontra memória não utilizada e a desaloca para o programador." +"* Um \"coletor de lixo\" (garbage collector) encontra memória não utilizada e a desaloca para o programador." #: src/memory-management/garbage-collection.md:9 msgid "## Java Example" @@ -4183,11 +3806,6 @@ msgid "" "}\n" "```" msgstr "" -"```java\n" -"void sayHello(Person person) {\n" -" System.out.println(\"Hello \" + person.getName());\n" -"}\n" -"```" #: src/memory-management/rust.md:1 msgid "# Memory Management in Rust" @@ -4200,18 +3818,16 @@ msgstr "O gerenciamento de memória no Rust é uma mistura:" #: src/memory-management/rust.md:5 msgid "" "* Safe and correct like Java, but without a garbage collector.\n" -"* Depending on which abstraction (or combination of abstractions) you choose, can be a single " -"unique pointer, reference counted, or atomically reference counted.\n" +"* Depending on which abstraction (or combination of abstractions) you choose, can be a single unique pointer, reference " +"counted, or atomically reference counted.\n" "* Scope-based like C++, but the compiler enforces full adherence.\n" -"* A Rust user can choose the right abstraction for the situation, some even have no cost at " -"runtime like C." +"* A Rust user can choose the right abstraction for the situation, some even have no cost at runtime like C." msgstr "" "* Seguro e correto como Java, mas sem coletor de lixo.\n" -"* Dependendo de qual abstração (ou combinação de abstrações) você escolher, pode ser um único " -"ponteiro único, referência contada ou referência atomicamente contada.\n" +"* Dependendo de qual abstração (ou combinação de abstrações) você escolher, pode ser um simples ponteiro único, referência " +"contada ou referência atomicamente contada.\n" "* Baseado em escopo como C++, mas o compilador impõe adesão total.\n" -"* Um usuário do Rust pode escolher a abstração certa para a situação, algumas até sem custo em " -"tempo de execução como C." +"* Um usuário do Rust pode escolher a abstração certa para a situação, algumas até sem custo em tempo de execução como C." #: src/memory-management/rust.md:10 msgid "It achieves this by modeling _ownership_ explicitly." @@ -4219,13 +3835,12 @@ msgstr "Ele consegue isso modelando _ownership_ explicitamente." #: src/memory-management/rust.md:14 msgid "" -"* If asked how at this point, you can mention that in Rust this is usually handled by RAII wrapper " -"types such as [Box], [Vec], [Rc], or [Arc]. These encapsulate ownership and memory allocation via " -"various means, and prevent the potential errors in C." +"* If asked how at this point, you can mention that in Rust this is usually handled by RAII wrapper types such as [Box], " +"[Vec], [Rc], or [Arc]. These encapsulate ownership and memory allocation via various means, and prevent the potential " +"errors in C." msgstr "" -"* Se perguntado como neste Point, você pode mencionar que em Rust isso geralmente é tratado por " -"tipos de wrapper RAII como [Box], [Vec], [Rc] ou [Arc]. Eles encapsulam a ownership e a alocação " -"de memória por vários meios e evitam possíveis erros em C." +"* Neste ponto, se perguntado como, você pode mencionar que em Rust isso geralmente é tratado por wrappers RAII como [Box], " +"[Vec], [Rc] ou [Arc]. Eles encapsulam a ownership e a alocação de memória por vários meios e evitam possíveis erros em C." #: src/memory-management/rust.md:16 msgid "* You may be asked about destructors here, the [Drop] trait is the Rust equivalent." @@ -4239,7 +3854,7 @@ msgid "" "[Arc]: https://doc.rust-lang.org/std/sync/struct.Arc.html\n" "[Drop]: https://doc.rust-lang.org/std/ops/trait.Drop.html" msgstr "" -"[Caixa]: https://doc.rust-lang.org/std/boxed/struct.Box.html\n" +"[Box]: https://doc.rust-lang.org/std/boxed/struct.Box.html\n" "[Vec]: https://doc.rust-lang.org/std/vec/struct.Vec.html\n" "[Rc]: https://doc.rust-lang.org/std/rc/struct.Rc.html\n" "[Arc]: https://doc.rust-lang.org/std/sync/struct.Arc.html\n" @@ -4255,7 +3870,7 @@ msgstr "Aqui está uma comparação aproximada das técnicas de gerenciamento de #: src/memory-management/comparison.md:5 msgid "## Pros of Different Memory Management Techniques" -msgstr "## Prós de diferentes técnicas de gerenciamento de memória" +msgstr "## Vantagens de diferentes técnicas de gerenciamento de memória" #: src/memory-management/comparison.md:7 msgid "" @@ -4273,7 +3888,7 @@ msgid "" " * Safe and correct." msgstr "" "* Manual como C:\n" -" * Nenhuma sobrecargo de tempo de execução.\n" +" * Nenhuma sobrecarga em tempo de execução.\n" "* Automático como Java:\n" " * Totalmente automatizado.\n" " * Seguro e correto.\n" @@ -4282,12 +3897,12 @@ msgstr "" " * Nenhuma sobrecargo de tempo de execução.\n" "* Baseado em escopo aplicado pelo compilador como Rust:\n" " * Aplicado pelo compilador.\n" -" * Nenhuma sobrecargo de tempo de execução.\n" +" * Nenhuma sobrecarga em tempo de execução.\n" " * Seguro e correto." #: src/memory-management/comparison.md:20 msgid "## Cons of Different Memory Management Techniques" -msgstr "## Contras de diferentes técnicas de gerenciamento de memória" +msgstr "## Desvantagens de diferentes técnicas de gerenciamento de memória" #: src/memory-management/comparison.md:22 msgid "" @@ -4307,16 +3922,16 @@ msgid "" msgstr "" "* Manual como C:\n" " * Use-after-free.\n" -" * Liberações duplas.\n" -" * Perdas de memória.\n" +" * Liberações duplas (double-free).\n" +" * Vazamento de memória.\n" "* Automático como Java:\n" -" * Pausa na garbage collection.\n" -" * Atrasos destruidores.\n" +" * Pausa para coleta de lixo.\n" +" * Atrasos na execução de destrutores.\n" "* Baseado em escopo como C++:\n" -" * Complexo, opt-in pelo programador.\n" -" *Potencial para uso pós-livre.\n" -"* Reforçado pelo compilador e baseado em escopo como Rust:\n" -" * Alguma complexage inicial.\n" +" * Complexo, o programador deve optar em utilizá-las.\n" +" * Potencial para uso pós-livre (user-after-free).\n" +"* Obrigado pelo compilador e baseado em escopo como Rust:\n" +" * Alguma complexidade inicial.\n" " * Pode rejeitar programas válidos." #: src/ownership.md:1 @@ -4328,16 +3943,14 @@ msgid "" "All variable bindings have a _scope_ where they are valid and it is an error to\n" "use a variable outside its scope:" msgstr "" -"Todas as associações de variáveis têm um _scope_ onde são válidas e é um erro\n" -"use uma variável fora de seu escopo:" +"Todas as associações de variáveis têm um _escopo_ onde são válidas e é um erro\n" +"usar uma variável fora de seu escopo:" #: src/ownership.md:6 msgid "" "```rust,editable,compile_fail\n" "struct Point(i32, i32);" msgstr "" -"```rust,editable,compile_fail\n" -"struct Point(i32, i32);" #: src/ownership.md:9 msgid "" @@ -4350,14 +3963,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" {\n" -" let p = Point(3, 4);\n" -" println!(\"x: {}\", p.0);\n" -" }\n" -" println!(\"y: {}\", p.1);\n" -"}\n" -"```" #: src/ownership.md:18 msgid "" @@ -4366,12 +3971,12 @@ msgid "" "* We say that the variable _owns_ the value." msgstr "" "* No final do escopo, a variável é _dropada_ e os dados são liberados.\n" -"* Um destruidor pode ser executado aqui para liberar recursos.\n" -"* Dizemos que a variável _possui_ o valor." +"* Um destrutor pode ser executado aqui para liberar recursos.\n" +"* Dizemos que a variável _possui_ (é dona) o valor." #: src/ownership/move-semantics.md:1 msgid "# Move Semantics" -msgstr "# Mover semântica" +msgstr "# Semântica de mover (move)" #: src/ownership/move-semantics.md:3 msgid "An assignment will transfer ownership between variables:" @@ -4388,14 +3993,6 @@ msgid "" "}\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:14 msgid "" @@ -4413,15 +4010,15 @@ msgstr "" #: src/ownership/move-semantics.md:22 msgid "" -"* Mention that this is the opposite of the defaults in C++, which copies by value unless you use " -"`std::move` (and the move constructor is defined!)." +"* Mention that this is the opposite of the defaults in C++, which copies by value unless you use `std::move` (and the move " +"constructor is defined!)." msgstr "" -"* Mencione que isso é o oposto dos padrões em C++, que copia por valor, a menos que você use `std::" -"move` (e o construtor de movimento esteja definido!)." +"* Mencione que isso é o oposto dos padrões em C++, que copia por valor, a menos que você use `std::move` (e o construtor de " +"movimento esteja definido!)." #: src/ownership/move-semantics.md:24 msgid "* In Rust, you clones are explicit (by using `clone`)." -msgstr "* No Rust, seus clones são explícitos (usando `clone`)." +msgstr "* No Rust, clones são explícitos (usando `clone`)." #: src/ownership/moved-strings-rust.md:1 msgid "# Moved Strings in Rust" @@ -4436,19 +4033,13 @@ msgid "" "}\n" "```" msgstr "" -"```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:10 msgid "" "* The heap data from `s1` is reused for `s2`.\n" "* When `s1` goes out of scope, nothing happens (it has been moved from)." msgstr "" -"* Os dados heap de `s1` são reutilizados para `s2`.\n" +"* Os dados no heap de `s1` são reutilizados para `s2`.\n" "* Quando `s1` sai do escopo, nada acontece (foi movido de)." #: src/ownership/moved-strings-rust.md:13 @@ -4456,6 +4047,7 @@ msgid "Before move to `s2`:" msgstr "Antes de mover para `s2`:" #: src/ownership/moved-strings-rust.md:15 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -4472,26 +4064,13 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -"```bob\n" -" Pilha\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n" -": : : :\n" -":s1 : : :\n" -": +-----------+-------+ : : +----+----+----+----+ :\n" -": | ptr | o---+---+-----+-->| R | você | s | t | :\n" -": | len | 4 | : : +----+----+----+----+ :\n" -": | capacage | 4 | : : :\n" -": +-----------+-------+ : : :\n" -": : `- - - - - - - - - - - - -'\n" -": :\n" -"`- - - - - - - - - - - - - -'\n" -"```" #: src/ownership/moved-strings-rust.md:30 msgid "After move to `s2`:" msgstr "Depois de mover para `s2`:" #: src/ownership/moved-strings-rust.md:32 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -4514,30 +4093,10 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -"```bob\n" -" Pilha\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n" -": : : :\n" -": s1 \"(inacessível)\" : : :\n" -": +-----------+-------+ : : +----+----+----+----+ :\n" -": | ptr | o---+---+--+--+-->| R | você | s | t | :\n" -": | len | 4 | : | : +----+----+----+----+:\n" -": | capacage | 4 | : | : :\n" -": +-----------+-------+ : | : :\n" -": : | `- - - - - - - - - - - - - -'\n" -": s2 : |\n" -": +-----------+-------+ : |\n" -": | ptr | o---+---+--'\n" -": | len | 4 | :\n" -": | capacage | 4 | :\n" -": +-----------+-------+ :\n" -": :\n" -"`- - - - - - - - - - - - - -'\n" -"```" #: src/ownership/double-free-modern-cpp.md:1 msgid "# Double Frees in Modern C++" -msgstr "# Liberações duplas em C++ moderno" +msgstr "# Liberações duplas (double-free) em C++ moderno" #: src/ownership/double-free-modern-cpp.md:3 msgid "Modern C++ solves this differently:" @@ -4552,7 +4111,7 @@ msgid "" msgstr "" "```c++\n" "std::string s1 = \"Cpp\";\n" -"std::string s2 = s1; // Duplica os dados em s1.\n" +"std::string s2 = s1; // Duplica os dados em s1.\n" "```" #: src/ownership/double-free-modern-cpp.md:10 @@ -4560,14 +4119,15 @@ msgid "" "* The heap data from `s1` is duplicated and `s2` gets its own independent copy.\n" "* When `s1` and `s2` go out of scope, they each free their own memory." msgstr "" -"* Os dados heap de `s1` são duplicados e `s2` obtém sua própria cópia independente.\n" +"* Os dados de `s1` no heap são duplicados e `s2` obtém sua própria cópia independente.\n" "* Quando `s1` e `s2` saem do escopo, cada um libera sua própria memória." #: src/ownership/double-free-modern-cpp.md:13 msgid "Before copy-assignment:" -msgstr "Antes da atribuição de cópias:" +msgstr "Antes da atribuição por cópias:" #: src/ownership/double-free-modern-cpp.md:16 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -4583,25 +4143,13 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -"```bob\n" -" Pilha\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n" -": : : :\n" -":s1 : : :\n" -": +-----------+-------+ : : +----+----+----+ :\n" -": | ptr | o---+---+--+--+-->| C | p | p | :\n" -": | len | 3 | : : +----+----+----+ :\n" -": | capacage | 3 | : : :\n" -": +-----------+-------+ : : :\n" -": : `- - - - - - - - - - -'\n" -"`- - - - - - - - - - - - - -'\n" -"```" #: src/ownership/double-free-modern-cpp.md:30 msgid "After copy-assignment:" -msgstr "Após atribuição de cópia:" +msgstr "Após atribuição por cópia:" #: src/ownership/double-free-modern-cpp.md:32 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -4624,38 +4172,18 @@ msgid "" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" -"```bob\n" -" Pilha\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - -.\n" -": : : :\n" -":s1 : : :\n" -": +-----------+-------+ : : +----+----+----+ :\n" -": | ptr | o---+---+--+--+-->| C | p | p | :\n" -": | len | 3 | : : +----+----+----+ :\n" -": | capacage | 3 | : : :\n" -": +-----------+-------+ : : :\n" -": : : :\n" -":s2 : : :\n" -": +-----------+-------+ : : +----+----+----+ :\n" -": | ptr | o---+---+-----+-->| C | p | p | :\n" -": | len | 3 | : : +----+----+----+ :\n" -": | capacage | 3 | : : :\n" -": +-----------+-------+ : : :\n" -": : `- - - - - - - - - - -'\n" -"`- - - - - - - - - - - - - -'\n" -"```" #: src/ownership/moves-function-calls.md:1 msgid "# Moves in Function Calls" -msgstr "# Movimentos em Chamadas de Função" +msgstr "# Movimentos em chamadas de Função" #: src/ownership/moves-function-calls.md:3 msgid "" "When you pass a value to a function, the value is assigned to the function\n" "parameter. This transfers ownership:" msgstr "" -"Quando você passa um valor para uma função, o valor é atribuído à função\n" -"parâmetro. Isso transfere a ownership:" +"Quando você passa um valor para uma função, o valor é atribuído ao parâmetro\n" +"da função. Isso transfere a ownership:" #: src/ownership/moves-function-calls.md:6 msgid "" @@ -4664,10 +4192,6 @@ msgid "" " println!(\"Hello {name}\")\n" "}" msgstr "" -"```rust, editable\n" -"fn say_hello(name: String) {\n" -" println!(\"Hello {name}\")\n" -"}" #: src/ownership/moves-function-calls.md:11 msgid "" @@ -4678,32 +4202,26 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let name = String::from(\"Alice\");\n" -" say_hello(name);\n" -" // say_hello(name);\n" -"}\n" -"```" #: src/ownership/moves-function-calls.md:20 msgid "" -"* With the first call to `say_hello`, `main` gives up ownership of `name`. Afterwards, `name` " -"cannot be used anymore within `main`.\n" +"* With the first call to `say_hello`, `main` gives up ownership of `name`. Afterwards, `name` cannot be used anymore within " +"`main`.\n" "* The heap memory allocated for `name` will be freed at the end of the `say_hello` function.\n" -"* `main` can retain ownership if it passes `name` as a reference (`&name`) and if `say_hello` " -"accepts a reference as a parameter.\n" +"* `main` can retain ownership if it passes `name` as a reference (`&name`) and if `say_hello` accepts a reference as a " +"parameter.\n" "* Alternatively, `main` can pass a clone of `name` in the first call (`name.clone()`).\n" -"* Rust makes it harder than C++ to inadvertently create copies by making move semantics the " -"default, and by forcing programmers to make clones explicit." +"* Rust makes it harder than C++ to inadvertently create copies by making move semantics the default, and by forcing " +"programmers to make clones explicit." msgstr "" -"* Com a primeira chamada para `say_hello`, `main` desiste da ownership de `name`. Depois disso, " -"`name` não pode mais ser usado dentro de `main`.\n" +"* Com a primeira chamada para `say_hello`, `main` desiste da ownership de `name`. Depois disso, `name` não pode mais ser " +"usado dentro de `main`.\n" "* A memória heap alocada para `name` será liberada no final da função `say_hello`.\n" -"* `main` pode manter a ownership se passar `name` como uma referência (`&name`) e se `say_hello` " -"aceitar uma referência como um parâmetro.\n" +"* `main` pode manter a ownership se passar `name` como uma referência (`&name`) e se `say_hello` aceitar uma referência " +"como um parâmetro.\n" "* Alternativamente, `main` pode passar um clone de `name` na primeira chamada (`name.clone()`).\n" -"* Rust torna mais difícil do que C++ criar cópias inadvertidamente, tornando a semântica de " -"movimento o padrão e forçando os programadores a tornar os clones explícitos." +"* Rust torna mais difícil do que C++ criar cópias inadvertidamente, tornando a semântica de movimento o padrão e forçando " +"os programadores a tornar os clones explícitos." #: src/ownership/copy-clone.md:1 msgid "# Copying and Cloning" @@ -4785,15 +4303,12 @@ msgstr "Copiar e clonar não são a mesma coisa:" msgid "" "* Copying refers to bitwise copies of memory regions and does not work on arbitrary objects.\n" "* Copying does not allow for custom logic (unlike copy constructors in C++).\n" -"* Cloning is a more general operation and also allows for custom behavior by implementing the " -"`Clone` trait.\n" +"* Cloning is a more general operation and also allows for custom behavior by implementing the `Clone` trait.\n" "* Copying does not work on types that implement the `Drop` trait." msgstr "" -"* A cópia refere-se a cópias bit a bit de regiões de memória e não funciona em objetos " -"arbitrários.\n" +"* A cópia refere-se a cópias bit a bit de regiões de memória e não funciona em objetos arbitrários.\n" "* A cópia não permite lógica personalizada (ao contrário dos construtores de cópia em C++).\n" -"* A clonagem é uma operação mais geral e também permite um comportamento personalizado " -"implementando a trait `Clone`.\n" +"* A clonagem é uma operação mais geral e também permite um comportamento personalizado implementando a trait `Clone`.\n" "* A cópia não funciona em tipos que implementam a característica `Drop`." #: src/ownership/copy-clone.md:42 src/ownership/lifetimes-function-calls.md:29 @@ -4802,29 +4317,23 @@ msgstr "No exemplo acima, tente o seguinte:" #: src/ownership/copy-clone.md:44 msgid "" -"* Add a `String` field to `struct Point`. It will not compile because `String` is not a `Copy` " -"type.\n" -"* Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for " -"`p1`.\n" +"* Add a `String` field to `struct Point`. It will not compile because `String` is not a `Copy` type.\n" +"* Remove `Copy` from the `derive` attribute. The compiler error is now in the `println!` for `p1`.\n" "* Show that it works if you clone `p1` instead." msgstr "" -"* Adicione um campo `String` ao `struct Point`. Não irá compilar porque `String` não é um tipo " -"`Copy`.\n" +"* Adicione um campo `String` ao `struct Point`. Não irá compilar porque `String` não é um tipo `Copy`.\n" "* Remova `Copy` do atributo `derive`. O erro do compilador agora está no `println!` para `p1`.\n" "* Mostre que funciona se você clonar `p1` em vez disso." #: src/ownership/copy-clone.md:48 msgid "" -"If students ask about `derive`, it is sufficient to say that this is a way to generate code in " -"Rust\n" -"at compile time. In this case the default implementations of `Copy` and `Clone` traits are " -"generated.\n" +"If students ask about `derive`, it is sufficient to say that this is a way to generate code in Rust\n" +"at compile time. In this case the default implementations of `Copy` and `Clone` traits are generated.\n" " \n" "" msgstr "" "Se os alunos perguntarem sobre `derive`, basta dizer que esta é uma forma de gerar código em Rust\n" -"em tempo de compilação. Nesse caso, as implementações padrão dos traits `Copy` e `Clone` são " -"geradas.\n" +"em tempo de compilação. Nesse caso, as implementações padrão dos traits `Copy` e `Clone` são geradas.\n" " \n" "" @@ -4889,16 +4398,14 @@ msgstr "" #: src/ownership/borrowing.md:27 msgid "" "Notes on stack returns:\n" -"* 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]. In the " -"\"DEBUG\" optimization level, the addresses should change, while the stay the same when changing " -"to the \"RELEASE\" setting:" +"* 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]. In the \"DEBUG\" optimization level, the addresses should " +"change, while the stay the same when changing to the \"RELEASE\" setting:" msgstr "" "Notas sobre retornos de pilha:\n" -"* Demonstre que o retorno de `add` é barato porque o compilador pode eliminar a operação de cópia. " -"Altere o código acima para imprimir endereços de pilha e execute-o no [Playground]. No nível de " -"otimização \"DEBUG\", os endereços devem mudar, enquanto os permanecem os mesmos ao mudar para a " -"configuração \"RELEASE\":" +"* Demonstre que o retorno de `add` é barato porque o compilador pode eliminar a operação de cópia. Altere o código acima " +"para imprimir endereços de pilha e execute-o no [Playground]. No nível de otimização \"DEBUG\", os endereços devem mudar, " +"enquanto os permanecem os mesmos ao mudar para a configuração \"RELEASE\":" #: src/ownership/borrowing.md:30 msgid "" @@ -4935,9 +4442,8 @@ msgid "" " }\n" " ```\n" "* The Rust compiler can do return value optimization (RVO).\n" -"* 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 " -"performs a simple and efficient `memcpy` copy." +"* 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 performs a simple and efficient `memcpy` copy." msgstr "" " fn main() {\n" " let p1 = Point(3, 4);\n" @@ -4948,9 +4454,9 @@ msgstr "" " }\n" " ```\n" "* O compilador Rust pode fazer otimização de valor de retorno (RVO).\n" -"* Em C++, a elisão de cópia deve ser definida na especificação da linguagem porque os construtores " -"podem ter efeitos colaterais. Em Rust, isso não é um problema. Se o RVO não aconteceu, o Rust " -"sempre executará uma cópia `memcpy` simples e eficiente." +"* Em C++, a elisão de cópia deve ser definida na especificação da linguagem porque os construtores podem ter efeitos " +"colaterais. Em Rust, isso não é um problema. Se o RVO não aconteceu, o Rust sempre executará uma cópia `memcpy` simples e " +"eficiente." #: src/ownership/borrowing.md:53 msgid "[Playground]: https://play.rust-lang.org/" @@ -5010,20 +4516,17 @@ msgstr "" #: src/ownership/shared-unique-borrows.md:25 msgid "" -"* The above code does not compile because `a` is borrowed as mutable (through `c`) and as " -"immutable (through `b`) at the same time.\n" -"* Move the `println!` statement for `b` before the scope that introduces `c` to make the code " -"compile.\n" -"* After that change, the compiler realizes that `b` is only ever used before the new mutable " -"borrow of `a` through `c`. This is a feature of the borrow checker called \"non-lexical " -"lifetimes\"." -msgstr "" -"* O código acima não compila porque `a` é emprestado como mutável (através de `c`) e como imutável " -"(através de `b`) ao mesmo tempo.\n" -"* Mova a instrução `println!` para `b` antes do escopo que introduz `c` para fazer o código " -"compilar.\n" -"* Após essa alteração, o compilador percebe que `b` só é usado antes do novo empréstimo mutável de " -"`a` a `c`. Este é um recurso do verificador de empréstimo chamado \"tempo de vida não lexical\"." +"* The above code does not compile because `a` is borrowed as mutable (through `c`) and as immutable (through `b`) at the " +"same time.\n" +"* Move the `println!` statement for `b` before the scope that introduces `c` to make the code compile.\n" +"* After that change, the compiler realizes that `b` is only ever used before the new mutable borrow of `a` through `c`. " +"This is a feature of the borrow checker called \"non-lexical lifetimes\"." +msgstr "" +"* O código acima não compila porque `a` é emprestado como mutável (através de `c`) e como imutável (através de `b`) ao " +"mesmo tempo.\n" +"* Mova a instrução `println!` para `b` antes do escopo que introduz `c` para fazer o código compilar.\n" +"* Após essa alteração, o compilador percebe que `b` só é usado antes do novo empréstimo mutável de `a` a `c`. Este é um " +"recurso do verificador de empréstimo chamado \"tempo de vida não lexical\"." #: src/ownership/lifetimes.md:1 msgid "# Lifetimes" @@ -5105,14 +4608,12 @@ msgstr "" #: src/ownership/lifetimes-function-calls.md:31 msgid "" -"* Move the declaration of `p2` and `p3` into a a new scope (`{ ... }`), resulting in the following " -"code:\n" +"* Move the declaration of `p2` and `p3` into a a new scope (`{ ... }`), resulting in the following code:\n" " ```rust,ignore\n" " #[derive(Debug)]\n" " struct Point(i32, i32);" msgstr "" -"* Mova a declaração de `p2` e `p3` para um novo escopo (`{ ... }`), resultando no seguinte " -"código:\n" +"* Mova a declaração de `p2` e `p3` para um novo escopo (`{ ... }`), resultando no seguinte código:\n" " ```rust, ignore\n" " #[derive(Debug)]\n" " struct Point(i32, i32);" @@ -5155,26 +4656,22 @@ msgstr "" #: src/ownership/lifetimes-function-calls.md:52 msgid "" -"* Reset the workspace and change the function signature to `fn left_most<'a, 'b>(p1: &'a Point, " -"p2: &'a Point) -> &'b Point`. This will not compile because the relationship between the lifetimes " -"`'a` and `'b` is unclear.\n" +"* Reset the workspace and change the function signature to `fn left_most<'a, 'b>(p1: &'a Point, p2: &'a Point) -> &'b " +"Point`. This will not compile because the relationship between the lifetimes `'a` and `'b` is unclear.\n" "* Another way to explain it:\n" " * Two references to two values are borrowed by a function and the function returns\n" " another reference.\n" " * It must have come from one of those two inputs (or from a global variable).\n" -" * Which one is it? The compiler needs to to know, so at the call site the returned reference is " -"not used\n" +" * Which one is it? The compiler needs to to know, so at the call site the returned reference is not used\n" " for longer than a variable from where the reference came from." msgstr "" -"* Redefina o espaço de trabalho e altere a assinatura da função para `fn left_most<'a, 'b>(p1: &'a " -"Point, p2: &'a Point) -> &'b Point`. Isso não será compilado porque a relação entre os tempos de " -"vida `'a` e `'b` não é clara.\n" +"* Redefina o espaço de trabalho e altere a assinatura da função para `fn left_most<'a, 'b>(p1: &'a Point, p2: &'a Point) -> " +"&'b Point`. Isso não será compilado porque a relação entre os tempos de vida `'a` e `'b` não é clara.\n" "* Outra forma de explicar:\n" " * Duas referências a dois valores são emprestadas por uma função e a função retorna\n" " outra referência.\n" " * Deve ter vindo de uma dessas duas entradas (ou de uma variável global).\n" -" * Qual é? O compilador precisa saber, portanto, no local da chamada, a referência retornada não " -"é usada\n" +" * Qual é? O compilador precisa saber, portanto, no local da chamada, a referência retornada não é usada\n" " por mais tempo do que uma variável de onde veio a referência." #: src/ownership/lifetimes-data-structures.md:1 @@ -5229,29 +4726,27 @@ msgstr "" #: src/ownership/lifetimes-data-structures.md:25 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.\n" -"* If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker " -"throws an error.\n" -"* Types with borrowed data force users to hold on to the original data. This can be useful for " -"creating lightweight views, but it generally makes them somewhat harder to use.\n" +"* 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.\n" +"* If `text` is consumed before the end of the lifetime of `fox` (or `dog`), the borrow checker throws an error.\n" +"* Types with borrowed data force users to hold on to the original data. This can be useful for creating lightweight views, " +"but it generally makes them somewhat harder to use.\n" "* When possible, make data structures own their data directly.\n" -"* Some structs with multiple references inside can have more than one lifetime annotation. This " -"can be necessary if there is a need to describe lifetime relationships between the references " -"themselves, in addition to the lifetime of the struct itself. Those are very advanced use cases.\n" +"* Some structs with multiple references inside can have more than one lifetime annotation. This can be necessary if there " +"is a need to describe lifetime relationships between the references themselves, in addition to the lifetime of the struct " +"itself. Those are very advanced use cases.\n" "" msgstr "" -"* No exemplo acima, a anotação em `Highlight` impõe que os dados subjacentes ao `&str` contido " -"vivam pelo menos tanto quanto qualquer instância de `Highlight` que usa esses dados.\n" -"* Se `text` for consumido antes do final do tempo de vida de `fox` (ou `dog`), o verificador de " -"empréstimo lançará um erro.\n" -"* Tipos com dados emprestados forçam os usuários a manter os dados originais. Isso pode ser útil " -"para criar exibições leves, mas geralmente as torna um pouco mais difíceis de usar.\n" +"* No exemplo acima, a anotação em `Highlight` impõe que os dados subjacentes ao `&str` contido vivam pelo menos tanto " +"quanto qualquer instância de `Highlight` que usa esses dados.\n" +"* Se `text` for consumido antes do final do tempo de vida de `fox` (ou `dog`), o verificador de empréstimo lançará um " +"erro.\n" +"* Tipos com dados emprestados forçam os usuários a manter os dados originais. Isso pode ser útil para criar exibições " +"leves, mas geralmente as torna um pouco mais difíceis de usar.\n" "* Quando possível, faça com que as Structs de dados possuam seus dados diretamente.\n" -"* Algumas Structs com várias referências internas podem ter mais de uma anotação vitalícia. Isso " -"pode ser necessário se houver necessage de descrever relacionamentos de tempo de vida entre as " -"próprias referências, além do tempo de vida da própria estrutura. Esses são casos de uso muito " -"avançados.\n" +"* Algumas Structs com várias referências internas podem ter mais de uma anotação vitalícia. Isso pode ser necessário se " +"houver necessage de descrever relacionamentos de tempo de vida entre as próprias referências, além do tempo de vida da " +"própria estrutura. Esses são casos de uso muito avançados.\n" "" #: src/exercises/day-1/afternoon.md:1 @@ -5324,11 +4819,12 @@ msgid "" " books: Vec,\n" "}" msgstr "" -"library struct {\n" +"struct Library {\n" " books: Vec,\n" "}" #: src/exercises/day-1/book-library.md:28 src/exercises/day-1/solutions-afternoon.md:27 +#, fuzzy msgid "" "struct Book {\n" " title: String,\n" @@ -5341,6 +4837,7 @@ msgstr "" "}" #: src/exercises/day-1/book-library.md:33 src/exercises/day-1/solutions-afternoon.md:32 +#, fuzzy msgid "" "impl Book {\n" " // This is a constructor, used below.\n" @@ -5379,6 +4876,7 @@ msgstr "" "}" #: src/exercises/day-1/book-library.md:50 +#, fuzzy msgid "" "impl Library {\n" " fn new() -> Library {\n" @@ -5387,7 +4885,7 @@ msgid "" msgstr "" "impl Library {\n" " fn new() -> Library {\n" -" não implementado!()\n" +" unimplemented!()\n" " }" #: src/exercises/day-1/book-library.md:55 @@ -5397,8 +4895,8 @@ msgid "" " //}" msgstr "" " //fn len(self) -> usize {\n" -" // não implementado!()\n" -" ///}" +" // unimplemented!()\n" +" //}" #: src/exercises/day-1/book-library.md:59 msgid "" @@ -5407,8 +4905,8 @@ msgid "" " //}" msgstr "" " //fn is_empty(self) -> bool {\n" -" // não implementado!()\n" -" ///}" +" // unimplemented!()\n" +" //}" #: src/exercises/day-1/book-library.md:63 msgid "" @@ -5417,8 +4915,8 @@ msgid "" " //}" msgstr "" " //fn add_book(self, book: Book) {\n" -" // não implementado!()\n" -" ///}" +" // unimplemented!()\n" +" //}" #: src/exercises/day-1/book-library.md:67 msgid "" @@ -5427,8 +4925,8 @@ msgid "" " //}" msgstr "" " //fn print_books(self) {\n" -" // não implementado!()\n" -" ///}" +" // unimplemented!()\n" +" //}" #: src/exercises/day-1/book-library.md:71 msgid "" @@ -5438,8 +4936,8 @@ msgid "" "}" msgstr "" " //fn oldest_book(self) -> Option<&Book> {\n" -" // não implementado!()\n" -" ///}\n" +" // unimplemented!()\n" +" //}\n" "}" #: src/exercises/day-1/book-library.md:76 @@ -5459,6 +4957,7 @@ msgstr "" " let library = Library::new();" #: src/exercises/day-1/book-library.md:83 +#, fuzzy msgid "" " //println!(\"Our library is empty: {}\", library.is_empty());\n" " //\n" @@ -5486,7 +4985,7 @@ msgstr "" " //corresponde à library.oldest_book() {\n" " // Some(book) => println!(\"Meu livro mais antigo é {book}\"),\n" " // None => println!(\"Minha biblioteca está vazia!\"),\n" -" ///}\n" +" //}\n" " //\n" " //println!(\"Nossa biblioteca tem {} livros\", library.len());\n" "}\n" @@ -5594,8 +5093,7 @@ msgstr "" " let v: Vec = vec![10, 20, 30];\n" " let mut iter = v.iter();" -#: src/exercises/day-1/iterators-and-ownership.md:41 -#: src/exercises/day-1/iterators-and-ownership.md:78 +#: src/exercises/day-1/iterators-and-ownership.md:41 src/exercises/day-1/iterators-and-ownership.md:78 msgid "" " let v0: Option<..> = iter.next();\n" " println!(\"v0: {v0:?}\");\n" @@ -5741,20 +5239,16 @@ msgstr "Qual é o tipo de `palavra` em cada loop?" msgid "" "Experiment with the code above and then consult the documentation for [`impl\n" "IntoIterator for\n" -"&Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-" -"%26%27a%20Vec%3CT%2C%20A%3E)\n" +"&Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-%26%27a%20Vec%3CT%2C%20A%3E)\n" "and [`impl IntoIterator for\n" -"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-" -"Vec%3CT%2C%20A%3E)\n" +"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-Vec%3CT%2C%20A%3E)\n" "to check your answers." msgstr "" "Experimente o código acima e depois consulte a documentação para [`impl\n" "IntoIterator para\n" -"&Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-" -"%26%27a%20Vec%3CT%2C%20A%3E)\n" +"&Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-%26%27a%20Vec%3CT%2C%20A%3E)\n" "e [`impl IntoIterator para\n" -"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-" -"Vec%3CT%2C%20A%3E)\n" +"Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-IntoIterator-for-Vec%3CT%2C%20A%3E)\n" "para verificar suas respostas." #: src/welcome-day-2.md:1 @@ -5836,18 +5330,18 @@ msgid "" "```" msgstr "" "fn main() {\n" -" let mut peter = Person {\n" +" let mut pedro = Person {\n" " name: String::from(\"Pedro\"),\n" " age: 27,\n" " };\n" -" println!(\"{} is {} years old\", peter.name, peter.age);\n" +" println!(\"{} is {} years old\", pedro.name, pedro.age);\n" " \n" -" peter.age = 28;\n" -" println!(\"{} is {} years old\", peter.name, peter.age);\n" +" pedro.age = 28;\n" +" println!(\"{} is {} years old\", pedro.name, pedro.age);\n" " \n" " let jackie = Person {\n" " name: String::from(\"Jackie\"),\n" -" ..Pedro\n" +" ..pedro\n" " };\n" " println!(\"{} is {} years old\", jackie.name, jackie.age);\n" "}\n" @@ -5868,21 +5362,19 @@ msgid "" " * Unlike in C++, there is no inheritance between structs.\n" "* Methods are defined in an `impl` block, which we will see in following slides.\n" "* This may be a good time to let people know there are different types of structs. \n" -" * Zero-sized structs `e.g., struct Foo;` might be used when implementing a trait on some type " -"but don’t have any data that you want to store in the value itself. \n" +" * Zero-sized structs `e.g., struct Foo;` might be used when implementing a trait on some type but don't have any data " +"that you want to store in the value itself. \n" " * The next slide will introduce Tuple structs, used when the field names are not important.\n" -"* The syntax `..peter` 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." +"* The syntax `..peter` 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 "" "* Structs funcionam como em C ou C++.\n" " * Como em C++, e ao contrário de C, nenhum typedef é necessário para definir um tipo.\n" " * Ao contrário do C++, não há herança entre structs.\n" "* Os métodos são definidos em um bloco `impl`, que veremos nos próximos slides.\n" -"* Este pode ser um bom momento para que as Persons saibam que existem diferentes tipos de " -"structs.\n" -" * Structs de tamanho zero `por exemplo, struct Foo;` podem ser usadas ao implementar uma " -"característica em algum tipo, mas não possuem nenhum dado que você deseja armazenar no próprio " -"valor.\n" +"* Este pode ser um bom momento para que as Persons saibam que existem diferentes tipos de structs.\n" +" * Structs de tamanho zero `por exemplo, struct Foo;` podem ser usadas ao implementar uma característica em algum tipo, " +"mas não possuem nenhum dado que você deseja armazenar no próprio valor.\n" " * O próximo slide apresentará as Structs Tuple." #: src/structs/tuple-structs.md:1 @@ -5967,19 +5459,17 @@ msgstr "```" #: src/structs/tuple-structs.md:37 msgid "" -"Newtypes are a great way to encode additional information about the value in a primitive type, for " -"example:\n" +"Newtypes are a great way to encode additional information about the value in a primitive type, for example:\n" " * The number is measured in some units: `Newtons` in the example above.\n" -" * 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)`.\n" +" * 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)`.\n" " \n" "" msgstr "" -"Newtypes são uma ótima maneira de codificar informações adicionais sobre o valor em um tipo " -"primitivo, por exemplo:\n" +"Newtypes são uma ótima maneira de codificar informações adicionais sobre o valor em um tipo primitivo, por exemplo:\n" " * O número é medido em algumas unages: `Newtons` no exemplo acima.\n" -" * O valor passou por alguma validação quando foi criado, então você não precisa mais validá-lo " -"novamente a cada uso: 'PhoneNumber(String)` ou `OddNumber(u32)`.\n" +" * O valor passou por alguma validação quando foi criado, então você não precisa mais validá-lo novamente a cada uso: " +"'PhoneNumber(String)` ou `OddNumber(u32)`.\n" " \n" "" @@ -6040,12 +5530,8 @@ msgstr "" "```" #: src/structs/field-shorthand.md:27 -msgid "" -"The `new` function could be written using `Self` as a type, as it is interchangeable with the " -"struct type name" -msgstr "" -"A função `new` pode ser escrita usando `Self` como um tipo, já que é intercambiável com o name do " -"tipo struct" +msgid "The `new` function could be written using `Self` as a type, as it is interchangeable with the struct type name" +msgstr "A função `new` pode ser escrita usando `Self` como um tipo, já que é intercambiável com o name do tipo struct" #: src/structs/field-shorthand.md:29 msgid "" @@ -6152,25 +5638,25 @@ msgstr "" #: src/enums.md:35 msgid "" "* Enumerations allow you to collect a set of values under one type\n" -"* This page offers an enum type `CoinFlip` with two variants `Heads` and `Tail`. You might note " -"the namespace when using variants.\n" +"* This page offers an enum type `CoinFlip` with two variants `Heads` and `Tail`. You might note the namespace when using " +"variants.\n" "* This might be a good time to compare Structs and Enums:\n" -" * In both, you can have a simple version without fields (unit struct) or one with different " -"types of fields (variant payloads). \n" +" * In both, you can have a simple version without fields (unit struct) or one with different types of fields (variant " +"payloads). \n" " * In both, associated functions are defined within an `impl` block.\n" -" * You could even implement the different variants of an enum with separate structs but then they " -"wouldn’t be the same type as they would if they were all defined in an enum. \n" +" * You could even implement the different variants of an enum with separate structs but then they wouldn't be the same " +"type as they would if they were all defined in an enum. \n" "" msgstr "" "* As enumerações permitem que você colete um conjunto de valores em um tipo\n" -"* Esta página oferece um tipo de Enum `CoinFlip` com duas variantes `Heads` e `Tail`. Você pode " -"observar o namespace ao usar variantes.\n" +"* Esta página oferece um tipo de Enum `CoinFlip` com duas variantes `Heads` e `Tail`. Você pode observar o namespace ao " +"usar variantes.\n" "* Este pode ser um bom momento para comparar Structs e Enums:\n" -" * Em ambos, você pode ter uma versão simples sem campos (unit struct) ou uma com diferentes " -"tipos de campos (variant payloads).\n" +" * Em ambos, você pode ter uma versão simples sem campos (unit struct) ou uma com diferentes tipos de campos (variant " +"payloads).\n" " * Em ambos, as funções associadas são definidas dentro de um bloco `impl`.\n" -" * Você pode até mesmo implementar as diferentes variantes de uma Enum com Structs separadas, mas " -"elas não seriam do mesmo tipo que seriam se todas fossem definidas em uma Enum.\n" +" * Você pode até mesmo implementar as diferentes variantes de uma Enum com Structs separadas, mas elas não seriam do mesmo " +"tipo que seriam se todas fossem definidas em uma Enum.\n" "" #: src/enums/variant-payloads.md:1 @@ -6230,7 +5716,7 @@ msgid "" msgstr "" "fn main() {\n" " let load = WebEvent::PageLoad;\n" -" let pressionar = WebEvent::KeyPress('x');\n" +" let press = WebEvent::KeyPress('x');\n" " let click = WebEvent::Click { x: 20, y: 80 };" #: src/enums/variant-payloads.md:27 @@ -6249,20 +5735,19 @@ msgstr "" #: src/enums/variant-payloads.md:35 msgid "" -"* In the above example, accessing the `char` in `KeyPress`, or `x` and `y` in `Click` only works " -"within a `match` or an `if let` statement.\n" +"* In the above example, accessing the `char` in `KeyPress`, or `x` and `y` in `Click` only works within a `match` or an `if " +"let` statement.\n" "* `match` and `if let` inspect a hidden discriminant field in the `enum`.\n" "* It is possible to retrieve the discriminant by calling `std::mem::discriminant()`\n" -" * This is useful, for example, if implementing `PartialEq` for structs where comparing field " -"values doesn't affect equality.\n" -"* `WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top level " -"`struct Click { ... }`. The inlined version cannot implement traits, for example." +" * This is useful, for example, if implementing `PartialEq` for structs where comparing field values doesn't affect " +"equality.\n" +"* `WebEvent::Click { ... }` is not exactly the same as `WebEvent::Click(Click)` with a top level `struct Click { ... }`. " +"The inlined version cannot implement traits, for example." msgstr "" -"* No exemplo acima, acessar o `char` em `KeyPress`, ou `x` e `y` em `Click` só funciona dentro de " -"uma instrução `match`.\n" +"* No exemplo acima, acessar o `char` em `KeyPress`, ou `x` e `y` em `Click` só funciona dentro de uma instrução `match`.\n" "* `match` inspeciona um campo discriminante oculto no `enum`.\n" -"* `WebEvent::Click { ... }` não é exatamente o mesmo que `WebEvent::Click(Click)` com um `struct " -"Click { ... }` de nível superior. A versão embutida não pode implementar traits, por exemplo." +"* `WebEvent::Click { ... }` não é exatamente o mesmo que `WebEvent::Click(Click)` com um `struct Click { ... }` de nível " +"superior. A versão embutida não pode implementar traits, por exemplo." #: src/enums/sizes.md:1 msgid "# Enum Sizes" @@ -6270,16 +5755,13 @@ msgstr "# Tamanhos de Enum" #: src/enums/sizes.md:3 msgid "Rust enums are packed tightly, taking constraints due to alignment into account:" -msgstr "" -"Rust enums são empacotados firmemente, levando em consideração as restrições devido ao alinhamento:" +msgstr "Rust enums são empacotados firmemente, levando em consideração as restrições devido ao alinhamento:" #: src/enums/sizes.md:5 msgid "" "```rust,editable\n" "use std::mem::{align_of, size_of};" msgstr "" -"```rust, editable\n" -"use std::mem::{align_of, size_of};" #: src/enums/sizes.md:8 msgid "" @@ -6290,12 +5772,6 @@ msgid "" " };\n" "}" msgstr "" -"macro_regras! dbg_size {\n" -" ($t:ty) => {\n" -" println!(\"{}: tamanho {} bytes, align: {} bytes\",\n" -" stringify!($t), size_of::<$t>(), align_of::<$t>());\n" -" };\n" -"}" #: src/enums/sizes.md:15 msgid "" @@ -6318,12 +5794,6 @@ msgid "" " C, // 10001\n" "}" msgstr "" -"#[repr(u32)]\n" -"enum Bar {\n" -" A, // 0\n" -" B = 10000,\n" -" C, // 10001\n" -"}" #: src/enums/sizes.md:27 msgid "" @@ -6337,15 +5807,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" dbg_size!(Foo);\n" -" dbg_size!(Bar);\n" -" dbg_size!(bool);\n" -" dbg_size!(Option);\n" -" dbg_size!(&i32);\n" -" dbg_size!(Option<&i32>);\n" -"}\n" -"```" #: src/enums/sizes.md:37 msgid "* See the [Rust Reference](https://doc.rust-lang.org/reference/type-layout.html)." @@ -6357,35 +5818,33 @@ msgid "" " \n" "Key Points: \n" " * Internally Rust is using a field (discriminant) to keep track of the enum variant.\n" -" * `Bar` enum demonstrates that there is a way to control the discriminant value and type. If " -"`repr` is removed, the discriminant type takes 2 bytes, becuase 10001 fits 2 bytes.\n" -" * As a niche optimization an enum discriminant is merged with the pointer so that `Option<&Foo>` " -"is the same size as `&Foo`.\n" +" * `Bar` enum demonstrates that there is a way to control the discriminant value and type. If `repr` is removed, the " +"discriminant type takes 2 bytes, becuase 10001 fits 2 bytes.\n" +" * As a niche optimization an enum discriminant is merged with the pointer so that `Option<&Foo>` is the same size as " +"`&Foo`.\n" " * `Option` is another example of tight packing.\n" -" * For [some types](https://doc.rust-lang.org/std/option/#representation), Rust guarantees that " -"`size_of::()` equals `size_of::>()`.\n" -" * Zero-sized types allow for efficient implementation of `HashSet` using `HashMap` with `()` as " -"the value." +" * For [some types](https://doc.rust-lang.org/std/option/#representation), Rust guarantees that `size_of::()` equals " +"`size_of::>()`.\n" +" * Zero-sized types allow for efficient implementation of `HashSet` using `HashMap` with `()` as the value." msgstr "" "
\n" " \n" "Points chave:\n" " * Internamente Rust está usando um campo (discriminante) para acompanhar a variante enum.\n" -" * A Enum `Bar` demonstra que existe uma maneira de controlar o valor e o tipo discriminante. Se " -"`repr` for removido, o tipo discriminante ocupa 2 bytes, porque 10001 cabe 2 bytes.\n" -" * Como uma otimização de nicho, um discriminante de Enum é mesclado com o ponteiro para que " -"`Option<&Foo>` seja do mesmo tamanho que `&Foo`.\n" +" * A Enum `Bar` demonstra que existe uma maneira de controlar o valor e o tipo discriminante. Se `repr` for removido, o " +"tipo discriminante ocupa 2 bytes, porque 10001 cabe 2 bytes.\n" +" * Como uma otimização de nicho, um discriminante de Enum é mesclado com o ponteiro para que `Option<&Foo>` seja do mesmo " +"tamanho que `&Foo`.\n" " * `Option` é outro exemplo de empacotamento compacto.\n" -" * Para [alguns tipos](https://doc.rust-lang.org/std/option/#representation), Rust garante que " -"`size_of::()` é igual a `size_of:: >()`.\n" -" * Tipos de tamanho zero permitem a implementação eficiente de `HashSet` usando `HashMap` com `()` " -"como valor." +" * Para [alguns tipos](https://doc.rust-lang.org/std/option/#representation), Rust garante que `size_of::()` é igual a " +"`size_of:: >()`.\n" +" * Tipos de tamanho zero permitem a implementação eficiente de `HashSet` usando `HashMap` com `()` como valor." #: src/enums/sizes.md:49 msgid "" "Example code if you want to show how the bitwise representation *may* look like in practice.\n" -"It's important to note that the compiler provides no guarantees regarding this representation, " -"therefore this is totally unsafe." +"It's important to note that the compiler provides no guarantees regarding this representation, therefore this is totally " +"unsafe." msgstr "" #: src/enums/sizes.md:52 @@ -6393,8 +5852,6 @@ msgid "" "```rust,editable\n" "use std::mem::transmute;" msgstr "" -"```rust, editable\n" -"use std::thread;" #: src/enums/sizes.md:55 src/enums/sizes.md:94 msgid "" @@ -6404,12 +5861,6 @@ msgid "" " };\n" "}" msgstr "" -"macro_regras! dbg_size {\n" -" ($t:ty) => {\n" -" println!(\"{}: tamanho {} bytes, align: {} bytes\",\n" -" stringify!($t), size_of::<$t>(), align_of::<$t>());\n" -" };\n" -"}" #: src/enums/sizes.md:61 msgid "" @@ -6450,9 +5901,7 @@ msgid "" msgstr "" #: src/enums/sizes.md:87 -msgid "" -"More complex example if you want to discuss what happens when we chain more than 256 `Option`s " -"together." +msgid "More complex example if you want to discuss what happens when we chain more than 256 `Option`s together." msgstr "" #: src/enums/sizes.md:89 @@ -6460,10 +5909,12 @@ msgid "" "```rust,editable\n" "#![recursion_limit = \"1000\"]" msgstr "" +"```rust,editable\n" +"#![recursion_limit = \"1000\"]" #: src/enums/sizes.md:92 msgid "use std::mem::transmute;" -msgstr "use std::os::raw::c_int;" +msgstr "use std::mem::transmute;" #: src/enums/sizes.md:100 msgid "" @@ -6562,40 +6013,34 @@ msgstr "" msgid "" "Key Points:\n" "* It can be helpful to introduce methods by comparing them to functions.\n" -" * Methods are called on an instance of a type (such as a struct or enum), the first parameter " -"represents the instance as `self`.\n" -" * Developers may choose to use methods to take advantage of method receiver syntax and to help " -"keep them more organized. By using methods we can keep all the implementation code in one " -"predictable place.\n" +" * Methods are called on an instance of a type (such as a struct or enum), the first parameter represents the instance as " +"`self`.\n" +" * Developers may choose to use methods to take advantage of method receiver syntax and to help keep them more organized. " +"By using methods we can keep all the implementation code in one predictable place.\n" "* Point out the use of the keyword `self`, a method receiver. \n" -" * Show that it is an abbreviated term for `self:&Self` and perhaps show how the struct name " -"could also be used. \n" -" * Explain that `Self` is a type alias for the type the `impl` block is in and can be used " -"elsewhere in the block.\n" -" * Note how `self` is used like other structs and dot notation can be used to refer to individual " -"fields.\n" -" * This might be a good time to demonstrate how the `&self` differs from `self` by modifying the " -"code and trying to run say_hello twice. \n" +" * Show that it is an abbreviated term for `self:&Self` and perhaps show how the struct name could also be used. \n" +" * Explain that `Self` is a type alias for the type the `impl` block is in and can be used elsewhere in the block.\n" +" * Note how `self` is used like other structs and dot notation can be used to refer to individual fields.\n" +" * This might be a good time to demonstrate how the `&self` differs from `self` by modifying the code and trying to run " +"say_hello twice. \n" "* We describe the distinction between method receivers next.\n" " \n" "
" msgstr "" "Points chave:\n" "* Pode ser útil introduzir métodos comparando-os com funções.\n" -" * Métodos são chamados em uma instância de um tipo (como struct ou enum), o primeiro parâmetro " -"representa a instância como `self`.\n" -" * Os desenvolvedores podem optar por usar métodos para aproveitar a sintaxe do receptor do " -"método e ajudar a mantê-los mais organizados. Usando métodos, podemos manter todo o código de " -"implementação em um local previsível.\n" +" * Métodos são chamados em uma instância de um tipo (como struct ou enum), o primeiro parâmetro representa a instância " +"como `self`.\n" +" * Os desenvolvedores podem optar por usar métodos para aproveitar a sintaxe do receptor do método e ajudar a mantê-los " +"mais organizados. Usando métodos, podemos manter todo o código de implementação em um local previsível.\n" "* Highlight o uso da palavra-chave `self`, um receptor de método.\n" -" * Mostre que é um termo abreviado para `self:&Self` e talvez mostre como o name struct também " -"poderia ser usado.\n" -" * Explique que Self é um alias de tipo para o tipo em que o bloco `impl` está e pode ser usado " -"em qualquer outro lugar no bloco.\n" -" * Observe como self é usado como outras Structs e a notação de Point pode ser usada para se " -"referir a campos individuais.\n" -" * Este pode ser um bom momento para demonstrar como `&self` difere de `self` modificando o " -"código e tentando executar say_hello duas vezes.\n" +" * Mostre que é um termo abreviado para `self:&Self` e talvez mostre como o name struct também poderia ser usado.\n" +" * Explique que Self é um alias de tipo para o tipo em que o bloco `impl` está e pode ser usado em qualquer outro lugar no " +"bloco.\n" +" * Observe como self é usado como outras Structs e a notação de Point pode ser usada para se referir a campos " +"individuais.\n" +" * Este pode ser um bom momento para demonstrar como `&self` difere de `self` modificando o código e tentando executar " +"say_hello duas vezes.\n" "* Descrevemos a distinção entre os receptores de método a seguir.\n" " \n" "" @@ -6654,8 +6099,7 @@ msgstr "" msgid "" "
\n" " \n" -"Consider emphasizing on \"shared and immutable\" and \"unique and mutable\". These constraints " -"always come\n" +"Consider emphasizing on \"shared and immutable\" and \"unique and mutable\". These constraints always come\n" "together in Rust due to borrow checker rules, and `self` is no exception. It won't be possible to\n" "reference a struct from multiple locations and call a mutating (`&mut self`) method on it.\n" " \n" @@ -6663,10 +6107,8 @@ msgid "" msgstr "" "
\n" " \n" -"Considere enfatizar \"compartilhado e imutável\" e \"único e mutável\". Essas restrições sempre " -"vêm\n" -"juntos no Rust devido às regras do verificador emprestado, e `self` não é exceção. Não será " -"possível\n" +"Considere enfatizar \"compartilhado e imutável\" e \"único e mutável\". Essas restrições sempre vêm\n" +"juntos no Rust devido às regras do verificador emprestado, e `self` não é exceção. Não será possível\n" "referenciar um struct de vários locais e chamar um método mutante (`&mut self`) nele.\n" " \n" "
" @@ -6676,6 +6118,7 @@ msgid "# Example" msgstr "# Exemplo" #: src/methods/example.md:3 +#, fuzzy msgid "" "```rust,editable\n" "#[derive(Debug)]\n" @@ -6698,23 +6141,20 @@ msgid "" " Race { name: String::from(name), laps: Vec::new() }\n" " }" msgstr "" -"impl Raça {\n" -" fn new(name: &str) -> Race { // Sem receptor, um método static\n" -" Race { name: String::from(name), voltas: Vec::new() }\n" -" }" #: src/methods/example.md:15 +#, fuzzy msgid "" " fn add_lap(&mut self, lap: i32) { // Exclusive borrowed read-write access to self\n" " self.laps.push(lap);\n" " }" msgstr "" -" fn add_lap(&mut self, lap: i32) { // Acesso de leitura e gravação emprestado exclusivo para " -"self\n" +" fn add_lap(&mut self, lap: i32) { // Acesso de leitura e gravação emprestado exclusivo para self\n" " self.laps.push(volta);\n" " }" #: src/methods/example.md:19 +#, fuzzy msgid "" " fn print_laps(&self) { // Shared and read-only borrowed access to self\n" " println!(\"Recorded {} laps for {}:\", self.laps.len(), self.name);\n" @@ -6745,6 +6185,7 @@ msgstr "" "}" #: src/methods/example.md:32 +#, fuzzy msgid "" "fn main() {\n" " let mut race = Race::new(\"Monaco Grand Prix\");\n" @@ -6776,29 +6217,26 @@ msgid "" " \n" "Key Points:\n" "* All four methods here use a different method receiver.\n" -" * You can point out how that changes what the function can do with the variable values and if/" -"how it can be used again in `main`.\n" +" * You can point out how that changes what the function can do with the variable values and if/how it can be used again in " +"`main`.\n" " * You can showcase the error that appears when trying to call `finish` twice.\n" -"* Note, that although the method receivers are different, the non-static functions are called the " -"same way in the main body. Rust enables automatic referencing and dereferencing when calling " -"methods. Rust automatically adds in the `&`, `*`, `muts` so that that object matches the method " -"signature.\n" -"* You might point out that `print_laps` is using a vector that is iterated over. We describe " -"vectors in more detail in the afternoon. " +"* Note, that although the method receivers are different, the non-static functions are called the same way in the main " +"body. Rust enables automatic referencing and dereferencing when calling methods. Rust automatically adds in the `&`, `*`, " +"`muts` so that that object matches the method signature.\n" +"* You might point out that `print_laps` is using a vector that is iterated over. We describe vectors in more detail in the " +"afternoon. " msgstr "" "
\n" " \n" "Points chave:\n" "* Todos os quatro métodos aqui usam um receptor de método diferente.\n" -" * Você pode apontar como isso muda o que a função pode fazer com os valores das variáveis e se/" -"como ela pode ser usada novamente em `main`.\n" +" * Você pode apontar como isso muda o que a função pode fazer com os valores das variáveis e se/como ela pode ser usada " +"novamente em `main`.\n" " * Você pode mostrar o erro que aparece ao tentar chamar `finish` duas vezes.\n" -"* Observe que, embora os receptores do método sejam diferentes, as funções não estáticas são " -"chamadas da mesma maneira no corpo principal. Rust permite referenciar e desreferenciar " -"automaticamente ao chamar métodos. Rust adiciona automaticamente `&`, `*`, `muts` para que esse " -"objeto corresponda à assinatura do método.\n" -"* Você pode apontar que `print_laps` está usando um vetor iterado. Descrevemos os vetores com mais " -"detalhes à tarde." +"* Observe que, embora os receptores do método sejam diferentes, as funções não estáticas são chamadas da mesma maneira no " +"corpo principal. Rust permite referenciar e desreferenciar automaticamente ao chamar métodos. Rust adiciona automaticamente " +"`&`, `*`, `muts` para que esse objeto corresponda à assinatura do método.\n" +"* Você pode apontar que `print_laps` está usando um vetor iterado. Descrevemos os vetores com mais detalhes à tarde." #: src/pattern-matching.md:1 msgid "# Pattern Matching" @@ -6860,11 +6298,10 @@ msgid "" " * `..` can expand as much as it needs to be\n" " * `1..=5` represents an inclusive range\n" " * `_` is a wild card\n" -"* It can be useful to show how binding works, by for instance replacing a wildcard character with " -"a variable, or removing the quotes around `q`.\n" +"* It can be useful to show how binding works, by for instance replacing a wildcard character with a variable, or removing " +"the quotes around `q`.\n" "* You can demonstrate matching on a reference.\n" -"* This might be a good time to bring up the concept of irrefutable patterns, as the term can show " -"up in error messages.\n" +"* This might be a good time to bring up the concept of irrefutable patterns, as the term can show up in error messages.\n" " \n" "
" msgstr "" @@ -6876,11 +6313,11 @@ msgstr "" " * `..` pode expandir o quanto for necessário\n" " * `1..=5` representa um intervalo inclusivo\n" " * `_` é um curinga\n" -"* Pode ser útil mostrar como funciona a vinculação, por exemplo, substituindo um caractere curinga " -"por uma variável ou removendo as aspas ao redor de `q`.\n" +"* Pode ser útil mostrar como funciona a vinculação, por exemplo, substituindo um caractere curinga por uma variável ou " +"removendo as aspas ao redor de `q`.\n" "* Você pode demonstrar correspondência em uma referência.\n" -"* Este pode ser um bom momento para trazer à tona o conceito de padrões irrefutáveis, já que o " -"termo pode aparecer em mensagens de erro.\n" +"* Este pode ser um bom momento para trazer à tona o conceito de padrões irrefutáveis, já que o termo pode aparecer em " +"mensagens de erro.\n" " \n" "
" @@ -6904,11 +6341,6 @@ msgid "" " Err(String),\n" "}" msgstr "" -"```rust, editable\n" -"enum Result {\n" -" ok(i32),\n" -" Err(String),\n" -"}" #: src/pattern-matching/destructuring-enums.md:12 msgid "" @@ -6962,16 +6394,13 @@ msgstr "" msgid "" "Key points:\n" "* The `if`/`else` expression is returning an enum that is later unpacked with a `match`.\n" -"* 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." +"* 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 "" "Points chave:\n" -"* A expressão `if`/`else` está retornando um enum que é posteriormente descompactado com um " -"`match`.\n" -"* Você pode tentar adicionar uma terceira variante à definição de Enum e exibir os erros ao " -"executar o código. Aponte os lugares onde seu código agora é inexaustivo e como o compilador tenta " -"lhe dar dicas." +"* A expressão `if`/`else` está retornando um enum que é posteriormente descompactado com um `match`.\n" +"* Você pode tentar adicionar uma terceira variante à definição de Enum e exibir os erros ao executar o código. Aponte os " +"lugares onde seu código agora é inexaustivo e como o compilador tenta lhe dar dicas." #: src/pattern-matching/destructuring-structs.md:1 msgid "# Destructuring Structs" @@ -6992,7 +6421,7 @@ msgstr "" "```rust, editable\n" "struct Foo {\n" " x: (u32, u32),\n" -" e: u32,\n" +" y: u32,\n" "}" #: src/pattern-matching/destructuring-structs.md:11 @@ -7036,6 +6465,7 @@ msgid "You can destructure arrays, tuples, and slices by matching on their eleme msgstr "Você pode desestruturar arrays, tuplas e slices combinando seus elementos:" #: src/pattern-matching/destructuring-arrays.md:5 +#, fuzzy msgid "" "```rust,editable\n" "#[rustfmt::skip]\n" @@ -7075,9 +6505,6 @@ msgid "" " inspect(&[0, -2, 3, 4]);\n" "}" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let v = vec![10, 20, 30];" #: src/pattern-matching/destructuring-arrays.md:28 msgid "" @@ -7094,18 +6521,6 @@ msgid "" "* Show matching against the tail with patterns `[.., b]` and `[a@..,b]`\n" "" msgstr "" -"```rust, editable\n" -"#[rustfmt::pular]\n" -"fn main() {\n" -" let triplo = [0, -2, 3];\n" -" println!(\"Fale-me sobre {triplo:?}\");\n" -" match triplo {\n" -" [0, y, z] => println!(\"Primeiro é 0, y = {y} e z = {z}\"),\n" -" [1, ..] => println!(\"Primeiro é 1 e o resto foi ignorado\"),\n" -" _ => println!(\"Todos os elementos foram ignorados\"),\n" -" }\n" -"}\n" -"```" #: src/pattern-matching/match-guards.md:1 msgid "# Match Guards" @@ -7152,11 +6567,11 @@ msgstr "" #: src/pattern-matching/match-guards.md:22 msgid "" "Key Points:\n" -"* 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.\n" -"* 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\n" +"* 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.\n" +"* 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\n" "of the original `match` expression being considered. \n" "* You can use the variables defined in the pattern in your if expression.\n" "* The condition defined in the guard applies to every expression in a pattern with an `|`.\n" @@ -7164,10 +6579,9 @@ msgid "" msgstr "" "Points chave:\n" "* Match guards como um recurso de sintaxe separado são importantes e necessários.\n" -"* Eles não são iguais à expressão 'if' separada dentro do braço de correspondência. Uma expressão " -"`if` dentro do bloco de ramificação (depois de `=>`) acontece depois que o braço de " -"correspondência é selecionado. A falha na condição `if` dentro desse bloco não resultará em outros " -"braços\n" +"* Eles não são iguais à expressão 'if' separada dentro do braço de correspondência. Uma expressão `if` dentro do bloco de " +"ramificação (depois de `=>`) acontece depois que o braço de correspondência é selecionado. A falha na condição `if` dentro " +"desse bloco não resultará em outros braços\n" "da expressão `match` original sendo considerada.\n" "* Você pode usar as variáveis definidas no padrão em sua expressão if.\n" "* A condição definida na guarda se aplica a todas as expressões em um padrão com um `|`.\n" @@ -7198,8 +6612,7 @@ msgid "" "You're working on implementing a health-monitoring system. As part of that, you\n" "need to keep track of users' health statistics." msgstr "" -"Você está trabalhando na implementação de um sistema de monitoramento de saúde. Como parte disso, " -"você\n" +"Você está trabalhando na implementação de um sistema de monitoramento de saúde. Como parte disso, você\n" "precisam acompanhar as estatísticas de saúde dos usuários." #: src/exercises/day-2/health-statistics.md:6 @@ -7228,10 +6641,10 @@ msgid "" " weight: f32,\n" "}" msgstr "" -"struct Usuário {\n" +"struct User {\n" " name: String,\n" " age: u32,\n" -" peso: f32,\n" +" weight: f32,\n" "}" #: src/exercises/day-2/health-statistics.md:23 @@ -7241,9 +6654,9 @@ msgid "" " unimplemented!()\n" " }" msgstr "" -"usuário impl {\n" -" pub fn new(name: String, age: u32, peso: f32) -> Self {\n" -" não implementado!()\n" +"impl User {\n" +" pub fn new(name: String, age: u32, weight: f32) -> Self {\n" +" unimplemented!()\n" " }" #: src/exercises/day-2/health-statistics.md:28 @@ -7253,7 +6666,7 @@ msgid "" " }" msgstr "" " pub fn name(&self) -> &str {\n" -" não implementado!()\n" +" unimplemented!()\n" " }" #: src/exercises/day-2/health-statistics.md:32 @@ -7263,7 +6676,7 @@ msgid "" " }" msgstr "" " pub fn age(&self) -> u32 {\n" -" não implementado!()\n" +" unimplemented!()\n" " }" #: src/exercises/day-2/health-statistics.md:36 @@ -7272,8 +6685,8 @@ msgid "" " unimplemented!()\n" " }" msgstr "" -" pub fn peso(&self) -> f32 {\n" -" não implementado!()\n" +" pub fn weight(&self) -> f32 {\n" +" unimplemented!()\n" " }" #: src/exercises/day-2/health-statistics.md:40 @@ -7283,7 +6696,7 @@ msgid "" " }" msgstr "" " pub fn set_age(&mut self, new_age: u32) {\n" -" não implementado!()\n" +" unimplemented!()\n" " }" #: src/exercises/day-2/health-statistics.md:44 @@ -7294,7 +6707,7 @@ msgid "" "}" msgstr "" " pub fn set_weight(&mut self, new_weight: f32) {\n" -" não implementado!()\n" +" unimplemented!()\n" " }\n" "}" @@ -7358,8 +6771,7 @@ msgstr "" "para e preencha os métodos que faltam para fazer o\n" "tests passam:" -#: src/exercises/day-2/points-polygons.md:7 src/exercises/day-2/luhn.md:23 -#: src/exercises/day-2/strings-iterators.md:12 +#: src/exercises/day-2/points-polygons.md:7 src/exercises/day-2/luhn.md:23 src/exercises/day-2/strings-iterators.md:12 msgid "" "```rust\n" "// TODO: remove this when you're done with your implementation.\n" @@ -7390,6 +6802,7 @@ msgstr "" "}" #: src/exercises/day-2/points-polygons.md:19 +#, fuzzy msgid "" "pub struct Polygon {\n" " // add fields\n" @@ -7400,6 +6813,7 @@ msgstr "" "}" #: src/exercises/day-2/points-polygons.md:23 +#, fuzzy msgid "" "impl Polygon {\n" " // add methods\n" @@ -7410,6 +6824,7 @@ msgstr "" "}" #: src/exercises/day-2/points-polygons.md:27 +#, fuzzy msgid "" "pub struct Circle {\n" " // add fields\n" @@ -7420,6 +6835,7 @@ msgstr "" "}" #: src/exercises/day-2/points-polygons.md:31 +#, fuzzy msgid "" "impl Circle {\n" " // add methods\n" @@ -7448,7 +6864,7 @@ msgid "" " use super::*;" msgstr "" "#[cfg(test)]\n" -"tests mod {\n" +"mod tests {\n" " use super::*;" #: src/exercises/day-2/points-polygons.md:44 src/exercises/day-2/solutions-morning.md:165 @@ -7458,7 +6874,7 @@ msgid "" " }" msgstr "" " fn round_two_digits(x: f64) -> f64 {\n" -" (x * 100,0).round() / 100,0\n" +" (x * 100.0).round() / 100.0\n" " }" #: src/exercises/day-2/points-polygons.md:48 src/exercises/day-2/solutions-morning.md:169 @@ -7627,17 +7043,14 @@ msgstr "" msgid "" "Other interesting parts of the exercise:\n" " \n" -"* Derive a `Copy` trait for some structs, as in tests the methods sometimes don't borrow their " -"arguments.\n" -"* Discover that `Add` trait must be implemented for two objects to be addable via \"+\". Note that " -"we do not discuss generics until Day 3." +"* Derive a `Copy` trait for some structs, as in tests the methods sometimes don't borrow their arguments.\n" +"* Discover that `Add` trait must be implemented for two objects to be addable via \"+\". Note that we do not discuss " +"generics until Day 3." msgstr "" "Outras partes interessantes do exercício:\n" " \n" -"* Derive um trait `Copy` para algumas Structs, já que em testes os métodos às vezes não emprestam " -"seus argumentos.\n" -"* Descubra que o trait `Add` deve ser implementado para que dois objetos sejam adicionados via \"+" -"\"." +"* Derive um trait `Copy` para algumas Structs, já que em testes os métodos às vezes não emprestam seus argumentos.\n" +"* Descubra que o trait `Add` deve ser implementado para que dois objetos sejam adicionados via \"+\"." #: src/control-flow.md:1 msgid "# Control Flow" @@ -7668,6 +7081,7 @@ msgstr "" "quadra:" #: src/control-flow/blocks.md:6 +#, fuzzy msgid "" "```rust,editable\n" "fn main() {\n" @@ -7722,10 +7136,6 @@ msgid "" " x + x\n" "}" msgstr "" -"```rust, editable\n" -"fn duplo(x: i32) -> i32 {\n" -" x + x\n" -"}" #: src/control-flow/blocks.md:33 msgid "" @@ -7734,10 +7144,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" println!(\"doubled: {}\", double(7));\n" -"}\n" -"```" #: src/control-flow/blocks.md:38 msgid "However if the last expression ends with `;`, then the resulting value and type is `()`." @@ -7747,15 +7153,15 @@ msgstr "No entanto, se a última expressão terminar com `;`, o valor e o tipo r msgid "" "Key Points:\n" "* The point of this slide is to show that blocks have a type and value in Rust. \n" -"* 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`.\n" +"* 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`.\n" " \n" "" msgstr "" "Points chave:\n" "* O objetivo deste slide é mostrar que os blocos têm um tipo e valor em Rust.\n" -"* Você pode mostrar como o valor do bloco muda alterando a última linha do bloco. Por exemplo, " -"adicionar/remover um Point e vírgula ou usar um `return`.\n" +"* Você pode mostrar como o valor do bloco muda alterando a última linha do bloco. Por exemplo, adicionar/remover um Point e " +"vírgula ou usar um `return`.\n" " \n" "" @@ -7821,14 +7227,13 @@ msgstr "" #: src/control-flow/if-expressions.md:31 msgid "" -"Because `if` is an expression and must have a particular type, both of its branch blocks must have " -"the same type. Consider showing what happens if you add `;` after `x / 2` in the second example.\n" +"Because `if` is an expression and must have a particular type, both of its branch blocks must have the same type. Consider " +"showing what happens if you add `;` after `x / 2` in the second example.\n" " \n" "" msgstr "" -"Como `if` é uma expressão e deve ter um tipo específico, ambos os blocos de ramificação devem ter " -"o mesmo tipo. Considere mostrar o que acontece se você adicionar `;` depois de `x / 2` no segundo " -"exemplo.\n" +"Como `if` é uma expressão e deve ter um tipo específico, ambos os blocos de ramificação devem ter o mesmo tipo. Considere " +"mostrar o que acontece se você adicionar `;` depois de `x / 2` no segundo exemplo.\n" " \n" "" @@ -7870,23 +7275,22 @@ msgid "" "See [pattern matching](../pattern-matching.md) for more details on patterns in\n" "Rust." msgstr "" -"Consulte [correspondência de padrões](../pattern-matching.md) para obter mais detalhes sobre " -"padrões em\n" +"Consulte [correspondência de padrões](../pattern-matching.md) para obter mais detalhes sobre padrões em\n" "rust." #: src/control-flow/if-let-expressions.md:21 msgid "" -"* `if let` can be more concise than `match`, e.g., when only one case is interesting. In contrast, " -"`match` requires all branches to be covered.\n" -" * For the similar use case consider demonstrating a newly stabilized [`let else`](https://" -"github.com/rust-lang/rust/pull/93628) feature.\n" +"* `if let` can be more concise than `match`, e.g., when only one case is interesting. In contrast, `match` requires all " +"branches to be covered.\n" +" * For the similar use case consider demonstrating a newly stabilized [`let else`](https://github.com/rust-lang/rust/" +"pull/93628) feature.\n" "* A common usage is handling `Some` values when working with `Option`.\n" "* Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -"* `if let` pode ser mais conciso que `match`, por exemplo, quando apenas um caso é interessante. " -"Em contraste, `match` requer que todas as ramificações sejam cobertas.\n" -" * Para o caso de uso semelhante, considere demonstrar um recurso [`let else`](https://github." -"com/rust-lang/rust/pull/93628) recentemente estabilizado.\n" +"* `if let` pode ser mais conciso que `match`, por exemplo, quando apenas um caso é interessante. Em contraste, `match` " +"requer que todas as ramificações sejam cobertas.\n" +" * Para o caso de uso semelhante, considere demonstrar um recurso [`let else`](https://github.com/rust-lang/rust/" +"pull/93628) recentemente estabilizado.\n" "* Um uso comum é lidar com valores `Some` ao trabalhar com `Option`.\n" "* Ao contrário de `match`, `if let` não suporta cláusulas de guarda para casamento de padrões." @@ -7979,16 +7383,14 @@ msgstr "" #: src/control-flow/while-let-expressions.md:27 msgid "" "* Point out that the `while let` loop will keep going as long as the value matches the pattern.\n" -"* 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 `iter.next()`. The `while let` provides syntactic sugar for the " -"above scenario.\n" +"* 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 `iter.next()`. The `while let` provides syntactic sugar for the above scenario.\n" " \n" "" msgstr "" "* Saliente que o loop `while let` continuará enquanto o valor corresponder ao padrão.\n" -"* Você pode reescrever o loop `while let` como um loop infinito com uma instrução if que quebra " -"quando não há valor para desempacotar para `iter.next()`. O `while let` fornece açúcar sintático " -"para o cenário acima.\n" +"* Você pode reescrever o loop `while let` como um loop infinito com uma instrução if que quebra quando não há valor para " +"desempacotar para `iter.next()`. O `while let` fornece açúcar sintático para o cenário acima.\n" " \n" "" @@ -8047,8 +7449,8 @@ msgid "" "* Index iteration is not a special syntax in Rust for just that case.\n" "* `(0..10)` is a range that implements an `Iterator` trait. \n" "* `step_by` is a method that returns another `Iterator` that skips every other element. \n" -"* Modify the elements in the vector and explain the compiler errors. Change vector `v` to be " -"mutable and the for loop to `for x in v.iter_mut()`." +"* Modify the elements in the vector and explain the compiler errors. Change vector `v` to be mutable and the for loop to " +"`for x in v.iter_mut()`." msgstr "" "
\n" " \n" @@ -8089,22 +7491,6 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let mut x = 10;\n" -" loop {\n" -" x = if x % 2 == 0 {\n" -" x / 2\n" -" } elif {\n" -" if 3 * x + 1\n" -" };\n" -" if x == 1 {\n" -" break;\n" -" }\n" -" }\n" -" println!(\"X final: {x}\");\n" -"}\n" -"```" #: src/control-flow/loop-expressions.md:23 msgid "" @@ -8168,8 +7554,8 @@ msgid "" "* Save the match expression to a variable and print it out.\n" "* Remove `.as_deref()` and explain the error.\n" " * `std::env::Agrs().next` returns an `Option<&String>`, but we cannot match against `String`.\n" -" * `as_deref()` transforms an `Option` to `Option`. In our case, this turns " -"`Option<&String>` into `Option<&str>`.\n" +" * `as_deref()` transforms an `Option` to `Option`. In our case, this turns `Option<&String>` into " +"`Option<&str>`.\n" " * We can now use pattern matching to match against the `&str` inside `Option`.\n" "
" msgstr "" @@ -8278,9 +7664,7 @@ msgstr "* [`Box`](std/box.md): um ponteiro próprio para dados alocados em heap. #: src/std.md:21 msgid "* [`Rc`](std/rc.md): a shared reference-counted pointer for heap-allocated data." -msgstr "" -"* [`Rc`](std/rc.md): um ponteiro de contagem de referência compartilhado para dados alocados em " -"heap." +msgstr "* [`Rc`](std/rc.md): um ponteiro de contagem de referência compartilhado para dados alocados em heap." #: src/std.md:23 msgid "" @@ -8309,6 +7693,7 @@ msgid "The types represent optional data:" msgstr "Os tipos representam dados opcionais:" #: src/std/option-result.md:5 +#, fuzzy msgid "" "```rust,editable\n" "fn main() {\n" @@ -8323,13 +7708,14 @@ msgstr "" " println!(\"primeiro: {primeiro:?}\");" #: src/std/option-result.md:11 +#, fuzzy msgid "" " let idx: Result = numbers.binary_search(&10);\n" " println!(\"idx: {idx:?}\");\n" "}\n" "```" msgstr "" -" let idx: Result = números.binary_search(&10);\n" +" let idx: Result = numbers.binary_search(&10);\n" " println!(\"idx: {idx:?}\");\n" "}\n" "```" @@ -8447,6 +7833,7 @@ msgstr "" " println!(\"v1: len = {}, capacage = {}\", v1.len(), v1.capacity());" #: src/std/vec.md:11 +#, fuzzy msgid "" " let mut v2 = Vec::with_capacity(v1.len() + 1);\n" " v2.extend(v1.iter());\n" @@ -8481,10 +7868,6 @@ msgid "" "}\n" "```" msgstr "" -" handle.join().unwrap();\n" -" println!(\"v: {v:?}\");\n" -"}\n" -"```" #: src/std/vec.md:29 msgid "" @@ -8504,13 +7887,10 @@ msgstr "" #: src/std/vec.md:37 msgid "" -"* `Vec` is a type of collection, along with `String` and `HashMap`. The data it contains is " -"stored\n" -" on the heap. This means the amount of data doesn't need to be known at compile time. It can " -"grow\n" +"* `Vec` is a type of collection, along with `String` and `HashMap`. The data it contains is stored\n" +" on the heap. This means the amount of data doesn't need to be known at compile time. It can grow\n" " or shrink at runtime.\n" -"* Notice how `Vec` is a generic type too, but you don't have to specify `T` explicitly. As " -"always\n" +"* Notice how `Vec` is a generic type too, but you don't have to specify `T` explicitly. As always\n" " with Rust type inference, the `T` was established during the first `push` call.\n" "* `vec![...]` is a canonical macro to use instead of `Vec::new()` and it supports adding initial\n" " elements to the vector.\n" @@ -8521,18 +7901,15 @@ msgid "" msgstr "" "
\n" " \n" -"* `Vec` é um tipo de coleção, junto com `String` e `HashMap`. Os dados que ele contém são " -"armazenados\n" -" na pilha. Isso significa que a quantage de dados não precisa ser conhecida em tempo de " -"compilação. pode crescer\n" +"* `Vec` é um tipo de coleção, junto com `String` e `HashMap`. Os dados que ele contém são armazenados\n" +" na pilha. Isso significa que a quantage de dados não precisa ser conhecida em tempo de compilação. pode crescer\n" " ou encolher em tempo de execução.\n" -"* Observe como `Vec` também é um tipo genérico, mas você não precisa especificar `T` " -"explicitamente. Como sempre\n" +"* Observe como `Vec` também é um tipo genérico, mas você não precisa especificar `T` explicitamente. Como sempre\n" " com inferência de tipo Rust, o `T` foi estabelecido durante a primeira chamada `push`.\n" "* `vec![...]` é uma macro canônica para usar em vez de `Vec::new()` e suporta adicionar iniciais\n" " elementos ao vetor.\n" -"* Para indexar o vetor, você usa `[` `]`, mas eles entrarão em pânico se estiverem fora dos " -"limites. Alternativamente, usando\n" +"* Para indexar o vetor, você usa `[` `]`, mas eles entrarão em pânico se estiverem fora dos limites. Alternativamente, " +"usando\n" " `get` retornará uma `Option`. A função `pop` removerá o último elemento.\n" "* Mostrar iterando sobre um vetor e alterando o valor:\n" " `for e in &mut v { *e += 50; }`" @@ -8550,8 +7927,8 @@ msgid "" "```rust,editable\n" "use std::collections::HashMap;" msgstr "" -"```rust, editable\n" -"use std::coleções::HashMap;" +"```rust,editable\n" +"use std::collections::HashMap;" #: src/std/hashmap.md:8 msgid "" @@ -8580,6 +7957,7 @@ msgstr "" " }" #: src/std/hashmap.md:19 +#, fuzzy msgid "" " for book in [\"Pride and Prejudice\", \"Alice's Adventure in Wonderland\"] {\n" " match page_counts.get(book) {\n" @@ -8608,13 +7986,10 @@ msgstr "" #: src/std/hashmap.md:32 msgid "" -" println!(\"{page_counts:#?}\");\n" -"}\n" -"```" -msgstr "" -" println!(\"após: {a}\");\n" +" println!(\"{page_counts:#?}\");\n" "}\n" "```" +msgstr "" #: src/std/hashmap.md:38 msgid "* Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." @@ -8645,6 +8020,7 @@ msgstr "" "```" #: src/std/box.md:13 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -8691,13 +8067,11 @@ msgstr "" #: src/std/box.md:34 msgid "" "* `Box` is like `std::unique_ptr` in C++. \n" -"* In the above example, you can even leave out the `*` in the `println!` statement thanks to " -"`Deref`. \n" +"* In the above example, you can even leave out the `*` in the `println!` statement thanks to `Deref`. \n" "* A `Box` can be useful when you:\n" -" * have a type whose size that can't be known at compile time, but the Rust compiler wants to " -"know an exact size.\n" -" * want to transfer ownership of a large amount of data. To avoid copying large amounts of data " -"on the stack, instead store the data on the heap in a `Box` so only the pointer is moved.\n" +" * have a type whose size that can't be known at compile time, but the Rust compiler wants to know an exact size.\n" +" * want to transfer ownership of a large amount of data. To avoid copying large amounts of data on the stack, instead " +"store the data on the heap in a `Box` so only the pointer is moved.\n" "
" msgstr "" @@ -8718,11 +8092,11 @@ msgid "" " Nil,\n" "}" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "#[derive(Debug)]\n" -"enum Lista {\n" -" Cons(T, Caixa>),\n" -" Nada,\n" +"enum List {\n" +" Cons(T, Box>),\n" +" Nil,\n" "}" #: src/std/box-recursive.md:12 src/std/box-niche.md:10 @@ -8733,13 +8107,9 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let list: List = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Nil))));\n" -" println!(\"{lista:?}\");\n" -"}\n" -"```" #: src/std/box-recursive.md:18 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -8778,8 +8148,7 @@ msgid "" "* If the `Box` was not used here and we attempted to embed a `List` directly into the `List`,\n" "the compiler would not compute a fixed size of the struct in memory, it would look infinite.\n" " \n" -"* `Box` solves this problem as it has the same size as a regular pointer and just points at the " -"next\n" +"* `Box` solves this problem as it has the same size as a regular pointer and just points at the next\n" "element of the `List` in the heap. " msgstr "" "
\n" @@ -8787,17 +8156,15 @@ msgstr "" "Se a `Caixa` não foi usada aqui e tentamos incorporar uma `Lista` diretamente na `Lista`,\n" "o compilador não calcularia um tamanho fixo da estrutura na memória, pareceria infinito.\n" " \n" -"`Box` resolve esse problema, pois tem o mesmo tamanho de um ponteiro normal e apenas aponta para o " -"próximo\n" +"`Box` resolve esse problema, pois tem o mesmo tamanho de um ponteiro normal e apenas aponta para o próximo\n" "elemento da `Lista` na pilha.\n" " \n" "
" #: src/std/box-recursive.md:41 msgid "" -"* Remove the `Box` in the List definition and show the compiler error. `Recursive with " -"indirection` is a hint you might want to use a Box or reference of some kind, instead of storing a " -"value directly. \n" +"* Remove the `Box` in the List definition and show the compiler error. `Recursive with indirection` is a hint you might " +"want to use a Box or reference of some kind, instead of storing a value directly. \n" " \n" "" msgstr "" @@ -8815,6 +8182,7 @@ msgstr "" "permite que o compilador otimize o layout da memória:" #: src/std/box-niche.md:19 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -8853,8 +8221,7 @@ msgid "" "[`Rc`][1] is a reference-counted shared pointer. Use this when you need to refer\n" "to the same data from multiple places:" msgstr "" -"[`Rc`][1] é um ponteiro compartilhado com contagem de referência. Use isso quando precisar " -"consultar\n" +"[`Rc`][1] é um ponteiro compartilhado com contagem de referência. Use isso quando precisar consultar\n" "aos mesmos dados de vários lugares:" #: src/std/rc.md:6 @@ -8862,8 +8229,8 @@ msgid "" "```rust,editable\n" "use std::rc::Rc;" msgstr "" -"```rust, editable\n" -"usar padrão::rc::Rc;" +"```rust,editable\n" +"use std::rc::Rc;" #: src/std/rc.md:9 msgid "" @@ -8902,16 +8269,14 @@ msgstr "" msgid "" "* Like C++'s `std::shared_ptr`.\n" "* `clone` is cheap: creates a pointer to the same allocation and increases the reference count.\n" -"* `make_mut` actually clones the inner value if necessary (\"clone-on-write\") and returns a " -"mutable reference.\n" +"* `make_mut` actually clones the inner value if necessary (\"clone-on-write\") and returns a mutable reference.\n" "* You can `downgrade()` a `Rc` into a *weakly reference-counted* object to\n" " create cycles that will be dropped properly (likely in combination with\n" " `RefCell`)." msgstr "" "* Como `std::shared_ptr` do C++.\n" "* `clone` é barato: cria um ponteiro para a mesma alocação e aumenta a contagem de referência.\n" -"* `make_mut` realmente clona o valor interno se necessário (\"clone-on-write\") e retorna uma " -"referência mutável." +"* `make_mut` realmente clona o valor interno se necessário (\"clone-on-write\") e retorna uma referência mutável." #: src/std/rc.md:38 msgid "" @@ -8919,9 +8284,9 @@ msgid "" "use std::rc::{Rc, Weak};\n" "use std::cell::RefCell;" msgstr "" -"```rust, editable\n" -"use std::thread;\n" -"use std::sync::Arc;" +"```rust,editable\n" +"use std::rc::{Rc, Weak};\n" +"use std::cell::RefCell;" #: src/std/rc.md:42 msgid "" @@ -8950,6 +8315,7 @@ msgid "" msgstr "" #: src/std/rc.md:62 +#, fuzzy msgid "" " println!(\"graph: {root:#?}\");\n" "}\n" @@ -8988,6 +8354,7 @@ msgstr "" "}" #: src/modules.md:14 +#, fuzzy msgid "" "mod bar {\n" " pub fn do_something() {\n" @@ -9017,10 +8384,8 @@ msgstr "" #: src/modules.md:28 msgid "" -"* Packages provide functionality and include a `Cargo.toml` file that describes how to build a " -"bundle of 1+ crates.\n" -"* Crates are a tree of modules, where a binary crate creates an executable and a library crate " -"compiles to a library.\n" +"* Packages provide functionality and include a `Cargo.toml` file that describes how to build a bundle of 1+ crates.\n" +"* Crates are a tree of modules, where a binary crate creates an executable and a library crate compiles to a library.\n" "* Modules define organization, scope, and is the focus of this section." msgstr "" @@ -9111,14 +8476,13 @@ msgid "* Use the `pub` keyword to make mods public." msgstr "" #: src/modules/visibility.md:41 -msgid "" -"Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public visibility." +msgid "Additionally, there are advanced `pub(...)` specifiers to restrict the scope of public visibility." msgstr "" #: src/modules/visibility.md:43 msgid "" -"* See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-" -"path-pubcrate-pubsuper-and-pubself)).\n" +"* See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-privacy.html#pubin-path-pubcrate-pubsuper-and-" +"pubself)).\n" "* Configuring `pub(crate)` visibility is a common pattern.\n" "* Less commonly, you can give visibility to a specific path.\n" "* In any case, visibility must be granted to an ancestor module (and all of its descendants)." @@ -9271,7 +8635,7 @@ msgid "" "}" msgstr "" "pub fn luhn(cc_number: &str) -> bool {\n" -" não implementado!()\n" +" unimplemented!()\n" "}" #: src/exercises/day-2/luhn.md:31 @@ -9283,7 +8647,7 @@ msgid "" msgstr "" "#[test]\n" "fn test_non_digit_cc_number() {\n" -" afirmar!(!luhn(\"foo\"));\n" +" assert!(!luhn(\"foo\"));\n" "}" #: src/exercises/day-2/luhn.md:36 src/exercises/day-2/solutions-afternoon.md:64 @@ -9298,10 +8662,10 @@ msgid "" msgstr "" "#[test]\n" "fn test_empty_cc_number() {\n" -" afirmar!(!luhn(\"\"));\n" -" afirmar!(!luhn(\" \"));\n" -" afirmar!(!luhn(\" \"));\n" -" afirmar!(!luhn(\" \"));\n" +" assert!(!luhn(\"\"));\n" +" assert!(!luhn(\" \"));\n" +" assert!(!luhn(\" \"));\n" +" assert!(!luhn(\" \"));\n" "}" #: src/exercises/day-2/luhn.md:44 src/exercises/day-2/solutions-afternoon.md:72 @@ -9313,7 +8677,7 @@ msgid "" msgstr "" "#[test]\n" "fn test_single_digit_cc_number() {\n" -" afirmar!(!luhn(\"0\"));\n" +" assert!(!luhn(\"0\"));\n" "}" #: src/exercises/day-2/luhn.md:49 src/exercises/day-2/solutions-afternoon.md:77 @@ -9325,7 +8689,7 @@ msgid "" msgstr "" "#[test]\n" "fn test_two_digit_cc_number() {\n" -" afirmar!(luhn(\" 0 0 \"));\n" +" assert!(luhn(\" 0 0 \"));\n" "}" #: src/exercises/day-2/luhn.md:54 src/exercises/day-2/solutions-afternoon.md:82 @@ -9339,9 +8703,9 @@ msgid "" msgstr "" "#[test]\n" "fn test_valid_cc_number() {\n" -" afirmar!(luhn(\"4263 9826 4026 9299\"));\n" -" afirmar!(luhn(\"4539 3195 0343 6467\"));\n" -" afirmar!(luhn(\"7992 7398 713\"));\n" +" assert!(luhn(\"4263 9826 4026 9299\"));\n" +" assert!(luhn(\"4539 3195 0343 6467\"));\n" +" assert!(luhn(\"7992 7398 713\"));\n" "}" #: src/exercises/day-2/luhn.md:61 @@ -9355,9 +8719,9 @@ msgid "" msgstr "" "#[test]\n" "fn test_invalid_cc_number() {\n" -" afirmar!(!luhn(\"4223 9826 4026 9299\"));\n" -" afirmar!(!luhn(\"4539 3195 0343 6476\"));\n" -" afirmar!(!luhn(\"8273 1232 7352 0569\"));\n" +" assert!(!luhn(\"4223 9826 4026 9299\"));\n" +" assert!(!luhn(\"4539 3195 0343 6476\"));\n" +" assert!(!luhn(\"8273 1232 7352 0569\"));\n" "}" #: src/exercises/day-2/strings-iterators.md:1 @@ -9390,8 +8754,8 @@ msgid "" " unimplemented!()\n" "}" msgstr "" -"pub fn prefix_matches(prefixo: &str, request_path: &str) -> bool {\n" -" não implementado!()\n" +"pub fn prefix_matches(prefix: &str, request_path: &str) -> bool {\n" +" unimplemented!()\n" "}" #: src/exercises/day-2/strings-iterators.md:20 @@ -9463,8 +8827,8 @@ msgid "" "```" msgstr "" " assert!(!prefix_matches(\"/v1/publishers/*/books\", \"/v1/publishers\"));\n" -" afirmar!(!prefix_matches(\n" -" \"/v1/editores/*/books\",\n" +" assert!(!prefix_matches(\n" +" \"/v1/publishers/*/books\",\n" " \"/v1/publishers/foo/booksByAuthor\"\n" " ));\n" "}\n" @@ -9525,12 +8889,13 @@ msgid "" " fn say_hello(&self);\n" "}" msgstr "" -"```rust, editable\n" -"característica Cumprimentar {\n" +"```rust,editable\n" +"trait Greet {\n" " fn say_hello(&self);\n" "}" #: src/traits.md:10 +#, fuzzy msgid "" "struct Dog {\n" " name: String,\n" @@ -9541,6 +8906,7 @@ msgstr "" "}" #: src/traits.md:14 +#, fuzzy msgid "struct Cat; // No name, cats won't respond to it anyway." msgstr "Cat estrutura; // Sem name, os gatos não vão responder de qualquer maneira." @@ -9588,7 +8954,7 @@ msgstr "" "fn main() {\n" " let pets: Vec> = vec![\n" " Box::new(Dog { name: String::from(\"Fido\") }),\n" -" Caixa::new(Cat),\n" +" Box::new(Cat),\n" " ];\n" " for pet in pets {\n" " pet.say_hello();\n" @@ -9598,26 +8964,23 @@ msgstr "" #: src/traits.md:41 msgid "" -"* Traits may specify pre-implemented (default) methods and methods that users are required to " -"implement themselves. Methods with default implementations can rely on required methods.\n" -"* Types that implement a given trait may be of different sizes. This makes it impossible to have " -"things like `Vec` in the example above.\n" -"* `dyn Greet` is a way to tell the compiler about a dynamically sized type that implements " -"`Greet`.\n" -"* In the example, `pets` holds Fat Pointers to objects that implement `Greet`. The Fat Pointer " -"consists of two components, a pointer to the actual object and a pointer to the virtual method " -"table for the `Greet` implementation of that particular object." -msgstr "" -"* Traits podem especificar métodos pré-implementados (padrão) e métodos que os usuários devem " -"implementar por conta própria. Os métodos com implementações padrão podem contar com os métodos " -"necessários.\n" -"* Os tipos que implementam uma determinada característica podem ser de tamanhos diferentes. Isso " -"torna impossível ter coisas como `Vec` no exemplo acima.\n" -"* `dyn Greet` é uma maneira de dizer ao compilador sobre um tipo de tamanho dinâmico que " -"implementa `Greet`.\n" -"* No exemplo, `pets` mantém Fat Pointers para objetos que implementam `Greet`. O Fat Pointer " -"consiste em dois componentes, um ponteiro para o objeto real e um ponteiro para a tabela de " -"métodos virtuais para a implementação `Greet` desse objeto em particular." +"* Traits may specify pre-implemented (default) methods and methods that users are required to implement themselves. Methods " +"with default implementations can rely on required methods.\n" +"* Types that implement a given trait may be of different sizes. This makes it impossible to have things like `Vec` " +"in the example above.\n" +"* `dyn Greet` is a way to tell the compiler about a dynamically sized type that implements `Greet`.\n" +"* In the example, `pets` holds Fat Pointers to objects that implement `Greet`. The Fat Pointer consists of two components, " +"a pointer to the actual object and a pointer to the virtual method table for the `Greet` implementation of that particular " +"object." +msgstr "" +"* Traits podem especificar métodos pré-implementados (padrão) e métodos que os usuários devem implementar por conta " +"própria. Os métodos com implementações padrão podem contar com os métodos necessários.\n" +"* Os tipos que implementam uma determinada característica podem ser de tamanhos diferentes. Isso torna impossível ter " +"coisas como `Vec` no exemplo acima.\n" +"* `dyn Greet` é uma maneira de dizer ao compilador sobre um tipo de tamanho dinâmico que implementa `Greet`.\n" +"* No exemplo, `pets` mantém Fat Pointers para objetos que implementam `Greet`. O Fat Pointer consiste em dois componentes, " +"um ponteiro para o objeto real e um ponteiro para a tabela de métodos virtuais para a implementação `Greet` desse objeto em " +"particular." #: src/traits.md:46 msgid "" @@ -9655,13 +9018,6 @@ msgid "" " hit_points: u8,\n" "}" msgstr "" -"```rust, editable\n" -"#[derive(Debug, Clone, PartialEq, Eq, Default)]\n" -"jogador struct {\n" -" name: String,\n" -" força: u8,\n" -" hit_points: u8,\n" -"}" #: src/traits/deriving-traits.md:13 msgid "" @@ -9687,8 +9043,7 @@ msgstr "# Métodos Padrão" #: src/traits/default-methods.md:3 msgid "Traits can implement behavior in terms of other trait methods:" -msgstr "" -"As características podem implementar o comportamento em termos de outros métodos de característica:" +msgstr "As características podem implementar o comportamento em termos de outros métodos de característica:" #: src/traits/default-methods.md:5 msgid "" @@ -9700,11 +9055,11 @@ msgid "" " }\n" "}" msgstr "" -"```rust, editable\n" -"característica é igual a {\n" -" fn igual(&self, outro: &Self) -> bool;\n" +"```rust,editable\n" +"trait Equals {\n" +" fn equal(&self, other: &Self) -> bool;\n" " fn not_equal(&self, other: &Self) -> bool {\n" -" !self.igual(outro)\n" +" !self.equal(other)\n" " }\n" "}" @@ -9714,7 +9069,7 @@ msgid "" "struct Centimeter(i16);" msgstr "" "#[derive(Debug)]\n" -"struct Centímetro(i16);" +"struct Centimeter(i16);" #: src/traits/default-methods.md:16 msgid "" @@ -9726,7 +9081,7 @@ msgid "" msgstr "" "impl Equals for Centimeter {\n" " fn equal(&self, other: &Centimeter) -> bool {\n" -" auto.0 == outro.0\n" +" self.0 == other.0\n" " }\n" "}" @@ -9740,13 +9095,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let a = Centímetro(10);\n" -" let b = Centímetro(20);\n" -" println!(\"{a:?} é igual a {b:?}: {}\", a.equal(&b));\n" -" println!(\"{a:?} not_equals {b:?}: {}\", a.not_equal(&b));\n" -"}\n" -"```" #: src/traits/important-traits.md:1 msgid "# Important Traits" @@ -9765,11 +9113,12 @@ msgid "" "* [`Drop`][9] used for defining destructors.\n" "* [`Default`][10] used to construct a default instance of a type." msgstr "" -"* `Iterator` e `IntoIterator` usados em loops `for`,\n" -"* `From` e `Into` usados para converter valores,\n" -"* `Read` e `Write` usados para IO,\n" -"* `Add`, `Mul`, ... usado para sobrecargo do operador e\n" -"* `Drop` usado para definir destruidores." +"* [`Iterator`][1] and [`IntoIterator`][2] used in `for` loops,\n" +"* [`From`][3] and [`Into`][4] used to convert values,\n" +"* [`Read`][5] and [`Write`][6] used for IO,\n" +"* [`Add`][7], [`Mul`][8], ... used for operator overloading, and\n" +"* [`Drop`][9] used for defining destructors.\n" +"* [`Default`][10] used to construct a default instance of a type." #: src/traits/important-traits.md:12 msgid "" @@ -9801,19 +9150,12 @@ msgid "" " next: u32,\n" "}" msgstr "" -"```rust, editable\n" -"struct Fibonacci {\n" -" atual: u32,\n" -" próximo: u32,\n" -"}" #: src/traits/iterator.md:11 msgid "" "impl Iterator for Fibonacci {\n" " type Item = u32;" msgstr "" -"impl Iterador para Fibonacci {\n" -" type Item = u32;" #: src/traits/iterator.md:14 msgid "" @@ -9825,13 +9167,6 @@ msgid "" " }\n" "}" msgstr "" -" fn next(&mut self) -> Option {\n" -" let new_next = self.curr + self.next;\n" -" self.curr = self.next;\n" -" self.próximo = novo_próximo;\n" -" Some(self.curr)\n" -" }\n" -"}" #: src/traits/iterator.md:22 msgid "" @@ -9843,36 +9178,23 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" let fib = Fibonacci { atual: 0, próximo: 1 };\n" -" for (i, n) in fib.enumerate().take(5) {\n" -" println!(\"fib({i}): {n}\");\n" -" }\n" -"}\n" -"```" #: src/traits/iterator.md:32 msgid "" -"* `IntoIterator` is the trait that makes for loops work. It is implemented by collection types " -"such as\n" +"* `IntoIterator` is the trait that makes for loops work. It is implemented by collection types such as\n" " `Vec` and references to them such as `&Vec` and `&[T]`. Ranges also implement it.\n" "* The `Iterator` trait implements many common functional programming operations over collections \n" -" (e.g. `map`, `filter`, `reduce`, etc). This is the trait where you can find all the " -"documentation\n" -" about them. In Rust these functions should produce the code as efficient as equivalent " -"imperative\n" +" (e.g. `map`, `filter`, `reduce`, etc). This is the trait where you can find all the documentation\n" +" about them. In Rust these functions should produce the code as efficient as equivalent imperative\n" " implementations.\n" " \n" "" msgstr "" -"* `IntoIterator` é o recurso que faz com que os loops funcionem. É implementado por tipos de " -"coleção, como\n" +"* `IntoIterator` é o recurso que faz com que os loops funcionem. É implementado por tipos de coleção, como\n" " `Vec` e referências a eles, como `&Vec` e `&[T]`. Os intervalos também o implementam.\n" "* O trait `Iterator` implementa muitas operações de programação funcional comuns sobre coleções\n" -" (por exemplo, `mapa`, `filtro`, `redução`, etc). Este é o trait onde você pode encontrar toda a " -"documentação\n" -" sobre eles. Em Rust, essas funções devem produzir o código tão eficiente quanto o imperativo " -"equivalente\n" +" (por exemplo, `mapa`, `filtro`, `redução`, etc). Este é o trait onde você pode encontrar toda a documentação\n" +" sobre eles. Em Rust, essas funções devem produzir o código tão eficiente quanto o imperativo equivalente\n" " implementações.\n" " \n" "" @@ -9901,12 +9223,6 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let primos = vec![2, 3, 5, 7];\n" -" let prime_squares = primes.into_iter().map(|prime| prime * prime).collect::>();\n" -"}\n" -"```" #: src/traits/from-iterator.md:17 msgid "" @@ -9916,11 +9232,6 @@ msgid "" " B: FromIterator,\n" " Self: Sized`" msgstr "" -"Implementações `Iterator`\n" -"`fn coletar(self) -> B\n" -"Onde\n" -" B: FromIterator,\n" -" Auto: Tamanho`" #: src/traits/from-iterator.md:23 msgid "" @@ -9935,8 +9246,8 @@ msgid "" "[1]: https://doc.rust-lang.org/std/iter/trait.FromIterator.html\n" "[2]: https://doc.rust-lang.org/std/iter/trait.Iterator.html" msgstr "" -"[1]: https://doc.rust-lang.org/std/sync/struct.Arc.html\n" -"[2]: https://doc.rust-lang.org/std/sync/struct.Mutex.html" +"[1]: https://doc.rust-lang.org/std/iter/trait.FromIterator.html\n" +"[2]: https://doc.rust-lang.org/std/iter/trait.Iterator.html" #: src/traits/from-into.md:1 msgid "# `From` and `Into`" @@ -9958,17 +9269,9 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let s = String::from(\"olá\");\n" -" let addr = std::net::Ipv4Addr::from([127, 0, 0, 1]);\n" -" let um = i16::from(true);\n" -" let maior = i32::from(123i16);\n" -" println!(\"{s}, {addr}, {um}, {maior}\");\n" -"}\n" -"```" #: src/traits/from-into.md:15 +#, fuzzy msgid "[`Into`][2] is automatically implemented when [`From`][1] is implemented:" msgstr "`Into` é implementado automaticamente quando `From` é implementado:" @@ -9984,34 +9287,23 @@ msgid "" "}\n" "```" msgstr "" -"```rust, editable\n" -"fn main() {\n" -" let s: String = \"olá\".into();\n" -" let addr: std::net::Ipv4Addr = [127, 0, 0, 1].into();\n" -" let um: i16 = true.into();\n" -" let maior: i32 = 123i16.into();\n" -" println!(\"{s}, {addr}, {um}, {maior}\");\n" -"}\n" -"```" #: src/traits/from-into.md:27 msgid "" "
\n" " \n" -"* That's why it is common to only implement `From`, as your type will get `Into` implementation " -"too.\n" -"* When declaring a function argument input type like \"anything that can be converted into a " -"`String`\", the rule is opposite, you should use `Into`.\n" +"* That's why it is common to only implement `From`, as your type will get `Into` implementation too.\n" +"* When declaring a function argument input type like \"anything that can be converted into a `String`\", the rule is " +"opposite, you should use `Into`.\n" " Your function will accept types that implement `From` and those that _only_ implement `Into`.\n" " \n" "
" msgstr "" "
\n" " \n" -"* É por isso que é comum implementar apenas `From`, já que seu tipo também receberá implementação " -"`Into`.\n" -"* Ao declarar um tipo de entrada de argumento de função como \"qualquer coisa que possa ser " -"convertida em `String`\", a regra é oposta, você deve usar `Into`.\n" +"* É por isso que é comum implementar apenas `From`, já que seu tipo também receberá implementação `Into`.\n" +"* Ao declarar um tipo de entrada de argumento de função como \"qualquer coisa que possa ser convertida em `String`\", a " +"regra é oposta, você deve usar `Into`.\n" " Sua função aceitará tipos que implementam `From` e aqueles que _apenas_ implementam `Into`.\n" " \n" "
" @@ -10021,8 +9313,8 @@ msgid "" "[1]: https://doc.rust-lang.org/std/convert/trait.From.html\n" "[2]: https://doc.rust-lang.org/std/convert/trait.Into.html" msgstr "" -"[1]: https://doc.rust-lang.org/std/sync/struct.Arc.html\n" -"[2]: https://doc.rust-lang.org/std/sync/struct.Mutex.html" +"[1]: https://doc.rust-lang.org/std/convert/trait.From.html\n" +"[2]: https://doc.rust-lang.org/std/convert/trait.Into.html" #: src/traits/read-write.md:1 msgid "# `Read` and `Write`" @@ -10037,8 +9329,6 @@ msgid "" "```rust,editable\n" "use std::io::{BufRead, BufReader, Read, Result};" msgstr "" -"```rust, editable\n" -"use std::io::{BufRead, BufReader, Read, Result};" #: src/traits/read-write.md:8 msgid "" @@ -10047,10 +9337,6 @@ msgid "" " buf_reader.lines().count()\n" "}" msgstr "" -"fn count_lines(leitor: R) -> usize {\n" -" let buf_reader = BufReader::new(leitor);\n" -" buf_reader.lines().count()\n" -"}" #: src/traits/read-write.md:13 msgid "" @@ -10077,6 +9363,7 @@ msgstr "" "```" #: src/traits/read-write.md:23 +#, fuzzy msgid "Similarly, [`Write`][3] lets you abstract over `u8` sinks:" msgstr "Da mesma forma, `Write` permite abstrair sobre coletores `u8`:" @@ -10095,12 +9382,9 @@ msgid "" " writer.write_all(\"\\n\".as_bytes())\n" "}" msgstr "" -"fn log(writer: &mut W, msg: &str) -> Result<()> {\n" -" Writer.write_all(msg.as_bytes())?;\n" -" escritor.write_all(\"\\n\".as_bytes())\n" -"}" #: src/traits/read-write.md:33 +#, fuzzy msgid "" "fn main() -> Result<()> {\n" " let mut buffer = Vec::new();\n" @@ -10126,9 +9410,9 @@ msgid "" "[2]: https://doc.rust-lang.org/std/io/trait.BufRead.html\n" "[3]: https://doc.rust-lang.org/std/io/trait.Write.html" msgstr "" -"[1]: https://doc.rust-lang.org/std/sync/struct.Mutex.html\n" -"[2]: https://doc.rust-lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E\n" -"[3]: https://doc.rust-lang.org/std/sync/struct.Arc.html" +"[1]: https://doc.rust-lang.org/std/io/trait.Read.html\n" +"[2]: https://doc.rust-lang.org/std/io/trait.BufRead.html\n" +"[3]: https://doc.rust-lang.org/std/io/trait.Write.html" #: src/traits/operators.md:1 msgid "# `Add`, `Mul`, ..." @@ -10144,17 +9428,12 @@ msgid "" "#[derive(Debug, Copy, Clone)]\n" "struct Point { x: i32, y: i32 }" msgstr "" -"```rust, editable\n" -"#[derive(Debug, Copiar, Clonar)]\n" -"struct Point { x: i32, y: i32 }" #: src/traits/operators.md:9 src/exercises/day-2/solutions-morning.md:46 msgid "" "impl std::ops::Add for Point {\n" " type Output = Self;" msgstr "" -"impl std::ops::Adicionar para Point {\n" -" type Saída = Auto;" #: src/traits/operators.md:12 msgid "" @@ -10163,10 +9442,6 @@ msgid "" " }\n" "}" msgstr "" -" fn add(self, other: Self) -> Self {\n" -" Eu {x: eu.x + outro.x, y: eu.y + outro.y}\n" -" }\n" -"}" #: src/traits/operators.md:17 msgid "" @@ -10212,7 +9487,7 @@ msgstr "" #: src/traits/operators.md:40 msgid "[1]: https://doc.rust-lang.org/std/ops/index.html" -msgstr "[`Qualquer`]: https://doc.rust-lang.org/std/any/index.html" +msgstr "" #: src/traits/drop.md:1 msgid "# The `Drop` Trait" @@ -10220,8 +9495,7 @@ msgstr "# A característica 'Drop'" #: src/traits/drop.md:3 msgid "Values which implement [`Drop`][1] can specify code to run when they go out of scope:" -msgstr "" -"Valores que implementam `Drop` podem especificar o código a ser executado quando saem do escopo:" +msgstr "Valores que implementam `Drop` podem especificar o código a ser executado quando saem do escopo:" #: src/traits/drop.md:5 msgid "" @@ -10230,10 +9504,6 @@ msgid "" " name: &'static str,\n" "}" msgstr "" -"```rust, editable\n" -"struct Soltável {\n" -" name: &'static str,\n" -"}" #: src/traits/drop.md:10 msgid "" @@ -10243,13 +9513,9 @@ msgid "" " }\n" "}" msgstr "" -"impl Drop para Droppable {\n" -" fn drop(&mut self) {\n" -" println!(\"Dropping {}\", self.name);\n" -" }\n" -"}" #: src/traits/drop.md:16 +#, fuzzy msgid "" "fn main() {\n" " let a = Droppable { name: \"a\" };\n" @@ -10299,7 +9565,7 @@ msgstr "" #: src/traits/drop.md:44 msgid "[1]: https://doc.rust-lang.org/std/ops/trait.Drop.html" -msgstr "[1]: https://doc.rust-lang.org/std/sync/struct.Arc.html" +msgstr "[1]: https://doc.rust-lang.org/std/ops/trait.Drop.html" #: src/traits/default.md:1 msgid "# The `Default` Trait" @@ -10319,11 +9585,12 @@ msgid "" " z: Implemented,\n" "}" msgstr "" -"```rust, editable\n" -"#[derive(Debug)]\n" -"struct Person {\n" -" name: String,\n" -" age: u8,\n" +"```rust,editable\n" +"#[derive(Debug, Default)]\n" +"struct Derived {\n" +" x: u32,\n" +" y: String,\n" +" z: Implemented,\n" "}" #: src/traits/default.md:13 @@ -10331,8 +9598,6 @@ msgid "" "#[derive(Debug)]\n" "struct Implemented(String);" msgstr "" -"#[derive(Debug)]\n" -"struct Centímetro(i16);" #: src/traits/default.md:16 msgid "" @@ -10342,10 +9607,6 @@ msgid "" " }\n" "}" msgstr "" -"impl Widget para Janela {\n" -" fn width(&self) -> use {\n" -" não implementado!()\n" -" }" #: src/traits/default.md:22 msgid "" @@ -10353,11 +9614,6 @@ msgid "" " let default_struct: Derived = Default::default();\n" " println!(\"{default_struct:#?}\");" msgstr "" -"fn main() {\n" -" let digest = compute_digest(\"Hello\");\n" -" println!(\"Digest: {digest:?}\");\n" -"}\n" -"```" #: src/traits/default.md:26 msgid "" @@ -10378,13 +9634,11 @@ msgstr "" #: src/traits/default.md:40 msgid "" " * It can be implemented directly or it can be derived via `#[derive(Default)]`.\n" -" * Derived implementation will produce an instance where all fields are set to their default " -"values.\n" +" * Derived implementation will produce an instance where all fields are set to their default values.\n" " * This means all types in the struct must implement `Default` too.\n" " * Standard Rust types often implement `Default` with reasonable values (e.g. `0`, `\"\"`, etc).\n" " * The partial struct copy works nicely with default.\n" -" * Rust standard library is aware that types can implement `Default` and provides convenience " -"methods that use it." +" * Rust standard library is aware that types can implement `Default` and provides convenience methods that use it." msgstr "" #: src/traits/default.md:49 @@ -10420,11 +9674,11 @@ msgid "" " y: T,\n" "}" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "#[derive(Debug)]\n" "struct Point {\n" " x: T,\n" -" e: T,\n" +" y: T,\n" "}" #: src/generics/data-types.md:12 @@ -10498,20 +9752,19 @@ msgstr "" #: src/generics/methods.md:25 msgid "" "* *Q:* Why `T` is specified twice in `impl Point {}`? Isn't that redundant?\n" -" * This is because it is a generic implementation section for generic type. They are " -"independently generic.\n" +" * This is because it is a generic implementation section for generic type. They are independently generic.\n" " * It means these methods are defined for any `T`.\n" " * It is possible to write `impl Point { .. }`. \n" -" * `Point` is still generic and you can use `Point`, but methods in this block will only " -"be available for `Point`." +" * `Point` is still generic and you can use `Point`, but methods in this block will only be available for " +"`Point`." msgstr "" "* *P:* Por que `T` é especificado duas vezes em `impl Point {}`? Isso não é redundante?\n" -" * Isso ocorre porque é uma seção de implementação genérica para tipo genérico. Eles são " -"genéricos de forma independente.\n" +" * Isso ocorre porque é uma seção de implementação genérica para tipo genérico. Eles são genéricos de forma " +"independente.\n" " * Significa que esses métodos são definidos para qualquer `T`.\n" " * É possível escrever `Impl Point { .. }`.\n" -" * `Point` ainda é genérico e você pode usar `Point`, mas os métodos neste bloco só " -"estarão disponíveis para `Point`." +" * `Point` ainda é genérico e você pode usar `Point`, mas os métodos neste bloco só estarão disponíveis para " +"`Point`." #: src/generics/trait-bounds.md:1 msgid "# Trait Bounds" @@ -10530,6 +9783,7 @@ msgid "You can do this with `T: Trait` or `impl Trait`:" msgstr "" #: src/generics/trait-bounds.md:8 +#, fuzzy msgid "" "```rust,editable\n" "fn duplicate(a: T) -> (T, T) {\n" @@ -10541,20 +9795,22 @@ msgstr "" " (a.clone(), a.clone())\n" "}" -#: src/generics/trait-bounds.md:13 -msgid "" -"// Syntactic sugar for:\n" -"// fn add_42_millions>(x: T) -> i32 {\n" -"fn add_42_millions(x: impl Into) -> i32 {\n" -" x.into() + 42_000_000\n" -"}" -msgstr "" +#~ #: src/generics/trait-bounds.md:13 +#~ msgid "" +#~ "// Syntactic sugar for:\n" +#~ "// fn add_42_millions>(x: T) -> i32 {\n" +#~ "fn add_42_millions(x: impl Into) -> i32 {\n" +#~ " x.into() + 42_000_000\n" +#~ "}" +#~ msgstr "" #: src/generics/trait-bounds.md:19 +#, fuzzy msgid "// struct NotClonable;" msgstr "// estrutura NotClonable;" #: src/generics/trait-bounds.md:21 +#, fuzzy msgid "" "fn main() {\n" " let foo = String::from(\"foo\");\n" @@ -10568,17 +9824,18 @@ msgstr "" "}\n" "```" -#: src/generics/trait-bounds.md:26 -msgid "" -" let many = add_42_millions(42_i8);\n" -" println!(\"{many}\");\n" -" let many_more = add_42_millions(10_000_000);\n" -" println!(\"{many_more}\");\n" -"}\n" -"```" -msgstr "" +#~ #: src/generics/trait-bounds.md:26 +#~ msgid "" +#~ " let many = add_42_millions(42_i8);\n" +#~ " println!(\"{many}\");\n" +#~ " let many_more = add_42_millions(10_000_000);\n" +#~ " println!(\"{many_more}\");\n" +#~ "}\n" +#~ "```" +#~ msgstr "" #: src/generics/trait-bounds.md:35 +#, fuzzy msgid "" "Show a `where` clause, students will encounter it when reading code.\n" " \n" @@ -10606,19 +9863,18 @@ msgstr "" msgid "" "* It declutters the function signature if you have many parameters.\n" "* It has additional features making it more powerful.\n" -" * If someone asks, the extra feature is that the type on the left of \":\" can be arbitrary, " -"like `Option`.\n" +" * If someone asks, the extra feature is that the type on the left of \":\" can be arbitrary, like `Option`.\n" " \n" "" msgstr "" "* Organiza a assinatura da função se você tiver muitos parâmetros.\n" "* Possui recursos adicionais tornando-o mais poderoso.\n" -" * Se alguém perguntar, o recurso extra é que o tipo à esquerda de \":\" pode ser arbitrário, " -"como `Option`.\n" +" * Se alguém perguntar, o recurso extra é que o tipo à esquerda de \":\" pode ser arbitrário, como `Option`.\n" " \n" "" #: src/generics/impl-trait.md:1 +#, fuzzy msgid "# `impl Trait`" msgstr "# `Impl Trait`" @@ -10639,6 +9895,7 @@ msgstr "" "use std::fmt::Display;" #: src/generics/impl-trait.md:9 +#, fuzzy msgid "" "fn get_x(name: impl Display) -> impl Display {\n" " format!(\"Hello {name}\")\n" @@ -10677,16 +9934,12 @@ msgstr "O significado de 'impl Trait' é um pouco diferente nas diferentes posi #: src/generics/impl-trait.md:26 msgid "" "* For a parameter, `impl Trait` is like an anonymous generic parameter with a trait bound.\n" -"* For a return type, it means that the return type is some concrete type that implements the " -"trait,\n" -" without naming the type. This can be useful when you don't want to expose the concrete type in " -"a\n" +"* For a return type, it means that the return type is some concrete type that implements the trait,\n" +" without naming the type. This can be useful when you don't want to expose the concrete type in a\n" " public API." msgstr "" -"* Para um parâmetro, `impl Trait` é como um parâmetro genérico anônimo com um limite de " -"característica.\n" -"* Para um tipo de retorno, significa que o tipo de retorno é algum tipo concreto que implementa o " -"trait,\n" +"* Para um parâmetro, `impl Trait` é como um parâmetro genérico anônimo com um limite de característica.\n" +"* Para um tipo de retorno, significa que o tipo de retorno é algum tipo concreto que implementa o trait,\n" " sem namear o tipo. Isso pode ser útil quando você não deseja expor o tipo concreto em um\n" " API pública." @@ -10694,8 +9947,7 @@ msgstr "" msgid "" "This example is great, because it uses `impl Display` twice. It helps to explain that\n" "nothing here enforces that it is _the same_ `impl Display` type. If we used a single \n" -"`T: Display`, it would enforce the constraint that input `T` and return `T` type are the same " -"type.\n" +"`T: Display`, it would enforce the constraint that input `T` and return `T` type are the same type.\n" "It would not work for this particular function, as the type we expect as input is likely not\n" "what `format!` returns. If we wanted to do the same via `: Display` syntax, we'd need two\n" "independent generic parameters.\n" @@ -10704,12 +9956,9 @@ msgid "" msgstr "" "Este exemplo é ótimo, porque usa `impl Display` duas vezes. Isso ajuda a explicar\n" "nada aqui impõe que seja _o mesmo_ tipo `impl Display`. Se usássemos um único\n" -"`T: Display`, imporia a restrição de que o tipo `T` de entrada e o tipo `T` de retorno são do " -"mesmo tipo.\n" -"Não funcionaria para esta função específica, pois o tipo que esperamos como entrada provavelmente " -"não é\n" -"o que `format!` retorna. Se quiséssemos fazer o mesmo através da sintaxe `: Display`, " -"precisaríamos de dois\n" +"`T: Display`, imporia a restrição de que o tipo `T` de entrada e o tipo `T` de retorno são do mesmo tipo.\n" +"Não funcionaria para esta função específica, pois o tipo que esperamos como entrada provavelmente não é\n" +"o que `format!` retorna. Se quiséssemos fazer o mesmo através da sintaxe `: Display`, precisaríamos de dois\n" "parâmetros genéricos independentes.\n" " \n" "" @@ -10738,9 +9987,9 @@ msgid "" " func(input)\n" "}" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "fn apply_with_log(func: impl FnOnce(i32) -> i32, input: i32) -> i32 {\n" -" println!(\"Chamando função em {input}\");\n" +" println!(\"Calling function on {input}\");\n" " func(input)\n" "}" @@ -10771,16 +10020,12 @@ msgid "If you have an `FnOnce`, you may only call it once. It might consume capt msgstr "Se você tiver um `FnOnce`, poderá chamá-lo apenas uma vez. Pode consumir valores capturados." #: src/generics/closures.md:27 -msgid "" -"An `FnMut` might mutate captured values, so you can call it multiple times but not concurrently." -msgstr "" -"Um `FnMut` pode alterar os valores capturados, então você pode chamá-lo várias vezes, mas não " -"simultaneamente." +msgid "An `FnMut` might mutate captured values, so you can call it multiple times but not concurrently." +msgstr "Um `FnMut` pode alterar os valores capturados, então você pode chamá-lo várias vezes, mas não simultaneamente." #: src/generics/closures.md:29 msgid "" -"An `Fn` neither consumes nor mutates captured values, or perhaps captures nothing at all, so it " -"can\n" +"An `Fn` neither consumes nor mutates captured values, or perhaps captures nothing at all, so it can\n" "be called multiple times concurrently." msgstr "" "Um `Fn` não consome nem muda os valores capturados, ou talvez não capture nada, então pode\n" @@ -10789,14 +10034,11 @@ msgstr "" #: src/generics/closures.md:32 msgid "" "`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. I.e. you can use an\n" -"`FnMut` wherever an `FnOnce` is called for, and you can use an `Fn` wherever an `FnMut` or " -"`FnOnce`\n" +"`FnMut` wherever an `FnOnce` is called for, and you can use an `Fn` wherever an `FnMut` or `FnOnce`\n" "is called for." msgstr "" -"`FnMut` é um subtipo de `FnOnce`. `Fn` é um subtipo de `FnMut` e `FnOnce`. ou seja você pode usar " -"um\n" -"`FnMut` sempre que um `FnOnce` é chamado, e você pode usar um `Fn` sempre que um `FnMut` ou " -"`FnOnce`\n" +"`FnMut` é um subtipo de `FnOnce`. `Fn` é um subtipo de `FnMut` e `FnOnce`. ou seja você pode usar um\n" +"`FnMut` sempre que um `FnOnce` é chamado, e você pode usar um `Fn` sempre que um `FnMut` ou `FnOnce`\n" "é chamado." #: src/generics/closures.md:36 @@ -10812,6 +10054,7 @@ msgid "Generic code is turned into non-generic code based on the call sites:" msgstr "O código genérico é transformado em código não genérico com base nos sites de chamadas:" #: src/generics/monomorphization.md:5 +#, fuzzy msgid "" "```rust,editable\n" "fn main() {\n" @@ -10898,6 +10141,7 @@ msgstr "" "}" #: src/generics/trait-objects.md:12 +#, fuzzy msgid "" "fn main() {\n" " print(123);\n" @@ -10956,6 +10200,7 @@ msgid "Memory layout after allocating `xs`:" msgstr "Layout da memória após alocar `xs`:" #: src/generics/trait-objects.md:41 +#, fuzzy msgid "" "```bob\n" " Stack Heap\n" @@ -11032,12 +10277,12 @@ msgid "" " }\n" "}" msgstr "" -"```rust, editable\n" -"números fn(n: i32) -> Box> {\n" +"```rust,editable\n" +"fn numbers(n: i32) -> Box> {\n" " if n > 0 {\n" -" Caixa::new(0..n)\n" +" Box::new(0..n)\n" " } else {\n" -" Caixa::new((n..0).rev())\n" +" Box::new((n..0).rev())\n" " }\n" "}" @@ -11049,8 +10294,8 @@ msgid "" "}" msgstr "" "fn main() {\n" -" println!(\"{:?}\", números(-5).collect::>());\n" -" println!(\"{:?}\", números(5).collect::>());\n" +" println!(\"{:?}\", numbers(-5).collect::>());\n" +" println!(\"{:?}\", numbers(5).collect::>());\n" "}" #: src/exercises/day-3/morning.md:1 @@ -11102,6 +10347,7 @@ msgstr "" "métodos `draw_into` para que você implemente o trait `Widget`:" #: src/exercises/day-3/simple-gui.md:18 src/exercises/day-3/safe-ffi-wrapper.md:25 +#, fuzzy msgid "" "```rust,should_panic\n" "// TODO: remove this when you're done with your implementation.\n" @@ -11117,7 +10363,7 @@ msgid "" " /// Natural width of `self`.\n" " fn width(&self) -> usize;" msgstr "" -"Pub trait Widget {\n" +"pub trait Widget {\n" " /// Largura natural de `self`.\n" " fn width(&self) -> usize;" @@ -11130,6 +10376,7 @@ msgstr "" " fn draw_into(&self, buffer: &mut dyn std::fmt::Write);" #: src/exercises/day-3/simple-gui.md:29 src/exercises/day-3/solutions-morning.md:30 +#, fuzzy msgid "" " /// Draw the widget on standard output.\n" " fn draw(&self) {\n" @@ -11153,8 +10400,8 @@ msgid "" " label: String,\n" "}" msgstr "" -"pub struct Rótulo {\n" -" rótulo: Cadeia de caracteres,\n" +"pub struct Label {\n" +" label: String,\n" "}" #: src/exercises/day-3/simple-gui.md:41 src/exercises/day-3/solutions-morning.md:42 @@ -11167,10 +10414,10 @@ msgid "" " }\n" "}" msgstr "" -"impl Rótulo {\n" -" fn new(rótulo: &str) -> Rótulo {\n" -" Rótulo {\n" -" label: label.to_own(),\n" +"impl Label {\n" +" fn new(label: &str) -> Label {\n" +" Label {\n" +" label: label.to_owned(),\n" " }\n" " }\n" "}" @@ -11182,9 +10429,9 @@ msgid "" " callback: Box,\n" "}" msgstr "" -"Pub struct Botão {\n" -" etiqueta: etiqueta,\n" -" retorno de chamada: Box,\n" +"pub struct Button {\n" +" label: Label,\n" +" callback: Box,\n" "}" #: src/exercises/day-3/simple-gui.md:54 src/exercises/day-3/solutions-morning.md:55 @@ -11198,11 +10445,11 @@ msgid "" " }\n" "}" msgstr "" -"botão impl {\n" -" fn new(label: &str, callback: Box) -> Botão {\n" -" Botão {\n" -" rótulo: Rótulo::new(rótulo),\n" -" ligar de volta,\n" +"impl Button {\n" +" fn new(label: &str, callback: Box) -> Button {\n" +" Button {\n" +" label: Label::new(label),\n" +" callback,\n" " }\n" " }\n" "}" @@ -11214,8 +10461,8 @@ msgid "" " widgets: Vec>,\n" "}" msgstr "" -"pub struct Janela {\n" -" título: String,\n" +"pub struct Window {\n" +" title: String,\n" " widgets: Vec>,\n" "}" @@ -11229,10 +10476,10 @@ msgid "" " }\n" " }" msgstr "" -"impl Janela {\n" -" fn new(título: &str) -> Janela {\n" -" Janela {\n" -" título: title.to_own(),\n" +"impl Window {\n" +" fn new(title: &str) -> Window {\n" +" Window {\n" +" title: title.to_owned(),\n" " widgets: Vec::new(),\n" " }\n" " }" @@ -11256,13 +10503,12 @@ msgid "" " unimplemented!()\n" " }" msgstr "" -"impl Widget para etiqueta {\n" -" fn width(&self) -> use {\n" -" não implementado!()\n" +"impl Widget for Label {\n" +" fn width(&self) -> usize {\n" +" unimplemented!()\n" " }" -#: src/exercises/day-3/simple-gui.md:87 src/exercises/day-3/simple-gui.md:97 -#: src/exercises/day-3/simple-gui.md:107 +#: src/exercises/day-3/simple-gui.md:87 src/exercises/day-3/simple-gui.md:97 src/exercises/day-3/simple-gui.md:107 msgid "" " fn draw_into(&self, buffer: &mut dyn std::fmt::Write) {\n" " unimplemented!()\n" @@ -11270,7 +10516,7 @@ msgid "" "}" msgstr "" " fn draw_into(&self, buffer: &mut dyn std::fmt::Write) {\n" -" não implementado!()\n" +" unimplemented!()\n" " }\n" "}" @@ -11281,9 +10527,9 @@ msgid "" " unimplemented!()\n" " }" msgstr "" -"impl Widget para botão {\n" -" fn width(&self) -> use {\n" -" não implementado!()\n" +"impl Widget for Button {\n" +" fn width(&self) -> usize {\n" +" unimplemented!()\n" " }" #: src/exercises/day-3/simple-gui.md:102 @@ -11293,12 +10539,13 @@ msgid "" " unimplemented!()\n" " }" msgstr "" -"impl Widget para Janela {\n" -" fn width(&self) -> use {\n" -" não implementado!()\n" +"impl Widget for Window {\n" +" fn width(&self) -> usize {\n" +" unimplemented!()\n" " }" #: src/exercises/day-3/simple-gui.md:112 +#, fuzzy msgid "" "fn main() {\n" " let mut window = Window::new(\"Rust GUI Demo 1.23\");\n" @@ -11313,8 +10560,7 @@ msgid "" msgstr "" "fn main() {\n" " let mut window = Window::new(\"Rust GUI Demo 1.23\");\n" -" window.add_widget(Box::new(Label::new(\"Esta é uma pequena demonstração de GUI de texto." -"\")));\n" +" window.add_widget(Box::new(Label::new(\"Esta é uma pequena demonstração de GUI de texto.\")));\n" " window.add_widget(Caixa::new(Botão::new(\n" " \"Clique em mim!\",\n" " Box::new(|| println!(\"Você clicou no botão!\")),\n" @@ -11467,8 +10713,7 @@ msgstr "# Pegando a pilha desenrolando" #: src/error-handling/panic-unwind.md:3 msgid "By default, a panic will cause the stack to unwind. The unwinding can be caught:" -msgstr "" -"Por padrão, um pânico fará com que a pilha se desenrole. O desenrolamento pode ser capturado:" +msgstr "Por padrão, um pânico fará com que a pilha se desenrole. O desenrolamento pode ser capturado:" #: src/error-handling/panic-unwind.md:5 msgid "" @@ -11476,7 +10721,7 @@ msgid "" "use std::panic;" msgstr "" "```rust\n" -"use padrão::pânico;" +"use std::panic;" #: src/error-handling/panic-unwind.md:8 msgid "" @@ -11491,6 +10736,7 @@ msgstr "" "assert!(result.is_ok());" #: src/error-handling/panic-unwind.md:13 +#, fuzzy msgid "" "let result = panic::catch_unwind(|| {\n" " panic!(\"oh no!\");\n" @@ -11557,7 +10803,7 @@ msgstr "" " let file = File::open(\"diary.txt\");\n" " match file {\n" " Ok(mut file) => {\n" -" let mut content = String::new();\n" +" let mut contents = String::new();\n" " file.read_to_string(&mut contents);\n" " println!(\"Querido diário: {contents}\");\n" " },\n" @@ -11571,25 +10817,18 @@ msgstr "" #: src/error-handling/result.md:27 msgid "" " * As with `Option`, the successful value sits inside of `Result`, forcing the developer to\n" -" explicitly extract it. This encourages error checking. In the case where an error should never " -"happen,\n" +" explicitly extract it. This encourages error checking. In the case where an error should never happen,\n" " `unwrap()` or `expect()` can be called, and this is a signal of the developer intent too. \n" -" * `Result` documentation is a recommended read. Not during the course, but it is worth " -"mentioning. \n" -" It contains a lot of convenience methods and functions that help functional-style " -"programming. \n" +" * `Result` documentation is a recommended read. Not during the course, but it is worth mentioning. \n" +" It contains a lot of convenience methods and functions that help functional-style programming. \n" " \n" "" msgstr "" " * Como em `Option`, o valor bem-sucedido fica dentro de `Result`, forçando o desenvolvedor a\n" -" extraí-lo explicitamente. Isso encoraja a verificação de erros. No caso em que um erro nunca " -"deve acontecer,\n" -" `unwrap()` ou `expect()` podem ser chamados, e isso também é um sinal da intenção do " -"desenvolvedor.\n" -" * A documentação do `Resultado` é uma leitura recomendada. Não durante o curso, mas vale a pena " -"mencionar.\n" -" Ele contém muitos métodos e funções de conveniência que ajudam na programação de estilo " -"funcional.\n" +" extraí-lo explicitamente. Isso encoraja a verificação de erros. No caso em que um erro nunca deve acontecer,\n" +" `unwrap()` ou `expect()` podem ser chamados, e isso também é um sinal da intenção do desenvolvedor.\n" +" * A documentação do `Resultado` é uma leitura recomendada. Não durante o curso, mas vale a pena mencionar.\n" +" Ele contém muitos métodos e funções de conveniência que ajudam na programação de estilo funcional.\n" " \n" "" @@ -11671,7 +10910,7 @@ msgstr "" #: src/error-handling/try-operator.md:33 msgid " let mut username = String::new();" -msgstr " let mut name de usuário = String::new();" +msgstr "" #: src/error-handling/try-operator.md:35 msgid "" @@ -11681,11 +10920,6 @@ msgid "" " }\n" "}" msgstr "" -" match username_file.read_to_string(&mut username) {\n" -" Ok(_) => Ok(name de usuário),\n" -" Err(e) => Err(e),\n" -" }\n" -"}" #: src/error-handling/try-operator.md:41 msgid "" @@ -11696,25 +10930,16 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" //fs::write(\"config.dat\", \"alice\").unwrap();\n" -" let username = read_username(\"config.dat\");\n" -" println!(\"name de usuário ou erro: {name de usuário:?}\");\n" -"}\n" -"```" #: src/error-handling/try-operator.md:52 src/error-handling/converting-error-types-example.md:52 msgid "" "* The `username` variable can be either `Ok(string)` or `Err(error)`.\n" -"* Use the `fs::write` call to test out the different scenarios: no file, empty file, file with " -"username." +"* Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username." msgstr "" "* A variável `username` pode ser `Ok(string)` ou `Err(error)`.\n" -"* Use a chamada `fs::write` para testar os diferentes cenários: nenhum arquivo, arquivo vazio, " -"arquivo com name de usuário." +"* Use a chamada `fs::write` para testar os diferentes cenários: nenhum arquivo, arquivo vazio, arquivo com name de usuário." -#: src/error-handling/converting-error-types.md:1 -#: src/error-handling/converting-error-types-example.md:1 +#: src/error-handling/converting-error-types.md:1 src/error-handling/converting-error-types-example.md:1 msgid "# Converting Error Types" msgstr "# Convertendo Tipos de Erro" @@ -11728,8 +10953,8 @@ msgid "" "expression?\n" "```" msgstr "" -"```rust, ignore\n" -"expressão?\n" +"```rust,ignore\n" +"expression?\n" "```" #: src/error-handling/converting-error-types.md:9 @@ -11745,10 +10970,10 @@ msgid "" "}\n" "```" msgstr "" -"```rust, ignore\n" +"```rust,ignore\n" "match expression {\n" " Ok(value) => value,\n" -" Err(err) => return Err(From::from(err)),\n" +" Err(err) => return Err(From::from(err)),\n" "}\n" "```" @@ -11768,11 +10993,11 @@ msgid "" "use std::fs::{self, File};\n" "use std::io::{self, Read};" msgstr "" -"```rust, editable\n" -"use padrão::erro::erro;\n" -"use std::{fs, io};\n" -"use std::io::Read;\n" -"use std::fmt::{self, Display, Formatter};" +"```rust,editable\n" +"use std::error::Error;\n" +"use std::fmt::{self, Display, Formatter};\n" +"use std::fs::{self, File};\n" +"use std::io::{self, Read};" #: src/error-handling/converting-error-types-example.md:9 msgid "" @@ -11785,14 +11010,15 @@ msgstr "" "#[derive(Debug)]\n" "enum ReadUsernameError {\n" " IoError(io::Error),\n" -" name de usuário vazio(String),\n" +" EmptyUsername(String),\n" "}" #: src/error-handling/converting-error-types-example.md:15 msgid "impl Error for ReadUsernameError {}" -msgstr "erro impl para ReadUsernameError {}" +msgstr "impl Error for ReadUsernameError {}" #: src/error-handling/converting-error-types-example.md:17 +#, fuzzy msgid "" "impl Display for ReadUsernameError {\n" " fn fmt(&self, f: &mut Formatter) -> fmt::Result {\n" @@ -11807,8 +11033,7 @@ msgstr "" " fn fmt(&self, f: &mut Formatter) -> fmt::Result {\n" " match self {\n" " Self::IoError(e) => write!(f, \"IO error: {}\", e),\n" -" Self::EmptyUsername(filename) => write!(f, \"Não foi encontrado name de usuário em " -"{}\", filename),\n" +" Self::EmptyUsername(filename) => write!(f, \"Não foi encontrado name de usuário em {}\", filename),\n" " }\n" " }\n" "}" @@ -11821,7 +11046,7 @@ msgid "" " }\n" "}" msgstr "" -"impl De para ReadUsernameError {\n" +"impl From for ReadUsernameError {\n" " fn from(err: io::Error) -> ReadUsernameError {\n" " ReadUsernameError::IoError(err)\n" " }\n" @@ -11831,23 +11056,16 @@ msgstr "" msgid "" "fn read_username(path: &str) -> Result {\n" " let mut username = String::with_capacity(100);\n" -" File::open(path)?.read_to_string(&mut username)?;\n" -" if username.is_empty() {\n" -" return Err(ReadUsernameError::EmptyUsername(String::from(path)));\n" -" }\n" -" Ok(username)\n" -"}" -msgstr "" -"fn read_username(path: &str) -> Result {\n" -" let mut username = String::with_capacity(100);\n" -" fs::File::open(path)?.read_to_string(&mut name de usuário)?;\n" -" if name de usuário.is_empty() {\n" +" File::open(path)?.read_to_string(&mut username)?;\n" +" if username.is_empty() {\n" " return Err(ReadUsernameError::EmptyUsername(String::from(path)));\n" " }\n" -" Ok (name de usuário)\n" +" Ok(username)\n" "}" +msgstr "" #: src/error-handling/converting-error-types-example.md:41 +#, fuzzy msgid "" "fn main() {\n" " //fs::write(\"config.dat\", \"\").unwrap();\n" @@ -11865,19 +11083,14 @@ msgstr "" #: src/error-handling/converting-error-types-example.md:55 msgid "" -"It is good practice for all error types to implement `std::error::Error`, which requires `Debug` " -"and\n" -"`Display`. It's generally helpful for them to implement `Clone` and `Eq` too where possible, to " -"make\n" +"It is good practice for all error types to implement `std::error::Error`, which requires `Debug` and\n" +"`Display`. It's generally helpful for them to implement `Clone` and `Eq` too where possible, to make\n" "life easier for tests and consumers of your library. In this case we can't easily do so, because\n" "`io::Error` doesn't implement them." msgstr "" -"É uma boa prática para todos os tipos de erro implementar `std::error::Error`, que requer `Debug` " -"e\n" -"`Mostrar`. Geralmente é útil para eles implementar `Clone` e `Eq` também quando possível, para " -"fazer\n" -"vida mais fácil para testes e consumidores de sua biblioteca. Neste caso, não podemos fazê-lo " -"facilmente, porque\n" +"É uma boa prática para todos os tipos de erro implementar `std::error::Error`, que requer `Debug` e\n" +"`Mostrar`. Geralmente é útil para eles implementar `Clone` e `Eq` também quando possível, para fazer\n" +"vida mais fácil para testes e consumidores de sua biblioteca. Neste caso, não podemos fazê-lo facilmente, porque\n" "`io::Error` não os implementa." #: src/error-handling/deriving-error-enums.md:1 @@ -11902,9 +11115,10 @@ msgstr "" "```rust,editable,compile_fail\n" "use std::{fs, io};\n" "use std::io::Read;\n" -"use este erro::Erro;" +"use thiserror::Error;" #: src/error-handling/deriving-error-enums.md:11 +#, fuzzy msgid "" "#[derive(Debug, Error)]\n" "enum ReadUsernameError {\n" @@ -11935,11 +11149,11 @@ msgid "" msgstr "" "fn read_username(path: &str) -> Result {\n" " let mut username = String::with_capacity(100);\n" -" fs::File::open(path)?.read_to_string(&mut name de usuário)?;\n" -" if name de usuário.is_empty() {\n" +" fs::File::open(path)?.read_to_string(&mut username)?;\n" +" if username.is_empty() {\n" " return Err(ReadUsernameError::EmptyUsername(String::from(path)));\n" " }\n" -" Ok (name de usuário)\n" +" Ok(username)\n" "}" #: src/error-handling/deriving-error-enums.md:28 src/error-handling/dynamic-errors.md:25 @@ -11965,14 +11179,11 @@ msgstr "" #: src/error-handling/deriving-error-enums.md:39 msgid "" "`thiserror`'s derive macro automatically implements `std::error::Error`, and optionally `Display`\n" -"(if the `#[error(...)]` attributes are provided) and `From` (if the `#[from]` attribute is " -"added).\n" +"(if the `#[error(...)]` attributes are provided) and `From` (if the `#[from]` attribute is added).\n" "It also works for structs." msgstr "" -"A macro derivação do `thiserror` implementa automaticamente `std::error::Error`, e opcionalmente " -"`Display`\n" -"(se os atributos `#[error(...)]` forem fornecidos) e `From` (se o atributo `#[from]` for " -"adicionado).\n" +"A macro derivação do `thiserror` implementa automaticamente `std::error::Error`, e opcionalmente `Display`\n" +"(se os atributos `#[error(...)]` forem fornecidos) e `From` (se o atributo `#[from]` for adicionado).\n" "Também funciona para structs." #: src/error-handling/deriving-error-enums.md:43 @@ -11988,8 +11199,7 @@ msgid "" "Sometimes we want to allow any type of error to be returned without writing our own enum covering\n" "all the different possibilities. `std::error::Error` makes this easy." msgstr "" -"Às vezes, queremos permitir que qualquer tipo de erro seja retornado sem escrever nossa própria " -"cobertura de Enum\n" +"Às vezes, queremos permitir que qualquer tipo de erro seja retornado sem escrever nossa própria cobertura de Enum\n" "todas as diferentes possibilages. `std::error::Error` torna isso fácil." #: src/error-handling/dynamic-errors.md:6 @@ -12003,8 +11213,8 @@ msgstr "" "```rust,editable,compile_fail\n" "use std::fs::{self, File};\n" "use std::io::Read;\n" -"use este erro::Erro;\n" -"use padrão::erro::erro;" +"use thiserror::Error;\n" +"use std::error::Error;" #: src/error-handling/dynamic-errors.md:12 msgid "" @@ -12013,10 +11223,11 @@ msgid "" "struct EmptyUsernameError(String);" msgstr "" "#[derive(Clone, Debug, Eq, Error, PartialEq)]\n" -"#[error(\"Não foi encontrado name de usuário em {0}\")]\n" +"#[error(\"Found no username in {0}\")]\n" "struct EmptyUsernameError(String);" #: src/error-handling/dynamic-errors.md:16 +#, fuzzy msgid "" "fn read_username(path: &str) -> Result> {\n" " let mut username = String::with_capacity(100);\n" @@ -12038,19 +11249,14 @@ msgstr "" #: src/error-handling/dynamic-errors.md:36 msgid "" -"This saves on code, but gives up the ability to cleanly handle different error cases differently " -"in\n" -"the program. As such it's generally not a good idea to use `Box` in the public API of " -"a\n" -"library, but it can be a good option in a program where you just want to display the error " -"message\n" +"This saves on code, but gives up the ability to cleanly handle different error cases differently in\n" +"the program. As such it's generally not a good idea to use `Box` in the public API of a\n" +"library, but it can be a good option in a program where you just want to display the error message\n" "somewhere." msgstr "" -"Isso economiza código, mas abre mão da capacage de lidar com diferentes casos de erro de maneira " -"diferente em\n" +"Isso economiza código, mas abre mão da capacage de lidar com diferentes casos de erro de maneira diferente em\n" "o programa. Como tal, geralmente não é uma boa ideia usar `Box` na API pública de um\n" -"biblioteca, mas pode ser uma boa Option em um programa onde você deseja apenas exibir a mensagem " -"de erro\n" +"biblioteca, mas pode ser uma boa Option em um programa onde você deseja apenas exibir a mensagem de erro\n" "algum lugar." #: src/error-handling/error-contexts.md:1 @@ -12077,7 +11283,7 @@ msgstr "" "```rust,editable,compile_fail\n" "use std::{fs, io};\n" "use std::io::Read;\n" -"use de qualquer maneira::{Context, Result, bail};" +"use anyhow::{Context, Result, bail};" #: src/error-handling/error-contexts.md:12 msgid "" @@ -12106,6 +11312,7 @@ msgstr "" "}" #: src/error-handling/error-contexts.md:24 +#, fuzzy msgid "" "fn main() {\n" " //fs::write(\"config.dat\", \"\").unwrap();\n" @@ -12128,20 +11335,17 @@ msgstr "" #: src/error-handling/error-contexts.md:35 msgid "" "* `anyhow::Result` is a type alias for `Result`.\n" -"* `anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally " -"not\n" +"* `anyhow::Error` is essentially a wrapper around `Box`. As such it's again generally not\n" " a good choice for the public API of a library, but is widely used in applications.\n" "* Actual error type inside of it can be extracted for examination if necessary.\n" "* Functionality provided by `anyhow::Result` may be familiar to Go developers, as it provides\n" " similar usage patterns and ergonomics to `(T, error)` from Go." msgstr "" "* `anyhow::Result` é um apelido de tipo para `Result`.\n" -"* `anyhow::Error` é essencialmente um wrapper em torno de `Box`. Como tal, geralmente " -"não é\n" +"* `anyhow::Error` é essencialmente um wrapper em torno de `Box`. Como tal, geralmente não é\n" " uma boa escolha para a API pública de uma biblioteca, mas é amplamente utilizada em aplicações.\n" "* O tipo de erro real dentro dele pode ser extraído para exame, se necessário.\n" -"* A funcionalage fornecida por `anyhow::Result` pode ser familiar para desenvolvedores Go, pois " -"fornece\n" +"* A funcionalage fornecida por `anyhow::Result` pode ser familiar para desenvolvedores Go, pois fornece\n" " padrões de uso e ergonomia semelhantes a `(T, error)` do Go." #: src/testing.md:1 @@ -12178,11 +11382,11 @@ msgid "" " }\n" "}" msgstr "" -"```rust, editable\n" -"fn primeira_palavra(texto: &str) -> &str {\n" +"```rust,editable\n" +"fn first_word(text: &str) -> &str {\n" " match text.find(' ') {\n" -" Some(idx) => &texto[..idx],\n" -" None => &texto,\n" +" Some(idx) => &text[..idx],\n" +" None => &text,\n" " }\n" "}" @@ -12438,11 +11642,9 @@ msgid "" "turned off the compiler safety features and have to write correct code by\n" "themselves. It means the compiler no longer enforces Rust's memory-safety rules." msgstr "" -"Rust inseguro não significa que o código está incorreto. Isso significa que os desenvolvedores " -"têm\n" +"Rust inseguro não significa que o código está incorreto. Isso significa que os desenvolvedores têm\n" "desligou os recursos de segurança do compilador e tem que escrever o código correto\n" -"eles mesmos. Isso significa que o compilador não impõe mais as regras de segurança de memória do " -"Rust." +"eles mesmos. Isso significa que o compilador não impõe mais as regras de segurança de memória do Rust." #: src/unsafe/raw-pointers.md:1 msgid "# Dereferencing Raw Pointers" @@ -12472,8 +11674,7 @@ msgstr "" #: src/unsafe/raw-pointers.md:12 msgid "" -" // Safe because r1 and r2 were obtained from references and so are guaranteed to be non-null " -"and\n" +" // Safe because r1 and r2 were obtained from references and so are guaranteed to be non-null and\n" " // properly aligned, the objects underlying the references from which they were obtained are\n" " // live throughout the whole unsafe block, and they are not accessed either through the\n" " // references or concurrently through any other pointers.\n" @@ -12485,8 +11686,7 @@ msgid "" "}\n" "```" msgstr "" -" // Seguro porque r1 e r2 foram obtidos de referências e, portanto, são garantidos como não " -"nulos e\n" +" // Seguro porque r1 e r2 foram obtidos de referências e, portanto, são garantidos como não nulos e\n" " // devidamente alinhados, os objetos subjacentes às referências das quais foram obtidos são\n" " // vivem em todo o bloco inseguro e não são acessados nem por meio do\n" " // referências ou simultaneamente por meio de quaisquer outros ponteiros.\n" @@ -12504,10 +11704,8 @@ msgid "" "`unsafe` block explaining how the code inside it satisfies the safety requirements of the unsafe\n" "operations it is doing." msgstr "" -"É uma boa prática (e exigida pelo guia de estilo do Android Rust) escrever um comentário para " -"cada\n" -"Bloco `inseguro` explicando como o código dentro dele satisfaz os requisitos de segurança do " -"inseguro\n" +"É uma boa prática (e exigida pelo guia de estilo do Android Rust) escrever um comentário para cada\n" +"Bloco `inseguro` explicando como o código dentro dele satisfaz os requisitos de segurança do inseguro\n" "operações que está fazendo." #: src/unsafe/raw-pointers.md:30 @@ -12561,10 +11759,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() {\n" -" println!(\"HELLO_WORLD: {}\", OLÁ_WORLD);\n" -"}\n" -"```" #: src/unsafe/mutable-static-variables.md:13 msgid "" @@ -12580,7 +11774,7 @@ msgid "" "static mut COUNTER: u32 = 0;" msgstr "" "```rust, editable\n" -"CONTADOR mut static: u32 = 0;" +"static mut CONTADOR: u32 = 0;" #: src/unsafe/mutable-static-variables.md:19 msgid "" @@ -12612,14 +11806,11 @@ msgstr "" #: src/unsafe/mutable-static-variables.md:32 msgid "" -"Using a mutable static is generally a bad idea, but there are some cases where it might make " -"sense\n" +"Using a mutable static is generally a bad idea, but there are some cases where it might make sense\n" "in low-level `no_std` code, such as implementing a heap allocator or working with some C APIs." msgstr "" -"Usar uma estática mutável geralmente é uma má ideia, mas há alguns casos em que pode fazer " -"sentido\n" -"em código `no_std` de baixo nível, como implementar um alocador de heap ou trabalhar com algumas " -"APIs C." +"Usar uma estática mutável geralmente é uma má ideia, mas há alguns casos em que pode fazer sentido\n" +"em código `no_std` de baixo nível, como implementar um alocador de heap ou trabalhar com algumas APIs C." #: src/unsafe/unions.md:1 msgid "# Unions" @@ -12638,10 +11829,10 @@ msgid "" " b: bool,\n" "}" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "#[repr(C)]\n" -"sindicato MyUnion {\n" -" eu: u8,\n" +"union MyUnion {\n" +" i: u8,\n" " b: bool,\n" "}" @@ -12657,18 +11848,16 @@ msgstr "" "fn main() {\n" " let u = MyUnion { i: 42 };\n" " println!(\"int: {}\", unsafe { u.i });\n" -" println!(\"bool: {}\", unsafe { u.b }); // Comportamento indefinido!\n" +" println!(\"bool: {}\", unsafe { u.b }); // Undefined behavior!\n" "}\n" "```" #: src/unsafe/unions.md:21 msgid "" -"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally " -"needed\n" +"Unions are very rarely needed in Rust as you can usually use an enum. They are occasionally needed\n" "for interacting with C library APIs." msgstr "" -"As uniões raramente são necessárias no Rust, pois geralmente você pode usar um enum. Eles são " -"ocasionalmente necessários\n" +"As uniões raramente são necessárias no Rust, pois geralmente você pode usar um enum. Eles são ocasionalmente necessários\n" "para interagir com as APIs da biblioteca C." #: src/unsafe/unions.md:24 @@ -12731,12 +11920,10 @@ msgstr "# Escrevendo Funções Inseguras" #: src/unsafe/writing-unsafe-functions.md:3 msgid "" -"You can mark your own functions as `unsafe` if they require particular conditions to avoid " -"undefined\n" +"You can mark your own functions as `unsafe` if they require particular conditions to avoid undefined\n" "behaviour." msgstr "" -"Você pode marcar suas próprias funções como `inseguras` se elas exigirem condições específicas " -"para evitar\n" +"Você pode marcar suas próprias funções como `inseguras` se elas exigirem condições específicas para evitar\n" "comportamento." #: src/unsafe/writing-unsafe-functions.md:6 @@ -12753,16 +11940,16 @@ msgid "" " *b = temp;\n" "}" msgstr "" -"```rust, editable\n" -"/// Troca os valores apontados pelos ponteiros fornecidos.\n" +"```rust,editable\n" +"/// Swaps the values pointed to by the given pointers.\n" "///\n" -"/// # Segurança\n" +"/// # Safety\n" "///\n" -"/// Os ponteiros devem ser válidos e devidamente alinhados.\n" +"/// The pointers must be valid and properly aligned.\n" "unsafe fn swap(a: *mut u8, b: *mut u8) {\n" " let temp = *a;\n" " *a = *b;\n" -" *b = temperatura;\n" +" *b = temp;\n" "}" #: src/unsafe/writing-unsafe-functions.md:18 @@ -12782,7 +11969,7 @@ msgid "" " swap(&mut a, &mut b);\n" " }" msgstr "" -" // Seguro porque...\n" +" // Safe because ...\n" " unsafe {\n" " swap(&mut a, &mut b);\n" " }" @@ -12799,17 +11986,14 @@ msgstr "" #: src/unsafe/writing-unsafe-functions.md:33 msgid "We wouldn't actually use pointers for this because it can be done safely with references." -msgstr "" -"Na verdade, não usaríamos ponteiros para isso porque isso pode ser feito com segurança com " -"referências." +msgstr "Na verdade, não usaríamos ponteiros para isso porque isso pode ser feito com segurança com referências." #: src/unsafe/writing-unsafe-functions.md:35 msgid "" "Note that unsafe code is allowed within an unsafe function without an `unsafe` block. We can\n" "prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it and see what happens." msgstr "" -"Observe que o código inseguro é permitido dentro de uma função insegura sem um bloco `unsafe`. " -"Pudermos\n" +"Observe que o código inseguro é permitido dentro de uma função insegura sem um bloco `unsafe`. Pudermos\n" "proibir isso com `#[deny(unsafe_op_in_unsafe_fn)]`. Tente adicioná-lo e veja o que acontece." #: src/unsafe/extern-functions.md:1 @@ -12831,10 +12015,6 @@ msgid "" " fn abs(input: i32) -> i32;\n" "}" msgstr "" -"```rust, editable\n" -"externo \"C\" {\n" -" fn abs(input: i32) -> i32;\n" -"}" #: src/unsafe/extern-functions.md:11 msgid "" @@ -12857,14 +12037,11 @@ msgstr "" #: src/unsafe/extern-functions.md:21 msgid "" "This is usually only a problem for extern functions which do things with pointers which might\n" -"violate Rust's memory model, but in general any C function might have undefined behaviour under " -"any\n" +"violate Rust's memory model, but in general any C function might have undefined behaviour under any\n" "arbitrary circumstances." msgstr "" -"Isso geralmente é apenas um problema para funções externas que fazem coisas com ponteiros que " -"podem\n" -"violam o modelo de memória do Rust, mas em geral qualquer função C pode ter comportamento " -"indefinido sob qualquer\n" +"Isso geralmente é apenas um problema para funções externas que fazem coisas com ponteiros que podem\n" +"violam o modelo de memória do Rust, mas em geral qualquer função C pode ter comportamento indefinido sob qualquer\n" "circunstâncias arbitrárias." #: src/unsafe/extern-functions.md:25 @@ -12873,8 +12050,7 @@ msgid "" "[other ABIs are available too](https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" "O `\"C\"` neste exemplo é o ABI;\n" -"[outros ABIs também estão disponíveis](https://doc.rust-lang.org/reference/items/external-blocks." -"html)." +"[outros ABIs também estão disponíveis](https://doc.rust-lang.org/reference/items/external-blocks.html)." #: src/unsafe/unsafe-traits.md:1 msgid "# Implementing Unsafe Traits" @@ -12885,8 +12061,7 @@ msgid "" "Like with functions, you can mark a trait as `unsafe` if the implementation must guarantee\n" "particular conditions to avoid undefined behaviour." msgstr "" -"Assim como nas funções, você pode marcar uma característica como `insegura` se a implementação " -"deve garantir\n" +"Assim como nas funções, você pode marcar uma característica como `insegura` se a implementação deve garantir\n" "condições particulares para evitar comportamento indefinido." #: src/unsafe/unsafe-traits.md:6 @@ -12908,6 +12083,7 @@ msgstr "" "use std::slice;" #: src/unsafe/unsafe-traits.md:13 +#, fuzzy msgid "" "/// ...\n" "/// # Safety\n" @@ -12932,6 +12108,7 @@ msgstr "" "}" #: src/unsafe/unsafe-traits.md:24 +#, fuzzy msgid "" "// Safe because u32 has a defined representation and no padding.\n" "unsafe impl AsBytes for u32 {}\n" @@ -12971,7 +12148,7 @@ msgstr "Depois de ver o exercício, você pode ver a [Solution] fornecida." #: src/exercises/day-3/afternoon.md:9 msgid "[solution]: solutions-afternoon.md" -msgstr "[Solution]: soluções-tarde.md" +msgstr "" #: src/exercises/day-3/safe-ffi-wrapper.md:1 msgid "# Safe FFI Wrapper" @@ -13036,7 +12213,7 @@ msgid "" "mod ffi {\n" " use std::os::raw::{c_char, c_int, c_long, c_ulong, c_ushort};" msgstr "" -"modo ffi {\n" +"mod ffi {\n" " use std::os::raw::{c_char, c_int, c_long, c_ulong, c_ushort};" #: src/exercises/day-3/safe-ffi-wrapper.md:32 src/exercises/day-3/solutions-afternoon.md:26 @@ -13067,9 +12244,9 @@ msgid "" " pub d_name: [c_char; 256],\n" " }" msgstr "" -" // Layout conforme readdir(3) e definições em /usr/include/x86_64-linux-gnu.\n" +" // Layout as per readdir(3) and definitions in /usr/include/x86_64-linux-gnu.\n" " #[repr(C)]\n" -" pub struct direto {\n" +" pub struct dirent {\n" " pub d_ino: c_long,\n" " pub d_off: c_ulong,\n" " pub d_reclen: c_ushort,\n" @@ -13086,7 +12263,7 @@ msgid "" " }\n" "}" msgstr "" -" externo \"C\" {\n" +" extern \"C\" {\n" " pub fn opendir(s: *const c_char) -> *mut DIR;\n" " pub fn readdir(s: *mut DIR) -> *const dirent;\n" " pub fn closedir(s: *mut DIR) -> c_int;\n" @@ -13116,6 +12293,7 @@ msgstr "" "}" #: src/exercises/day-3/safe-ffi-wrapper.md:65 +#, fuzzy msgid "" "impl DirectoryIterator {\n" " fn new(path: &str) -> Result {\n" @@ -13134,6 +12312,7 @@ msgstr "" "}" #: src/exercises/day-3/safe-ffi-wrapper.md:73 +#, fuzzy msgid "" "impl Iterator for DirectoryIterator {\n" " type Item = OsString;\n" @@ -13160,12 +12339,6 @@ msgid "" " }\n" "}" msgstr "" -"impl Drop para DirectoryIterator {\n" -" fn drop(&mut self) {\n" -" // Chama closedir conforme necessário.\n" -" não implementado!()\n" -" }\n" -"}" #: src/exercises/day-3/safe-ffi-wrapper.md:88 msgid "" @@ -13176,12 +12349,6 @@ msgid "" "}\n" "```" msgstr "" -"fn main() -> Result<(), String> {\n" -" let iter = DirectoryIterator::new(\".\")?;\n" -" println!(\"arquivos: {:#?}\", iter.collect::>());\n" -" Ok(())\n" -"}\n" -"```" #: src/welcome-day-4.md:1 msgid "# Welcome to Day 4" @@ -13211,8 +12378,7 @@ msgid "" "> parses some raw bytes would be ideal." msgstr "" "> Tentaremos chamar Rust de um de seus próprios projetos hoje. Então tente\n" -"> encontre um pequeno canto da sua base de código onde podemos mover algumas linhas de código " -"para\n" +"> encontre um pequeno canto da sua base de código onde podemos mover algumas linhas de código para\n" "> rust. Quanto menos dependências e tipos \"exóticos\", melhor. Algo que\n" "> analisa alguns bytes brutos seria o ideal." @@ -13244,8 +12410,7 @@ msgstr "# Tópicos" #: src/concurrency/threads.md:3 msgid "Rust threads work similarly to threads in other languages:" -msgstr "" -"Os encadeamentos Rust funcionam de maneira semelhante aos encadeamentos em outras linguagens:" +msgstr "Os encadeamentos Rust funcionam de maneira semelhante aos encadeamentos em outras linguagens:" #: src/concurrency/threads.md:5 msgid "" @@ -13253,9 +12418,9 @@ msgid "" "use std::thread;\n" "use std::time::Duration;" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "use std::thread;\n" -"use padrão::tempo::Duração;" +"use std::time::Duration;" #: src/concurrency/threads.md:9 msgid "" @@ -13267,13 +12432,6 @@ msgid "" " }\n" " });" msgstr "" -"fn main() {\n" -" thread::spawn(|| {\n" -" para i in 1..10 {\n" -" println!(\"Contagem na thread: {i}!\");\n" -" thread::sleep(Duração::from_millis(5));\n" -" }\n" -" });" #: src/concurrency/threads.md:17 msgid "" @@ -13284,12 +12442,6 @@ msgid "" "}\n" "```" msgstr "" -" for i in 1..5 {\n" -" println!(\"Main thread: {i}\");\n" -" thread::sleep(Duration::from_millis(5));\n" -" }\n" -"}\n" -"```" #: src/concurrency/threads.md:24 msgid "" @@ -13365,11 +12517,6 @@ msgid "" "}\n" "```" msgstr "" -" thread::spawn(|| {\n" -" println!(\"Comprimento: {}\", s.len());\n" -" });\n" -"}\n" -"```" #: src/concurrency/scoped-threads.md:17 msgid "However, you can use a [scoped thread][1] for this:" @@ -13380,7 +12527,7 @@ msgid "" "```rust,editable\n" "use std::thread;" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "use std::thread;" #: src/concurrency/scoped-threads.md:25 @@ -13393,9 +12540,9 @@ msgid "" "}\n" "```" msgstr "" -" thread::escopo(|escopo| {\n" -" escopo.spawn(|| {\n" -" println!(\"Comprimento: {}\", s.len());\n" +" thread::scope(|scope| {\n" +" scope.spawn(|| {\n" +" println!(\"Length: {}\", s.len());\n" " });\n" " });\n" "}\n" @@ -13409,19 +12556,18 @@ msgstr "[1]: https://doc.rust-lang.org/std/thread/fn.scope.html" msgid "" "
\n" " \n" -"* 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.\n" -"* Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably by " -"any number of threads.\n" +"* 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.\n" +"* Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably by any number of threads.\n" " \n" "
" msgstr "" "
\n" " \n" -"* A razão para isso é que, quando a função `thread::scope` for concluída, todas as threads serão " -"unidas, para que possam retornar dados emprestados.\n" -"* Aplicam-se as regras normais de empréstimo do Rust: você pode emprestar mutável por um " -"encadeamento ou imutavelmente por qualquer número de encadeamentos.\n" +"* A razão para isso é que, quando a função `thread::scope` for concluída, todas as threads serão unidas, para que possam " +"retornar dados emprestados.\n" +"* Aplicam-se as regras normais de empréstimo do Rust: você pode emprestar mutável por um encadeamento ou imutavelmente por " +"qualquer número de encadeamentos.\n" " \n" "
" @@ -13443,7 +12589,7 @@ msgid "" "use std::sync::mpsc;\n" "use std::thread;" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "use std::sync::mpsc;\n" "use std::thread;" @@ -13453,23 +12599,19 @@ msgid "" " let (tx, rx) = mpsc::channel();" msgstr "" "fn main() {\n" -" let (tx, rx) = mpsc::canal();" +" let (tx, rx) = mpsc::channel();" #: src/concurrency/channels.md:13 msgid "" " tx.send(10).unwrap();\n" " tx.send(20).unwrap();" msgstr "" -" tx.send(10).unwrap();\n" -" tx.send(20).unwrap();" #: src/concurrency/channels.md:16 msgid "" " println!(\"Received: {:?}\", rx.recv());\n" " println!(\"Received: {:?}\", rx.recv());" msgstr "" -" println!(\"Recebido: {:?}\", rx.recv());\n" -" println!(\"Recebido: {:?}\", rx.recv());" #: src/concurrency/channels.md:19 msgid "" @@ -13479,23 +12621,15 @@ msgid "" "}\n" "```" msgstr "" -" let tx2 = tx.clone();\n" -" tx2.send(30).unwrap();\n" -" println!(\"Recebido: {:?}\", rx.recv());\n" -"}\n" -"```" #: src/concurrency/channels.md:27 msgid "" -"* `mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` " -"(so\n" +"* `mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` (so\n" " you can make multiple producers) but `Receiver` does not.\n" -"* `send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` " -"or\n" +"* `send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` or\n" " `Receiver` is dropped and the channel is closed." msgstr "" -"* `mpsc` significa Multi-Produtor, Único-Consumidor. `Sender` e `SyncSender` implementam `Clone` " -"(então\n" +"* `mpsc` significa Multi-Produtor, Único-Consumidor. `Sender` e `SyncSender` implementam `Clone` (então\n" " você pode criar vários produtores), mas `Receiver` não.\n" "* `send()` e `recv()` retornam `Result`. Se retornarem `Err`, significa a contraparte `Sender` ou\n" " `Receiver` é descartado e o canal é fechado." @@ -13515,10 +12649,10 @@ msgid "" "use std::thread;\n" "use std::time::Duration;" msgstr "" -"```rust, editable\n" +"```rust,editable\n" "use std::sync::mpsc;\n" "use std::thread;\n" -"use padrão::tempo::Duração;" +"use std::time::Duration;" #: src/concurrency/channels/unbounded.md:13 src/concurrency/channels/bounded.md:13 msgid "" @@ -13532,15 +12666,6 @@ msgid "" " });\n" " thread::sleep(Duration::from_millis(100));" msgstr "" -" thread::spawn(mover || {\n" -" let thread_id = thread::current().id();\n" -" para i in 1..10 {\n" -" tx.send(format!(\"Mensagem {i}\")).unwrap();\n" -" println!(\"{thread_id:?}: mensagem enviada {i}\");\n" -" }\n" -" println!(\"{thread_id:?}: feito\");\n" -" });\n" -" thread::sleep(Duração::from_millis(100));" #: src/concurrency/channels/unbounded.md:23 msgid "" @@ -13550,11 +12675,6 @@ msgid "" "}\n" "```" msgstr "" -" for msg em rx.iter() {\n" -" println!(\"Main: obteve {}\", msg);\n" -" }\n" -"}\n" -"```" #: src/concurrency/channels/bounded.md:1 msgid "# Bounded Channels" @@ -13573,6 +12693,7 @@ msgstr "" " let (tx, rx) = mpsc::sync_channel(3);" #: src/concurrency/channels/bounded.md:23 +#, fuzzy msgid "" " for msg in rx.iter() {\n" " println!(\"Main: got {msg}\");\n" @@ -13680,14 +12801,12 @@ msgid "" " operations.\n" "* `Arc` implements `Clone` whether or not `T` does. It implements `Send` and `Sync` iff `T`\n" " implements them both.\n" -"* `Arc::clone()` has the cost of atomic operations that get executed, but after that the use of " -"the\n" +"* `Arc::clone()` has the cost of atomic operations that get executed, but after that the use of the\n" " `T` is free.\n" "* Beware of reference cycles, `Arc` does not use a garbage collector to detect them.\n" " * `std::sync::Weak` can help." msgstr "" -"* `Arc` significa \"Atomic Reference Counted\", uma versão thread-safe de `Rc` que usa dados " -"atômicos\n" +"* `Arc` significa \"Atomic Reference Counted\", uma versão thread-safe de `Rc` que usa dados atômicos\n" " operações.\n" "* `Arc` implementa `Clone` quer `T` o faça ou não. Ele implementa `Send` e `Sync` iff `T`\n" " implementa os dois.\n" @@ -13774,16 +12893,13 @@ msgid "" " \n" "* `Mutex` in Rust looks like a collection with just one element - the protected data.\n" " * It is not possible to forget to acquire the mutex before accessing the protected data.\n" -"* You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that " -"the\n" +"* You can get an `&mut T` from an `&Mutex` by taking the lock. The `MutexGuard` ensures that the\n" " `&mut T` doesn't outlive the lock being held.\n" "* `Mutex` implements both `Send` and `Sync` iff `T` implements `Send`.\n" "* A read-write lock counterpart - `RwLock`.\n" "* Why does `lock()` return a `Result`? \n" -" * If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal " -"that\n" -" the data it protected might be in an inconsistent state. Calling `lock()` on a poisoned " -"mutex\n" +" * If the thread that held the `Mutex` panicked, the `Mutex` becomes \"poisoned\" to signal that\n" +" the data it protected might be in an inconsistent state. Calling `lock()` on a poisoned mutex\n" " fails with a [`PoisonError`]. You can call `into_inner()` on the error to recover the data\n" " regardless." msgstr "" @@ -13796,12 +12912,9 @@ msgstr "" "* `Mutex` implementa `Send` e `Sync` se `T` implementa `Send`.\n" "* Uma contraparte de bloqueio de leitura e gravação - `RwLock`.\n" "* Por que `lock()` retorna um `Result`?\n" -" * Se o thread que manteve o `Mutex` entrou em pânico, o `Mutex` torna-se \"envenenado\" para " -"sinalizar que\n" -" os dados protegidos podem estar em um estado inconsistente. Chamando `lock ()` em um mutex " -"envenenado\n" -" falha com um [`PoisonError`]. Você pode chamar `into_inner()` no erro para recuperar os " -"dados\n" +" * Se o thread que manteve o `Mutex` entrou em pânico, o `Mutex` torna-se \"envenenado\" para sinalizar que\n" +" os dados protegidos podem estar em um estado inconsistente. Chamando `lock ()` em um mutex envenenado\n" +" falha com um [`PoisonError`]. Você pode chamar `into_inner()` no erro para recuperar os dados\n" " independentemente." #: src/concurrency/shared_state/mutex.md:44 @@ -13932,16 +13045,15 @@ msgstr "" msgid "" "* `v` is wrapped in both `Arc` and `Mutex`, because their concerns are orthogonal.\n" " * Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state between threads.\n" -"* `v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` " -"was added to the lambda signature.\n" +"* `v: Arc<_>` needs to be cloned as `v2` before it can be moved into another thread. Note `move` was added to the lambda " +"signature.\n" "* Blocks are introduced to narrow the scope of the `LockGuard` as much as possible.\n" "* We still need to acquire the `Mutex` to print our `Vec`." msgstr "" "* `v` é agrupado em ambos `Arc` e `Mutex`, porque seus interesses são ortogonais.\n" -" * Envolver um `Mutex` em um `Arc` é um padrão comum para compartilhar o estado mutável entre " -"threads.\n" -"* `v: Arc<_>` precisa ser clonado como `v2` antes que possa ser movido para outro thread. A nota " -"`move` foi adicionada à assinatura lambda.\n" +" * Envolver um `Mutex` em um `Arc` é um padrão comum para compartilhar o estado mutável entre threads.\n" +"* `v: Arc<_>` precisa ser clonado como `v2` antes que possa ser movido para outro thread. A nota `move` foi adicionada à " +"assinatura lambda.\n" "* Os blocos são introduzidos para restringir o escopo do `LockGuard` tanto quanto possível.\n" "* Ainda precisamos adquirir o `Mutex` para imprimir nosso `Vec`." @@ -13951,9 +13063,7 @@ msgstr "# `Enviar` e `Sincronizar`" #: src/concurrency/send-sync.md:3 msgid "How does Rust know to forbid shared access across thread? The answer is in two traits:" -msgstr "" -"Como o Rust sabe proibir o acesso compartilhado entre threads? A resposta está em duas " -"características:" +msgstr "Como o Rust sabe proibir o acesso compartilhado entre threads? A resposta está em duas características:" #: src/concurrency/send-sync.md:5 msgid "" @@ -13969,16 +13079,12 @@ msgstr "" #: src/concurrency/send-sync.md:10 msgid "" -"`Send` and `Sync` are [unsafe traits][3]. The compiler will automatically derive them for your " -"types\n" -"as long as they only contain `Send` and `Sync` types. You can also implement them manually when " -"you\n" +"`Send` and `Sync` are [unsafe traits][3]. The compiler will automatically derive them for your types\n" +"as long as they only contain `Send` and `Sync` types. You can also implement them manually when you\n" "know it is valid." msgstr "" -"`Send` e `Sync` são [características inseguras][3]. O compilador os derivará automaticamente para " -"seus tipos\n" -"desde que contenham apenas os tipos `Send` e `Sync`. Você também pode implementá-los manualmente " -"quando\n" +"`Send` e `Sync` são [características inseguras][3]. O compilador os derivará automaticamente para seus tipos\n" +"desde que contenham apenas os tipos `Send` e `Sync`. Você também pode implementá-los manualmente quando\n" "saiba que é válido." #: src/concurrency/send-sync.md:14 @@ -13998,8 +13104,8 @@ msgid "" " \n" "" msgstr "" -"* Pode-se pensar nessas características como marcadores de que o tipo possui certas ownerships de " -"segurança de encadeamento.\n" +"* Pode-se pensar nessas características como marcadores de que o tipo possui certas ownerships de segurança de " +"encadeamento.\n" "* Eles podem ser usados nas restrições genéricas como características normais.\n" " \n" "" @@ -14052,24 +13158,22 @@ msgstr "[1]: https://doc.rust-lang.org/std/marker/trait.Sync.html" #: src/concurrency/send-sync/sync.md:14 msgid "" -"This statement is essentially a shorthand way of saying that if a type is thread-safe for shared " -"use, it is also thread-safe to pass references of it across threads." +"This statement is essentially a shorthand way of saying that if a type is thread-safe for shared use, it is also thread-" +"safe to pass references of it across threads." msgstr "" -"Essa instrução é essencialmente uma maneira abreviada de dizer que, se um tipo é thread-safe para " -"uso compartilhado, também é thread-safe passar referências a ele entre threads." +"Essa instrução é essencialmente uma maneira abreviada de dizer que, se um tipo é thread-safe para uso compartilhado, também " +"é thread-safe passar referências a ele entre threads." #: src/concurrency/send-sync/sync.md:16 msgid "" -"This is because if a type is Sync it means that it can be shared across multiple threads without " -"the risk of data races or other synchronization issues, so it is safe to move it to another " -"thread. A reference to the type is also safe to move to another thread, because the data it " -"references can be accessed from any thread safely." +"This is because if a type is Sync it means that it can be shared across multiple threads without the risk of data races or " +"other synchronization issues, so it is safe to move it to another thread. A reference to the type is also safe to move to " +"another thread, because the data it references can be accessed from any thread safely." msgstr "" -"Isso ocorre porque, se um tipo for Sync, significa que ele pode ser compartilhado entre vários " -"encadeamentos sem o risco de corridas de dados ou outros problemas de sincronização, portanto, é " -"seguro movê-lo para outro encadeamento. Uma referência ao tipo também é segura para mover para " -"outro thread, porque os dados a que ele faz referência podem ser acessados de qualquer thread com " -"segurança." +"Isso ocorre porque, se um tipo for Sync, significa que ele pode ser compartilhado entre vários encadeamentos sem o risco de " +"corridas de dados ou outros problemas de sincronização, portanto, é seguro movê-lo para outro encadeamento. Uma referência " +"ao tipo também é segura para mover para outro thread, porque os dados a que ele faz referência podem ser acessados de " +"qualquer thread com segurança." #: src/concurrency/send-sync/examples.md:1 msgid "# Examples" @@ -14210,8 +13314,7 @@ msgstr "" "> uma espécie de esparguete que se come com dois garfos. Cada philosopher pode\n" "> só pensa e come alternadamente. Além disso, um philosopher só pode comer sua\n" "> espaguete quando eles têm garfo esquerdo e direito. Assim, dois garfos só\n" -"> estar disponível quando seus dois vizinhos mais próximos estiverem pensando, não comendo. Depois " -"de\n" +"> estar disponível quando seus dois vizinhos mais próximos estiverem pensando, não comendo. Depois de\n" "> um philosopher individual termina de comer, eles abaixam os dois garfos." #: src/exercises/day-4/dining-philosophers.md:13 @@ -14221,8 +13324,7 @@ msgid "" "and test that `cargo run` does not deadlock:" msgstr "" "Você precisará de uma [instalação do Cargo] local (../../cargo/running-locally.md) para\n" -"esse exercício. Copie o código abaixo para o arquivo `src/main.rs`, preencha os espaços em " -"branco,\n" +"esse exercício. Copie o código abaixo para o arquivo `src/main.rs`, preencha os espaços em branco,\n" "e teste se `cargo run` não trava:" #: src/exercises/day-4/dining-philosophers.md:17 @@ -14237,7 +13339,7 @@ msgstr "" "use std::sync::mpsc;\n" "use std::sync::{Arc, Mutex};\n" "use std::thread;\n" -"use padrão::tempo::Duração;" +"use std::time::Duration;" #: src/exercises/day-4/dining-philosophers.md:23 src/exercises/day-4/solutions-morning.md:28 msgid "struct Fork;" @@ -14292,6 +13394,7 @@ msgstr "" "}" #: src/exercises/day-4/dining-philosophers.md:46 src/exercises/day-4/solutions-morning.md:60 +#, fuzzy msgid "" "static PHILOSOPHERS: &[&str] =\n" " &[\"Socrates\", \"Plato\", \"Aristotle\", \"Thales\", \"Pythagoras\"];" @@ -14373,8 +13476,7 @@ msgstr "" #: src/exercises/day-4/link-checker.md:20 msgid "You will also need a way to find links. We can use [`scraper`][2] for that:" -msgstr "" -"Você também precisará de uma maneira de encontrar links. Podemos usar [`scraper`][2] para isso:" +msgstr "Você também precisará de uma maneira de encontrar links. Podemos usar [`scraper`][2] para isso:" #: src/exercises/day-4/link-checker.md:22 msgid "" @@ -14498,8 +13600,7 @@ msgstr "" " match base_url.join(href) {\n" " Ok(url) => valid_urls.push(url),\n" " Err(err) => {\n" -" println!(\"Em {base_url}: não foi possível analisar {href:?}: {err} " -"(ignorado)\",);\n" +" println!(\"Em {base_url}: não foi possível analisar {href:?}: {err} (ignorado)\",);\n" " }\n" " }\n" " }\n" @@ -14631,47 +13732,33 @@ msgstr "# Regras de construção" #: src/android/build-rules.md:3 msgid "The Android build system (Soong) supports Rust via a number of modules:" -msgstr "" -"O sistema de compilação do Android (Soong) oferece suporte ao Rust por meio de vários módulos:" +msgstr "O sistema de compilação do Android (Soong) oferece suporte ao Rust por meio de vários módulos:" #: src/android/build-rules.md:5 msgid "" -"| Module Type | " -"Description " -"|\n" +"| Module Type | Description |\n" "|-------------------|----------------------------------------------------------------------------------------------------|\n" -"| `rust_binary` | Produces a Rust " -"binary. |\n" -"| `rust_library` | Produces a Rust library, and provides both `rlib` and `dylib` " -"variants. |\n" -"| `rust_ffi` | Produces a Rust C library usable by `cc` modules, and provides both static " -"and shared variants. |\n" -"| `rust_proc_macro` | Produces a `proc-macro` Rust library. These are analogous to compiler " -"plugins. |\n" -"| `rust_test` | Produces a Rust test binary that uses the standard Rust test " -"harness. |\n" -"| `rust_fuzz` | Produces a Rust fuzz binary leveraging " -"`libfuzzer`. |\n" -"| `rust_protobuf` | Generates source and produces a Rust library that provides an interface for " -"a particular protobuf. |\n" -"| `rust_bindgen` | Generates source and produces a Rust library containing Rust bindings to C " -"libraries. |" +"| `rust_binary` | Produces a Rust binary. |\n" +"| `rust_library` | Produces a Rust library, and provides both `rlib` and `dylib` variants. |\n" +"| `rust_ffi` | Produces a Rust C library usable by `cc` modules, and provides both static and shared variants. |\n" +"| `rust_proc_macro` | Produces a `proc-macro` Rust library. These are analogous to compiler plugins. |\n" +"| `rust_test` | Produces a Rust test binary that uses the standard Rust test harness. |\n" +"| `rust_fuzz` | Produces a Rust fuzz binary leveraging `libfuzzer`. |\n" +"| `rust_protobuf` | Generates source and produces a Rust library that provides an interface for a particular protobuf. |\n" +"| `rust_bindgen` | Generates source and produces a Rust library containing Rust bindings to C libraries. |" msgstr "" "| Tipo de módulo | Descrição |\n" -"|-------------------|---------------------------- " -"-------------------------------------------------- ---------------------|\n" +"|-------------------|---------------------------- -------------------------------------------------- " +"---------------------|\n" "| `rust_binary` | Produz um binário Rust. |\n" "| `rust_library` | Produz uma biblioteca Rust e fornece as variantes `rlib` e `dylib`. |\n" -"| `rust_ffi` | Produz uma biblioteca Rust C utilizável por módulos `cc` e fornece variantes " -"estáticas e compartilhadas. |\n" -"| `rust_proc_macro` | Produz uma biblioteca Rust `proc-macro`. Estes são análogos aos plugins do " -"compilador. |\n" +"| `rust_ffi` | Produz uma biblioteca Rust C utilizável por módulos `cc` e fornece variantes estáticas e compartilhadas. |\n" +"| `rust_proc_macro` | Produz uma biblioteca Rust `proc-macro`. Estes são análogos aos plugins do compilador. |\n" "| `rust_test` | Produz um binário de teste Rust que usa o equipamento de teste Rust padrão. |\n" "| `rust_fuzz` | Produz um binário Rust fuzz aproveitando `libfuzzer`. |\n" -"| `rust_protobuf` | Gera o código-fonte e produz uma biblioteca Rust que fornece uma interface " -"para um protobuf específico. |\n" -"| `rust_bindgen` | Gera fonte e produz uma biblioteca Rust contendo ligações Rust para bibliotecas " -"C. |" +"| `rust_protobuf` | Gera o código-fonte e produz uma biblioteca Rust que fornece uma interface para um protobuf específico. " +"|\n" +"| `rust_bindgen` | Gera fonte e produz uma biblioteca Rust contendo ligações Rust para bibliotecas C. |" #: src/android/build-rules.md:16 msgid "We will look at `rust_binary` and `rust_library` next." @@ -14770,6 +13857,7 @@ msgid "Here we declare a dependency on two libraries:" msgstr "Aqui declaramos uma dependência em duas bibliotecas:" #: src/android/build-rules/library.md:7 +#, fuzzy msgid "" "* `libgreeting`, which we define below,\n" "* `libtextwrap`, which is a crate already vendored in\n" @@ -14780,11 +13868,12 @@ msgstr "" " [`externo/rust/caixas/`][caixas]." #: src/android/build-rules/library.md:11 +#, fuzzy msgid "[crates]: https://cs.android.com/android/platform/superproject/+/master:external/rust/crates/" -msgstr "" -"[caixas]: https://cs.android.com/android/platform/superproject/+/master:external/rust/crates/" +msgstr "[caixas]: https://cs.android.com/android/platform/superproject/+/master:external/rust/crates/" #: src/android/build-rules/library.md:15 +#, fuzzy msgid "" "```javascript\n" "rust_binary {\n" @@ -14799,7 +13888,7 @@ msgid "" "}" msgstr "" "```javascript\n" -"rust_binário {\n" +"rust_binary {\n" " name: \"hello_rust_with_dep\",\n" " crate_name: \"hello_rust_with_dep\",\n" " srcs: [\"src/main.rs\"],\n" @@ -14807,7 +13896,7 @@ msgstr "" " \"libgreetings\",\n" " \"libtextwrap\",\n" " ],\n" -" prefere_rlib: true,\n" +" prefer_rlib: true,\n" "}" #: src/android/build-rules/library.md:27 @@ -14821,7 +13910,7 @@ msgid "" msgstr "" "rust_library {\n" " name: \"libgreetings\",\n" -" crate_name: \"saudações\",\n" +" crate_name: \"greetings\",\n" " srcs: [\"src/lib.rs\"],\n" "}\n" "```" @@ -15016,14 +14105,12 @@ msgstr "*aniversário_serviço/src/lib.rs*:" msgid "" "```rust,ignore\n" "//! Implementation of the `IBirthdayService` AIDL interface.\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"IBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::IBirthdayService;\n" "use com_example_birthdayservice::binder;" msgstr "" "```rust, ignore\n" "//! Implementação da interface AIDL `IBirthdayService`.\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"IBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::IBirthdayService;\n" "use com_example_birthdayservice::binder;" #: src/android/aidl/implementation.md:12 @@ -15105,15 +14192,13 @@ msgid "" "```rust,ignore\n" "//! Birthday service.\n" "use birthdayservice::BirthdayService;\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"BnBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::BnBirthdayService;\n" "use com_example_birthdayservice::binder;" msgstr "" "```rust, ignore\n" "//! Serviço de aniversário.\n" "use birthdayservice::BirthdayService;\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"BnBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::BnBirthdayService;\n" "use com_example_birthdayservice::binder;" #: src/android/aidl/server.md:13 src/android/aidl/client.md:12 @@ -15264,14 +14349,12 @@ msgstr "*aniversário_service/src/client.rs*:" msgid "" "```rust,ignore\n" "//! Birthday service.\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"IBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::IBirthdayService;\n" "use com_example_birthdayservice::binder;" msgstr "" "```rust, ignore\n" "//! Serviço de aniversário.\n" -"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::" -"IBirthdayService;\n" +"use com_example_birthdayservice::aidl::com::example::birthdayservice::IBirthdayService::IBirthdayService;\n" "use com_example_birthdayservice::binder;" #: src/android/aidl/client.md:14 @@ -15496,8 +14579,7 @@ msgstr "" "}\n" "```" -#: src/android/logging.md:42 src/android/interoperability/with-c/bindgen.md:98 -#: src/android/interoperability/with-c/rust.md:73 +#: src/android/logging.md:42 src/android/interoperability/with-c/bindgen.md:98 src/android/interoperability/with-c/rust.md:73 msgid "Build, push, and run the binary on your device:" msgstr "Crie, envie e execute o binário em seu dispositivo:" @@ -15587,7 +14669,7 @@ msgid "" "}" msgstr "" "```rust\n" -"externo \"C\" {\n" +"extern \"C\" {\n" " fn abs(x: i32) -> i32;\n" "}" @@ -15608,6 +14690,7 @@ msgstr "" "```" #: src/android/interoperability/with-c.md:20 +#, fuzzy msgid "" "We already saw this in the [Safe FFI Wrapper\n" "exercise](../../exercises/day-3/safe-ffi-wrapper.md)." @@ -15705,10 +14788,8 @@ msgstr "" msgid "Add this to your `Android.bp` file:" msgstr "Adicione isto ao seu arquivo `Android.bp`:" -#: src/android/interoperability/with-c/bindgen.md:35 -#: src/android/interoperability/with-c/bindgen.md:55 -#: src/android/interoperability/with-c/bindgen.md:69 -#: src/android/interoperability/with-c/bindgen.md:108 +#: src/android/interoperability/with-c/bindgen.md:35 src/android/interoperability/with-c/bindgen.md:55 +#: src/android/interoperability/with-c/bindgen.md:69 src/android/interoperability/with-c/bindgen.md:108 msgid "_interoperability/bindgen/Android.bp_:" msgstr "_interoperabilage/bindgen/Android.bp_:" @@ -15856,9 +14937,7 @@ msgstr "" #: src/android/interoperability/with-c/bindgen.md:106 msgid "Finally, we can run auto-generated tests to ensure the bindings work:" -msgstr "" -"Por fim, podemos executar testes gerados automaticamente para garantir que as vinculações " -"funcionem:" +msgstr "Por fim, podemos executar testes gerados automaticamente para garantir que as vinculações funcionem:" #: src/android/interoperability/with-c/bindgen.md:110 msgid "" @@ -15909,6 +14988,7 @@ msgid "_interoperability/rust/libanalyze/analyze.rs_" msgstr "_interoperabilage/rust/libanalyze/analyze.rs_" #: src/android/interoperability/with-c/rust.md:7 +#, fuzzy msgid "" "```rust,editable\n" "//! Rust FFI demo.\n" @@ -15923,6 +15003,7 @@ msgid "use std::os::raw::c_int;" msgstr "use std::os::raw::c_int;" #: src/android/interoperability/with-c/rust.md:13 +#, fuzzy msgid "" "/// Analyze the numbers.\n" "#[no_mangle]\n" @@ -16072,14 +15153,11 @@ msgstr "" #: src/android/interoperability/with-c/rust.md:83 msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the name " -"of\n" +"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol will just be the name of\n" "the function. You can also use `#[export_name = \"some_name\"]` to specify whatever name you want." msgstr "" -"`#[no_mangle]` desativa a alteração de name usual do Rust, então o símbolo exportado será apenas o " -"name de\n" -"a função. Você também pode usar `#[export_name = \"some_name\"]` para especificar qualquer name " -"que desejar." +"`#[no_mangle]` desativa a alteração de name usual do Rust, então o símbolo exportado será apenas o name de\n" +"a função. Você também pode usar `#[export_name = \"some_name\"]` para especificar qualquer name que desejar." #: src/android/interoperability/cpp.md:1 msgid "# With C++" @@ -16482,8 +15560,7 @@ msgid "" "resources." msgstr "" "O material aqui se baseia em muitas fontes excelentes de documentação do Rust.\n" -"Consulte a página em [outros recursos](outros-recursos.md) para obter uma lista completa de " -"recursos úteis\n" +"Consulte a página em [outros recursos](outros-recursos.md) para obter uma lista completa de recursos úteis\n" "Recursos." #: src/credits.md:7 @@ -16601,19 +15678,19 @@ msgid "" "// limitations under the License." msgstr "" "```rust\n" -"// Direitos autorais 2022 Google LLC\n" +"// Copyright 2022 Google LLC\n" "//\n" -"// Licenciado sob a Licença Apache, Versão 2.0 (a \"Licença\");\n" -"// você não pode usar este arquivo exceto em conformage com a Licença.\n" -"// Você pode obter uma cópia da Licença em\n" +"// Licensed under the Apache License, Version 2.0 (the \"License\");\n" +"// you may not use this file except in compliance with the License.\n" +"// You may obtain a copy of the License at\n" "//\n" -"// http://www.apache.org/licenses/LICENSE-2.0\n" +"// http://www.apache.org/licenses/LICENSE-2.0\n" "//\n" -"// A menos que exigido pela lei aplicável ou aStringdo por escrito, o software\n" -"// distribuído sob a Licença é distribuído em uma BASE \"COMO ESTÁ\",\n" -"// SEM GARANTIAS OU CONDIÇÕES DE QUALQUER TIPO, expressas ou implícitas.\n" -"// Consulte a Licença para obter as permissões de controle do idioma específico e\n" -"// limitações sob a Licença." +"// Unless required by applicable law or agreed to in writing, software\n" +"// distributed under the License is distributed on an \"AS IS\" BASIS,\n" +"// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +"// See the License for the specific language governing permissions and\n" +"// limitations under the License." #: src/exercises/day-1/solutions-morning.md:22 msgid "" @@ -16630,15 +15707,15 @@ msgid "" "}" msgstr "" "// ANCHOR: transpose\n" -"fn transpose(array: [[i32; 3]; 3]) -> [[i32; 3]; 3] {\n" +"fn transpose(matrix: [[i32; 3]; 3]) -> [[i32; 3]; 3] {\n" " // ANCHOR_END: transpose\n" " let mut result = [[0; 3]; 3];\n" " for i in 0..3 {\n" " for j in 0..3 {\n" -" result[j][i] = array[i][j];\n" +" result[j][i] = matrix[i][j];\n" " }\n" " }\n" -" result de retorno;\n" +" return result;\n" "}" #: src/exercises/day-1/solutions-morning.md:34 @@ -16652,10 +15729,10 @@ msgid "" "}" msgstr "" "// ANCHOR: pretty_print\n" -"fn pretty_print(array: &[[i32; 3]; 3]) {\n" +"fn pretty_print(matrix: &[[i32; 3]; 3]) {\n" " // ANCHOR_END: pretty_print\n" -" for linha na array {\n" -" println!(\"{linha:?}\");\n" +" for row in matrix {\n" +" println!(\"{row:?}\");\n" " }\n" "}" @@ -16684,14 +15761,14 @@ msgstr "" "// ANCHOR: tests\n" "#[test]\n" "fn test_transpose() {\n" -" let array = [\n" +" let matrix = [\n" " [101, 102, 103], //\n" " [201, 202, 203],\n" " [301, 302, 303],\n" " ];\n" -" let transposed = transpose(array);\n" +" let transposed = transpose(matrix);\n" " assert_eq!(\n" -" transposto,\n" +" transposed,\n" " [\n" " [101, 201, 301], //\n" " [102, 202, 302],\n" @@ -16702,6 +15779,7 @@ msgstr "" "// ANCHOR_END: tests" #: src/exercises/day-1/solutions-morning.md:62 +#, fuzzy msgid "" "// ANCHOR: main\n" "fn main() {\n" @@ -16720,6 +15798,7 @@ msgstr "" " ];" #: src/exercises/day-1/solutions-morning.md:73 +#, fuzzy msgid "" " let transposed = transpose(matrix);\n" " println!(\"transposed:\");\n" @@ -16737,30 +15816,26 @@ msgstr "" #: src/exercises/day-1/solutions-morning.md:80 msgid "" -"It requires more advanced concepts. It might seem that we could use a slice-of-slices " -"(`&[&[i32]]`) as the input type to transpose and thus make our function handle any size of matrix. " -"However, this quickly breaks down: the return type cannot be `&[&[i32]]` since it needs to own the " -"data you return." +"It requires more advanced concepts. It might seem that we could use a slice-of-slices (`&[&[i32]]`) as the input type to " +"transpose and thus make our function handle any size of matrix. However, this quickly breaks down: the return type cannot " +"be `&[&[i32]]` since it needs to own the data you return." msgstr "" -"Sinceramente não funciona tão bem. Pode parecer que poderíamos usar uma slice de slices " -"(`&[&[i32]]`) como o tipo de entrada para transpose e, assim, fazer nossa função lidar com " -"qualquer tamanho de array. No entanto, isso falha rapidamente: o tipo de retorno não pode ser " -"`&[&[i32]]`, pois ele precisa possuir os dados que você retorna." +"Sinceramente não funciona tão bem. Pode parecer que poderíamos usar uma slice de slices (`&[&[i32]]`) como o tipo de " +"entrada para transpose e, assim, fazer nossa função lidar com qualquer tamanho de array. No entanto, isso falha " +"rapidamente: o tipo de retorno não pode ser `&[&[i32]]`, pois ele precisa possuir os dados que você retorna." #: src/exercises/day-1/solutions-morning.md:82 msgid "" -"You can attempt to use something like `Vec>`, but this doesn't work out-of-the-box " -"either: it's hard to convert from `Vec>` to `&[&[i32]]` so now you cannot easily use " -"`pretty_print` either." +"You can attempt to use something like `Vec>`, but this doesn't work out-of-the-box either: it's hard to convert " +"from `Vec>` to `&[&[i32]]` so now you cannot easily use `pretty_print` either." msgstr "" -"Você pode tentar usar algo como `Vec>`, mas isso também não funciona muito bem: é difícil " -"converter de `Vec>` para `&[&[i32]] ` então agora você também não pode usar " -"`pretty_print` facilmente." +"Você pode tentar usar algo como `Vec>`, mas isso também não funciona muito bem: é difícil converter de " +"`Vec>` para `&[&[i32]] ` então agora você também não pode usar `pretty_print` facilmente." #: src/exercises/day-1/solutions-morning.md:84 msgid "" -"Once we get to traits and generics, we'll be able to use the [`std::convert::AsRef`][1] trait to " -"abstract over anything that can be referenced as a slice." +"Once we get to traits and generics, we'll be able to use the [`std::convert::AsRef`][1] trait to abstract over anything " +"that can be referenced as a slice." msgstr "" #: src/exercises/day-1/solutions-morning.md:86 @@ -16770,8 +15845,8 @@ msgid "" "use std::fmt::Debug;" msgstr "" "```rust\n" -"use std::fs::File;\n" -"use std::io::Read;" +"use std::convert::AsRef;\n" +"use std::fmt::Debug;" #: src/exercises/day-1/solutions-morning.md:90 msgid "" @@ -16788,6 +15863,18 @@ msgid "" " }\n" "}" msgstr "" +"fn pretty_print(matrix: Matrix)\n" +"where\n" +" T: Debug,\n" +" // A line references a slice of items\n" +" Line: AsRef<[T]>,\n" +" // A matrix references a slice of lines\n" +" Matrix: AsRef<[Line]>\n" +"{\n" +" for row in matrix.as_ref() {\n" +" println!(\"{:?}\", row.as_ref());\n" +" }\n" +"}" #: src/exercises/day-1/solutions-morning.md:103 msgid "" @@ -16801,14 +15888,23 @@ msgid "" "}\n" "```" msgstr "" +"fn main() {\n" +" // &[&[i32]]\n" +" pretty_print(&[&[1, 2, 3], &[4, 5, 6], &[7, 8, 9]]);\n" +" // [[&str; 2]; 2]\n" +" pretty_print([[\"a\", \"b\"], [\"c\", \"d\"]]);\n" +" // Vec>\n" +" pretty_print(vec![vec![1, 2], vec![3, 4]]);\n" +"}\n" +"```" #: src/exercises/day-1/solutions-morning.md:113 msgid "" -"In addition, the type itself would not enforce that the child slices are of the same length, so " -"such variable could contain an invalid matrix." +"In addition, the type itself would not enforce that the child slices are of the same length, so such variable could contain " +"an invalid matrix." msgstr "" -"Além disso, o próprio tipo não imporia que as slices filhas tenham o mesmo comprimento, portanto, " -"tal variável poderia conter uma array inválida." +"Além disso, o próprio tipo não imporia que as slices filhas tenham o mesmo comprimento, portanto, tal variável poderia " +"conter uma array inválida." #: src/exercises/day-1/solutions-morning.md:115 msgid "[1]: https://doc.rust-lang.org/std/convert/trait.AsRef.html" @@ -16873,6 +15969,7 @@ msgstr "" " }" #: src/exercises/day-1/solutions-afternoon.md:57 +#, fuzzy msgid "" " // ANCHOR: Library_len\n" " //fn len(self) -> usize {\n" @@ -16893,6 +15990,7 @@ msgstr "" " }" #: src/exercises/day-1/solutions-afternoon.md:66 +#, fuzzy msgid "" " // ANCHOR: Library_is_empty\n" " //fn is_empty(self) -> bool {\n" @@ -16913,6 +16011,7 @@ msgstr "" " }" #: src/exercises/day-1/solutions-afternoon.md:75 +#, fuzzy msgid "" " // ANCHOR: Library_add_book\n" " //fn add_book(self, book: Book) {\n" @@ -16933,6 +16032,7 @@ msgstr "" " }" #: src/exercises/day-1/solutions-afternoon.md:84 +#, fuzzy msgid "" " // ANCHOR: Library_print_books\n" " //fn print_books(self) {\n" @@ -16957,6 +16057,7 @@ msgstr "" " }" #: src/exercises/day-1/solutions-afternoon.md:95 +#, fuzzy msgid "" " // ANCHOR: Library_oldest_book\n" " //fn oldest_book(self) -> Option<&Book> {\n" @@ -16997,6 +16098,7 @@ msgstr "" " let library = Library::new();" #: src/exercises/day-1/solutions-afternoon.md:113 +#, fuzzy msgid "" " //println!(\"Our library is empty: {}\", library.is_empty());\n" " //\n" @@ -17173,7 +16275,7 @@ msgstr "" "pub struct Point {\n" " // ANCHOR_END: Point\n" " x: i32,\n" -" e: i32,\n" +" y: i32,\n" "}" #: src/exercises/day-2/solutions-morning.md:30 @@ -17187,8 +16289,8 @@ msgid "" msgstr "" "// ANCHOR: Point-impl\n" "impl Point {\n" -" // ANCHOR_END: implementação de Point\n" -" pub fn novo(x: i32, y: i32) -> Point {\n" +" // ANCHOR_END: Point-impl\n" +" pub fn new(x: i32, y: i32) -> Point {\n" " Point { x, y }\n" " }" @@ -17198,7 +16300,7 @@ msgid "" " f64::from(self.x.pow(2) + self.y.pow(2)).sqrt()\n" " }" msgstr "" -" pub fn magnitude(auto) -> f64 {\n" +" pub fn magnitude(self) -> f64 {\n" " f64::from(self.x.pow(2) + self.y.pow(2)).sqrt()\n" " }" @@ -17210,7 +16312,7 @@ msgid "" "}" msgstr "" " pub fn dist(self, other: Point) -> f64 {\n" -" (próprio - outro).magnitude()\n" +" (self - other).magnitude()\n" " }\n" "}" @@ -17252,7 +16354,7 @@ msgid "" msgstr "" " fn sub(self, other: Self) -> Self::Output {\n" " Self {\n" -" x: auto.x - outro.x,\n" +" x: self.x - other.x,\n" " y: self.y - other.y,\n" " }\n" " }\n" @@ -17266,10 +16368,10 @@ msgid "" " points: Vec,\n" "}" msgstr "" -"// ANCHOR: Polígono\n" -"pub struct Polígono {\n" -" // ANCHOR_END: Polígono\n" -" Points: Vec,\n" +"// ANCHOR: Polygon\n" +"pub struct Polygon {\n" +" // ANCHOR_END: Polygon\n" +" points: Vec,\n" "}" #: src/exercises/day-2/solutions-morning.md:74 @@ -17282,10 +16384,10 @@ msgid "" " }" msgstr "" "// ANCHOR: Polygon-impl\n" -"impl Polígono {\n" -" // ANCHOR_END: implementação de polígono\n" -" pub fn new() -> Polígono {\n" -" Polígono { Points: Vec::new() }\n" +"impl Polygon {\n" +" // ANCHOR_END: Polygon-impl\n" +" pub fn new() -> Polygon {\n" +" Polygon { points: Vec::new() }\n" " }" #: src/exercises/day-2/solutions-morning.md:81 @@ -17327,7 +16429,7 @@ msgid "" msgstr "" " pub fn length(&self) -> f64 {\n" " if self.points.is_empty() {\n" -" return 0,0;\n" +" return 0.0;\n" " }" #: src/exercises/day-2/solutions-morning.md:98 @@ -17343,11 +16445,11 @@ msgid "" " }\n" "}" msgstr "" -" let mut result = 0,0;\n" +" let mut result = 0.0;\n" " let mut last_point = self.points[0];\n" -" for Point in &self.points[1..] {\n" +" for point in &self.points[1..] {\n" " result += last_point.dist(*point);\n" -" last_point = *Point;\n" +" last_point = *point;\n" " }\n" " result += last_point.dist(self.points[0]);\n" " result\n" @@ -17363,14 +16465,15 @@ msgid "" " radius: i32,\n" "}" msgstr "" -"// ANCHOR: Círculo\n" -"pub struct Círculo {\n" -" // ANCHOR_END: Círculo\n" -" Point central,\n" -" raio: i32,\n" +"// ANCHOR: Circle\n" +"pub struct Circle {\n" +" // ANCHOR_END: Circle\n" +" center: Point,\n" +" radius: i32,\n" "}" #: src/exercises/day-2/solutions-morning.md:116 +#, fuzzy msgid "" "// ANCHOR: Circle-impl\n" "impl Circle {\n" @@ -17387,6 +16490,7 @@ msgstr "" " }" #: src/exercises/day-2/solutions-morning.md:123 +#, fuzzy msgid "" " pub fn circumference(&self) -> f64 {\n" " 2.0 * std::f64::consts::PI * f64::from(self.radius)\n" @@ -17397,6 +16501,7 @@ msgstr "" " }" #: src/exercises/day-2/solutions-morning.md:127 +#, fuzzy msgid "" " pub fn dist(&self, other: &Self) -> f64 {\n" " self.center.dist(other.center)\n" @@ -17479,9 +16584,9 @@ msgid "" "mod tests {\n" " use super::*;" msgstr "" -"// ANCHOR: tests unitários\n" +"// ANCHOR: unit-tests\n" "#[cfg(test)]\n" -"tests mod {\n" +"mod tests {\n" " use super::*;" #: src/exercises/day-2/solutions-morning.md:213 @@ -17513,18 +16618,18 @@ msgstr "" " poly.add_point(Point::new(17, 11));\n" " poly.add_point(Point::new(16, 16));\n" " let shapes = vec![\n" -" Shape::de(poli),\n" -" Shape::de(Círculo::new(Point::new(10, 20), 5)),\n" +" Shape::from(poly),\n" +" Shape::from(Circle::new(Point::new(10, 20), 5)),\n" " ];\n" -" let perímetros = shapes\n" +" let perimeters = shapes\n" " .iter()\n" " .map(Shape::perimeter)\n" " .map(round_two_digits)\n" " .collect::>();\n" -" assert_eq!(perímetros, vec![15.48, 31.42]);\n" +" assert_eq!(perimeters, vec![15.48, 31.42]);\n" " }\n" "}\n" -"// ANCHOR_END: tests unitários" +"// ANCHOR_END: unit-tests" #: src/exercises/day-2/solutions-morning.md:233 src/exercises/day-2/solutions-afternoon.md:174 msgid "" @@ -17579,7 +16684,7 @@ msgstr "" " Some(d) => {\n" " sum += if i % 2 == 1 {\n" " let dd = d * 2;\n" -" dd/10 + dd% 10\n" +" dd / 10 + dd % 10\n" " } else {\n" " d\n" " };\n" @@ -17595,7 +16700,7 @@ msgid "" " return false;\n" " }" msgstr "" -" if dígitos_vistos < 2 {\n" +" if digits_seen < 2 {\n" " return false;\n" " }" @@ -17621,9 +16726,9 @@ msgstr "" "fn main() {\n" " let cc_number = \"1234 5678 1234 5670\";\n" " println!(\n" -" \"{} é um número de cartão de crédito válido? {}\",\n" -" número_cc,\n" -" if luhn(cc_number) { \"sim\" } else { \"não\" }\n" +" \"Is {} a valid credit card number? {}\",\n" +" cc_number,\n" +" if luhn(cc_number) { \"yes\" } else { \"no\" }\n" " );\n" "}" @@ -17635,10 +16740,10 @@ msgid "" " assert!(!luhn(\"foo\"));\n" "}" msgstr "" -"// ANCHOR: tests unitários\n" +"// ANCHOR: unit-tests\n" "#[test]\n" "fn test_non_digit_cc_number() {\n" -" afirmar!(!luhn(\"foo\"));\n" +" assert!(!luhn(\"foo\"));\n" "}" #: src/exercises/day-2/solutions-afternoon.md:89 @@ -17654,11 +16759,11 @@ msgid "" msgstr "" "#[test]\n" "fn test_invalid_cc_number() {\n" -" afirmar!(!luhn(\"4223 9826 4026 9299\"));\n" -" afirmar!(!luhn(\"4539 3195 0343 6476\"));\n" -" afirmar!(!luhn(\"8273 1232 7352 0569\"));\n" +" assert!(!luhn(\"4223 9826 4026 9299\"));\n" +" assert!(!luhn(\"4539 3195 0343 6476\"));\n" +" assert!(!luhn(\"8273 1232 7352 0569\"));\n" "}\n" -"// ANCHOR_END: tests unitários\n" +"// ANCHOR_END: unit-tests\n" "```" #: src/exercises/day-2/solutions-afternoon.md:98 @@ -17681,11 +16786,11 @@ msgid "" " .chain(std::iter::once(None));" msgstr "" "// ANCHOR: prefix_matches\n" -"pub fn prefix_matches(prefixo: &str, request_path: &str) -> bool {\n" +"pub fn prefix_matches(prefix: &str, request_path: &str) -> bool {\n" " // ANCHOR_END: prefix_matches\n" -" let prefixos = prefix.split('/');\n" +" let prefixes = prefix.split('/');\n" " let request_paths = request_path\n" -" .dividir('/')\n" +" .split('/')\n" " .map(|p| Some(p))\n" " .chain(std::iter::once(None));" @@ -17711,7 +16816,7 @@ msgstr "" " return false;\n" " }\n" " }\n" -" None => return false,\n" +" None => return false,\n" " }\n" " }\n" " true\n" @@ -17726,7 +16831,7 @@ msgid "" " assert!(prefix_matches(\"/v1/publishers\", \"/v1/publishers/abc-123\"));\n" " assert!(prefix_matches(\"/v1/publishers\", \"/v1/publishers/abc/books\"));" msgstr "" -"// ANCHOR: tests unitários\n" +"// ANCHOR: unit-tests\n" "#[test]\n" "fn test_matches_without_wildcard() {\n" " assert!(prefix_matches(\"/v1/publishers\", \"/v1/publishers\"));\n" @@ -17749,8 +16854,7 @@ msgstr "" " \"/v1/publishers/foo/booksByAuthor\"\n" " ));\n" "}\n" -"// ANCHOR_END: unit-tests\n" -"```" +"// ANCHOR_END: unit-tests" #: src/exercises/day-3/solutions-morning.md:1 msgid "# Day 3 Morning Exercise" @@ -17771,14 +16875,14 @@ msgid "" " /// Natural width of `self`.\n" " fn width(&self) -> usize;" msgstr "" -"// ANCHOR: configuração\n" -"Pub trait Widget {\n" -" /// Largura natural de `self`.\n" +"// ANCHOR: setup\n" +"pub trait Widget {\n" +" /// Natural width of `self`.\n" " fn width(&self) -> usize;" #: src/exercises/day-3/solutions-morning.md:82 msgid "// ANCHOR_END: setup" -msgstr "// ANCHOR_END: configuração" +msgstr "// ANCHOR_END: setup" #: src/exercises/day-3/solutions-morning.md:84 msgid "" @@ -17792,10 +16896,10 @@ msgid "" " )\n" " }" msgstr "" -"// ANCHOR: largura da janela\n" +"// ANCHOR: Window-width\n" "impl Widget for Window {\n" -" fn width(&self) -> use {\n" -" // ANCHOR_END: largura da janela\n" +" fn width(&self) -> usize {\n" +" // ANCHOR_END: Window-width\n" " std::cmp::max(\n" " self.title.chars().count(),\n" " self.widgets.iter().map(|w| w.width()).max().unwrap_or(0),\n" @@ -17861,11 +16965,11 @@ msgid "" " self.label.width() + 8 // add a bit of padding\n" " }" msgstr "" -"// ANCHOR: Largura do botão\n" +"// ANCHOR: Button-width\n" "impl Widget for Button {\n" -" fn width(&self) -> use {\n" +" fn width(&self) -> usize {\n" " // ANCHOR_END: Button-width\n" -" self.label.width() + 8 // adiciona um pouco de preenchimento\n" +" self.label.width() + 8 // add a bit of padding\n" " }" #: src/exercises/day-3/solutions-morning.md:124 @@ -17915,10 +17019,10 @@ msgid "" " .unwrap_or(0)\n" " }" msgstr "" -"// ANCHOR: Largura do rótulo\n" +"// ANCHOR: Label-width\n" "impl Widget for Label {\n" -" fn width(&self) -> use {\n" -" // ANCHOR_END: Largura do rótulo\n" +" fn width(&self) -> usize {\n" +" // ANCHOR_END: Label-width\n" " self.label\n" " .lines()\n" " .map(|line| line.chars().count())\n" @@ -17943,6 +17047,7 @@ msgstr "" "}" #: src/exercises/day-3/solutions-morning.md:157 +#, fuzzy msgid "" "// ANCHOR: main\n" "fn main() {\n" @@ -17960,8 +17065,7 @@ msgstr "" "// ANCHOR: main\n" "fn main() {\n" " let mut window = Window::new(\"Rust GUI Demo 1.23\");\n" -" window.add_widget(Box::new(Label::new(\"Esta é uma pequena demonstração de GUI de texto." -"\")));\n" +" window.add_widget(Box::new(Label::new(\"Esta é uma pequena demonstração de GUI de texto.\")));\n" " window.add_widget(Caixa::new(Botão::new(\n" " \"Clique em mim!\",\n" " Box::new(|| println!(\"Você clicou no botão!\")),\n" @@ -17990,7 +17094,7 @@ msgid "" " use std::os::raw::{c_char, c_int, c_long, c_ulong, c_ushort};" msgstr "" "// ANCHOR: ffi\n" -"modo ffi {\n" +"mod ffi {\n" " use std::os::raw::{c_char, c_int, c_long, c_ulong, c_ushort};" #: src/exercises/day-3/solutions-afternoon.md:53 @@ -18031,14 +17135,14 @@ msgstr "" "// ANCHOR: DirectoryIterator\n" "impl DirectoryIterator {\n" " fn new(path: &str) -> Result {\n" -" // Chame opendir e retorne um valor Ok se funcionou,\n" -" // caso contrário, retorna Err com uma mensagem.\n" +" // Call opendir and return a Ok value if that worked,\n" +" // otherwise return Err with a message.\n" " // ANCHOR_END: DirectoryIterator\n" -" let path = CString::new(path).map_err(|err| format!(\"Path inválido: {err}\"))?;\n" -" // SEGURANÇA: path.as_ptr() não pode ser NULL.\n" +" let path = CString::new(path).map_err(|err| format!(\"Invalid path: {err}\"))?;\n" +" // SAFETY: path.as_ptr() cannot be NULL.\n" " let dir = unsafe { ffi::opendir(path.as_ptr()) };\n" " if dir.is_null() {\n" -" Err(format!(\"Não foi possível abrir {:?}\", path))\n" +" Err(format!(\"Could not open {:?}\", path))\n" " } else {\n" " Ok(DirectoryIterator { path, dir })\n" " }\n" @@ -18071,16 +17175,16 @@ msgstr "" "impl Iterator for DirectoryIterator {\n" " type Item = OsString;\n" " fn next(&mut self) -> Option {\n" -" // Continue chamando readdir até obtermos um ponteiro NULL de volta.\n" -" // ANCHOR_END: iterator\n" -" // SEGURANÇA: self.dir nunca é NULL.\n" +" // Keep calling readdir until we get a NULL pointer back.\n" +" // ANCHOR_END: Iterator\n" +" // SAFETY: self.dir is never NULL.\n" " let dirent = unsafe { ffi::readdir(self.dir) };\n" " if dirent.is_null() {\n" -" // Chegamos ao final do diretório.\n" +" // We have reached the end of the directory.\n" " return None;\n" " }\n" -" // SEGURANÇA: dirent não é NULL e dirent.d_name é NUL\n" -" // encerrado.\n" +" // SAFETY: dirent is not NULL and dirent.d_name is NUL\n" +" // terminated.\n" " let d_name = unsafe { CStr::from_ptr((*dirent).d_name.as_ptr()) };\n" " let os_str = OsStr::from_bytes(d_name.to_bytes());\n" " Some(os_str.to_owned())\n" @@ -18106,12 +17210,12 @@ msgstr "" "// ANCHOR: Drop\n" "impl Drop for DirectoryIterator {\n" " fn drop(&mut self) {\n" -" // Chama closedir conforme necessário.\n" +" // Call closedir as needed.\n" " // ANCHOR_END: Drop\n" " if !self.dir.is_null() {\n" -" // SEGURANÇA: self.dir não é NULL.\n" +" // SAFETY: self.dir is not NULL.\n" " if unsafe { ffi::closedir(self.dir) } != 0 {\n" -" panic!(\"Não foi possível fechar {:?}\", self.path);\n" +" panic!(\"Could not close {:?}\", self.path);\n" " }\n" " }\n" " }\n" @@ -18161,7 +17265,7 @@ msgstr "" "use std::sync::mpsc;\n" "use std::sync::{Arc, Mutex};\n" "use std::thread;\n" -"use padrão::tempo::Duração;" +"use std::time::Duration;" #: src/exercises/day-4/solutions-morning.md:30 msgid "" @@ -18196,7 +17300,7 @@ msgstr "" "impl Philosopher {\n" " fn think(&self) {\n" " self.thoughts\n" -" .send(format!(“Eureka! {} has a new idea!”, &self.name))\n" +" .send(format!(\"Eureka! {} has a new idea!\", &self.name))\n" " .unwrap();\n" " }\n" " // ANCHOR_END: Philosopher-think" @@ -18213,7 +17317,7 @@ msgstr "" " // ANCHOR: Philosopher-eat\n" " fn eat(&self) {\n" " // ANCHOR_END: Philosopher-eat\n" -" println!(“{} is trying to eat”, &self.name);\n" +" println!(\"{} is trying to eat\", &self.name);\n" " let left = self.left_fork.lock().unwrap();\n" " let right = self.right_fork.lock().unwrap();" @@ -18226,7 +17330,7 @@ msgid "" "}" msgstr "" " // ANCHOR: Philosopher-eat-end\n" -" println!(“{} is eating…”, &self.name);\n" +" println!(\"{} is eating...\", &self.name);\n" " thread::sleep(Duration::from_millis(10));\n" " }\n" "}" @@ -18247,8 +17351,8 @@ msgid "" " .map(|_| Arc::new(Mutex::new(Fork)))\n" " .collect::>();" msgstr "" -" let garfos = (0..Philosopher.len())\n" -" .map(|_| Arc::new(Mutex::new(Fora)))\n" +" let forks = (0..PHILOSOPHERS.len())\n" +" .map(|_| Arc::new(Mutex::new(Fork)))\n" " .collect::>();" #: src/exercises/day-4/solutions-morning.md:71 @@ -18276,7 +17380,7 @@ msgstr "" " // algum lugar. Isso irá trocar os garfos sem desinicializar\n" " // qualquer um deles.\n" " if i == forks.len() - 1 {\n" -" std::mem::swap(&mut left_fork, &mut fork_direita);\n" +" std::mem::swap(&mut left_fork, &mut right_fork);\n" " }" #: src/exercises/day-4/solutions-morning.md:83 @@ -18305,7 +17409,7 @@ msgid "" " });\n" " }" msgstr "" -" thread::spawn(mover || {\n" +" thread::spawn(move || {\n" " for _ in 0..100 {\n" " philosopher.eat();\n" " philosopher.think();\n" @@ -18324,16 +17428,14 @@ msgid "" msgstr "" " drop(tx);\n" " for thought in rx {\n" -" println!(\"{}\", thought);\n" +" println!(\"{thought}\");\n" " }\n" "}\n" "```" #~ msgid "" #~ "* `Box` is like `std::unique_ptr` in C++.\n" -#~ "* In the above example, you can even leave out the `*` in the `println!` statement thanks to " -#~ "`Deref`." +#~ "* In the above example, you can even leave out the `*` in the `println!` statement thanks to `Deref`." #~ msgstr "" #~ "* `Box` é como `std::unique_ptr` em C++.\n" -#~ "* No exemplo acima, você pode até deixar de fora o `*` na declaração `println!` graças a " -#~ "`Deref`." +#~ "* No exemplo acima, você pode até deixar de fora o `*` na declaração `println!` graças a `Deref`."