Skip to content

Commit

Permalink
Merge pull request #67 from londospark/fix-windows-warnings
Browse files Browse the repository at this point in the history
Remove items from the Windows build that are not used there.
  • Loading branch information
togglebyte authored Sep 10, 2024
2 parents 9df0cf0 + 67fef56 commit 191a0de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anathema-backend/src/tui/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::io::{Result, Write};
use anathema_geometry::{Pos, Size};
use anathema_widgets::paint::CellAttributes;
use anathema_widgets::WidgetRenderer;
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
use crossterm::event::EnableMouseCapture;
use crossterm::terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen};
use crossterm::{cursor, ExecutableCommand, QueueableCommand};

Expand Down Expand Up @@ -131,7 +131,7 @@ impl Screen {
disable_raw_mode()?;
output.execute(LeaveAlternateScreen)?;
#[cfg(not(target_os = "windows"))]
output.execute(DisableMouseCapture)?;
output.execute(crossterm::event::DisableMouseCapture)?;
output.execute(cursor::Show)?;
Ok(())
}
Expand Down
5 changes: 5 additions & 0 deletions anathema-templates/src/variables.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::collections::HashMap;
use std::rc::Rc;

#[cfg(not(target_os = "windows"))]
use anathema_debug::DebugWriter;
use anathema_store::slab::Slab;

Expand Down Expand Up @@ -370,12 +371,14 @@ impl From<Variables> for HashMap<Rc<str>, Expression> {
}
}

#[cfg(not(target_os = "windows"))]
pub struct ScopeDebug<'a> {
level: usize,
scope: &'a Scope,
store: &'a Slab<VarId, Expression>,
}

#[cfg(not(target_os = "windows"))]
impl DebugWriter for ScopeDebug<'_> {
fn write(&mut self, output: &mut impl std::fmt::Write) -> std::fmt::Result {
let indent = " ".repeat(self.level * 4);
Expand Down Expand Up @@ -404,8 +407,10 @@ impl DebugWriter for ScopeDebug<'_> {
}
}

#[cfg(not(target_os = "windows"))]
pub struct VariablesDebug<'a>(pub(crate) &'a Variables);

#[cfg(not(target_os = "windows"))]
impl DebugWriter for VariablesDebug<'_> {
fn write(&mut self, output: &mut impl std::fmt::Write) -> std::fmt::Result {
ScopeDebug {
Expand Down

0 comments on commit 191a0de

Please sign in to comment.