From 7645adfc9c383ccacec1b13108783e9e96881d74 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Fri, 27 Sep 2024 19:07:33 +0800 Subject: [PATCH] fix: use clone instead of to_owned --- viz-core/src/middleware/otel/tracing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viz-core/src/middleware/otel/tracing.rs b/viz-core/src/middleware/otel/tracing.rs index d53f38c..10fedc4 100644 --- a/viz-core/src/middleware/otel/tracing.rs +++ b/viz-core/src/middleware/otel/tracing.rs @@ -47,7 +47,7 @@ where TracingMiddleware { h, tracer: self.tracer.clone(), - name: self.name.to_owned().unwrap_or("tracing".to_string()), + name: self.name.clone().unwrap_or("tracing".to_string()), } } } @@ -80,7 +80,7 @@ where let attributes = build_attributes(&req, http_route.as_str()); let tracer = self .tracer - .tracer_builder(self.name.to_owned()) + .tracer_builder(self.name.clone()) .with_attributes(attributes) .build(); let mut span = tracer.build_with_context(