The cognitive effort required to "learn Rust" is much greater than scrolling social media, watching YouTube, etc. and doesn't provide the same reward/stimulation. The brain will always crave the easier sources of dopamine and prefers to be on auto-pilot.
In my opinion having done a few of them, a dopamine detox is likely a waste of time, although disconnecting from electronics can be a nice break if you need/want that.
You will never want to start learning Rust because there's always easier sources of dopamine for your brain to indulge in. The key is starting anyways. Open the Rust docs and start trying. I only require myself to do 10 minutes of coding per day. Usually, after the 10 minutes my brain is already engaged and I continue for multiple hours on that momentum. Occasionally I'm having an off day and can't get myself to focus/engage properly for whatever reason and after the 10 minutes or the one small change I wanted to make is over I stop.
Even just the 10 minutes each day is infinitely more than continuing to do nothing.
That's a pseudoscientific narrative. It's not literally based on the science of dopamine. It's based on the pop-science dopamine metaphor.
It's nowhere near scientifically accurate. Don't read too much into it.
Do you know of anything that elucidates the oversimplifications of dopamine popscience?
Edit: This does a good job: https://www.theguardian.com/science/2013/feb/03/dopamine-the...