diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-13 14:55:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 14:55:45 +0100 |
commit | 5462c415744a64899dcd344dee42075f9154741b (patch) | |
tree | bbbb7df9a9f18c5fd3caf406d7f5bc9e13168d1f /netwerk/base/rust-url-capi/src/error_mapping.rs | |
parent | 90e68c3e3f4bb2f1a427a01586981e62bf74b898 (diff) | |
parent | 38d185280e2cad4ed6673bb38f707f54dad4ded7 (diff) | |
download | UXP-5462c415744a64899dcd344dee42075f9154741b.tar UXP-5462c415744a64899dcd344dee42075f9154741b.tar.gz UXP-5462c415744a64899dcd344dee42075f9154741b.tar.lz UXP-5462c415744a64899dcd344dee42075f9154741b.tar.xz UXP-5462c415744a64899dcd344dee42075f9154741b.zip |
Merge pull request #59 from MoonchildProductions/Evapo-Rust
Remove all rust components and libs.
Diffstat (limited to 'netwerk/base/rust-url-capi/src/error_mapping.rs')
-rw-r--r-- | netwerk/base/rust-url-capi/src/error_mapping.rs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/netwerk/base/rust-url-capi/src/error_mapping.rs b/netwerk/base/rust-url-capi/src/error_mapping.rs deleted file mode 100644 index f20afb263..000000000 --- a/netwerk/base/rust-url-capi/src/error_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -use url::ParseError; - -pub trait ErrorCode { - fn error_code(&self) -> i32; -} - -impl<T: ErrorCode> ErrorCode for Result<(), T> { - fn error_code(&self) -> i32 { - match *self { - Ok(_) => 0, - Err(ref error) => error.error_code(), - } - } -} - -impl ErrorCode for () { - fn error_code(&self) -> i32 { - return -1; - } -} -impl ErrorCode for ParseError { - fn error_code(&self) -> i32 { - return -1; -// match *self { -// ParseError::EmptyHost => -1, -// ParseError::InvalidScheme => -2, -// ParseError::InvalidPort => -3, -// ParseError::InvalidIpv6Address => -4, -// ParseError::InvalidDomainCharacter => -5, -// ParseError::InvalidCharacter => -6, -// ParseError::InvalidBackslash => -7, -// ParseError::InvalidPercentEncoded => -8, -// ParseError::InvalidAtSymbolInUser => -9, -// ParseError::ExpectedTwoSlashes => -10, -// ParseError::ExpectedInitialSlash => -11, -// ParseError::NonUrlCodePoint => -12, -// ParseError::RelativeUrlWithScheme => -13, -// ParseError::RelativeUrlWithoutBase => -14, -// ParseError::RelativeUrlWithNonRelativeBase => -15, -// ParseError::NonAsciiDomainsNotSupportedYet => -16, -// ParseError::CannotSetJavascriptFragment => -17, -// ParseError::CannotSetPortWithFileLikeScheme => -18, -// ParseError::CannotSetUsernameWithNonRelativeScheme => -19, -// ParseError::CannotSetPasswordWithNonRelativeScheme => -20, -// ParseError::CannotSetHostPortWithNonRelativeScheme => -21, -// ParseError::CannotSetHostWithNonRelativeScheme => -22, -// ParseError::CannotSetPortWithNonRelativeScheme => -23, -// ParseError::CannotSetPathWithNonRelativeScheme => -24, -// } - } -} - -pub enum NSError { - OK, - InvalidArg, - Failure, -} - -impl ErrorCode for NSError { - #[allow(overflowing_literals)] - fn error_code(&self) -> i32 { - match *self { - NSError::OK => 0, - NSError::InvalidArg => 0x80070057, - NSError::Failure => 0x80004005 - } - } -} |