trace!("TheBestTvarynka")


Kanal geosi va tili: ko‘rsatilmagan, ko‘rsatilmagan
Toifa: ko‘rsatilmagan


Blog: https://tbt.qkation.com
Author: @TheBestTvarynka
Let's trace my journey

Связанные каналы

Kanal geosi va tili
ko‘rsatilmagan, ko‘rsatilmagan
Toifa
ko‘rsatilmagan
Statistika
Postlar filtri


fn main() {
break rust;
}

Result:
error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?
note: the compiler expectedly panicked. this is a feature.
note: we would appreciate a joke overview:
https://github.com/rust-lang/rust/issues/43162#issuecomment-320764675

👩‍💻 playground 👩‍💻

#joke #rust


Блог* dan repost
#justrusteceanthings

@janet/111223564960983226' rel='nofollow'>https://fosstodon.org/@janet/111223564960983226


Perfect joke:


computers suck 😭
twit src

#joke


Вивчаємо Rust разом dan repost
Вчора наші євангелісти Павло та @evldd' rel='nofollow'>Микола відвідали Київську Школу Економіки із гостьовою лекцією для студентів “Знайомство із Rust та її алгебраїчними типами”💥
Також ми зібрали у студентів фідбек та розіграли книгу по Rust 🎁.

В планах налагодити співпрацю й із іншими передовими університетами України.


There comes a point in every rustacean's life when it learns about for>) {}
fn bar(_b: Box>) {}
What is the difference between them?

In short, the difference between foo and bar is that in foo() the lifetime for the internal usize reference is provided by the caller of the function, while in bar() the same lifetime is provided by the function itself. And this distinction is very important for the implementation of foo/bar.

Also, you can read alternate explanations here:
🔘 For


Noma’lum dan repost
Коли небудь ми проживемо день з растом без драми і більше ніколи не будемо онлайн 🤣


#horror_story




#meme #rust




#meme


I have a habit of reading pull requests, issues, and discussions in some interesting open-source projects. It's fun sometimes and informative. You can learn in such a way. Especially when you don't have enough time to do actual open-source contributions.

Take, for example, this pull request: https://github.com/Devolutions/IronRDP/pull/192

What we can learn from it?
🔘 System boundaries: the focus of design.
🔴 Architectural Invariants.
🔘 When enums can be bad (see code example below) and how we can avoid it.
// can be bad somewhy
#[repr(u32)]
pub enum MyNetworkCode {
FirstValue = 0,
SecondValue = 1,
}
🟣 Examples of the in-repo documentation. Examples of the in-repo documentation.
🟡 And other interesting and useful stuff. (If you are interested, explore the rest by yourself 😏)

#rust


when someone knows you too well 😑

#meme


It's just a part of a discussion from some chat where I explained why we should avoid using the as operator in Rust

#rust


Pavlo Myroniuk dan repost
трошки розкрию свою відповідь на це

в чому перевага писати через into/try_into або from/try_from (в контексті числових типів):
* ми явно перетворюємо один тип чисел на інший. якщо буде помилка, то try_into/try_from це захендлить. ти не отримаєш неочікуваних значень
* якщо в тебе буде навіть код по типу usize::try_from(/* some value */).unwrap(), то це вже краще замість as, оскільки варіант із .unwrap простіше дебажити. воно відразу впаде на unwrap і буде видно де баг
* такі конвертації компілятором дуже добре оптимізовуються. ось приклад як кастинг u32 в usize через usize::try_from(n).unwrap() перетворюється в одну mov інструкцію: https://gcc.godbolt.org/z/Y4WjWTqh1
* якщо в тебе десь в коді змінився тип чисел, то із into/try_into ти відразу це побачиш, бо компілятор покаже. із as ти цього можеш не помітити. і це знову ж таки стає небезпечним місцем
* якщо лінь писати усі ці виклики функцій, то напиши собі мінімальний декларативний макрос. у нас є такий)


🚛 Look what I'm compiling 😏
I decided to try dioxus for my new desktop app (it's for my university project)




💗 Yeeey, my PR to Microsoft Docs has been merged: https://github.com/MicrosoftDocs/sdk-api/pull/1615


👩‍💻 I started loving GitHub Codespaces more and more 👩‍💻

I was talking before about reviewing pull requests in codespace, but now I wanna tell you about another feature: container configuration.

I think we all know that all those codespaces are just containers + vs code in the browser. I was curious. Can I make a custom container with preinstalled Rust and other libraries? Because I always manually installed Rust before.

Of course, the answer is yes. First, I looked at container templates but couldn't find a suitable one. On the other hand, even if I found it, it wouldn't be flexible enough. Then I found out about dev containers. The devcontainer.json is a very flexible and convenient way to configure your codespace container. Here is a small guide:
🟢 Open the dev container configuration page (screenshot 1) by clicking the "Configure dev container" button.
🟢 Add features. You can search in the marketplace for a needed one. (screenshot 2)
🟢 Commit changes.
🟢 Start a codespace. For example, by clicking the "Create codespace on main" button.
🟢 It'll automatically install all needed libraries. (screenshot 3)
🟢 Now you can start coding 🥳.

As a result, I got the full-features web IDE: rust-analyzer, Rust itself, WASM target, my favorite theme, and icons. (screenshot 4) 💙

🔩 Official dev container documentation: Introduction to dev containers. containers.dev.

#github

20 ta oxirgi post ko‘rsatilgan.

43

obunachilar
Kanal statistikasi