From ea02c366298cd9c54dc30509b57f10f92e1ca8f3 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Mon, 10 May 2021 15:10:16 +0800 Subject: [PATCH] Address comment --- diesel_derives/src/queryable_by_name.rs | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/diesel_derives/src/queryable_by_name.rs b/diesel_derives/src/queryable_by_name.rs index ac0ac463c147..912857b8f7fe 100644 --- a/diesel_derives/src/queryable_by_name.rs +++ b/diesel_derives/src/queryable_by_name.rs @@ -24,23 +24,13 @@ pub fn derive(item: syn::DeriveInput) -> Result>::into(field) - } - )) - } else { - let name = f.column_name_str(); - Ok(quote!( - { - let field = diesel::row::NamedRow::get(row, #name)?; - <#deserialize_ty as Into<#field_ty>>::into(field) - } - )) - } + let name = f.column_name_str(); + Ok(quote!( + { + let field = diesel::row::NamedRow::get(row, #name)?; + <#deserialize_ty as Into<#field_ty>>::into(field) + } + )) } }) .collect::, Diagnostic>>()?;