Skip to content

Commit 56ddea5

Browse files
authored
Merge pull request #638 from louis-e/telemetry-nofeatures-fix
Fix no-default-features build
2 parents 74fbdab + 430a497 commit 56ddea5

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

src/data_processing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::element_processing::*;
66
use crate::ground::Ground;
77
use crate::osm_parser::ProcessedElement;
88
use crate::progress::emit_gui_progress_update;
9+
#[cfg(feature = "gui")]
910
use crate::telemetry::{send_log, LogLevel};
1011
use crate::world_editor::WorldEditor;
1112
use colored::Colorize;
@@ -253,6 +254,7 @@ pub fn generate_world(
253254
) {
254255
let warning_msg = format!("Failed to update spawn point Y coordinate: {}", e);
255256
eprintln!("Warning: {}", warning_msg);
257+
#[cfg(feature = "gui")]
256258
send_log(LogLevel::Warning, &warning_msg);
257259
}
258260
}

src/elevation_data.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::coordinate_system::{geographic::LLBBox, transformation::geo_distance};
2+
#[cfg(feature = "gui")]
23
use crate::telemetry::{send_log, LogLevel};
34
use image::Rgb;
45
use std::path::Path;
@@ -115,6 +116,7 @@ pub fn fetch_elevation_data(
115116
tile_path.display(),
116117
file_size
117118
);
119+
#[cfg(feature = "gui")]
118120
send_log(
119121
LogLevel::Warning,
120122
"Cached tile appears to be too small. Refetching tile.",
@@ -126,6 +128,7 @@ pub fn fetch_elevation_data(
126128
"Warning: Failed to remove corrupted tile file: {}",
127129
remove_err
128130
);
131+
#[cfg(feature = "gui")]
129132
send_log(
130133
LogLevel::Warning,
131134
"Failed to remove corrupted tile file during refetching.",
@@ -149,6 +152,7 @@ pub fn fetch_elevation_data(
149152
tile_path.display(),
150153
e
151154
);
155+
#[cfg(feature = "gui")]
152156
send_log(
153157
LogLevel::Warning,
154158
"Cached tile is corrupted or invalid. Re-downloading...",
@@ -160,6 +164,7 @@ pub fn fetch_elevation_data(
160164
"Warning: Failed to remove corrupted tile file: {}",
161165
remove_err
162166
);
167+
#[cfg(feature = "gui")]
163168
send_log(
164169
LogLevel::Warning,
165170
"Failed to remove corrupted tile file during re-download.",

src/progress.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg(feature = "gui")]
12
use crate::telemetry::{send_log, LogLevel};
23
use once_cell::sync::OnceCell;
34
use serde_json::json;
@@ -41,6 +42,7 @@ pub fn emit_gui_progress_update(progress: f64, message: &str) {
4142
if let Err(e) = window.emit("progress-update", payload) {
4243
let error_msg = format!("Failed to emit progress event: {}", e);
4344
eprintln!("{}", error_msg);
45+
#[cfg(feature = "gui")]
4446
send_log(LogLevel::Warning, &error_msg);
4547
}
4648
}

src/world_editor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::coordinate_system::cartesian::{XZBBox, XZPoint};
33
use crate::coordinate_system::geographic::LLBBox;
44
use crate::ground::Ground;
55
use crate::progress::emit_gui_progress_update;
6+
#[cfg(feature = "gui")]
67
use crate::telemetry::{send_log, LogLevel};
78
use colored::Colorize;
89
use fastanvil::Region;
@@ -757,6 +758,7 @@ impl<'a> WorldEditor<'a> {
757758
// Save metadata with error handling
758759
if let Err(e) = self.save_metadata() {
759760
eprintln!("Failed to save world metadata: {}", e);
761+
#[cfg(feature = "gui")]
760762
send_log(LogLevel::Warning, "Failed to save world metadata.");
761763
// Continue with world saving even if metadata fails
762764
}

0 commit comments

Comments
 (0)