Skip to content

Commit 3b2cc0a

Browse files
authored
Fix build errors
Fix the following errors: ``` error[E0599]: no method named `send` found for reference `&StubTransport` in the current scope --> crates/app/core/lib.rs:120:15 | 120 | transport.send(email).await?; | ^^^^ method not found in `&StubTransport` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | 1 | use lettre::Transport; | ``` ``` error[E0308]: mismatched types --> crates/app/core/lib.rs:121:20 | 121 | transport.send(email).await?; | ^^^^^ | | | expected `&Message`, found struct `Message` | help: consider borrowing here: `&email` ``` ``` error[E0277]: `Result<(), lettre::transport::stub::Error>` is not a future --> crates/app/core/lib.rs:121:26 | 121 | transport.send(email).await?; | ^^^^^^ `Result<(), lettre::transport::stub::Error>` is not a future | = help: the trait `futures::Future` is not implemented for `Result<(), lettre::transport::stub::Error>` = note: Result<(), lettre::transport::stub::Error> must be a future or must implement `IntoFuture` to be awaited = note: required because of the requirements on the impl of `std::future::IntoFuture` for `Result<(), lettre::transport::stub::Error>` help: remove the `.await` | 121 - transport.send(email).await?; 121 + transport.send(email)?; | ```
1 parent 26d2d2b commit 3b2cc0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/app/core/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::{
77
};
88
use anyhow::{anyhow, bail, Result};
99
use lettre::AsyncTransport;
10+
use lettre::Transport;
1011
use serde::Serialize;
1112
use sqlx::postgres::PgPoolOptions;
1213
use std::{
@@ -117,7 +118,7 @@ impl Mailer {
117118
transport.send(email).await?;
118119
}
119120
Mailer::Testing(transport) => {
120-
transport.send(email).await?;
121+
transport.send(&email)?;
121122
}
122123
};
123124
Ok(())

0 commit comments

Comments
 (0)