]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/traits/auto_trait.rs
Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper
[rust.git] / src / librustc / traits / auto_trait.rs
index 06d548909b549ec7048ee04d172907fb2cea97d5..50ca6ca78ab3aa5b81dd85670bf025e8101673e2 100644 (file)
@@ -498,8 +498,8 @@ pub fn get_lifetime(&self, region: Region<'_>,
                     panic!("Missing lifetime with name {:?} for {:?}", name, region)
                 )
             )
-            .unwrap_or(&"'static".to_owned())
-            .clone()
+            .cloned()
+            .unwrap_or_else(|| "'static".to_owned())
     }
 
     // This is very similar to handle_lifetimes. However, instead of matching ty::Region's