I have a custom error implementation via thiserror in my project. I would like to have an error variant that corresponds to ParseColorError in Ratatui, but I am unable to use that type since it is private.
To Reproduce
use ratatui::style::Color;
use std::str::FromStr;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum AppError {
/// Error that may occur while parsing colors.
#[error("Parse color error: `{0:?}`")]
ParseColor(ratatui::style::color::ParseColorError),
}
fn main() -> Result<(), AppError> {
let color = Color::from_str("#000000")?;
Ok(())
}
9 | ParseColor(ratatui::style::color::ParseColorError),
| ^^^^^ --------------- struct `ParseColorError` is not publicly re-exported
| |
| private module
Proposal
Make ParseColorError public, either via exposing it from ratatui::style::color::ParseColorError or ratatui::style::ParseColorError. I think latter makes more sense since color module is private.
Description
I have a custom error implementation via thiserror in my project. I would like to have an error variant that corresponds to
ParseColorError
in Ratatui, but I am unable to use that type since it is private.To Reproduce
Proposal
Make
ParseColorError
public, either via exposing it fromratatui::style::color::ParseColorError
orratatui::style::ParseColorError
. I think latter makes more sense sincecolor
module is private.