Skip to content

Commit

Permalink
Do not use repeat_n as it was introduced in 1.82
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Nov 11, 2024
1 parent 1743730 commit 353bbbe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "ca
env_logger = "0.10"
hex_color = { version = "3", features = ["serde"] }
indexmap = "2"
#TODO: for repeat_n, which is in std in 1.82
itertools = "0.13"
lazy_static = "1"
log = "0.4"
open = "5.0.2"
Expand Down
5 changes: 3 additions & 2 deletions src/mouse_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ impl MouseReporter {
};

//Generate term codes
let x_iter = std::iter::repeat_n(button_no_x, lines_x.unsigned_abs() as _);
let y_iter = std::iter::repeat_n(button_no_y, lines_y.unsigned_abs() as _);
//TODO: std::iter::repeat_n only available in 1.82
let x_iter = itertools::repeat_n(button_no_x, lines_x.unsigned_abs() as _);
let y_iter = itertools::repeat_n(button_no_y, lines_y.unsigned_abs() as _);

x_iter
.chain(y_iter)
Expand Down

0 comments on commit 353bbbe

Please sign in to comment.