Fix clippy lints.

This commit is contained in:
Luca Palmieri 2021-09-11 22:00:34 +02:00
parent 2fc300b2c8
commit 48c9a5b39c
6 changed files with 8 additions and 8 deletions

View file

@ -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));
}

View file

@ -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)?
{

View file

@ -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 }
}
}

View file

@ -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) {

View file

@ -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);

View file

@ -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)