Adopt let_else across the compiler
This performs a substitution of code following the pattern:
let <id> = if let <pat> = ... { identity } else { ... : ! };
To simplify it to:
let <pat> = ... { identity } else { ... : ! };
By adopting the let_else feature.
This commit is contained in:
@@ -164,9 +164,7 @@ impl<'tcx> OnUnimplementedDirective {
|
||||
) -> Result<Option<Self>, ErrorReported> {
|
||||
let attrs = tcx.get_attrs(impl_def_id);
|
||||
|
||||
let attr = if let Some(item) = tcx.sess.find_by_name(&attrs, sym::rustc_on_unimplemented) {
|
||||
item
|
||||
} else {
|
||||
let Some(attr) = tcx.sess.find_by_name(&attrs, sym::rustc_on_unimplemented) else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user