Function x11rb_protocol::utils::pretty_printer::pretty_print_enum
source ยท pub(crate) fn pretty_print_enum(
fmt: &mut Formatter<'_>,
value: u32,
cases: &[(u32, &str, &str)],
) -> Result
Expand description
A helper to pretty-print an enumeration value.
This function prints the given number. If it matches one of the provided variants, that match is used. Otherwise, the number is printed as a decimal.
In alternate mode, the second string in the given array is used, else the first.