File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -532,21 +532,20 @@ pub fn enrich_span_with_google_cloud_function_metadata(
532532 todo ! ( )
533533 } ;
534534
535- #[ allow( clippy:: unwrap_used) ]
536- if function. is_some ( ) && !region. is_empty ( ) && !project. is_empty ( ) {
537- let resource_name = format ! (
538- "projects/{}/locations/{}/functions/{}" ,
539- project,
540- region,
541- function. unwrap( )
542- ) ;
535+ if let Some ( function) = function {
536+ if !region. is_empty ( ) && !project. is_empty ( ) {
537+ let resource_name = format ! (
538+ "projects/{}/locations/{}/functions/{}" ,
539+ project, region, function
540+ ) ;
543541
544- span. meta
545- . insert ( "gcrfx.location" . to_string ( ) , region. to_string ( ) ) ;
546- span. meta
547- . insert ( "gcrfx.project_id" . to_string ( ) , project. to_string ( ) ) ;
548- span. meta
549- . insert ( "gcrfx.resource_name" . to_string ( ) , resource_name. to_string ( ) ) ;
542+ span. meta
543+ . insert ( "gcrfx.location" . to_string ( ) , region. to_string ( ) ) ;
544+ span. meta
545+ . insert ( "gcrfx.project_id" . to_string ( ) , project. to_string ( ) ) ;
546+ span. meta
547+ . insert ( "gcrfx.resource_name" . to_string ( ) , resource_name. to_string ( ) ) ;
548+ }
550549 }
551550}
552551
You can’t perform that action at this time.
0 commit comments