Skip to content

Commit

Permalink
Make Result alias gracefully degrade
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 27, 2024
1 parent 68a3f58 commit 83f108e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use std::io;
use crate::{StatusCode, Url};

/// A `Result` alias where the `Err` case is `reqwest::Error`.
pub type Result<T> = std::result::Result<T, Error>;
// The default error type is used to avoid breaking regular `Result<T, E>` when users glob-import `reqwest::*`
pub type Result<T, E = Error> = std::result::Result<T, E>;

/// The Errors that may occur when processing a `Request`.
///
Expand Down

0 comments on commit 83f108e

Please sign in to comment.