Skip to content

Commit

Permalink
error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
syntacticsugarglider committed Jan 17, 2020
1 parent 3fb41f6 commit c01df54
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/channel/id_channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ impl Display for SinkStage {

#[derive(Debug, Error)]
pub enum IdChannelError {
#[error("send on underlying channel `{1}` in `{0}` stage failed: `{2}`")]
#[error("send on underlying channel {1} in {0} stage failed: {2}")]
Channel(SinkStage, ForkHandle, ChannelError),
#[error("underlying channel `{0}` does not exist")]
#[error("underlying channel {0} does not exist")]
InvalidId(ForkHandle),
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/hal/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pub trait Peer {}

#[derive(Error, Debug, Kind)]
pub enum ConnectError {
#[error("connection failed: `{0}`")]
#[error("connection failed: {0}")]
Connect(#[source] Error),
#[error("construct failed: `{0}`")]
#[error("construct failed: {0}")]
Construct(#[source] Error),
#[error("underlying transport failed: `{0}`")]
#[error("underlying transport failed: {0}")]
Transport(#[from] TransportError),
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ pub struct UnimplementedError {
pub enum CoreError {
#[error("feature unavailable or unregistered")]
Unavailable,
#[error("`{0}`")]
#[error("{0}")]
Unimplemented(#[source] UnimplementedError),
#[error("`handle transfer failed: {0}`")]
#[error("`handle transfer failed: {0}")]
Construct(#[source] Error),
#[error("`underlying transport failed: {0}`")]
#[error("`underlying transport failed: {0}")]
Transport(#[from] TransportError),
}

Expand Down
4 changes: 2 additions & 2 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ pub enum EncodeError<T: Format, I, S: ISink<I>>
where
S::Error: ErrorBound,
{
#[error("`{0}`")]
#[error("{0}")]
Format(#[source] T::Error),
#[error("`{0}`")]
#[error("{0}")]
Sink(#[source] S::Error),
}

Expand Down
2 changes: 1 addition & 1 deletion src/kind/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<T: Unpin + Sync + Send + 'static> Kind for [T; 0] {

#[derive(Error, Debug)]
pub enum ArrayError<T: Error + 'static> {
#[error("`{0}`")]
#[error("{0}")]
Construct(#[source] T),
#[error("expected {expected} elements in array, got {got}")]
Length { got: usize, expected: usize },
Expand Down
4 changes: 2 additions & 2 deletions src/kind/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ pub trait AsKindMarker {}

#[derive(Error, Debug)]
pub enum WrappedError<T: StdError + 'static> {
#[error("`{0}`")]
#[error("{0}")]
Concrete(#[from] T),
#[error("got {got} items in construct, expected {expected}")]
Insufficient { got: usize, expected: usize },
#[error("failed to send on underlying channel: `{0}`")]
#[error("failed to send on underlying channel: {0}")]
Send(ChannelError),
}

Expand Down
4 changes: 2 additions & 2 deletions src/kind/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use super::WrappedError;

#[derive(Error, Debug)]
pub enum ResultError<T: Error + 'static, E: Error + 'static> {
#[error("`{0}`")]
#[error("{0}")]
Ok(#[source] T),
#[error("`{0}`")]
#[error("{0}")]
Err(#[source] E),
}

Expand Down
8 changes: 4 additions & 4 deletions src/reflect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ pub struct MethodTypes {

#[derive(Debug, Error)]
pub enum CallError {
#[error("invalid type for argument `{0}`")]
#[error("invalid type for argument {0}")]
Type(u8),
#[error("`{0}`")]
#[error("{0}")]
ArgumentCount(#[source] ArgumentCountError),
#[error("`{0}`")]
#[error("{0}")]
OutOfRange(#[source] OutOfRangeError),
#[error("expected `{0}` receiver")]
#[error("expected {0} receiver")]
IncorrectReceiver(Receiver),
}

Expand Down

0 comments on commit c01df54

Please sign in to comment.