From 256a9e031cc0ea9e9b5adae6049e13e2a606ec36 Mon Sep 17 00:00:00 2001 From: 0xf90c Date: Sat, 29 Jun 2024 15:04:38 +0500 Subject: [PATCH] update --- rustbook-uz/src/ch15-05-interior-mutability.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/rustbook-uz/src/ch15-05-interior-mutability.md b/rustbook-uz/src/ch15-05-interior-mutability.md index bdae70c..c4c0952 100644 --- a/rustbook-uz/src/ch15-05-interior-mutability.md +++ b/rustbook-uz/src/ch15-05-interior-mutability.md @@ -77,15 +77,14 @@ aktyorning o'rniga chiqib, sahna ko'rinishi amalga oshirib beruvchi, ya'nikino y misolida ko'rib chiqaylik. Test doublelari boshqa turlarda test o'tkazayotganimizda xizmat qiladi. *Soxta obyektlar* test paytida nimalar sodir bo'lishini qayd etuvchi test doublelar o'ziga xos turlardan biri bo'lib, siz to'g'ri amallar amalga oshirilayotganini ko'zdan kechirishingiz mumkin. -Rust doesn’t have objects in the same sense as other languages have objects, -and Rust doesn’t have mock object functionality built into the standard library -as some other languages do. However, you can definitely create a struct that -will serve the same purposes as a mock object. - -Here’s the scenario we’ll test: we’ll create a library that tracks a value -against a maximum value and sends messages based on how close to the maximum -value the current value is. This library could be used to keep track of a -user’s quota for the number of API calls they’re allowed to make, for example. +Rustda boshqa dasturlash tillari kabi bir xil ma'noli obyektlarga ega emas, +va soxta obyekt funksionalligini olgan standart kutubxonasi yo'q. Aksincha, soxta +obyektlar kabi ish bajaruvchi struct yaratishingiz mumkin. + +Ushbu ssenariyni ko'rib chiqaylik: qiymatni maksimal qiymatga nisbatan kuzatuvchi +kutubxona yaratamiz va joriy qiymat maksimal qiymatga qanchalik yaqinligiga qarab bizga +xabar jo'natib turadi. Ushbu kutubxona foydalanuvchi uchun ruxsat etilgan API 'call'lar sonini +kuzatib borish uchun ishlatilishi mumkin, bu ishlatish mumkin bo'lgan bir misol. Our library will only provide the functionality of tracking how close to the maximum a value is and what the messages should be at what times. Applications