System Info and disks. I'm going to show you the beauty of Rust. If I get this.name, this will actually return something called an OSString, which I can turn into a STR, which is not a string, but it's a string slice. So to STR, and that will return me an option, which means there may not be a string, so I need to be aware that they may not exist. So I can't return this. And what I want to do is be like, okay, if this doesn't exist, just ignore it, just like burn my old app. So I need to unwrap it, and this still returns an STR, which then I need to be like, okay, that's cool. And I need to be as string. I think it's as string. It's not a string. It continues. It never ends. Oh, it's toString. I'm so sorry about that. How dare I? ToString, and now that's a string. And I think in my country that's beautiful. This is how we show love in my 50 seconds. Okay, cool. So now I just return the disks, right? That should be okay. I should... Yeah, no errors. Cool. And no errors shows up. So that's cool. So let me just do a little pre here. I have bad hearing. I have no idea what that was or if I was supposed to hear it. json.stringifyInfo.Disks.
System Info, and let me do the same thing for disks, so we don't have to do this in a beta again, because it's awkward. Someone's standing in here, it's very awkward. So yeah, there we go. So we have my computer info with all of that stuff, and the last thing that I want to do, the creme de la creme, that's all my French. That is not even French. That was English with a French accent. Show you my disks. I only have one disk, now what's in my disk. I don't know what the hell that was. So we have this in every computer, and that returns, okay, so that returns an array, right, and what is an array in Rust? It's a Vect. Vect. So let's say let's mute, and if you say mute, it means this thing's going to change. Please do not yell at me. This equals, okay, so Vect, like this. This is a macro, it's just a nicer way of writing Vect new. I don't know if you can see my hands. But yeah, so now let's do, let's go for each disk, so I'm going to say for disk in sys.disks, I want to do something, and what I want to do is say disks, disks.push. Yes, that is exactly what I want to do. And what do I want to push into it? I want to push a vect, a disk, so that's the type, and let's put this here, and I have all of this stuff, right? This makes sense. So I have some sheets for that, because you don't deserve to watch me write that. So that's pretty much all of it, except one, because I think this one is really funny. Okay, you guys, you're all going to love this. Okay, cool. So we need to get the name, right? And you would think that would just be like disk.name, but I'm going to show you the beauty of Rust. So if I get this.name, this will actually return something called an OSString, which I can turn into a STR, which is not a string, but it's a string slice. So to STR, and that will return me an option, which means there may not be a string, so I need to be aware that they may not exist. So I can't return this. And what I want to do is be like, okay, if this doesn't exist, just ignore it, just like burn my old app. So I need to unwrap it, and this still returns an STR, which then I need to be like, okay, that's cool. And I need to be as string. I think it's as string. It's not a string. It continues. It never ends. Oh, it's toString. I'm so sorry about that. How dare I? ToString, and now that's a string. And I think in my country that's beautiful. This is how we show love in my 50 seconds. Okay, cool. So now I just return the disks, right? That should be okay. I should... Yeah, no errors. Cool. And no errors shows up. So that's cool. So let me just do a little pre here. I have bad hearing. I have no idea what that was or if I was supposed to hear it. json.stringifyInfo.Disks.
Comments