Rust ownership: borrowed value does not live long enough
· 5 vues
I keep fighting the borrow checker when returning a reference from a function. What am I missing?
Démonstration : données fictives.Version de démonstration. Les données sont fictives.
· 5 vues
I keep fighting the borrow checker when returning a reference from a function. What am I missing?
The official docs cover this in the limits section. Also read the repository issues: several contain tested workarounds.
Measure before optimizing. A quick profile usually shows that most of the time is spent in one call. Fix that one first.
Partagez une piste claire et vérifiable.
Votre brouillon est conservé sur cet appareil.