How to make &mut self from &self?
<p>I want to expose a public function with immutable self which calls a private function with mutable self.</p>

<pre><code>struct Foo {
    value: i32,
}

impl Foo {
    fn f1(&amp;self) {
        self.f2(); // &lt;--- is it possible to make self mutable?
    }

    fn f2(&amp;mut self) {
        self.value = 5;
    }
}

fn main() {
    let foo = Foo { value: 0 };
    foo.f1();
}
</code></pre>

<p>When compiling this code I get an error</p>

<blockquote>
  <p>cannot borrow immutable borrowed content <code>*self</code> as mutable</p>
</blockquote>

<p>Is it possible to make self mutable?</p>