mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-12-18 05:56:35 +00:00
Fix clippy lints.
This commit is contained in:
parent
2fc300b2c8
commit
48c9a5b39c
6 changed files with 8 additions and 8 deletions
|
@ -72,7 +72,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn names_containing_an_invalid_character_are_rejected() {
|
||||
for name in vec!['/', '(', ')', '"', '<', '>', '\\', '{', '}'] {
|
||||
for name in &['/', '(', ')', '"', '<', '>', '\\', '{', '}'] {
|
||||
let name = name.to_string();
|
||||
assert_err!(SubscriberName::parse(name));
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ async fn validate_credentials(
|
|||
.to_string();
|
||||
|
||||
if let Some((stored_user_id, stored_password_hash)) =
|
||||
get_stored_credentials(&credentials.username, &pool)
|
||||
get_stored_credentials(&credentials.username, pool)
|
||||
.await
|
||||
.map_err(PublishError::UnexpectedError)?
|
||||
{
|
||||
|
|
|
@ -75,8 +75,8 @@ impl TestApp {
|
|||
confirmation_link
|
||||
};
|
||||
|
||||
let html = get_link(&body["HtmlBody"].as_str().unwrap());
|
||||
let plain_text = get_link(&body["TextBody"].as_str().unwrap());
|
||||
let html = get_link(body["HtmlBody"].as_str().unwrap());
|
||||
let plain_text = get_link(body["TextBody"].as_str().unwrap());
|
||||
ConfirmationLinks { html, plain_text }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ async fn create_unconfirmed_subscriber(app: &TestApp) -> ConfirmationLinks {
|
|||
.unwrap()
|
||||
.pop()
|
||||
.unwrap();
|
||||
app.get_confirmation_links(&email_request)
|
||||
app.get_confirmation_links(email_request)
|
||||
}
|
||||
|
||||
async fn create_confirmed_subscriber(app: &TestApp) {
|
||||
|
|
|
@ -96,7 +96,7 @@ async fn subscribe_sends_a_confirmation_email_with_a_link() {
|
|||
|
||||
// Assert
|
||||
let email_request = &app.email_server.received_requests().await.unwrap()[0];
|
||||
let confirmation_links = app.get_confirmation_links(&email_request);
|
||||
let confirmation_links = app.get_confirmation_links(email_request);
|
||||
|
||||
// The two links should be identical
|
||||
assert_eq!(confirmation_links.html, confirmation_links.plain_text);
|
||||
|
|
|
@ -30,7 +30,7 @@ async fn the_link_returned_by_subscribe_returns_a_200_if_called() {
|
|||
|
||||
app.post_subscriptions(body.into()).await;
|
||||
let email_request = &app.email_server.received_requests().await.unwrap()[0];
|
||||
let confirmation_links = app.get_confirmation_links(&email_request);
|
||||
let confirmation_links = app.get_confirmation_links(email_request);
|
||||
|
||||
// Act
|
||||
let response = reqwest::get(confirmation_links.html).await.unwrap();
|
||||
|
@ -53,7 +53,7 @@ async fn clicking_on_the_confirmation_link_confirms_a_subscriber() {
|
|||
|
||||
app.post_subscriptions(body.into()).await;
|
||||
let email_request = &app.email_server.received_requests().await.unwrap()[0];
|
||||
let confirmation_links = app.get_confirmation_links(&email_request);
|
||||
let confirmation_links = app.get_confirmation_links(email_request);
|
||||
|
||||
// Act
|
||||
reqwest::get(confirmation_links.html)
|
||||
|
|
Loading…
Reference in a new issue