Skip to content

Commit

Permalink
fix must_use
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Jan 25, 2025
1 parent 41e0899 commit ce58cec
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion attest/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(orb_attest::SYSLOG_IDENTIFIER)
.init();
orb_attest::main().await
Expand Down
2 changes: 1 addition & 1 deletion attest/src/remote_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ printf dmFsaWRzaWduYXR1cmU=
// A happy path
#[tokio::test]
async fn get_token() {
orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();

let mock_server = MockServer::start().await;

Expand Down
6 changes: 3 additions & 3 deletions backend-state/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ const SYSLOG_IDENTIFIER: &str = "worldcoin-backend-state";
#[command(about, author, version=BUILD_INFO.version, styles=make_clap_v3_styles())]
struct Cli {}

// No need to waste RAM with a threadpool.
#[tokio::main(flavor = "current_thread")]
// No need to waste RAM with a ton of threads, but we need at least 1 for telemetry.
#[tokio::main(flavor = "multi_thread", worker_threads = 1)]
async fn main() -> Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();

Expand Down
2 changes: 1 addition & 1 deletion experiments/zenoh/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum Args {

#[tokio::main]
async fn main() -> color_eyre::Result<()> {
orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();
tracing::debug!("debug logging is enabled");

let args = Args::parse();
Expand Down
2 changes: 1 addition & 1 deletion mcu-util/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ fn clap_v3_styles() -> Styles {
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();

let args = Args::parse();

Expand Down
2 changes: 1 addition & 1 deletion supervisor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn clap_v3_styles() -> Styles {
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();
debug!("initialized telemetry");
Expand Down
2 changes: 1 addition & 1 deletion supervisor/tests/it/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use zbus::{
pub const WORLDCOIN_CORE_SERVICE_OBJECT_PATH: &str =
"/org/freedesktop/systemd1/unit/worldcoin_2dcore_2eservice";
static TRACING: Lazy<()> = Lazy::new(|| {
orb_telemetry::TelemetryConfig::new().init();
let _ = orb_telemetry::TelemetryConfig::new().init();
});

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion telemetry/examples/simple.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tracing::{debug, error, info, trace, warn};

fn main() {
let _guard = orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();

trace!("TRACE");
debug!("DEBUG");
Expand Down
2 changes: 1 addition & 1 deletion thermal-cam-ctrl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ enum Flow {

fn main() -> Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();

Expand Down
2 changes: 1 addition & 1 deletion ui/examples/ui-replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl FromStr for EventRecord {
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();

let args = Args::parse();
let connection = Connection::session().await?;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async fn get_hw_version() -> Result<Hardware> {
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();

Expand Down
2 changes: 1 addition & 1 deletion update-agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CFG_ENV_VAR: &str = const_format::concatcp!(ENV_VAR_PREFIX, "CONFIG");
const SYSLOG_IDENTIFIER: &str = "worldcoin-update-agent";

fn main() -> UpdateAgentResult {
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();

Expand Down
2 changes: 1 addition & 1 deletion update-agent/src/update/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::update::Update;
//#[cfg(feature = "can-update-test")]
#[ignore = "needs vcan interface"]
pub fn try_can_update() -> eyre::Result<()> {
orb_telemetry::TelemetryConfig::new().try_init().ok();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().try_init().ok();

let mut file = File::open("/mnt/scratch/app_mcu_main_test.bin")?;

Expand Down
2 changes: 1 addition & 1 deletion update-agent/tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
#[ignore = "requires specific block device"]
#[test]
fn test_blockdevice_size() {
orb_telemetry::TelemetryConfig::new().init();
let _telemetry_guard = orb_telemetry::TelemetryConfig::new().init();

let mut block_device: File = std::fs::OpenOptions::new()
.read(true)
Expand Down
2 changes: 1 addition & 1 deletion update-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn clap_v3_styles() -> Styles {

fn main() -> color_eyre::Result<()> {
color_eyre::install()?;
orb_telemetry::TelemetryConfig::new()
let _telemetry_guard = orb_telemetry::TelemetryConfig::new()
.with_journald(SYSLOG_IDENTIFIER)
.init();
run().inspect_err(|error| error!(?error, "failed to run update-verifier"))
Expand Down

0 comments on commit ce58cec

Please sign in to comment.