1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
Description: ignore the demo example
The demo example currently fails to compile when none of the features are enabled. This
breaks one of the autopkgtests that run tests with no features specified.
The patch also provides a fix to the termion feature in the demo, which requires
functionality from a newer termion version that is not yet available in Debian but is
relaxed as a dependency in ratatui
Author: Nadzeya Hutsko <nadzya.info@gmail.com>
Forwarded: not-needed
Last-Update: 2025-09-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/examples/demo/main.rs
+++ b/examples/demo/main.rs
@@ -1,9 +1,9 @@
-#[cfg(all(
- not(feature = "crossterm"),
- not(feature = "termion"),
- not(feature = "termwiz")
-))]
-compile_error!("The demo needs one of the crossterm, termion, or termwiz features");
+// #[cfg(all(
+// not(feature = "crossterm"),
+// not(feature = "termion"),
+// not(feature = "termwiz")
+// ))]
+// compile_error!("The demo needs one of the crossterm, termion, or termwiz features");
#[cfg(feature = "crossterm")]
mod crossterm;
@@ -30,13 +30,13 @@
};
fn main() -> Result<(), Box<dyn Error>> {
- #[cfg(feature = "crossterm")]
- crate::crossterm::run()?;
- #[cfg(feature = "termion")]
- crate::termion::run()?;
- #[cfg(feature = "termwiz")]
- crate::termwiz::run()?;
- Ok(())
+ #[cfg(feature = "crossterm")]
+ crate::crossterm::run()?;
+ #[cfg(feature = "termion")]
+ crate::termion::run()?;
+ #[cfg(feature = "termwiz")]
+ crate::termwiz::run()?;
+ Ok(())
}
#[derive(Debug)]
--- a/examples/demo/termion.rs
+++ b/examples/demo/termion.rs
@@ -6,7 +6,7 @@
event::Key,
input::{MouseTerminal, TermRead},
raw::IntoRawMode,
- screen::IntoAlternateScreen,
+ // screen::IntoAlternateScreen,
},
Terminal,
};
@@ -14,19 +14,19 @@
use crate::{ui, App};
pub fn run() -> Result<(), Box<dyn Error>> {
- // setup terminal
- let stdout = io::stdout()
- .into_raw_mode()
- .unwrap()
- .into_alternate_screen()
- .unwrap();
- let stdout = MouseTerminal::from(stdout);
- let backend = TermionBackend::new(stdout);
- let mut terminal = Terminal::new(backend)?;
+ // // setup terminal
+ // let stdout = io::stdout()
+ // .into_raw_mode()
+ // .unwrap()
+ // .into_alternate_screen()
+ // .unwrap();
+ // let stdout = MouseTerminal::from(stdout);
+ // let backend = TermionBackend::new(stdout);
+ // let mut terminal = Terminal::new(backend)?;
- // create app and run it
- let app = App::new(&mut terminal);
- run_app(&mut terminal, app)?;
+ // // create app and run it
+ // let app = App::new(&mut terminal);
+ // run_app(&mut terminal, app)?;
Ok(())
}
|