title: Return &str instead of std::borrow::Cow<'_, str>
body: <p>I want to update the variable input which is of type <code>&amp;str</code>. How can I make the inner function return the <code>&amp;str</code> instead of the <code>Cow</code>?</p>
  
  <p>This may be not a problem with the language but with the regex-crate. Is there one that is more straightforward?</p>
  
  <pre><code>fn transform_the_expression() {
  
      fn create_formula&lt;'t&gt;(input: &amp;'t str, re: Regex) -&gt; std::borrow::Cow&lt;'t, str&gt; {
          let changed_string = re.replace(input, "1");
          return changed_string;
      }
  
      let mut input = "(a+(b*c))";
      use regex::Regex;
      let re = Regex::new(r"\([\w\d][/*+-^][\w\d]\)").unwrap();
  
      println!("input = {:?}", input);
      input = create_formula(input, re);
      println!("input = {:?}", input);
  }
  </code></pre>