title: How can I return something from HashMap.get’s None case?
body: <p>I'm wondering with the best practice to handle the <code>None</code> result in getting values from a <code>HashMap</code>. Given I have a simple function:</p>
  
  <pre><code>pub fn get_value(&amp;self, value: String) -&gt; &amp;String {
  </code></pre>
  
  <p>One could get the value from the <code>HashMap</code> with <code>unwrap</code>:</p>
  
  <pre><code>my_map.get(&amp;"hello".to_string()).unwrap()
  </code></pre>
  
  <p>But I don’t want it to panic if it gets <code>None</code>. What else can I do?</p>
  
  <pre><code>match self.os_config.get(&amp;value) {
      Some(val) =&gt; return &amp;val,
      None =&gt;  //?? cannot return a String::new().. as it is temporal?
  }
  </code></pre>