In terms of its' value, yes ~ In terms of its' type, no. For example: if s is "M. Otto".𝚝𝚘_𝚜𝚝𝚛𝚒𝚗𝚐() (i.e., of type String), in this case, &s is of type &String, and &s[..] is of type &str.
I would suggest that you follow along in the order the videos are set in the playlist without skipping! I'm following the same order as The Rust Programming Language book and I don't think any of the info in there is "extra" ~ Hope that helps!
At around 11:41, I said that slices aren't constrained to just strings and gave an example of slicing an array of i32s. In that case, our slice is of type &[i32] which would fit the generic of &[T]. I didn't explicitly mention generics just because I'm holding that concept for full discussion in a later video. Thank you so much for your comment!
Thank you for the effort. Please increase the resolution on the code screen. Thx!!!
It took me a while, but I fixed it on later videos - Thanks! (:
Thank you for your videos! They are very helpful!!! :)
»&s[..]« is equal to »&s« ? I would guess. Thanks for the video
In terms of its' value, yes ~ In terms of its' type, no. For example: if s is "M. Otto".𝚝𝚘_𝚜𝚝𝚛𝚒𝚗𝚐() (i.e., of type String), in this case, &s is of type &String, and &s[..] is of type &str.
@@danlogs Ah, that makes sense. I bet this is quite a common rust newbie mistake.
If we skip the slice type in rust then what would be the impact? The slice type is important or not, if we just skip that slice topic
I would suggest that you follow along in the order the videos are set in the playlist without skipping! I'm following the same order as The Rust Programming Language book and I don't think any of the info in there is "extra" ~ Hope that helps!
@@danlogs ok
You didn't cover the other slice type. &[T]
At around 11:41, I said that slices aren't constrained to just strings and gave an example of slicing an array of i32s. In that case, our slice is of type &[i32] which would fit the generic of &[T].
I didn't explicitly mention generics just because I'm holding that concept for full discussion in a later video.
Thank you so much for your comment!
Heyo! ~ I finally made a video talking about &[T], here: th-cam.com/video/vzk5LvFHbrQ/w-d-xo.html ッ