Skip to content

Commit 4ced8f0

Browse files
mesutoezdilborao
andauthored
fix(function-autoscaler): move TracingGuard above the test module so clippy passes (#545)
Signed-off-by: mesutoezdil <mesudozdil@gmail.com> Co-authored-by: Bora Oztekin <borao@users.noreply.github.com>
1 parent c97bca2 commit 4ced8f0

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

  • src/control-plane-services/function-autoscaler/crates/server/src

src/control-plane-services/function-autoscaler/crates/server/src/tracing_init.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ fn endpoint_has_port(endpoint: &str) -> bool {
142142
.unwrap_or(false)
143143
}
144144

145+
pub struct TracingGuard {
146+
provider: SdkTracerProvider,
147+
}
148+
149+
impl Drop for TracingGuard {
150+
fn drop(&mut self) {
151+
if let Err(e) = self.provider.shutdown() {
152+
eprintln!("TracerProvider shutdown error: {:?}", e);
153+
}
154+
}
155+
}
156+
145157
#[cfg(test)]
146158
mod tests {
147159
use super::*;
@@ -206,15 +218,3 @@ mod tests {
206218
assert_eq!(build_otlp_grpc_endpoint(&settings), "http://127.0.0.1:4317");
207219
}
208220
}
209-
210-
pub struct TracingGuard {
211-
provider: SdkTracerProvider,
212-
}
213-
214-
impl Drop for TracingGuard {
215-
fn drop(&mut self) {
216-
if let Err(e) = self.provider.shutdown() {
217-
eprintln!("TracerProvider shutdown error: {:?}", e);
218-
}
219-
}
220-
}

0 commit comments

Comments
 (0)