Skip to content

Commit 92dd3e6

Browse files
authored
docs: specify what from_str expects
While you can clearly examine the source to see the conversion expression, specify the method in the doc comment as well.
1 parent 2b26b50 commit 92dd3e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ impl core::fmt::Display for CursorIcon {
332332
impl core::str::FromStr for CursorIcon {
333333
type Err = ParseError;
334334

335+
/// Parse a string slice into [`CursorIcon`].
336+
///
337+
/// The `name` is a lower kebab case [`CursorIcon`] varaint name, e.g.
338+
/// `nesw-resize`. The set of possible valid `name` values matches exactly
339+
/// the set of [`CursorIcon::name`] outputs.
335340
fn from_str(name: &str) -> Result<Self, Self::Err> {
336341
match name {
337342
"default" => Ok(CursorIcon::Default),

0 commit comments

Comments
 (0)