Skip to content

Commit 111e573

Browse files
committed
refactor: inline tag assignments
1 parent 5973888 commit 111e573

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/wasm/src/sentry_gauge.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,6 @@ pub trait SentryGauge {
217217
fn update(&mut self) -> Result<()>;
218218
}
219219

220-
fn set_sentry_tags(scope: &mut sentry::Scope) {
221-
let config = Config::get_config();
222-
scope.set_tag("developer", if let Some(config) = &config { config.addon.developer.clone() } else { "unknown".into() });
223-
scope.set_tag("product", if let Some(config) = &config { config.addon.product.clone() } else { "unknown".into() });
224-
}
225-
226220
/// Create a sentry "executor" around a gauge
227221
///
228222
/// Note: This MUST be the first function called within a gauge callback. Nothing will run after this
@@ -261,7 +255,9 @@ where
261255
..Default::default()
262256
}));
263257

264-
set_sentry_tags(scope);
258+
let config = Config::get_config();
259+
scope.set_tag("developer", if let Some(config) = &config { config.addon.developer.clone() } else { "unknown".into() });
260+
scope.set_tag("product", if let Some(config) = &config { config.addon.product.clone() } else { "unknown".into() });
265261
});
266262

267263
// Drain any pending reports. We need to structure it like this as opposed to just a top level `let Ok(state) = ...`` due to the fact we should not be holding a MutexGuard across an await point

0 commit comments

Comments
 (0)