title: How do I access a struct field which has the same name as a public function?
body: <p>I'm trying to access the version of a particular <code>clap::App</code> I have instantiated.  However, the field <a href="https://kbknapp.github.io/clap-rs/src/clap/app.rs.html#90" rel="noreferrer"><code>version</code></a> exists as does the public function <a href="https://kbknapp.github.io/clap-rs/src/clap/app.rs.html#299" rel="noreferrer"><code>version()</code></a></p>
  
  <p>Here is the relevant bits of source code:</p>
  
  <pre><code>pub struct App&lt;'a, 'v, 'ab, 'u, 'h, 'ar&gt; {
      // ...
      version: Option&lt;&amp;'v str&gt;,
      // ...
  }
  
  impl&lt;'a, 'v, 'ab, 'u, 'h, 'ar&gt; App&lt;'a, 'v, 'ab, 'u, 'h, 'ar&gt;{
      // ...
      pub fn version(mut self, v: &amp;'v str) -&gt; Self {
          self.version = Some(v);
          self
      }
      // ...
  }
  </code></pre>
  
  <p>And my code:</p>
  
  <pre><code>pub fn build_cli() -&gt; App&lt;'static, 'static&gt; {
      App::new("my-pi")
          .version("0.1.0")
  // ...
  
  let app = build_cli();
  assert_eq!(app.version, "0.1.0"); // &lt;-- Error here
  </code></pre>
  
  <p>The field <code>version</code> and function <code>version()</code> both exist on <code>App</code>.  How can this be? And how can I access the field <code>version</code>?</p>
  
  <p>The error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0615]: attempted to take value of method `version` on type `clap::App&lt;'_, '_&gt;`
    --&gt; src/cli.rs:27:21
     |
  27 |         assert_eq!(app.version, "0.1.0");
     |                        ^^^^^^^
     |
     = help: maybe a `()` to call it is missing?
  </code></pre>