Skip to content

Commit 5862831

Browse files
TheJanzapmarcoow
authored andcommitted
chore: Fix clippy::pedantic lints in "full" template
* clippy::wildcard_imports * clippy::manual_let_else * clippy::manual_string_new * clippy::uninlined_format_args
1 parent 4f69009 commit 5862831

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

blueprint/db/src/entities/tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[cfg(feature = "test-helpers")]
2-
use fake::{faker::lorem::en::*, Dummy};
2+
use fake::{faker::lorem::en::Sentence, Dummy};
33
use serde::Deserialize;
44
use serde::Serialize;
55
use sqlx::Postgres;

blueprint/db/src/test_helpers/users.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::entities::users::User;
2-
use fake::{faker::name::en::*, Dummy};
2+
use fake::{faker::name::en::Name, Dummy};
33
use sqlx::postgres::PgPool;
44

55
/// A changeset representing the data that is intended to be used to either create a new user or update an existing user.

blueprint/web/src/middlewares/auth.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ pub async fn auth(
2323
.get(http::header::AUTHORIZATION)
2424
.and_then(|header| header.to_str().ok());
2525

26-
let auth_header = if let Some(auth_header) = auth_header {
27-
auth_header
28-
} else {
26+
let Some(auth_header) = auth_header else {
2927
log_rejection_reason("Missing authorization header");
3028
return Err(StatusCode::UNAUTHORIZED);
3129
};

blueprint/web/tests/api/tasks_test.rs.liquid

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async fn test_create_invalid(context: &DbTestContext) {
3737
.unwrap();
3838

3939
let payload = json!(TaskChangeset {
40-
description: String::from("")
40+
description: String::new()
4141
});
4242

4343
let response = context
@@ -106,7 +106,7 @@ async fn test_create_batch_invalid(context: &DbTestContext) {
106106
let task_changeset: TaskChangeset = Faker.fake();
107107
let payload = json!(vec![
108108
TaskChangeset {
109-
description: String::from("")
109+
description: String::new()
110110
},
111111
task_changeset
112112
]);
@@ -210,7 +210,7 @@ async fn test_read_one_success(context: &DbTestContext) {
210210

211211
let response = context
212212
.app
213-
.request(format!("/tasks/{}", task_id).as_str())
213+
.request(format!("/tasks/{task_id}").as_str())
214214
.method(Method::GET)
215215
.send()
216216
.await;
@@ -253,7 +253,7 @@ async fn test_update_invalid(context: &DbTestContext) {
253253
.unwrap();
254254

255255
let payload = json!(TaskChangeset {
256-
description: String::from("")
256+
description: String::new()
257257
});
258258

259259
let response = context

0 commit comments

Comments
 (0)