Is life too short to fight Rust's borrow checker?

While solving a not-so-easy lifetime problem in Rust related to async closures, I came to think:

Is life too short to fight the borrow checker?

I mean, don't get me wrong, I love solving problems and the beauty of efficient and correct code, but sometimes, too much is too much.

Rust's price for improved control is the curse of choice:

struct Foo {
  bar: Bar
}

struct Foo<'a> {
  bar: &'a Bar
}

struct Foo<'a> {
  bar: &'a mut Bar
}

struct Foo {
  bar: Box<Bar>
}

struct Foo {
  bar: Rc<Bar>
}

struct Foo {
  bar: Arc<Bar>
}

While in most languages, we would simply:

type Foor struct {
  bar Bar
}

call it a day, finish work early and go to the beach for sunset.

So I'm asking you: Is life too short to fight the borrow checker?

Sunset

1 email / week to learn how to (ab)use technology for fun & profit: Programming, Hacking & Entrepreneurship.
I hate spam even more than you do. I'll never share your email, and you can unsubscribe at any time.

Tags: programming, rust

Want to learn Rust, Cryptography and Security? Get my book Black Hat Rust!