Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf90c committed Apr 24, 2024
1 parent 1444f6f commit fdeec23
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions rustbook-uz/src/ch15-04-rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ Ushbu kodni kompilyatsiya qilsak, biz yuqoridagi xatolikni ko'ramiz:

`Cons` variantlari o'zlariga tegishli bo'lgan ma'lumotlargagina egalik (own) qila oladi, shuninguchun biz `b` ro'yxatini yaratganimizda, `a` `b`ga o'tadi va `b` `a`ga egalik qiladi.Undan keyin, `c` ni yaratish uchun `a`dan foydalanmoqchi bo'lganizmizda bizga ruxsat bermaydi chunki `a` ko'chib ketganligi uchun.

We could change the definition of `Cons` to hold references instead, but then
we would have to specify lifetime parameters. By specifying lifetime
parameters, we would be specifying that every element in the list will live at
least as long as the entire list. This is the case for the elements and lists
in Listing 15-17, but not in every scenario.
Buning o'rniga havolalarni ushlab turish uchun `Cons` ta'rifini o'zgartirishimiz mumkin, lekin keyin biz layvtaym parametrlarini ko'rsatishimiz kerak bo'ladi. Layvtaym parametrlarini belgilash orqali, biz ro'yxatdagi har bir elementning yashashini ko'rsatamiz. 15-17 ro'yxatda ko'rsatilganidek bu elementlar va ro'yxatlarga tegishli, lekin har doim gam emas.

Instead, we’ll change our definition of `List` to use `Rc<T>` in place of
`Box<T>`, as shown in Listing 15-18. Each `Cons` variant will now hold a value
Expand Down

0 comments on commit fdeec23

Please sign in to comment.