1 // This file is part of ICU4X. For terms of use, please see the file 2 // called LICENSE at the top level of the ICU4X source tree 3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). 4 5 use core::fmt::Display; 6 7 #[derive(Debug)] 8 pub enum VarZeroVecFormatError { 9 /// The byte buffer was not in the appropriate format for VarZeroVec. 10 Metadata, 11 /// One of the values could not be decoded. 12 Values(crate::ule::UleError), 13 } 14 15 impl core::error::Error for VarZeroVecFormatError {} 16 17 impl Display for VarZeroVecFormatError { fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result18 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 19 match self { 20 Self::Metadata => write!(f, "VarZeroVecFormatError: metadata"), 21 Self::Values(e) => write!(f, "VarZeroVecFormatError: {e}"), 22 } 23 } 24 } 25