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

[xi-core-lib] Missing panic conditon on docs #1349

Open
HeeillWang opened this issue Sep 22, 2023 · 0 comments
Open

[xi-core-lib] Missing panic conditon on docs #1349

HeeillWang opened this issue Sep 22, 2023 · 0 comments

Comments

@HeeillWang
Copy link

Style::new() has assert statement, but panic condition is missing on rust docs. Better to add panic condition like other crates' api

pub fn new<O32, O16, OB>(
priority: u16,
fg_color: O32,
bg_color: O32,
weight: O16,
underline: OB,
italic: OB,
) -> Self
where
O32: Into<Option<u32>>,
O16: Into<Option<u16>>,
OB: Into<Option<bool>>,
{
assert!(priority <= 1000);
Style {
priority,
fg_color: fg_color.into(),
bg_color: bg_color.into(),
weight: weight.into(),
underline: underline.into(),
italic: italic.into(),
}
}

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

No branches or pull requests

1 participant