use super::generated_api::api::style::{ color::Payload as ProtobufColorPayload, Color as ProtobufColor, ColorType as ProtobufColorType, Palette as ProtobufPalette, RgbColorPayload as ProtobufRgbColorPayload, Style as ProtobufStyle, Styling as ProtobufStyling, ThemeHue as ProtobufThemeHue, }; use crate::data::{ MultiplayerColors, Palette, PaletteColor, Style, StyleDeclaration, Styling, ThemeHue, }; use crate::errors::prelude::*; use std::convert::TryFrom; impl TryFrom for Style { type Error = &'static str; fn try_from(protobuf_style: ProtobufStyle) -> Result { let s = protobuf_style .styling .ok_or("malformed style payload")? .try_into()?; Ok(Style { colors: s, rounded_corners: protobuf_style.rounded_corners, hide_session_name: protobuf_style.hide_session_name, }) } } #[allow(deprecated)] impl TryFrom