Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a471a04
translation > appendix 00 to 07
drunkleen Jan 4, 2025
9697010
translation > chapter 1st, 2nd 3rd, 4th, 5th
drunkleen Jan 4, 2025
fa1e62c
translation > chapter 6th, 7th, 8th, 9th, 10th
drunkleen Jan 4, 2025
67b442e
translation > chapter 11th, 12th, 13th, 14th, 15th
drunkleen Jan 4, 2025
12c138c
RTL support added to text
drunkleen Jan 4, 2025
a18582a
translation > random chapters and files
drunkleen Jan 4, 2025
5dbfba6
modification > main dir *.md files
drunkleen Jan 4, 2025
d83ed5e
typo fix
drunkleen Jan 4, 2025
6e283ae
translation > chapter 6th, 7th, 8th, 9th, 10th
drunkleen Jan 4, 2025
0700cc0
translation > chapter 11th, 12th, 13th, 14th, 15th
drunkleen Jan 4, 2025
afbd70f
translation > random chapters and files
drunkleen Jan 4, 2025
92c5a03
modification > main dir *.md files
drunkleen Jan 4, 2025
e9e12b8
typo fix
drunkleen Jan 4, 2025
489bee5
translation > new files
drunkleen Jan 7, 2025
0285ab4
translation > typo fix
drunkleen Jan 7, 2025
9b4fe4e
new chapters added
drunkleen Jan 8, 2025
49cfbbf
translation > chapter 20
drunkleen Jan 8, 2025
eae6017
translation > chapter 21
drunkleen Jan 8, 2025
6e2905e
custom js & css changed for rtl direction
drunkleen Jan 8, 2025
f74fe71
fixing some phrases
drunkleen Jan 8, 2025
cc875ed
word correction
drunkleen Jan 9, 2025
f79c65b
links fixed
drunkleen Jan 25, 2025
005f9cf
Merge pull request #4 from persian-rust/persian-draft
drunkleen Jan 25, 2025
82db7da
link fix
drunkleen Jan 25, 2025
70a29c5
update ch01-03-hello-cargo.md
amirfaramarzi Feb 10, 2025
dcc87ec
fix ch08-02-strings
amirfaramarzi Feb 14, 2025
cc7d74b
fix ch09-01-unrecoverable-errors-with-panic.md
amirfaramarzi Feb 14, 2025
cdc8b6a
fix ch17-02-concurrency-with-async.md
amirfaramarzi Feb 21, 2025
58c189d
remove text-direction from book.toml
szabgab Apr 11, 2025
fb60fad
Merge pull request #5 from amirfaramarzi/main
drunkleen May 14, 2025
0a5aa17
Merge pull request #6 from szabgab/patch-2
drunkleen May 14, 2025
387a073
Update Cargo.toml
mohammadrezafotohi Aug 4, 2025
913976a
Merge pull request #8 from mohammadrezafotohi/patch-2
drunkleen Aug 5, 2025
e583f65
Merge remote-tracking branch 'upstream/main' into persian-draft
drunkleen Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions CONTRIBUTING-en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Contributing

<div align="center">

[English](CONTRIBUTING-EN.md) | [فارسی](CONTRIBUTING.md)

</div>

We'd love your help! Thanks for caring about the book.

## Where to Edit

All edits should be made in the `src` directory.

The `nostarch` directory contains snapshots for sending edits to the publishers
of the print version. The snapshot files reflect what has been sent or not, so
they only get updated when edits are sent to No Starch. **Do not submit pull
requests changing files in the `nostarch` directory, they will be closed.**

We use [`rustfmt`][rustfmt] to apply standard formatting to Rust code in the
repo and [`dprint`][dprint] to apply standing formatting to the Markdown source
and the non-Rust code in the project.

[rustfmt]: https://github.com/rust-lang/rustfmt
[dprint]: https://dprint.dev

You will normally have `rustfmt` installed if you have a Rust toolchain
installed; if for some reason you do not have a copy of `rustfmt`, you can add
it by running the following command:

```sh
rustup component add rustfmt
```

To install `dprint`, you can run the following command:

```sh
cargo install dprint
```

Or follow the [instructions][install-dprint] on the `dprint` website.

[install-dprint]: https://dprint.dev/install/

To format Rust code, you can run `rustfmt <path to file>`, and to format other
files, you can pass `dprint <path to file>`. Many text editors also have native
support or extensions for both `rustfmt` and `dprint`.

## Checking for Fixes

The book rides the Rust release trains. Therefore, if you see a problem on
https://doc.rust-lang.org/stable/book, it may already be fixed on the `main`
branch in this repo, but the fix hasn't gone through nightly -> beta -> stable
yet. Please check the `main` branch in this repo before reporting an issue.

Looking at the history for a particular file can also give more information on
how or whether an issue has been fixed or not if you're trying to figure that
out.

Please also search open and closed issues and open and closed PRs before
reporting a new issue or opening a new PR.

## Licensing

This repository is under the same license as Rust itself, MIT/Apache2. You
can find the full text of each license in the `LICENSE-*` files in this
repository.

## Code of Conduct

The Rust project has [a code of conduct](http://rust-lang.org/policies/code-of-conduct)
that governs all sub-projects, including this one. Please respect it!

## Expectations

Because the book is [printed][nostarch], and because we want
to keep the online version of the book close to the print version when
possible, it may take longer than you're used to for us to address your issue
or pull request.

[nostarch]: https://nostarch.com/rust-programming-language-2nd-edition

So far, we've been doing a larger revision to coincide with [Rust Editions](https://doc.rust-lang.org/edition-guide/). Between those larger
revisions, we will only be correcting errors. If your issue or pull request
isn't strictly fixing an error, it might sit until the next time that we're
working on a large revision: expect on the order of months or years. Thank you
for your patience!

## Help wanted

If you're looking for ways to help that don't involve large amounts of
reading or writing, check out the [open issues with the E-help-wanted
label][help-wanted]. These might be small fixes to the text, Rust code,
frontend code, or shell scripts that would help us be more efficient or
enhance the book in some way!

[help-wanted]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3AE-help-wanted

## Translations

We'd love help translating the book! See the [Translations] label to join in
efforts that are currently in progress. Open a new issue to start working on
a new language! We're waiting on [mdbook support] for multiple languages
before we merge any in, but feel free to start!

[Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
[mdbook support]: https://github.com/rust-lang/mdBook/issues/5
95 changes: 30 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,66 @@
# Contributing
<div dir="rtl">

We'd love your help! Thanks for caring about the book.
# مشارکت

## Where to Edit
<div align="center">

[English](CONTRIBUTING-EN.md) | [فارسی](CONTRIBUTING.md)

</div>

All edits should be made in the `src` directory.
ما از کمک شما استقبال می‌کنیم! از اینکه به کتاب اهمیت می‌دهید سپاسگزاریم.

The `nostarch` directory contains snapshots for sending edits to the publishers
of the print version. The snapshot files reflect what has been sent or not, so
they only get updated when edits are sent to No Starch. **Do not submit pull
requests changing files in the `nostarch` directory, they will be closed.**
## کجا باید ویرایش شود؟

We use [`rustfmt`][rustfmt] to apply standard formatting to Rust code in the
repo and [`dprint`][dprint] to apply standing formatting to the Markdown source
and the non-Rust code in the project.
تمام ویرایش‌ها باید در دایرکتوری `src` انجام شوند.

دایرکتوری `nostarch` شامل عکس‌هایی برای ارسال ویرایش‌ها به ناشران نسخه چاپی است. فایل‌های عکس بازتابی از موارد ارسال‌شده یا نشده هستند، بنابراین فقط زمانی به‌روز می‌شوند که ویرایش‌ها به No Starch ارسال شوند. **لطفاً درخواست‌های pull که فایل‌های داخل دایرکتوری `nostarch` را تغییر می‌دهند ارسال نکنید، این درخواست‌ها بسته خواهند شد.**

ما از [`rustfmt`][rustfmt] برای اعمال قالب‌بندی استاندارد بر روی کد Rust در مخزن و از [`dprint`][dprint] برای اعمال قالب‌بندی استاندارد بر روی منبع Markdown و کدهای غیر Rust در پروژه استفاده می‌کنیم.

[rustfmt]: https://github.com/rust-lang/rustfmt
[dprint]: https://dprint.dev

You will normally have `rustfmt` installed if you have a Rust toolchain
installed; if for some reason you do not have a copy of `rustfmt`, you can add
it by running the following command:
اگر ابزار Rust را نصب کرده باشید، معمولاً `rustfmt` نصب خواهد شد؛ اما اگر به هر دلیلی نسخه‌ای از `rustfmt` ندارید، می‌توانید با اجرای دستور زیر آن را اضافه کنید:

```sh
rustup component add rustfmt
```

To install `dprint`, you can run the following command:
برای نصب `dprint` می‌توانید دستور زیر را اجرا کنید:

```sh
cargo install dprint
```

Or follow the [instructions][install-dprint] on the `dprint` website.
یا دستورالعمل‌های [وب‌سایت `dprint`][install-dprint] را دنبال کنید.

[install-dprint]: https://dprint.dev/install/

To format Rust code, you can run `rustfmt <path to file>`, and to format other
files, you can pass `dprint fmt <path to file>`. Many text editors also have native
support or extensions for both `rustfmt` and `dprint`.
برای قالب‌بندی کدهای Rust، می‌توانید دستور `rustfmt <path to file>` را اجرا کنید. برای قالب‌بندی فایل‌های دیگر، می‌توانید از دستور `dprint fmt <path to file>` استفاده کنید. بسیاری از ویرایشگرهای متن نیز به‌صورت داخلی یا از طریق افزونه‌ها از هر دو ابزار `rustfmt` و `dprint` پشتیبانی می‌کنند.

## Checking for Fixes
## بررسی issueها

The book rides the Rust release trains. Therefore, if you see a problem on
https://doc.rust-lang.org/stable/book, it may already be fixed on the `main`
branch in this repo, but the fix hasn't gone through nightly -> beta -> stable
yet. Please check the `main` branch in this repo before reporting an issue.
کتاب با نسخه‌های منتشرشده Rust حرکت می‌کند. بنابراین، اگر مشکلی در https://doc.rust-lang.org/stable/book مشاهده کردید، ممکن است قبلاً در شاخه `main` این مخزن رفع شده باشد، اما رفع آن هنوز از مسیر nightly -> beta -> stable عبور نکرده باشد. لطفاً شاخه `main` این مخزن را پیش از گزارش مشکل بررسی کنید.

Looking at the history for a particular file can also give more information on
how or whether an issue has been fixed or not if you're trying to figure that
out.
با نگاهی به تاریخچه یک فایل خاص نیز می‌تواند اطلاعات بیشتری در مورد چگونگی یا وضعیت رفع یک مشکل ارائه دهد.

Please also search open and closed issues and open and closed PRs before
reporting a new issue or opening a new PR.
همچنین لطفاً قبل از گزارش یک مشکل جدید یا باز کردن یک pull request جدید، در میان مشکلات باز و بسته و pull request‌های باز و بسته جستجو کنید.

## Licensing
## مجوزها

This repository is under the same license as Rust itself, MIT/Apache2. You
can find the full text of each license in the `LICENSE-*` files in this
repository.
این مخزن تحت همان مجوزهای Rust، یعنی MIT/Apache2 است. متن کامل هر مجوز در فایل‌های `LICENSE-*` این مخزن قرار دارد.

## Code of Conduct
## کد اخلاق

The Rust project has [a code of conduct](http://rust-lang.org/policies/code-of-conduct)
that governs all sub-projects, including this one. Please respect it!
پروژه Rust دارای [کد اخلاقی](http://rust-lang.org/policies/code-of-conduct) است که تمام زیرپروژه‌ها، از جمله این پروژه را شامل می‌شود. لطفاً به آن احترام بگذارید!

## Expectations
## انتظارات

Because the book is [printed][nostarch], and because we want
to keep the online version of the book close to the print version when
possible, it may take longer than you're used to for us to address your issue
or pull request.
از آنجا که کتاب [چاپ شده است][nostarch] و ما می‌خواهیم نسخه آنلاین کتاب تا حد امکان نزدیک به نسخه چاپی باشد، ممکن است مدت زمان بیشتری طول بکشد تا ما به مشکل یا pull request شما رسیدگی کنیم.

[nostarch]: https://nostarch.com/rust-programming-language-2nd-edition

So far, we've been doing a larger revision to coincide with [Rust Editions](https://doc.rust-lang.org/edition-guide/). Between those larger
revisions, we will only be correcting errors. If your issue or pull request
isn't strictly fixing an error, it might sit until the next time that we're
working on a large revision: expect on the order of months or years. Thank you
for your patience!

## Help wanted

If you're looking for ways to help that don't involve large amounts of
reading or writing, check out the [open issues with the E-help-wanted
label][help-wanted]. These might be small fixes to the text, Rust code,
frontend code, or shell scripts that would help us be more efficient or
enhance the book in some way!

[help-wanted]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3AE-help-wanted

## Translations

We'd love help translating the book! See the [Translations] label to join in
efforts that are currently in progress. Open a new issue to start working on
a new language! We're waiting on [mdbook support] for multiple languages
before we merge any in, but feel free to start!
تا کنون، ما یک بازبینی بزرگ‌تر را برای همزمانی با [نسخه‌های Rust](https://doc.rust-lang.org/edition-guide/) انجام داده‌ایم. بین این بازبینی‌های بزرگ، فقط خطاها را اصلاح می‌کنیم. اگر مشکل یا pull request شما به طور دقیق یک خطا را اصلاح نمی‌کند، ممکن است تا زمانی که روی یک بازبینی بزرگ دیگر کار کنیم منتظر بماند: انتظار داشته باشید که این مدت ممکن است ماه‌ها یا سال‌ها باشد. از صبر شما سپاسگزاریم!

[Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
[mdbook support]: https://github.com/rust-lang/mdBook/issues/5
</div>
18 changes: 15 additions & 3 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
This repository is licensed under the Apache License, Version 2.0
<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT
license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
<div align="center">

[English](COPYRIGHT-EN) | [فارسی](COPYRIGHT)

</div>

<div dir="rtl">

این مخزن تحت مجوز Apache، نسخه 2.0
<LICENSE-APACHE یا https://www.apache.org/licenses/LICENSE-2.0>
یا مجوز MIT
<LICENSE-MIT یا https://opensource.org/licenses/MIT>
به انتخاب شما مجاز است.

</div>
9 changes: 9 additions & 0 deletions COPYRIGHT-EN
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div align="center">

[English](COPYRIGHT-EN) | [فارسی](COPYRIGHT)

</div>

This repository is licensed under the Apache License, Version 2.0
<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the MIT
license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
126 changes: 126 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# The Rust Programming Language

![Build Status](https://github.com/rust-lang/book/workflows/CI/badge.svg)

<div align="center">

[English](README-EN.md) | [فارسی](README.md)

</div>

**Please note, this translation is not yet finished and requires thorough reviewing and editing, which should be completed soon. You can find ongoing translations in the [`persian-draft` branch](https://github.com/drunkleen/rust-book-persian/tree/persian-draft) of the repository.**



This repository contains the source of "The Rust Programming Language" book.

[The book is available in dead-tree form from No Starch Press][nostarch].

[nostarch]: https://nostarch.com/rust-programming-language-2nd-edition

You can also read the book for free online. Please see the book as shipped with
the latest [stable], [beta], or [nightly] Rust releases. Be aware that issues
in those versions may have been fixed in this repository already, as those
releases are updated less frequently.

[stable]: https://doc.rust-lang.org/stable/book/
[beta]: https://doc.rust-lang.org/beta/book/
[nightly]: https://doc.rust-lang.org/nightly/book/

See the [releases] to download just the code of all the code listings that appear in the book.

[releases]: https://github.com/rust-lang/book/releases

## Requirements

Building the book requires [mdBook], ideally the same version that
rust-lang/rust uses in [this file][rust-mdbook]. To get it:

[mdBook]: https://github.com/rust-lang/mdBook
[rust-mdbook]: https://github.com/rust-lang/rust/blob/master/src/tools/rustbook/Cargo.toml

```bash
$ cargo install mdbook --locked --version <version_num>
```

The book also uses two mdbook plugins which are part of this repository. If you
do not install them, you will see warnings when building and the output will not
look right, but you _will_ still be able to build the book. To use the plugins,
you should run:

```bash
$ cargo install --locked --path packages/mdbook-trpl
```

## Building

To build the book, type:

```bash
cd persian
$ mdbook build
```

The output will be in the `book` subdirectory. To check it out, open it in
your web browser.

_Firefox:_

```bash
$ firefox book/index.html # Linux
$ open -a "Firefox" book/index.html # OS X
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
$ start firefox.exe .\book\index.html # Windows (Cmd)
```

_Chrome:_

```bash
$ google-chrome book/index.html # Linux
$ open -a "Google Chrome" book/index.html # OS X
$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
$ start chrome.exe .\book\index.html # Windows (Cmd)
```

To run the tests:

```bash
$ mdbook test --library-path packages/trpl/target/debug/deps
```

## Contributing

We'd love your help! Please see [CONTRIBUTING-EN.md][contrib] to learn about the
kinds of contributions we're looking for.

[contrib]: https://github.com/rust-lang/book/blob/main/CONTRIBUTING.md

Because the book is [printed][nostarch], and because we want
to keep the online version of the book close to the print version when
possible, it may take longer than you're used to for us to address your issue
or pull request.

So far, we've been doing a larger revision to coincide with [Rust Editions](https://doc.rust-lang.org/edition-guide/). Between those larger
revisions, we will only be correcting errors. If your issue or pull request
isn't strictly fixing an error, it might sit until the next time that we're
working on a large revision: expect on the order of months or years. Thank you
for your patience!

### Translations

We'd love help translating the book! See the [Translations] label to join in
efforts that are currently in progress. Open a new issue to start working on
a new language! We're waiting on [mdbook support] for multiple languages
before we merge any in, but feel free to start!

[Translations]: https://github.com/rust-lang/book/issues?q=is%3Aopen+is%3Aissue+label%3ATranslations
[mdbook support]: https://github.com/rust-lang/mdBook/issues/5

## Spellchecking

To scan source files for spelling errors, you can use the `spellcheck.sh`
script available in the `ci` directory. It needs a dictionary of valid words,
which is provided in `ci/dictionary.txt`. If the script produces a false
positive (say, you used the word `BTreeMap` which the script considers invalid),
you need to add this word to `ci/dictionary.txt` (keep the sorted order for
consistency).
Loading
Loading