So, I'm new to Rust and I'm facing this problem for weeks, since the beginning I guess. I've always thought a good way to learn a language is by making a simple game with it, so here I am. I've tried both with SDL2 and with SFML bindings, and with both I end up having the same problem: When you create a sprite, you pass it a texture, and the texture lifetime cannot be smaller than the sprite (otherwise you'd have a sprite displaying garbage).
So, at some point in my code, I end up creating an instance of an struct that requires an explicit lifetime. And in order to make it work, this explicit lifetime ends up being used all over the place, until it reaches main, where you get the error that you can only mutably borrow once.
In case of SFML, the problem comes in Sprite::setTexture (https://docs.rs/sfml/0.15.1/sfml/graphics/struct.Sprite.html#method.set_texture), where I have to pass a texture with an explicit lifetime, and this is the lifetime which ends up bubbling up everywhere.
How should I approach this problem? I can provide some example code that doesn't compile (the error is cannot infer an appropriate lifetime for autoref due to conflicting requirements)
Thanks in advance,