caniuse_serde/regional_usage/
RegionalUsagesFromStrError.rs

1// This file is part of caniuse-serde. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/caniuse-serde/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2017 The developers of caniuse-serde. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/caniuse-serde/master/COPYRIGHT.
3
4
5/// Represents the error that can occur when parsing a str to get a Regional Usages.
6#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
7pub struct RegionalUsagesFromStrError;
8
9impl Error for RegionalUsagesFromStrError
10{
11	#[inline(always)]
12	fn description(&self) -> &str
13	{
14		"unknown caniuse ISO-like code"
15	}
16	
17	#[inline(always)]
18	fn cause(&self) -> Option<&Error>
19	{
20		None
21	}
22}
23
24impl Display for RegionalUsagesFromStrError
25{
26	#[inline(always)]
27	fn fmt(&self, f: &mut Formatter) -> fmt::Result
28	{
29		write!(f, "{}", self.description())
30	}
31}