diff options
| author | klensy <klensy@users.noreply.github.com> | 2021-02-23 23:56:04 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2021-02-23 23:56:04 +0300 |
| commit | 5ff1be197eaa8a014718b26b1fcbe0ced33b6e1a (patch) | |
| tree | 697e81ac40c38223d77eb7128a6a460166748137 /compiler/rustc_macros/src/query.rs | |
| parent | 446d4533e89db04f9568be4199e56b5fce0d176d (diff) | |
| download | rust-5ff1be197eaa8a014718b26b1fcbe0ced33b6e1a.tar.gz rust-5ff1be197eaa8a014718b26b1fcbe0ced33b6e1a.zip | |
replaced some unwrap_or with unwrap_or_else
Diffstat (limited to 'compiler/rustc_macros/src/query.rs')
| -rw-r--r-- | compiler/rustc_macros/src/query.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 3e67525567f..763f13d17ef 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -378,14 +378,14 @@ fn add_query_description_impl( let t = &(t.0).0; quote! { #t } }) - .unwrap_or(quote! { _ }); + .unwrap_or_else(|| quote! { _ }); let value = args .as_ref() .map(|t| { let t = &(t.1).0; quote! { #t } }) - .unwrap_or(quote! { _ }); + .unwrap_or_else(|| quote! { _ }); // expr is a `Block`, meaning that `{ #expr }` gets expanded // to `{ { stmts... } }`, which triggers the `unused_braces` lint. quote! { |
