Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(event): fix poll expect message #37

Merged
merged 2 commits into from
Jan 4, 2024
Merged

fix(event): fix poll expect message #37

merged 2 commits into from
Jan 4, 2024

Conversation

Valentin271
Copy link
Member

The doc says

Returns Ok(true) if an Event is available otherwise it returns Ok(false).

So "no events available" would correspond to Ok(false).

The doc does not mention the Err case but looking at the internal code in crossterm::event::read.rs, this is the only place an error is returned.

        let event_source = match self.source.as_mut() {
            Some(source) => source,
            None => {
                return Err(std::io::Error::new(
                    std::io::ErrorKind::Other,
                    "Failed to initialize input reader",
                ))
            }
        };

simple/src/event.rs Outdated Show resolved Hide resolved
Co-authored-by: Orhun Parmaksız <[email protected]>
Copy link
Sponsor Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@orhun orhun merged commit 566dc04 into ratatui:main Jan 4, 2024
2 checks passed
@Valentin271 Valentin271 deleted the fix/event-poll-expect-msg branch January 4, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants