Remove from_ref with unneeded clones
This commit is contained in:
parent
734f8b291c
commit
76b14ce75b
3 changed files with 4 additions and 12 deletions
emgauwa-lib/src/handlers/v1
|
@ -24,7 +24,7 @@ pub async fn index(pool: web::Data<Pool<Sqlite>>) -> Result<HttpResponse, ApiErr
|
|||
let schedules = Schedule::get_all(&mut pool_conn).await?;
|
||||
|
||||
let return_schedules: Vec<ReturnSchedule> =
|
||||
schedules.iter().map(|s| ReturnSchedule::from_schedule_ref(s, &mut pool_conn)).collect();
|
||||
schedules.into_iter().map(|s| ReturnSchedule::from_schedule(s, &mut pool_conn)).collect();
|
||||
|
||||
Ok(HttpResponse::Ok().json(return_schedules))
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ pub async fn tagged(
|
|||
let schedules = Schedule::get_by_tag(&mut pool_conn, &tag_db).await?;
|
||||
|
||||
let return_schedules: Vec<ReturnSchedule> =
|
||||
schedules.iter().map(|s| ReturnSchedule::from_schedule_ref(s, &mut pool_conn)).collect();
|
||||
schedules.into_iter().map(|s| ReturnSchedule::from_schedule(s, &mut pool_conn)).collect();
|
||||
|
||||
Ok(HttpResponse::Ok().json(return_schedules))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue