Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You've dodged the meat of my complaint by not having an example where you need to inject into a struct to test an implementation.

Sure. "Dr, it hurts... well stop doing that." Sometimes, you can design around the issue. I don't claim that this specific pattern works for everything, just that this is how my real-world application is built.

> Moreover, if you slap `Send + Sync + 'static` then you can certainly avoid the problems I am hinting at: you've committed to never having a lifetime and won't have to deal with the borrow checker.

Yes. Sometimes, one atomic increment on startup is worth not making your code more complex.

> A database that is only going to live for a finite time.

This is just not the case for a web application.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: