Learn about Rust RC Smart Pointer by Creating a Linked List Data Structure

  Рет қаралды 1,187

cudidotdev

cudidotdev

Күн бұрын

Пікірлер: 10
@gertrudessampaio8689
@gertrudessampaio8689 4 ай бұрын
Very nice content
@cudidotdev
@cudidotdev 4 ай бұрын
Thanks for the nice comments 💙
@neekonsaadat2532
@neekonsaadat2532 4 ай бұрын
Hey good video, you're doing a great job
@cudidotdev
@cudidotdev 4 ай бұрын
Thank you. This means a lot to me
@nordgaren2358
@nordgaren2358 4 ай бұрын
Shouldn't pop return the element it pops off the list?
@cudidotdev
@cudidotdev 4 ай бұрын
You are right. But after removing the element, nothing points to it, so it's dropped. It would be easier if the elements implement the clone trait. I had to do a general case scenario without using any unsafe block
@nordgaren2358
@nordgaren2358 4 ай бұрын
@@cudidotdev why not return the RC. Would that work? I'm not at my PC right now. Liked list is an interesting problem in Rust for sure! I think you did a decent job at tackling it. :)
@cudidotdev
@cudidotdev 4 ай бұрын
I think so. You can try and let me know
@LtdJorge
@LtdJorge 3 ай бұрын
@@cudidotdevI think the best way is to do the if let Some on &self.head.take(). This way, you will get ownership of the RC. Then you can call &self.head.replace() with the value obtained by calling next.
@cudidotdev
@cudidotdev 3 ай бұрын
@@LtdJorge I will try that and see
Rust: Store Data on the Heap with Box
10:02
The Dev Method
Рет қаралды 5 М.
Object-Oriented Programming Is The Root Of All Evil
25:16
Abstract Engineering | الهندسة المجردة
Рет қаралды 8 М.
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 17 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 15 МЛН
POSTGRESQL JOINS [Complete guide in 12 mins]
12:31
cudidotdev
Рет қаралды 1,1 М.
Box / Rc / Arc / Mutex - Smart Pointers Simplified - Rust
23:39
Bocksdin Coding
Рет қаралды 12 М.
JWT Authentication in Rust [Full Guide : Axum & Actix]
46:50
cudidotdev
Рет қаралды 3,5 М.
Are Lists Evil? Creator Of C++ | Prime Reacts
14:30
ThePrimeTime
Рет қаралды 100 М.
Advanced Golang: Generics Explained
13:37
Code With Ryan
Рет қаралды 63 М.
Build a CRUD REST API with Rust Axum | Tutorial
19:41
cudidotdev
Рет қаралды 8 М.
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 175 М.
Linked List in Rust
11:40
Zane Hitchcox
Рет қаралды 10 М.
Smart Pointers in C++ (Stop Using new?)
17:18
Caleb Curry
Рет қаралды 12 М.
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 17 МЛН