Skip to content

Commit

Permalink
refactor: replace dead_code allow with expect
Browse files Browse the repository at this point in the history
- Replace #[allow(dead_code)] with #[expect(dead_code)] for better maintainability
- Update EventHandler struct and world_map module to use expect instead of allow
  • Loading branch information
ShenMian committed Dec 29, 2024
1 parent b58033c commit 195e7ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ pub enum Event {
}

/// Terminal event handler.
#[allow(dead_code)]
#[derive(Debug)]
pub struct EventHandler {
/// Event sender channel.
#[expect(dead_code)]
sender: mpsc::UnboundedSender<Event>,
/// Event receiver channel.
receiver: mpsc::UnboundedReceiver<Event>,
/// Event handler thread.
#[expect(dead_code)]
handler: tokio::task::JoinHandle<()>,
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/world_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn area_to_lon_lat(x: u16, y: u16, area: Rect) -> (f64, f64) {
(lon, lat)
}

#[allow(dead_code)]
#[expect(dead_code)]
/// Convert lon/lat coordinates to area coordinates
fn lon_lat_to_area(lon: f64, lat: f64, area: Rect) -> (u16, u16) {
debug_assert!((-180.0..=180.0).contains(&lon));
Expand Down

0 comments on commit 195e7ba

Please sign in to comment.