|
|
|
|
|
by scottlamb
2808 days ago
|
|
> #4 highly depends on a project size. On big projects, some of these decisions might become effectively one way doors. The transformations between T, Box<T>, Rc<T>, Arc<T>, etc. are mechanical, so I expect someone will write a refactoring tool that makes a giant PR for you automatically. (Subject to certain limits, like if you're actually cloning the ref-counted pointer, it's indeed harder to go back.) Would that satisfy your need? > To be fair, though, we use Rust the way it wasn't specifically designed for (large "enterprise" software, think Java-like enterprise). IMHO, this is a valid use case for Rust. I'm not saying everyone should stop using Java (in some cases I think it's significantly faster to write) but Rust has some strong performance advantages and no data races in safe code. |
|
It's not always possible to change the data structure -- different ways of modeling data have different trade-offs. So, for me it is about not having to make a choice than about tools that will help you to change your mind.
Also, it could be something like structure coming from a 3rd-party crate using borrowing and you want to stick it into "Arc" of some sort. Or put it (with the thing it borrows from) into a lifetime-less struct, so you don't have to care about these lifetimes.
>IMHO, this is a valid use case for Rust.
I very much hope so :)