Skip to content

docs(error): Fix link to ratatui_core::backend::ClearType enum#102

Merged
j-g00da merged 1 commit intoratatui:mainfrom
deadbaed:sidetrack-error
Jun 26, 2025
Merged

docs(error): Fix link to ratatui_core::backend::ClearType enum#102
j-g00da merged 1 commit intoratatui:mainfrom
deadbaed:sidetrack-error

Conversation

@deadbaed
Copy link
Copy Markdown
Contributor

@deadbaed deadbaed commented Jun 25, 2025

Fixed a rustdoc error linking to an enum of ratatui_core.

Comment on lines 3 to 13
/// Represents different drawing operations
#[derive(thiserror::Error, Debug)]
pub enum DrawErrorKind {
/// Error when trying to draw pixels on the display
#[error("drawing pixels")]
DrawingPixels,

/// Error when trying to draw a pixel on the display
#[error("clearing display")]
ClearingDisplay,
}

/// Represents backend error.
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// Drawing to the display failed.
#[error("drawing to DrawTarget failed")]
DrawError,
/// Selected [`ClearType`] is not supported by Mousefood.
#[error("drawing to DrawTarget failed: {0}")]
DrawError(DrawErrorKind),

/// Selected [`ClearType`](ratatui_core::backend::ClearType) is not supported by Mousefood.
#[error("ClearType::{0} is not supported by Mousefood")]
ClearTypeUnsupported(alloc::string::String),
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think there's a need to nest it this way, this would be fine done flat inside Error.
Also not sure if we even need to differentiate between clear error and draw error, because this is essentially the same action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes that makes sense. I'll revert this, and just keep the PR for the documentation.

@deadbaed deadbaed changed the title feat(error)!: Add details to Error::DrawError docs(error): Fix link to ratatui_core::backend::ClearType enum Jun 26, 2025
@deadbaed deadbaed requested a review from j-g00da June 26, 2025 06:39
@j-g00da j-g00da merged commit 8d78348 into ratatui:main Jun 26, 2025
24 checks passed
@github-actions github-actions bot mentioned this pull request Jan 23, 2026
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