Skip to content

Commit

Permalink
editoast: bump rustc version and fix new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
flomonster committed May 15, 2024
1 parent 5ea52e1 commit 5b12cb9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 137 deletions.
2 changes: 1 addition & 1 deletion editoast/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##############
# Cargo chef #
##############
FROM lukemathwalker/cargo-chef:0.1.62-rust-latest AS chef
FROM lukemathwalker/cargo-chef:0.1.66-rust-latest AS chef
WORKDIR /app

#######################
Expand Down
20 changes: 0 additions & 20 deletions editoast/editoast_derive/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,6 @@ fn update_functions(config: &Config) -> TokenStream {
let table = &config.table;

let model_name = &config.model_name;
let documentation = format!(
r#"
Update a `{model_name}` given its ID (primary key).
Returns None if not found.
### Example
```
let obj_patch: {model_name} = ...;
let obj: {model_name} = obj_patch.update(db_pool, 42).await?;
```
"#
);

quote! {
#[async_trait::async_trait]
impl crate::models::Update for #model_name {
Expand All @@ -231,12 +217,6 @@ fn update_functions(config: &Config) -> TokenStream {
Err(e) => Err(e.into()),
}
}

#[doc = #documentation]
async fn update(self, db_pool: actix_web::web::Data<crate::modelsv2::DbConnectionPool>, id: i64) -> crate::error::Result<Option<Self>> {
let mut conn = db_pool.get().await?;
self.update_conn(&mut conn, id).await
}
}
}
}
Loading

0 comments on commit 5b12cb9

Please sign in to comment.