Merge pull request #186 from de-vri-es/more-from-for-error

Implement From<CapacityError> and From<UrlError> for Error.
pull/192/head
Daniel Abramov 3 years ago committed by GitHub
commit e6fee89726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/error.rs

@ -48,7 +48,7 @@ pub enum Error {
/// - When writing: your message is bigger than the configured max message size
/// (64MB by default).
#[error("Space limit exceeded: {0}")]
Capacity(CapacityError),
Capacity(#[from] CapacityError),
/// Protocol violation.
#[error("WebSocket protocol error: {0}")]
Protocol(#[from] ProtocolError),
@ -60,7 +60,7 @@ pub enum Error {
Utf8,
/// Invalid URL.
#[error("URL error: {0}")]
Url(UrlError),
Url(#[from] UrlError),
/// HTTP error.
#[error("HTTP error: {}", .0.status())]
Http(Response<Option<String>>),

Loading…
Cancel
Save