Skip to content

Commit

Permalink
Fixed linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
uglrl committed Feb 11, 2024
1 parent 9451ea0 commit 13f21a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/src/layer/trigger/api/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ mod tests {
}

#[tokio::test]
#[should_panic]
#[should_panic = "tried to shutdown graphql server while not running"]
/// test what happens when server is shutdown but not running.
async fn test_not_running() {
let mut server = get_test_server().await;
Expand Down
16 changes: 8 additions & 8 deletions backend/src/layer/trigger/api/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ async fn test_report_image() {

#[tokio::test]
async fn test_api_version() {
let request = r#"
let request = r"
{
apiVersion
}
"#;
";
test_gql_request(request).await;
}

Expand Down Expand Up @@ -310,7 +310,7 @@ async fn test_get_specific_meal() {

#[tokio::test]
async fn test_get_auth_info_empty() {
let request = r#"
let request = r"
{
getMyAuth {
clientId
Expand All @@ -321,7 +321,7 @@ async fn test_get_auth_info_empty() {
"#;
";
let request = Request::from(request).data(AuthInfo {
client_id: None,
api_ident: String::new(),
Expand All @@ -336,7 +336,7 @@ async fn test_get_auth_info_empty() {

#[tokio::test]
async fn test_recursive_line_canteen_ok() {
let request = r#"
let request = r"
{
getCanteens {
lines {
Expand All @@ -348,7 +348,7 @@ async fn test_recursive_line_canteen_ok() {
}
}
}
"#;
";
test_gql_request(request).await;
}

Expand All @@ -375,7 +375,7 @@ async fn test_recursive_meal_line_ok() {

#[tokio::test]
async fn test_get_auth_info() {
let request = r#"
let request = r"
{
getMyAuth {
clientId
Expand All @@ -385,7 +385,7 @@ async fn test_get_auth_info() {
authError
}
}
"#;
";

let auth_info: AuthInfo = AuthInfo {
client_id: Some(Uuid::try_from("1d75d380-cf07-4edb-9046-a2d981bc219d").unwrap()),
Expand Down
8 changes: 4 additions & 4 deletions backend/src/layer/trigger/api/types/meal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(in super::super) struct Meal {
name: String,
/// Type of this meal.
/// Here the type of meat which is contained in the meal, or whether it is vegetarian or vegan, is specified.
meal_type: MealType,
food_type: MealType,
/// The ratings given by the users to the meal.
ratings: Ratings,
/// The prices of the dish each for the four groups of people students, employees, pupils and guests.
Expand Down Expand Up @@ -105,7 +105,7 @@ struct Ratings {
/// The average rating of this meal.
average_rating: f32,
/// The total number of ratings for this meal.
ratings_count: u32,
count: u32,
#[graphql(skip)]
meal_id: Uuid,
}
Expand Down Expand Up @@ -144,7 +144,7 @@ impl From<model::Meal> for Meal {
name: value.name,
ratings: Ratings {
average_rating: value.average_rating,
ratings_count: value.rating_count,
count: value.rating_count,
meal_id: value.id,
},
price: Price {
Expand All @@ -161,7 +161,7 @@ impl From<model::Meal> for Meal {
},
date: value.date,
line_id: value.line_id,
meal_type: value.meal_type,
food_type: value.meal_type,
}
}
}
2 changes: 1 addition & 1 deletion backend/src/startup/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub async fn migrate_images(config: &ConfigReader) -> Result<(), SubcommandError
let image_id = record.image_id;

let response = client
.request(Method::GET, record.url.expect("not null by query"))
.request(Method::GET, record.url)
.send()
.await?;

Expand Down

0 comments on commit 13f21a2

Please sign in to comment.