From 317936770bbca37b3a2f642363de8a1d13b443e9 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Sun, 11 Feb 2024 09:24:15 +0100 Subject: [PATCH] Better imports in tracy example --- examples/tracy.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/tracy.rs b/examples/tracy.rs index e733512..dad5342 100644 --- a/examples/tracy.rs +++ b/examples/tracy.rs @@ -17,6 +17,8 @@ use std::time::Duration; use async_io::{block_on, Timer}; +use tracing_subscriber::layer::SubscriberExt; +use tracing_tracy::{client::Client as TracyClient, TracyLayer}; use mlua::prelude::*; use mlua_luau_runtime::{Functions, Runtime}; @@ -26,13 +28,10 @@ const MAIN_SCRIPT: &str = include_str!("./lua/lots_of_threads.luau"); const ONE_NANOSECOND: Duration = Duration::from_nanos(1); pub fn main() -> LuaResult<()> { - use tracing_subscriber::layer::SubscriberExt; - tracing::subscriber::set_global_default( - tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()), - ) - .unwrap(); - - let _client = tracing_tracy::client::Client::start(); + let _client = TracyClient::start(); + let _ = tracing::subscriber::set_global_default( + tracing_subscriber::registry().with(TracyLayer::default()), + ); // Set up persistent Lua environment let lua = Lua::new();