mirror of
https://github.com/TECHNOFAB11/aerosol.git
synced 2025-12-11 23:50:07 +01:00
refactor: use eyre instead of anyhow
This commit is contained in:
parent
698dfa31e6
commit
8b159d2b56
6 changed files with 21 additions and 21 deletions
|
|
@ -41,7 +41,7 @@
|
|||
//! # struct MagicNumber(i32);
|
||||
//! # trait EmailSender: Send + Sync { fn send(&self) {} }
|
||||
//! # impl EmailSender for PostmarkClient {}
|
||||
//! # impl PostmarkClient { fn new() -> anyhow::Result<Self> { Ok(Self) }}
|
||||
//! # impl PostmarkClient { fn new() -> eyre::Result<Self> { Ok(Self) }}
|
||||
//! use aerosol::{Aero, Constructible};
|
||||
//!
|
||||
//! // Here, we can list all the things we want to guarantee are in
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
//! // The `Constructible` trait can be implemented to allow resources to be automatically
|
||||
//! // constructed.
|
||||
//! impl Constructible for PostmarkClient {
|
||||
//! type Error = anyhow::Error;
|
||||
//! type Error = eyre::Error;
|
||||
//!
|
||||
//! fn construct(aero: &Aero) -> Result<Self, Self::Error> {
|
||||
//! PostmarkClient::new(/* initialize using environment variables */)
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
//! }
|
||||
//!
|
||||
//! impl Constructible for ConnectionPool {
|
||||
//! type Error = anyhow::Error;
|
||||
//! type Error = eyre::Error;
|
||||
//! fn construct(aero: &Aero) -> Result<Self, Self::Error> {
|
||||
//! // ...
|
||||
//! # Ok(ConnectionPool)
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
//! }
|
||||
//!
|
||||
//! impl Constructible for MessageQueue {
|
||||
//! type Error = anyhow::Error;
|
||||
//! type Error = eyre::Error;
|
||||
//! fn construct(aero: &Aero) -> Result<Self, Self::Error> {
|
||||
//! // ...
|
||||
//! # Ok(MessageQueue)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue