Skip to content

Commit

Permalink
Remove deprecated benchmark environment flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacdonald committed Nov 21, 2024
1 parent 1bf8720 commit 63f24c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/models/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,15 @@ fn create_workspace(
Ok(workspace)
}

#[cfg(not(any(test, feature = "bench")))]
#[cfg(not(test))]
fn user_syntax_path() -> Result<Option<PathBuf>> {
Preferences::syntax_path().map(Some)
}

// Building/linking user syntaxes is expensive, which is most obvious in the
// test suite, as it creates application instances in rapid succession. Bypass
// these in test and benchmark environments.
#[cfg(any(test, feature = "bench"))]
#[cfg(test)]
fn user_syntax_path() -> Result<Option<PathBuf>> {
Ok(None)
}
Expand Down
8 changes: 4 additions & 4 deletions src/view/terminal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod cell;
mod cursor;
mod termion_terminal;

#[cfg(any(test, feature = "bench"))]
#[cfg(test)]
mod test_terminal;

use crate::errors::*;
Expand All @@ -18,7 +18,7 @@ pub use self::buffer_iterator::TerminalBufferIterator;
pub use self::cell::Cell;
pub use self::cursor::CursorType;

#[cfg(any(test, feature = "bench"))]
#[cfg(test)]
pub use self::test_terminal::TestTerminal;

const MIN_WIDTH: usize = 10;
Expand All @@ -36,14 +36,14 @@ pub trait Terminal {
fn suspend(&self);
}

#[cfg(not(any(test, feature = "bench")))]
#[cfg(not(test))]
pub fn build_terminal() -> Result<Arc<Box<dyn Terminal + Sync + Send + 'static>>> {
Ok(Arc::new(
Box::new(termion_terminal::TermionTerminal::new()?),
))
}

#[cfg(any(test, feature = "bench"))]
#[cfg(test)]
pub fn build_terminal() -> Result<Arc<Box<dyn Terminal + Sync + Send + 'static>>> {
Ok(Arc::new(Box::new(TestTerminal::new())))
}

0 comments on commit 63f24c3

Please sign in to comment.