Programming

Почему Rust завоевывает сердца разработчиков

A

Adil Sher

Author

Jul 26, 2026
1 min read
10 views
Почему Rust завоевывает сердца разработчиков

Summary

программирование #rust #системноепрограммирование #безопасность

Владение и заимствование

impl User { // Метод для создания нового пользователя fn new(username: &str) -> Self { User { username: String::from(username), active: true, } }

// Метод для деактивации (берет изменяемую ссылку) fn deactivate(&mut self) { self.active = false; } }

fn main() { let mut user = User::new("dev_rust"); println!("Пользователь {} активен: {}", user.username, user.active);

user.deactivate(); println!("Пользователь {} активен: {}", user.username, user.active); }

Обработка ошибок

fn main() { match divide(10, 0) { Ok(result) => println!("Результат: {}", result), Err(e) => println!("Ошибка: {}", e), } }

Вывод

Source

This article discusses content originally published by at Dev.to.

Read the original article

Share this article

Written by Adil Sher

Full stack developer building high-traffic platforms, AI services, and custom web applications. Explore my portfolio, learn about my background, or get in touch.

Related Articles

Stop Asking Users to "Have a Look": The UAT Lesson I Learned the Hard Way
Programming Aug 19

Stop Asking Users to "Have a Look": The UAT Lesson I Learned the Hard Way

I still remember the migration project that taught me this lesson. It was a healthcare system overhaul, data, workflows, everything. We spent four months rebuilding the database, testing the ETL pipeline obsessively, and felt genuinely confident about go-live. Then we sent the san...

I Learned the Hard Way: Data Migration Isn't What I Thought It Was
Programming Aug 19

I Learned the Hard Way: Data Migration Isn't What I Thought It Was

Three years ago, I was asked to help move customer data from an old CRM into a shiny new system. I thought I had this, extract some SQL, transform it, load it, done. I was confidently wrong. Six weeks later, staring at a production issue where 47 customer records had split into du...