Skip to content

Commit

Permalink
Fix interactive-demo (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluis committed Apr 23, 2023
1 parent 769b181 commit dfc67e5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/interactive-demo/src/main.rs
Expand Up @@ -94,7 +94,7 @@ pub fn read_char() -> std::io::Result<char> {
}
}

pub fn buffer_size() -> io::Result<(u16> {
pub fn buffer_size() -> io::Result<(u16, u16)> {
terminal::size()
}

Expand Down
6 changes: 4 additions & 2 deletions examples/interactive-demo/src/test/attribute.rs
Expand Up @@ -7,8 +7,10 @@ const ATTRIBUTES: [(style::Attribute, style::Attribute); 10] = [
(style::Attribute::Bold, style::Attribute::NormalIntensity),
(style::Attribute::Italic, style::Attribute::NoItalic),
(style::Attribute::Underlined, style::Attribute::NoUnderline),

(style::Attribute::DoubleUnderlined, style::Attribute::NoUnderline),
(
style::Attribute::DoubleUnderlined,
style::Attribute::NoUnderline,
),
(style::Attribute::Undercurled, style::Attribute::NoUnderline),
(style::Attribute::Underdotted, style::Attribute::NoUnderline),
(style::Attribute::Underdashed, style::Attribute::NoUnderline),
Expand Down
1 change: 0 additions & 1 deletion examples/interactive-demo/src/test/color.rs
@@ -1,6 +1,5 @@
#![allow(clippy::cognitive_complexity)]

use crate::Result;
use crossterm::{cursor, queue, style, style::Color};
use std::io::Write;

Expand Down
5 changes: 2 additions & 3 deletions examples/interactive-demo/src/test/cursor.rs
Expand Up @@ -2,7 +2,7 @@

use std::io::Write;

use crossterm::{cursor, execute, queue, style, Command, style::Stylize};
use crossterm::{cursor, execute, queue, style, style::Stylize, Command};
use std::thread;
use std::time::Duration;

Expand Down Expand Up @@ -109,7 +109,6 @@ where
)
}


fn test_move_cursor_to<W>(w: &mut W) -> std::io::Result<()>
where
W: Write,
Expand Down Expand Up @@ -171,7 +170,7 @@ where
queue!(
w,
cursor::MoveTo(column, row),
style::PrintStyledContent("▓".red()),
style::PrintStyledContent("▓".red()),
)?;
} else {
queue!(
Expand Down
2 changes: 1 addition & 1 deletion examples/interactive-demo/src/test/event.rs
Expand Up @@ -5,7 +5,7 @@ use crossterm::{
event::{read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
execute,
};
use std::io;
use std::io::{self, Write};

fn test_event<W>(w: &mut W) -> io::Result<()>
where
Expand Down

0 comments on commit dfc67e5

Please sign in to comment.