Refactoring (#149)
* Warning fixes * More warning fixes * Cargo.toml cleanup
This commit was merged in pull request #149.
This commit is contained in:
@@ -114,7 +114,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e:?}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -163,7 +163,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e:?}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -194,7 +194,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e:?}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -225,7 +225,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e:?}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -250,7 +250,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -275,7 +275,7 @@ pub mod db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error updating query: {:?}", e);
|
||||
eprintln!("Error updating query: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -307,7 +307,7 @@ pub mod cov_db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -461,7 +461,7 @@ pub mod endpoint {
|
||||
// TODO: Make the conent disposition more dynamic
|
||||
headers.insert(
|
||||
axum::http::header::CONTENT_DISPOSITION,
|
||||
format!("attachment; filename=\"{}.jpg\"", id)
|
||||
format!("attachment; filename=\"{id}.jpg\"")
|
||||
.parse()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
@@ -107,7 +107,7 @@ pub mod metadata_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -135,7 +135,7 @@ pub mod metadata_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -174,7 +174,7 @@ pub mod metadata_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -241,7 +241,7 @@ pub mod endpoint {
|
||||
|
||||
match params.id {
|
||||
Some(id) => {
|
||||
println!("Something works {:?}", id);
|
||||
println!("Something works {id}");
|
||||
|
||||
match super::metadata_queue::get_with_id(&pool, &id).await {
|
||||
Ok(item) => {
|
||||
|
||||
+12
-12
@@ -189,7 +189,7 @@ pub mod song_db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting query: {:?}", e);
|
||||
eprintln!("Error inserting query: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -223,7 +223,7 @@ pub mod song_db {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -339,7 +339,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -369,7 +369,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {:?}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -401,7 +401,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -436,7 +436,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error selecting: {:?}", e);
|
||||
eprintln!("Error selecting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -463,7 +463,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error updating record {:?}", e);
|
||||
eprintln!("Error updating record {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -488,7 +488,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error querying data: {:?}", e);
|
||||
eprintln!("Error querying data: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -523,7 +523,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error updating record: {:?}", e);
|
||||
eprintln!("Error updating record: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -546,7 +546,7 @@ mod song_queue {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
eprintln!("Error inserting: {}", e);
|
||||
eprintln!("Error inserting: {e}");
|
||||
});
|
||||
|
||||
match result {
|
||||
@@ -641,7 +641,7 @@ pub mod endpoint {
|
||||
axum::Extension(pool): axum::Extension<sqlx::PgPool>,
|
||||
axum::extract::Path(id): axum::extract::Path<uuid::Uuid>,
|
||||
) -> (StatusCode, axum::response::Response) {
|
||||
println!("Id: {:?}", id);
|
||||
println!("Id: {id}");
|
||||
|
||||
match song_queue::get_data(&pool, &id).await {
|
||||
Ok(data) => {
|
||||
@@ -654,7 +654,7 @@ pub mod endpoint {
|
||||
);
|
||||
headers.insert(
|
||||
axum::http::header::CONTENT_DISPOSITION,
|
||||
format!("attachment; filename=\"{}.flac\"", id)
|
||||
format!("attachment; filename=\"{id}.flac\"")
|
||||
.parse()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ pub mod db {
|
||||
|
||||
pub async fn create_pool() -> Result<sqlx::PgPool, sqlx::Error> {
|
||||
let database_url = icarus_envy::environment::get_db_url().await;
|
||||
println!("Database url: {:?}", database_url);
|
||||
println!("Database url: {database_url}");
|
||||
|
||||
PgPoolOptions::new()
|
||||
.max_connections(connection_settings::MAXCONN)
|
||||
|
||||
Reference in New Issue
Block a user