Skip to content

Commit

Permalink
Renamed TryFrom associated type Err to Error
Browse files Browse the repository at this point in the history
This is due to rust-lang/rust#40281.
  • Loading branch information
Lukazoid committed Apr 20, 2017
1 parent 5f0e2b0 commit 885b34b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/crypto/client_hello_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct ClientHelloMessage {
}

impl<'a> TryFrom<&'a QuicTagValueMap> for ClientHelloMessage {
type Err = Error;
type Error = Error;

fn try_from(value: &'a QuicTagValueMap) -> Result<Self> {
let server_name = value.get_optional_value(QuicTag::ServerNameIndication)?;
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/key_exchange_algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl From<KeyExchangeAlgorithm> for QuicTag {
}
}
impl<'a> TryFrom<&'a QuicTag> for KeyExchangeAlgorithm {
type Err = Error;
type Error = Error;

fn try_from(value: &'a QuicTag) -> Result<Self> {
Ok(match *value {
Expand All @@ -55,7 +55,7 @@ impl<'a> TryFrom<&'a QuicTag> for KeyExchangeAlgorithm {
}

impl TryFrom<QuicTag> for KeyExchangeAlgorithm {
type Err = Error;
type Error = Error;

fn try_from(value: QuicTag) -> Result<Self> {
KeyExchangeAlgorithm::try_from(&value)
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl From<Proof> for QuicTag {
}

impl<'a> TryFrom<&'a QuicTag> for Proof {
type Err = Error;
type Error = Error;

fn try_from(value: &'a QuicTag) -> Result<Self> {
Ok(match *value {
Expand All @@ -52,8 +52,8 @@ impl<'a> TryFrom<&'a QuicTag> for Proof {
}

impl TryFrom<QuicTag> for Proof {
type Err = Error;
fn try_from(value: QuicTag) -> Result<Self> {
type Error = Error;
Proof::try_from(&value)
}
}
2 changes: 1 addition & 1 deletion src/crypto/rejection_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct RejectionMessage {
}

impl<'a> TryFrom<&'a QuicTagValueMap> for RejectionMessage {
type Err = Error;
type Error = Error;

fn try_from(value: &'a QuicTagValueMap) -> Result<Self> {

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/server_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct ServerConfiguration {
}

impl<'a> TryFrom<&'a QuicTagValueMap> for ServerConfiguration {
type Err = Error;
type Error = Error;

fn try_from(value: &'a QuicTagValueMap) -> Result<Self> {
let server_configuration_id = value.get_required_value(QuicTag::ServerConfigurationId)?;
Expand Down
4 changes: 2 additions & 2 deletions src/frames/stream_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum StreamIdLength {
}

impl TryFrom<usize> for StreamIdLength {
type Err = Error;
type Error = Error;

fn try_from(value: usize) -> Result<StreamIdLength> {
let length = match value {
Expand Down Expand Up @@ -94,7 +94,7 @@ pub enum StreamOffsetLength {
}

impl TryFrom<usize> for StreamOffsetLength {
type Err = Error;
type Error = Error;

fn try_from(value: usize) -> Result<StreamOffsetLength> {
let length = match value {
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/u24.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl From<U24> for u32 {
}

impl TryFrom<u32> for U24 {
type Err = Error;
type Error = Error;

fn try_from(value: u32) -> Result<U24> {
if value > MAX.into() {
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/u48.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl From<U48> for u64 {
}

impl TryFrom<u64> for U48 {
type Err = Error;
type Error = Error;

fn try_from(value: u64) -> Result<U48> {
if value > MAX.into() {
Expand Down

0 comments on commit 885b34b

Please sign in to comment.