TakeBlaster16
Joined 4 years ago
Karma
1,027
Submissions
191
Member since
Jun 24
Joined 4 years ago
enum MyEnum { Ok(u8), NotOk }
fn main() {
let value = MyEnum::Ok(42);
assert!(matches!(value, MyEnum::Ok(_)));
match value {
MyEnum::Ok(x) => assert_eq!(x, 42),
MyEnum::NotOk => unreachable!(),
}
}
No unsafe to be found. The feature is there, it just has a different keyword than you might be used to -- the same way Haskell and Java both have something called "class" that mean different things.In other words, he used his own private key to send a transaction. How is that "hacking"?
https://old.reddit.com/r/applehelp/comments/un9rjb/airdrop_h...
Windows has an existing convention for this, like Linux's XDG. Imagine if you looked at your Linux filesystem root and saw /boot, /dev, /usr, /tmp, and /Quicken.
I haven't done JS for awhile, but according to https://docs.cypress.io/api/commands/type#Events they still don't support it. The docs point you to a third party package that tries to simulate it inside the page.
And INT_MIN is a better place for it than zero imo. If Rust had a `BalancedI32` I would reach for it a lot more than I use the NonZero types. In my code at least, I've found zero is a pretty useful number.
It doesn't look like they update it more than once a year. I guess we'll see where we stand next January (if we make it that long)