A place for learning about Rust! 🦀 Content ranges from beginner to advanced so there should be something for everyone! Subscribe and let me know what you think over on Twitter (twitter.com/ryan_levick).
I hate this “take” hack coz it’s a hack. The only reason one needs to do it is to satisfy borrow checker. That’s one of the cases where Rust certainly feels awkward and dogmatic Prove me wrong )))
I know that is interesting structure because of Rust nature, but in current state of hardware (memory x100 slower that cpu and huge caches) using lists should be strongly discouraged, even smarter structures with pointers for N bellow 100 or even 1000 have almost no advantage.
std::env::args().skip(1) == index of [0], why does line #3 does invoke '.next()' method? Is it mean index of [2]? Then what happend to the index of [1]?
std::env::args().skip(1) == skip the very first args, which is the index [0], correct me if I am wrong, is it by default the current file path and not the current parrent folder path? And in line #3 @32:18, is doing '.next()' means args index of [2]? Then why does index of [1] exist in the demo/cli?
Seems that at 1:07:40 the `self.len.checked_mul(...)` must be `(self.len+1).checked_mul(...)` as this way we're checking not only starting offset of a pointer, but rather resulting offset of the pointer and making sure it doesn't wrap around when the actual operaiton of `ptr.as_ptr().add(self.len)...` is finished 🤔
FYI. I am writing a lib with SimConnect as well in Rust. Came across your video and had the same "Fail HRESULT" issue. Turns out GetNextDispatch _will_ fail if no data is ready. This is apparent if you subscribe to the 4sec event and call the function every second. You get the following output in the terminal with the received data size: Requesting subscription to event: 4sec Callback data size: 0 Callback data size: 308 Callback data size: 24 Callback data size: 0 Callback data size: 0 Callback data size: 24 Callback data size: 0 Callback data size: 0 Callback data size: 0 Callback data size: 24 The 0 sizes represent a failed HRESULT as there were no events to retrieve from the game. The 308 size represents an HRESULT of 0 with the open event. The 24 size represents an HRESULT of 0 with the 4sec system event.
It looks like you press "escape" "up" "down" compulsively. ... I do, too...why do we do this? I use kinesis advantage and vim. What kind of keyboard do you use? Thank you for the walkthrough!
1:04:20 If the `println` macro borrows its arguments, why aren't they references? E.g. `&key` and `&value`. Or does it implicitly create new references under the hood? E.g. `key_ref = &key` and `value_ref = &value`.
Thanks a lot. I have gone your document carefully. Now this youtube link is an added bonus. How to count the length of the linked list - How do you write an iterator for this. Thanks a miliion for your efforts in educating future rust developers
I used you iter and implemented the length - For your feedback pub fn len(self)->i32 { let mut count1 = 0; let mut iter:Iter<T> =self.iter(); loop{ let x=iter.next(); match x{ None=>return count1, Some(_)=> count1 = count1 + 1, } } }