crossterm-rs / crossterm

Cross platform terminal library rust
MIT License
3.29k stars 280 forks source link

Build error with use-dev-tty #886

Closed gwenn closed 6 months ago

gwenn commented 6 months ago

Describe the bug Build fails with use-dev-tty feature

To Reproduce

% cargo check --no-default-features --features "use-dev-tty events"
...
error[E0061]: this method takes 1 argument but 2 arguments were supplied
  --> src/event/source/unix/tty.rs:83:18
   |
83 |         match fd.read(buf, buf.len()) {
   |                  ^^^^    -----------
   |                          | |
   |                          | unexpected argument of type `usize`
   |                          help: remove the extra argument
   |
note: method defined here
  --> src/terminal/sys/file_descriptor.rs:32:12
   |
32 |     pub fn read(&self, buffer: &mut [u8]) -> io::Result<usize> {
   |            ^^^^        -----------------

It seems to be related to #821

Expected behavior The build should succeed. And ideally, use-dev-tty should imply events but without mio dependencies.

OS

joshka commented 6 months ago

Fixed in https://github.com/crossterm-rs/crossterm/pull/888

gwenn commented 6 months ago

Only partially fixed:

And ideally, use-dev-tty should imply events but without mio dependencies.

joshka commented 6 months ago

Only partially fixed:

And ideally, use-dev-tty should imply events but without mio dependencies.

Can you expand on this?

gwenn commented 6 months ago
joshka commented 6 months ago

Got it - makes sense.