MatrixFrog

u/MatrixFrog


r/rust•

Was just reading this https://weeklyrust.substack.com/p/the-never-type-is-finally-stable

and this part is very much giving me that "LLM-written" vibe:

Suddenly Result<T, !> feels honest, and dead-code detection gets cleaner because the compiler finally believes you when you say a function never returns.

For the rest of us who write Rust for a living, this matters because empty types stop being a niche party trick and start being standard kit.

Match arms on ! are allowed to be empty without the compiler side-eyeing you. And that quiet satisfaction when the type system proves a code path is unreachable? Stronger than

18767

r/learnrust•

I'm writing an interpreter for a little scripting language called Lox (following https://craftinginterpreters.com) and I just implemented how the "==" operator works in Lox. My PartialEq implementation for a Lox value essentially looks like this.

enum Value {
  Boolean(bool),
  Number(f64),
  Instance(Rc<Instance>),
  Nil,
}

impl PartialEq for Value {
  fn eq(&self, other: &Self) -> bool {
    match (self, other) {
      (Value::Boolean(self_value), Value::Boolean(other_value)) => self_value == other_value,
      (Value::Number(self_value), Value::Number(other_value)) => self_value == other_value,
      (Value::Instance(self_rc), Value::I
415

r/learnrust•

I'm working my way through Crafting Interpreters, and I'm parsing a class statement. For purposes of this question all you need to know is that a class statement looks like

class Duck {... or class Duck < Animal {...

so after consuming the "class" token and one identifier token, we want to:

  • consume a '<' token, if there is one
  • if there was such a token, consume another identifier token and turn that identifier token into an Expr::Name AST node
  • store the Expr::Name node as a Some() if we have one. None if not

so what I have currently is

let superclass = if self.match_type(TokenType::Less).is_some() {
  let token = self.consume_type(TokenType::Identifier)?;
  Some(Ex
45


r/AskHR•

At my job, it's impractical for us to leave the workplace for lunch, so we stay on site and it's counted as an on-duty meal break, which means it is paid. There were a few days last week when I wasn't able to take a meal break at all because we were short-staffed and there was no one to relieve me for lunch. My manager is saying they don't have to pay the one-hour penalty because our breaks are on-duty breaks. I would think that's incorrect: even if we can't leave, we are still entitled to 30 minutes to eat and rest. But I thought I'd ask here to be sure. Is my interpretation accurate?

https://www.dir.ca.gov/dlse/FAQ_MealPeriods.htm

If an employer fails to provide an employee a meal peri

12

r/union•

Once a bargaining committee has come up with a proposed contract for members to vote on, how does the process usually work? How much time do members get to review the contract and make their decision? How is the vote actually carried out? Are individual votes kept private?

24

r/GameChangerTV•

In most cases, the episode title gives at least a hint of what the game is. If the title were just "episode 4" or whatever then we as the audience would be just as puzzled as the players for the first minute or so. Might make it a little more fun! I don't know!

12636

r/NYTStrands•

I'm assuming most people here also play at least Connections. Even though Strands is pretty new I think my "ritual" is going to be

Wordle first, pretty much right after I wake up Connections a little later, about the time I get to work Strands at lunchtime, along with the Puzzmo crossword

I know Washington Post has a few games too but I haven't really tried them

314

r/antiwork•

Yesterday a really big storm hit pretty much all of California, lots of rain, dangerous amounts of wind, etc. My job is outdoors and not an essential service so it should have been obvious well in advance that the right call was just to be closed for the day. When we're close, we don't get paid for the day, but it would have been nice to not worry about getting to and from work in the rain, and have a safe and cozy day indoors instead.

But instead they decided to try and operate as normal... for about two hours, and then made the decision to close down. Luckily if we work less than four hours in a day, we get paid for four hours, so at least we got something out of it, but it just felt tota

150