Type std::char::ParseCharError

Overview

Protocols

protocol DISPLAY_FMT
format!("{}", value)

Write why a character could not be parsed.

Examples

let text = if let Err(error) = "ab".parse::<char>() {
   format!("{error}")
} else {
   ""
};

assert_eq!(text, "too many characters in string");
protocol DEBUG_FMT
format!("{:?}", value)

Write a debug representation of why a character could not be parsed.

Examples

let text = if let Err(error) = "ab".parse::<char>() {
   format!("{error:?}")
} else {
   ""
};

assert!(text.starts_with("ParseCharError"));