Export function only to module test?
<p>I use the standard way (according to the <a href="https://doc.rust-lang.org/book/ch11-01-writing-tests.html" rel="nofollow noreferrer">Rust book</a>) to write unit tests:</p>
<pre><code>fn func() -&gt; i32 {
    0
}

#[cfg(test)]
mod test {
    use super::*;

    #[test]
    fn func_test() {
        let res = func();
    }
}
</code></pre>
<p>to make it compile, I have to make <code>func</code> public via the <code>pub</code> keyword.</p>
<p>Is it possible to make <code>func</code> private, but use it inside the inner test module?</p>