Skip to content

Commit

Permalink
fix(opentelemetry): use Cow<'static, str> for span name in in_span.
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyCpp committed Feb 5, 2022
1 parent 3e645de commit 4f49f9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opentelemetry/src/trace/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ pub trait Tracer {
/// })
/// }
/// ```
fn in_span<T, F>(&self, name: &'static str, f: F) -> T
fn in_span<T, F, N>(&self, name: N, f: F) -> T
where
F: FnOnce(Context) -> T,
N: Into<Cow<'static, str>>,
Self::Span: Send + Sync + 'static,
{
let span = self.start(name);
Expand Down

0 comments on commit 4f49f9b

Please sign in to comment.