Skip to content

Commit

Permalink
Clippy edits
Browse files Browse the repository at this point in the history
  • Loading branch information
NChitty committed Aug 27, 2024
1 parent eef3072 commit c6cdf21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/lib/recipe/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ impl Repository<Recipe> for DynamoDbRecipe {
.items()
.iter()
.map(|item| from_item(item.clone()))
.filter(Result::is_ok)
.map(Result::unwrap)
.flatten()
.collect();

Ok(items)
Expand Down
8 changes: 7 additions & 1 deletion src/lib/services/recipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ use axum::http::StatusCode;
use axum::Json;
use uuid::Uuid;

use crate::recipe::request_models::{PatchRecipe, PostRecipe};
use crate::recipe::request_models::{PatchRecipe, PostRecipe, PutRecipe};
use crate::recipe::{mapper, Recipe};
use crate::services::ApplicationContext;
use crate::Repository;

/// Lists all recipes from the database.
///
/// # Errors
///
/// This function converts the result of the database operation to a status code
/// wrapped in an error.
pub async fn list<T>(
State(state): State<ApplicationContext<T>>,
) -> Result<Json<Vec<Recipe>>, StatusCode>
Expand Down

0 comments on commit c6cdf21

Please sign in to comment.