title: Is it possible to return either a borrowed or owned type in Rust?
body: <p>In the following code, how can I return the reference of <code>floor</code> instead of a new object? Is it possible to let the function return either a borrowed reference or an owned value? </p>
  
  <pre><code>extern crate num; // 0.2.0
  
  use num::bigint::BigInt;
  
  fn cal(a: BigInt, b: BigInt, floor: &amp;BigInt) -&gt; BigInt {
      let c: BigInt = a - b;
      if c.ge(floor) {
          c
      } else {
          floor.clone()
      }
  }
  </code></pre>